feat : New listing + MainView

This commit is contained in:
Yaël Perret
2025-06-27 09:04:37 +02:00
parent 2b143bd884
commit 9a328ec9d8
55 changed files with 1036 additions and 615 deletions

View File

@@ -1,36 +1,51 @@
import 'package:bahla_front/app/app.bottomsheets.dart';
import 'package:bahla_front/app/app.dialogs.dart';
import 'package:bahla_front/app/app.locator.dart';
import 'package:bahla_front/ui/common/app_strings.dart';
import 'package:stacked/stacked.dart';
import 'package:stacked_services/stacked_services.dart';
class HomeViewModel extends BaseViewModel {
final _dialogService = locator<DialogService>();
final _bottomSheetService = locator<BottomSheetService>();
String get counterLabel => 'Counter is: $_counter';
List<String> items = List<String>.generate(100, (i) => 'Item $i');
int _counter = 0;
List<Event> events = [
Event(
name: 'Event 1',
picture: 'images/Affiche.jpg',
date: DateTime.now().add(Duration(days: 1)),
organizer: 'Organizer 1',
place: 'Place 1',
),
Event(
name: 'Event 2',
picture: 'images/Affiche.jpg',
date: DateTime.now().add(Duration(days: 1)),
organizer: 'Organizer 2',
),
Event(
name: 'Event 3',
picture: 'images/Affiche.jpg',
date: DateTime.now().add(Duration(days: 1)),
organizer: 'Organizer 3',
place: 'Place 3',
),
];
void incrementCounter() {
_counter++;
rebuildUi();
}
void showDialog() {
_dialogService.showCustomDialog(
variant: DialogType.infoAlert,
title: 'Stacked Rocks!',
description: 'Give stacked $_counter stars on Github',
);
}
void showBottomSheet() {
_bottomSheetService.showCustomSheet(
variant: BottomSheetType.notice,
title: ksHomeBottomSheetTitle,
description: ksHomeBottomSheetDescription,
);
}
}
class Event {
String name;
String picture;
String organizer = 'Organizer';
String? place;
DateTime? date;
Event({
required this.name,
required this.picture,
required this.organizer,
this.date,
this.place,
});
@override
String toString() {
return 'Event{name: $name, picture: $picture}';
}
}