feat : Add Event details view with first informations

This commit is contained in:
Yaël Perret
2025-07-15 21:32:32 +02:00
parent 5cbed8e6cd
commit 2cb2133208
13 changed files with 1307 additions and 3024 deletions

View File

@@ -11,7 +11,7 @@
"name": "_macros", "name": "_macros",
"rootUri": "file:///D:/SDK/flutter/bin/cache/dart-sdk/pkg/_macros", "rootUri": "file:///D:/SDK/flutter/bin/cache/dart-sdk/pkg/_macros",
"packageUri": "lib/", "packageUri": "lib/",
"languageVersion": "3.4" "languageVersion": "3.5"
}, },
{ {
"name": "analyzer", "name": "analyzer",
@@ -27,7 +27,7 @@
}, },
{ {
"name": "async", "name": "async",
"rootUri": "file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/async-2.12.0", "rootUri": "file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/async-2.13.0",
"packageUri": "lib/", "packageUri": "lib/",
"languageVersion": "3.4" "languageVersion": "3.4"
}, },
@@ -135,7 +135,7 @@
}, },
{ {
"name": "fake_async", "name": "fake_async",
"rootUri": "file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/fake_async-1.3.2", "rootUri": "file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/fake_async-1.3.3",
"packageUri": "lib/", "packageUri": "lib/",
"languageVersion": "3.3" "languageVersion": "3.3"
}, },
@@ -249,9 +249,9 @@
}, },
{ {
"name": "intl", "name": "intl",
"rootUri": "file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/intl-0.19.0", "rootUri": "file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/intl-0.20.2",
"packageUri": "lib/", "packageUri": "lib/",
"languageVersion": "3.0" "languageVersion": "3.3"
}, },
{ {
"name": "io", "name": "io",
@@ -273,7 +273,7 @@
}, },
{ {
"name": "leak_tracker", "name": "leak_tracker",
"rootUri": "file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/leak_tracker-10.0.8", "rootUri": "file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/leak_tracker-10.0.9",
"packageUri": "lib/", "packageUri": "lib/",
"languageVersion": "3.2" "languageVersion": "3.2"
}, },
@@ -585,7 +585,7 @@
}, },
{ {
"name": "vm_service", "name": "vm_service",
"rootUri": "file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/vm_service-14.3.1", "rootUri": "file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/vm_service-15.0.0",
"packageUri": "lib/", "packageUri": "lib/",
"languageVersion": "3.3" "languageVersion": "3.3"
}, },
@@ -638,10 +638,9 @@
"languageVersion": "3.0" "languageVersion": "3.0"
} }
], ],
"generated": "2025-05-24T07:54:19.586866Z",
"generator": "pub", "generator": "pub",
"generatorVersion": "3.7.2", "generatorVersion": "3.8.1",
"flutterRoot": "file:///D:/SDK/flutter", "flutterRoot": "file:///D:/SDK/flutter",
"flutterVersion": "3.29.3", "flutterVersion": "3.32.6",
"pubCache": "file:///C:/Users/Yael/AppData/Local/Pub/Cache" "pubCache": "file:///C:/Users/Yael/AppData/Local/Pub/Cache"
} }

View File

