feat : Modèle avec sérialisation automatique
This commit is contained in:
@@ -2,6 +2,7 @@ import 'package:bahla_front/app/app.locator.dart';
|
||||
import 'package:bahla_front/app/app.router.dart';
|
||||
import 'package:stacked/stacked.dart';
|
||||
import 'package:stacked_services/stacked_services.dart';
|
||||
import '../../../models/event.dart';
|
||||
|
||||
class HomeViewModel extends BaseViewModel {
|
||||
final _navigationService = locator<NavigationService>();
|
||||
@@ -45,25 +46,4 @@ class HomeViewModel extends BaseViewModel {
|
||||
}
|
||||
}
|
||||
|
||||
class Event {
|
||||
String name;
|
||||
String picture;
|
||||
String organizer = 'Organizer';
|
||||
String? place;
|
||||
DateTime? date;
|
||||
bool isFavorite;
|
||||
|
||||
Event({
|
||||
required this.name,
|
||||
required this.picture,
|
||||
required this.organizer,
|
||||
this.date,
|
||||
this.place,
|
||||
this.isFavorite = false,
|
||||
});
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Event{name: $name, picture: $picture}';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user