@@ -12,8 +12,8 @@ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/args-2.6.0/
file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/args-2.6.0/lib/ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/args-2.6.0/lib/
async async
3.4 3.4
file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/async-2.12.0/ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/async-2.13.0/
file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/async-2.12.0/lib/ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/async-2.13.0/lib/
boolean_selector boolean_selector
3.1 3.1
file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/boolean_selector-2.1.2/ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/boolean_selector-2.1.2/
@@ -84,8 +84,8 @@ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/dart_style-2.3.7/
file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/dart_style-2.3.7/lib/ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/dart_style-2.3.7/lib/
fake_async fake_async
3.3 3.3
file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/fake_async-1.3.2/ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/fake_async-1.3.3/
file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/fake_async-1.3.2/lib/ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/fake_async-1.3.3/lib/
ffi ffi
3.3 3.3
file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/ffi-2.1.3/ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/ffi-2.1.3/
@@ -147,9 +147,9 @@ http_parser
file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/http_parser-4.0.2/ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/http_parser-4.0.2/
file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/http_parser-4.0.2/lib/ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/http_parser-4.0.2/lib/
intl intl
3.0 3.3
file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/intl-0.19.0/ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/intl-0.20.2/
file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/intl-0.19.0/lib/ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/intl-0.20.2/lib/
io io
2.12 2.12
file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/io-1.0.4/ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/io-1.0.4/
@@ -164,8 +164,8 @@ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/json_annotation-4.9
file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/json_annotation-4.9.0/lib/ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/json_annotation-4.9.0/lib/
leak_tracker leak_tracker
3.2 3.2
file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/leak_tracker-10.0.8/ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/leak_tracker-10.0.9/
file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/leak_tracker-10.0.8/lib/ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/leak_tracker-10.0.9/lib/
leak_tracker_flutter_testing leak_tracker_flutter_testing
3.2 3.2
file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/leak_tracker_flutter_testing-3.0.9/ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/leak_tracker_flutter_testing-3.0.9/
@@ -368,8 +368,8 @@ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/vector_math-2.1.4/
file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/vector_math-2.1.4/lib/ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/vector_math-2.1.4/lib/
vm_service vm_service
3.3 3.3
file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/vm_service-14.3.1/ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/vm_service-15.0.0/
file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/vm_service-14.3.1/lib/ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/vm_service-15.0.0/lib/
watcher watcher
3.0 3.0
file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/watcher-1.1.0/ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/watcher-1.1.0/
@@ -399,7 +399,7 @@ yaml
file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/yaml-3.1.2/ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/yaml-3.1.2/
file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/yaml-3.1.2/lib/ file:///C:/Users/Yael/AppData/Local/Pub/Cache/hosted/pub.dev/yaml-3.1.2/lib/
_macros _macros
3.4 3.5
file:///D:/SDK/flutter/bin/cache/dart-sdk/pkg/_macros/ file:///D:/SDK/flutter/bin/cache/dart-sdk/pkg/_macros/
file:///D:/SDK/flutter/bin/cache/dart-sdk/pkg/_macros/lib/ file:///D:/SDK/flutter/bin/cache/dart-sdk/pkg/_macros/lib/
sky_engine sky_engine

View File

@@ -1 +1 @@
3.29.3 3.32.6

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,8 @@ import 'package:bahla_front/ui/views/startup/startup_view.dart';
import 'package:stacked/stacked_annotations.dart'; import 'package:stacked/stacked_annotations.dart';
import 'package:stacked_services/stacked_services.dart'; import 'package:stacked_services/stacked_services.dart';
import 'package:bahla_front/ui/views/main/main_view.dart'; import 'package:bahla_front/ui/views/main/main_view.dart';
import 'package:bahla_front/ui/views/home/home_view.dart'; import 'package:bahla_front/ui/views/event_details/event_details_view.dart';
import 'package:bahla_front/ui/views/event_details/event_details_view.dart';
// @stacked-import // @stacked-import
@StackedApp( @StackedApp(
@@ -14,6 +15,8 @@ import 'package:bahla_front/ui/views/home/home_view.dart';
MaterialRoute(page: StartupView), MaterialRoute(page: StartupView),
MaterialRoute(page: MainView), MaterialRoute(page: MainView),
MaterialRoute(page: HomeView), MaterialRoute(page: HomeView),
MaterialRoute(page: EventDetailsView),
MaterialRoute(page: EventDetailsView),
// @stacked-route // @stacked-route
], ],
dependencies: [ dependencies: [

View File

@@ -5,35 +5,35 @@
// ************************************************************************** // **************************************************************************
// ignore_for_file: no_leading_underscores_for_library_prefixes // ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:bahla_front/ui/views/event_details/event_details_view.dart'
as _i5;
import 'package:bahla_front/ui/views/home/home_view.dart' as _i2; import 'package:bahla_front/ui/views/home/home_view.dart' as _i2;
import 'package:bahla_front/ui/views/main/main_view.dart' as _i4; import 'package:bahla_front/ui/views/main/main_view.dart' as _i4;
import 'package:bahla_front/ui/views/startup/startup_view.dart' as _i3; import 'package:bahla_front/ui/views/startup/startup_view.dart' as _i3;
import 'package:flutter/material.dart' as _i5; import 'package:flutter/material.dart' as _i6;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:stacked/stacked.dart' as _i1; import 'package:stacked/stacked.dart' as _i1;
import 'package:stacked_services/stacked_services.dart' as _i6; import 'package:stacked_services/stacked_services.dart' as _i7;
class Routes { class Routes {
static const startupView = '/startup-view'; static const startupView = '/startup-view';
static const mainView = '/main-view'; static const mainView = '/main-view';
static const homeView = '/home-view'; static const homeView = '/home-view';
static const eventDetailsView = '/event-details-view';
static const all = <String>{ static const all = <String>{
homeView, homeView,
startupView, startupView,
mainView, mainView,
eventDetailsView,
}; };
} }
class StackedRouter extends _i1.RouterBase { class StackedRouter extends _i1.RouterBase {
final _routes = <_i1.RouteDef>[ final _routes = <_i1.RouteDef>[
_i1.RouteDef(
Routes.homeView,
page: _i2.HomeView,
),
_i1.RouteDef( _i1.RouteDef(
Routes.startupView, Routes.startupView,
page: _i3.StartupView, page: _i3.StartupView,
@@ -46,27 +46,39 @@ class StackedRouter extends _i1.RouterBase {
Routes.homeView, Routes.homeView,
page: _i2.HomeView, page: _i2.HomeView,
), ),
_i1.RouteDef(
Routes.eventDetailsView,
page: _i5.EventDetailsView,
),
]; ];
final _pagesMap = <Type, _i1.StackedRouteFactory>{ final _pagesMap = <Type, _i1.StackedRouteFactory>{
_i2.HomeView: (data) { _i2.HomeView: (data) {
return _i5.MaterialPageRoute<dynamic>( return _i6.MaterialPageRoute<dynamic>(
builder: (context) => const _i2.HomeView(), builder: (context) => const _i2.HomeView(),
settings: data, settings: data,
); );
}, },
_i3.StartupView: (data) { _i3.StartupView: (data) {
return _i5.MaterialPageRoute<dynamic>( return _i6.MaterialPageRoute<dynamic>(
builder: (context) => const _i3.StartupView(), builder: (context) => const _i3.StartupView(),
settings: data, settings: data,
); );
}, },
_i4.MainView: (data) { _i4.MainView: (data) {
return _i5.MaterialPageRoute<dynamic>( return _i6.MaterialPageRoute<dynamic>(
builder: (context) => const _i4.MainView(), builder: (context) => const _i4.MainView(),
settings: data, settings: data,
); );
}, },
_i5.EventDetailsView: (data) {
final args = data.getArgs<EventDetailsViewArguments>(nullOk: false);
return _i6.MaterialPageRoute<dynamic>(
builder: (context) =>
_i5.EventDetailsView(key: args.key, eventId: args.eventId),
settings: data,
);
},
}; };
@override @override
@@ -76,21 +88,34 @@ class StackedRouter extends _i1.RouterBase {
Map<Type, _i1.StackedRouteFactory> get pagesMap => _pagesMap; Map<Type, _i1.StackedRouteFactory> get pagesMap => _pagesMap;
} }
extension NavigatorStateExtension on _i6.NavigationService { class EventDetailsViewArguments {
Future<dynamic> navigateToHomeView([ const EventDetailsViewArguments({
int? routerId, this.key,
bool preventDuplicates = true, required this.eventId,
Map<String, String>? parameters, });
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
transition, final _i6.Key? key;
]) async {
return navigateTo<dynamic>(Routes.homeView, final int eventId;
id: routerId,
preventDuplicates: preventDuplicates, @override
parameters: parameters, String toString() {
transition: transition); return '{"key": "$key", "eventId": "$eventId"}';
} }
@override
bool operator ==(covariant EventDetailsViewArguments other) {
if (identical(this, other)) return true;
return other.key == key && other.eventId == eventId;
}
@override
int get hashCode {
return key.hashCode ^ eventId.hashCode;
}
}
extension NavigatorStateExtension on _i7.NavigationService {
Future<dynamic> navigateToStartupView([ Future<dynamic> navigateToStartupView([
int? routerId, int? routerId,
bool preventDuplicates = true, bool preventDuplicates = true,
@@ -119,14 +144,31 @@ extension NavigatorStateExtension on _i6.NavigationService {
transition: transition); transition: transition);
} }
Future<dynamic> replaceWithHomeView([ Future<dynamic> navigateToHomeView([
int? routerId, int? routerId,
bool preventDuplicates = true, bool preventDuplicates = true,
Map<String, String>? parameters, Map<String, String>? parameters,
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)? Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
transition, transition,
]) async { ]) async {
return replaceWith<dynamic>(Routes.homeView, return navigateTo<dynamic>(Routes.homeView,
id: routerId,
preventDuplicates: preventDuplicates,
parameters: parameters,
transition: transition);
}
Future<dynamic> navigateToEventDetailsView({
_i6.Key? key,
required int eventId,
int? routerId,
bool preventDuplicates = true,
Map<String, String>? parameters,
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
transition,
}) async {
return navigateTo<dynamic>(Routes.eventDetailsView,
arguments: EventDetailsViewArguments(key: key, eventId: eventId),
id: routerId, id: routerId,
preventDuplicates: preventDuplicates, preventDuplicates: preventDuplicates,
parameters: parameters, parameters: parameters,
@@ -160,4 +202,35 @@ extension NavigatorStateExtension on _i6.NavigationService {
parameters: parameters, parameters: parameters,
transition: transition); transition: transition);
} }
Future<dynamic> replaceWithHomeView([
int? routerId,
bool preventDuplicates = true,
Map<String, String>? parameters,
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
transition,
]) async {
return replaceWith<dynamic>(Routes.homeView,
id: routerId,
preventDuplicates: preventDuplicates,
parameters: parameters,
transition: transition);
}
Future<dynamic> replaceWithEventDetailsView({
_i6.Key? key,
required int eventId,
int? routerId,
bool preventDuplicates = true,
Map<String, String>? parameters,
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
transition,
}) async {
return replaceWith<dynamic>(Routes.eventDetailsView,
arguments: EventDetailsViewArguments(key: key, eventId: eventId),
id: routerId,
preventDuplicates: preventDuplicates,
parameters: parameters,
transition: transition);
}
} }

View File

@@ -38,53 +38,87 @@ class MainApp extends StatelessWidget {
onPrimary: Colors.white, onPrimary: Colors.white,
onSecondary: Colors.white, onSecondary: Colors.white,
onBackground: Colors.white, onBackground: Colors.white,
onSurface: Colors.white, onSurface: Colors.black,
onPrimaryContainer: Colors.black,
onSecondaryContainer: Colors.black,
onTertiaryContainer: Colors.black,
surfaceBright: Colors.black,
), ),
iconTheme: const IconThemeData( iconTheme: const IconThemeData(
color: Colors.white, color: Colors.white,
), ),
textTheme: TextTheme( textTheme: TextTheme(
displayLarge: GoogleFonts.firaSans( displayLarge: GoogleFonts.firaSans(
fontSize: 96, fontWeight: FontWeight.normal, color: Colors.white), fontSize: 96,
fontWeight: FontWeight.normal,
color: Colors.white),
displayMedium: GoogleFonts.firaSans( displayMedium: GoogleFonts.firaSans(
fontSize: 60, fontWeight: FontWeight.normal, color: Colors.white), fontSize: 60,
fontWeight: FontWeight.normal,
color: Colors.white),
displaySmall: GoogleFonts.firaSans( displaySmall: GoogleFonts.firaSans(
fontSize: 48, fontWeight: FontWeight.normal, color: Colors.white), fontSize: 48,
fontWeight: FontWeight.normal,
color: Colors.white),
headlineLarge: GoogleFonts.firaSans( headlineLarge: GoogleFonts.firaSans(
fontSize: 40, fontWeight: FontWeight.normal, color: Colors.white), fontSize: 40,
fontWeight: FontWeight.normal,
color: Colors.white),
headlineMedium: GoogleFonts.firaSans( headlineMedium: GoogleFonts.firaSans(
fontSize: 34, fontWeight: FontWeight.normal, color: Colors.white), fontSize: 34,
fontWeight: FontWeight.normal,
color: Colors.white),
headlineSmall: GoogleFonts.firaSans( headlineSmall: GoogleFonts.firaSans(
fontSize: 24, fontWeight: FontWeight.normal, color: Colors.white), fontSize: 24,
fontWeight: FontWeight.normal,
color: Colors.white),
titleLarge: GoogleFonts.firaSans( titleLarge: GoogleFonts.firaSans(
fontSize: 20, fontWeight: FontWeight.normal, color: Colors.white), fontSize: 20,
fontWeight: FontWeight.normal,
color: Colors.white),
titleMedium: GoogleFonts.firaSans( titleMedium: GoogleFonts.firaSans(
fontSize: 16, fontWeight: FontWeight.normal, color: Colors.white), fontSize: 16,
fontWeight: FontWeight.normal,
color: Colors.white),
titleSmall: GoogleFonts.firaSans( titleSmall: GoogleFonts.firaSans(
fontSize: 14, fontWeight: FontWeight.normal, color: Colors.white), fontSize: 14,
fontWeight: FontWeight.normal,
color: Colors.white),
bodyLarge: GoogleFonts.firaSans( bodyLarge: GoogleFonts.firaSans(
fontSize: 20, fontWeight: FontWeight.normal, color: Colors.white), fontSize: 20,
fontWeight: FontWeight.normal,
color: Colors.white),
bodyMedium: GoogleFonts.firaSans( bodyMedium: GoogleFonts.firaSans(
fontSize: 16, fontWeight: FontWeight.normal, color: Colors.white), fontSize: 16,
fontWeight: FontWeight.normal,
color: Colors.white),
bodySmall: GoogleFonts.firaSans( bodySmall: GoogleFonts.firaSans(
fontSize: 14, fontWeight: FontWeight.normal, color: Colors.white), fontSize: 14,
fontWeight: FontWeight.normal,
color: Colors.white),
labelLarge: GoogleFonts.firaSans( labelLarge: GoogleFonts.firaSans(
fontSize: 14, fontWeight: FontWeight.normal, color: Colors.white), fontSize: 14,
fontWeight: FontWeight.normal,
color: Colors.white),
labelMedium: GoogleFonts.firaSans( labelMedium: GoogleFonts.firaSans(
fontSize: 12, fontWeight: FontWeight.normal, color: Colors.white), fontSize: 12,
fontWeight: FontWeight.normal,
color: Colors.white),
labelSmall: GoogleFonts.firaSans( labelSmall: GoogleFonts.firaSans(
fontSize: 10, fontWeight: FontWeight.normal, color: Colors.white), fontSize: 10,
fontWeight: FontWeight.normal,
color: Colors.white),
)), )),
localizationsDelegates: const [ localizationsDelegates: const [
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate, GlobalCupertinoLocalizations.delegate,
], ],
supportedLocales: const [ supportedLocales: const [
Locale('en'), Locale('en'),
Locale('fr'), Locale('fr'),
Locale('ch'), Locale('ch'),
], ],
); );
} }
} }

View File

@@ -0,0 +1,141 @@
import 'package:flutter/material.dart';
import 'package:stacked/stacked.dart';
import 'event_details_viewmodel.dart';
class EventDetailsView extends StackedView<EventDetailsViewModel> {
final int eventId;
const EventDetailsView({Key? key, required this.eventId}) : super(key: key);
@override
Widget builder(
BuildContext context,
EventDetailsViewModel viewModel,
Widget? child,
) {
return Scaffold(
backgroundColor: Theme.of(context).colorScheme.background,
body: Column(
children: [
Container(
width: double.infinity,
height: MediaQuery.of(context).size.width * 9 / 16,
child: const Image(
image: AssetImage('assets/images/Affiche.jpg'),
fit: BoxFit.cover,
alignment: Alignment.center,
),
),
Container(
color: Colors.white,
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Titre de l'événement
Text(
'Disc\'Octonelle 2',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
const SizedBox(height: 16),
// Date
Row(
children: [
Icon(
Icons.calendar_today,
size: 20,
color: Colors.grey[600],
),
const SizedBox(width: 12),
Text(
'29.04.2023',
style: TextStyle(
fontSize: 16,
color: Colors.black,
),
),
],
),
const SizedBox(height: 12),
// Lieu
Row(
children: [
Icon(
Icons.location_on,
size: 20,
color: Colors.grey[600],
),
const SizedBox(width: 12),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Anim-Halle',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Colors.black,
),
),
Text(
'En Bas-les-Barres 6',
style: TextStyle(
fontSize: 14,
color: Colors.grey[600],
),
),
Text(
'2316 Les Ponts-de-martel',
style: TextStyle(
fontSize: 14,
color: Colors.grey[600],
),
),
],
),
],
),
const SizedBox(height: 12),
// Organisation
Row(
children: [
Container(
width: 20,
height: 20,
child: Icon(
Icons.groups,
size: 20,
color: Colors.grey[600],
),
),
const SizedBox(width: 12),
Text(
'L\'Octonelle',
style: TextStyle(
fontSize: 16,
color: Colors.black,
),
),
],
),
],
),
),
],
),
);
}
@override
EventDetailsViewModel viewModelBuilder(
BuildContext context,
) =>
EventDetailsViewModel();
}

View File

@@ -0,0 +1,3 @@
import 'package:stacked/stacked.dart';
class EventDetailsViewModel extends BaseViewModel {}

View File

@@ -7,7 +7,6 @@ import 'home_viewmodel.dart';
class HomeView extends StackedView<HomeViewModel> { class HomeView extends StackedView<HomeViewModel> {
const HomeView({Key? key}) : super(key: key); const HomeView({Key? key}) : super(key: key);
@override @override
Widget builder( Widget builder(
BuildContext context, BuildContext context,
@@ -28,8 +27,7 @@ class HomeView extends StackedView<HomeViewModel> {
color: Theme.of(context).colorScheme.primary, color: Theme.of(context).colorScheme.primary,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
child: child: IntrinsicHeight(
IntrinsicHeight(
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
@@ -45,7 +43,8 @@ class HomeView extends StackedView<HomeViewModel> {
bottomLeft: Radius.circular(8), bottomLeft: Radius.circular(8),
), ),
image: DecorationImage( image: DecorationImage(
image: AssetImage(viewModel.events[index].picture), image:
AssetImage(viewModel.events[index].picture),
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
@@ -54,79 +53,89 @@ class HomeView extends StackedView<HomeViewModel> {
), ),
Expanded( Expanded(
flex: 2, flex: 2,
child: child: Container(
Container( margin: const EdgeInsets.all(8),
margin: const EdgeInsets.all(8), child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.stretch,
crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
Row(
children: [ mainAxisAlignment: MainAxisAlignment.spaceBetween,
Row( crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
crossAxisAlignment: CrossAxisAlignment.start, Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, Text(
children: [ viewModel.events[index].date != null
Text( ? DateFormat.yMMMMd(
viewModel.events[index].date != null Localizations.localeOf(
? DateFormat.yMMMMd(Localizations.localeOf(context).toString()) context)
.format(viewModel.events[index].date!) .toString())
: 'No date', .format(
style: Theme.of(context).textTheme.titleMedium, viewModel.events[index].date!)
), : 'No date',
Text( style: Theme.of(context)
viewModel.events[index].name, .textTheme
style: Theme.of(context).textTheme.headlineMedium, .titleMedium,
), ),
], Text(
), viewModel.events[index].name,
IconButton( style: Theme.of(context)
icon: Icon( .textTheme
viewModel.events[index].isFavorite .headlineMedium,
),
],
),
IconButton(
icon: Icon(
viewModel.events[index].isFavorite
? Icons.favorite ? Icons.favorite
: Icons.favorite_border, : Icons.favorite_border,
color: viewModel.events[index].isFavorite color: viewModel.events[index].isFavorite
? Colors.red ? Colors.red
: null, : null,
),
iconSize: 35,
onPressed: () {
viewModel.toggleFavorite(index);
},
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
viewModel.events[index].organizer,
style:
Theme.of(context).textTheme.bodyLarge,
), ),
iconSize: 35, Text(
onPressed: () { viewModel.events[index].place ??
viewModel.toggleFavorite(index); 'No place',
}, style: Theme.of(context)
), .textTheme
], .bodyMedium,
), ),
Row( ],
mainAxisAlignment: MainAxisAlignment.spaceBetween, ),
crossAxisAlignment: CrossAxisAlignment.end, IconButton(
children: [ icon: const Icon(Icons.place),
Column( iconSize: 35,
crossAxisAlignment: CrossAxisAlignment.start, onPressed: () {
children: [ // Handle favorite action
Text( },
viewModel.events[index].organizer, ),
style: Theme.of(context).textTheme.bodyLarge, ],
), ),
Text( ],
viewModel.events[index].place ?? 'No place',
style: Theme.of(context).textTheme.bodyMedium,
),
],
),
IconButton(
icon: const Icon(Icons.place),
iconSize: 35,
onPressed: () {
// Handle favorite action
},
),
],
),
],
),
), ),
),
), ),
], ],
), ),
@@ -134,8 +143,8 @@ class HomeView extends StackedView<HomeViewModel> {
), ),
); );
}, },
), ),
); );
} }
@override @override

View File

@@ -1,6 +1,10 @@
import 'package:bahla_front/app/app.locator.dart';
import 'package:bahla_front/app/app.router.dart';
import 'package:stacked/stacked.dart'; import 'package:stacked/stacked.dart';
import 'package:stacked_services/stacked_services.dart';
class HomeViewModel extends BaseViewModel { class HomeViewModel extends BaseViewModel {
final _navigationService = locator<NavigationService>();
List<String> items = List<String>.generate(100, (i) => 'Item $i'); List<String> items = List<String>.generate(100, (i) => 'Item $i');
@@ -36,8 +40,9 @@ class HomeViewModel extends BaseViewModel {
// Gérer le clic sur l'événement // Gérer le clic sur l'événement
print('Event tapped: ${events[index].name}'); print('Event tapped: ${events[index].name}');
// Ici vous pouvez naviguer vers une page de détails, etc. // Ici vous pouvez naviguer vers une page de détails, etc.
}
_navigationService.navigateToEventDetailsView(eventId: index);
}
} }
class Event { class Event {

View File

@@ -34,10 +34,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: async name: async
sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.12.0" version: "2.13.0"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
@@ -178,10 +178,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.3.2" version: "1.3.3"
ffi: ffi:
dependency: transitive dependency: transitive
description: description:
@@ -321,10 +321,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: intl name: intl
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.19.0" version: "0.20.2"
io: io:
dependency: transitive dependency: transitive
description: description:
@@ -353,10 +353,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker name: leak_tracker
sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "10.0.8" version: "10.0.9"
leak_tracker_flutter_testing: leak_tracker_flutter_testing:
dependency: transitive dependency: transitive
description: description:
@@ -766,10 +766,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: vm_service name: vm_service
sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "14.3.1" version: "15.0.0"
watcher: watcher:
dependency: transitive dependency: transitive
description: description:

View File

@@ -0,0 +1,11 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:bahla_front/app/app.locator.dart';
import '../helpers/test_helpers.dart';
void main() {
group('EventDetailsViewModel Tests -', () {
setUp(() => registerServices());
tearDown(() => locator.reset());
});
}