From 0f4e76e4b9b0fb1dde6fc5ee6296979de465f54c Mon Sep 17 00:00:00 2001 From: Sebastine Odeh Date: Wed, 4 Sep 2024 23:49:53 +0100 Subject: [PATCH 1/2] conference app setup --- packages/catalog/lib/main.dart | 6 +- packages/catalog/lib/usecases/bottom_nav.dart | 2 +- packages/catalog/lib/usecases/buttons.dart | 4 +- packages/cave/lib/themes/theme_data.dart | 27 +- packages/cave/lib/themes/theme_widget.dart | 7 +- packages/cave/lib/themes/typography.dart | 598 ++++++++++++++++++ packages/cave/lib/widgets/bottom_nav.dart | 10 +- packages/cave/lib/widgets/buttons.dart | 4 +- .../conferenceapp/lib/conference_app.dart | 73 +++ packages/conferenceapp/lib/main.dart | 91 +-- .../presentation/screens/dashboard.dart | 39 ++ .../src/features/home/application/.gitkeep | 0 .../home/presentation/presentation.dart | 1 + .../home/presentation/screens/home.dart | 10 + .../home/presentation/screens/screens.dart | 2 + .../src/features/more/application/.gitkeep | 0 .../more/presentation/presentation.dart | 1 + .../more/presentation/screens/home.dart | 10 + .../more/presentation/screens/my_qr_code.dart | 10 + .../more/presentation/screens/profile.dart | 10 + .../more/presentation/screens/screens.dart | 5 + .../more/presentation/screens/venue_map.dart | 10 + .../features/onboarding/application/.gitkeep | 0 .../onboarding/presentation/presentation.dart | 2 + .../onboarding/presentation/screens/home.dart | 37 ++ .../presentation/screens/login.dart | 27 + .../presentation/screens/screens.dart | 4 + .../presentation/screens/signature.dart | 10 + .../src/features/reserve/application/.gitkeep | 0 .../reserve/presentation/presentation.dart | 2 + .../reserve/presentation/screens/home.dart | 10 + .../reserve/presentation/screens/screens.dart | 2 + .../features/schedule/application/.gitkeep | 0 .../schedule/presentation/presentation.dart | 2 + .../schedule/presentation/screens/home.dart | 10 + .../screens/schedule_details.dart | 10 + .../presentation/screens/screens.dart | 4 + .../features/speakers/application/.gitkeep | 0 .../speakers/presentation/presentation.dart | 2 + .../speakers/presentation/screens/home.dart | 10 + .../presentation/screens/screens.dart | 3 + .../presentation/screens/speaker_details.dart | 10 + .../conferenceapp/lib/src/routing/router.dart | 78 +++ .../conferenceapp/lib/src/routing/routes.dart | 15 + .../lib/src/routing/routing.dart | 3 + .../src/shared/exceptions/base_exception.dart | 3 + .../shared/exceptions/empty_exception.dart | 8 + .../lib/src/shared/exceptions/exceptions.dart | 4 + .../conferenceapp/lib/src/shared/shared.dart | 3 + .../src/shared/ui_model/ui_state_model.dart | 104 +++ .../shared/ui_model/ui_state_model_mutex.dart | 81 +++ .../lib/src/shared/widgets/header.dart | 46 ++ .../lib/src/shared/widgets/widgets.dart | 2 + packages/conferenceapp/pubspec.lock | 71 ++- packages/conferenceapp/pubspec.yaml | 10 +- packages/conferenceapp/test/widget_test.dart | 5 +- 56 files changed, 1370 insertions(+), 128 deletions(-) create mode 100644 packages/conferenceapp/lib/conference_app.dart create mode 100644 packages/conferenceapp/lib/src/features/dashboard/presentation/screens/dashboard.dart create mode 100644 packages/conferenceapp/lib/src/features/home/application/.gitkeep create mode 100644 packages/conferenceapp/lib/src/features/home/presentation/presentation.dart create mode 100644 packages/conferenceapp/lib/src/features/home/presentation/screens/home.dart create mode 100644 packages/conferenceapp/lib/src/features/home/presentation/screens/screens.dart create mode 100644 packages/conferenceapp/lib/src/features/more/application/.gitkeep create mode 100644 packages/conferenceapp/lib/src/features/more/presentation/presentation.dart create mode 100644 packages/conferenceapp/lib/src/features/more/presentation/screens/home.dart create mode 100644 packages/conferenceapp/lib/src/features/more/presentation/screens/my_qr_code.dart create mode 100644 packages/conferenceapp/lib/src/features/more/presentation/screens/profile.dart create mode 100644 packages/conferenceapp/lib/src/features/more/presentation/screens/screens.dart create mode 100644 packages/conferenceapp/lib/src/features/more/presentation/screens/venue_map.dart create mode 100644 packages/conferenceapp/lib/src/features/onboarding/application/.gitkeep create mode 100644 packages/conferenceapp/lib/src/features/onboarding/presentation/presentation.dart create mode 100644 packages/conferenceapp/lib/src/features/onboarding/presentation/screens/home.dart create mode 100644 packages/conferenceapp/lib/src/features/onboarding/presentation/screens/login.dart create mode 100644 packages/conferenceapp/lib/src/features/onboarding/presentation/screens/screens.dart create mode 100644 packages/conferenceapp/lib/src/features/onboarding/presentation/screens/signature.dart create mode 100644 packages/conferenceapp/lib/src/features/reserve/application/.gitkeep create mode 100644 packages/conferenceapp/lib/src/features/reserve/presentation/presentation.dart create mode 100644 packages/conferenceapp/lib/src/features/reserve/presentation/screens/home.dart create mode 100644 packages/conferenceapp/lib/src/features/reserve/presentation/screens/screens.dart create mode 100644 packages/conferenceapp/lib/src/features/schedule/application/.gitkeep create mode 100644 packages/conferenceapp/lib/src/features/schedule/presentation/presentation.dart create mode 100644 packages/conferenceapp/lib/src/features/schedule/presentation/screens/home.dart create mode 100644 packages/conferenceapp/lib/src/features/schedule/presentation/screens/schedule_details.dart create mode 100644 packages/conferenceapp/lib/src/features/schedule/presentation/screens/screens.dart create mode 100644 packages/conferenceapp/lib/src/features/speakers/application/.gitkeep create mode 100644 packages/conferenceapp/lib/src/features/speakers/presentation/presentation.dart create mode 100644 packages/conferenceapp/lib/src/features/speakers/presentation/screens/home.dart create mode 100644 packages/conferenceapp/lib/src/features/speakers/presentation/screens/screens.dart create mode 100644 packages/conferenceapp/lib/src/features/speakers/presentation/screens/speaker_details.dart create mode 100644 packages/conferenceapp/lib/src/routing/router.dart create mode 100644 packages/conferenceapp/lib/src/routing/routes.dart create mode 100644 packages/conferenceapp/lib/src/routing/routing.dart create mode 100644 packages/conferenceapp/lib/src/shared/exceptions/base_exception.dart create mode 100644 packages/conferenceapp/lib/src/shared/exceptions/empty_exception.dart create mode 100644 packages/conferenceapp/lib/src/shared/exceptions/exceptions.dart create mode 100644 packages/conferenceapp/lib/src/shared/shared.dart create mode 100644 packages/conferenceapp/lib/src/shared/ui_model/ui_state_model.dart create mode 100644 packages/conferenceapp/lib/src/shared/ui_model/ui_state_model_mutex.dart create mode 100644 packages/conferenceapp/lib/src/shared/widgets/header.dart create mode 100644 packages/conferenceapp/lib/src/shared/widgets/widgets.dart diff --git a/packages/catalog/lib/main.dart b/packages/catalog/lib/main.dart index e23e4e5..40ed77c 100644 --- a/packages/catalog/lib/main.dart +++ b/packages/catalog/lib/main.dart @@ -47,7 +47,7 @@ class WidgetbookApp extends StatelessWidget { extensions: >[ /// Use the below format for raw theme data /// DevFestTheme(textTheme: DevfestTextTheme()), - DevFestTheme.light(), + DevFestThemeData.light(), ], ), ), @@ -64,7 +64,7 @@ class WidgetbookApp extends StatelessWidget { extensions: >[ /// Use the below format for raw theme data /// DevFestTheme(textTheme: DevfestTextTheme()), - DevFestTheme.dark(), + DevFestThemeData.dark(), ], ), ), @@ -80,7 +80,7 @@ class WidgetbookApp extends StatelessWidget { debugShowCheckedModeBanner: false, theme: theme.copyWith( extensions: [ - isDark ? DevFestTheme.dark() : DevFestTheme.light() + isDark ? DevFestThemeData.dark() : DevFestThemeData.light() ], ), home: Material(child: child), diff --git a/packages/catalog/lib/usecases/bottom_nav.dart b/packages/catalog/lib/usecases/bottom_nav.dart index 2f145c5..4fe665b 100644 --- a/packages/catalog/lib/usecases/bottom_nav.dart +++ b/packages/catalog/lib/usecases/bottom_nav.dart @@ -10,7 +10,7 @@ Widget devfestBottomNav(BuildContext context) { int index = 0; return StatefulBuilder(builder: (context, setState) { return Scaffold( - backgroundColor: DevFestTheme.of(context).backgroundColor, + backgroundColor: DevfestTheme.of(context).backgroundColor, bottomNavigationBar: DevfestBottomNav( index: index, items: const [ diff --git a/packages/catalog/lib/usecases/buttons.dart b/packages/catalog/lib/usecases/buttons.dart index 9397d5d..aad48fe 100644 --- a/packages/catalog/lib/usecases/buttons.dart +++ b/packages/catalog/lib/usecases/buttons.dart @@ -5,7 +5,7 @@ import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; @widgetbook.UseCase(name: 'Filled Button', type: DevfestFilledButton) Widget devfestFilledButton(BuildContext context) { return Material( - color: DevFestTheme.of(context).backgroundColor, + color: DevfestTheme.of(context).backgroundColor, child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.stretch, @@ -46,7 +46,7 @@ Widget devfestFilledButton(BuildContext context) { @widgetbook.UseCase(name: 'Outlined Button', type: DevfestOutlinedButton) Widget devfestOutlinedButton(BuildContext context) { return Material( - color: DevFestTheme.of(context).backgroundColor, + color: DevfestTheme.of(context).backgroundColor, child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.stretch, diff --git a/packages/cave/lib/themes/theme_data.dart b/packages/cave/lib/themes/theme_data.dart index 7fb35f2..e12e5b9 100644 --- a/packages/cave/lib/themes/theme_data.dart +++ b/packages/cave/lib/themes/theme_data.dart @@ -6,7 +6,7 @@ import 'colors.dart'; import 'text_field_theme.dart'; import 'typography.dart'; -class DevFestTheme extends ThemeExtension { +class DevFestThemeData extends ThemeExtension { /// Create and register new themes here final DevfestTextTheme? textTheme; final DevfestButtonTheme? buttonTheme; @@ -15,10 +15,7 @@ class DevFestTheme extends ThemeExtension { final DevfestTextFieldTheme? textFieldTheme; final Color? backgroundColor; - static DevFestTheme of(BuildContext context) => - Theme.of(context).extension()!; - - const DevFestTheme({ + const DevFestThemeData({ this.textTheme, this.backgroundColor, this.bottomNavTheme, @@ -27,19 +24,19 @@ class DevFestTheme extends ThemeExtension { this.textFieldTheme, }); - DevFestTheme.light() + DevFestThemeData.light() : this( - textTheme: const DevfestTextTheme.responsive(), - backgroundColor: DevfestColors.backgroundLight, + textTheme: DevfestTextTheme.light(), + backgroundColor: DevfestColors.primariesYellow100, buttonTheme: const DevfestButtonTheme.light(), outlinedButtonTheme: const DevfestOutlinedButtonTheme.light(), bottomNavTheme: const DevfestBottomNavTheme.light(), textFieldTheme: DevfestTextFieldTheme.light(), ); - DevFestTheme.dark() + DevFestThemeData.dark() : this( - textTheme: const DevfestTextTheme.responsive(), + textTheme: DevfestTextTheme.dark(), backgroundColor: DevfestColors.backgroundDark, textFieldTheme: DevfestTextFieldTheme.dark(), buttonTheme: const DevfestButtonTheme.dark(), @@ -48,13 +45,13 @@ class DevFestTheme extends ThemeExtension { ); @override - DevFestTheme copyWith({ + DevFestThemeData copyWith({ DevfestTextTheme? textTheme, DevfestButtonTheme? buttonTheme, DevfestOutlinedButtonTheme? outlinedButtonTheme, DevfestBottomNavTheme? bottomNavTheme, }) { - return DevFestTheme( + return DevFestThemeData( textTheme: textTheme ?? this.textTheme, buttonTheme: buttonTheme ?? this.buttonTheme, outlinedButtonTheme: outlinedButtonTheme ?? this.outlinedButtonTheme, @@ -63,9 +60,9 @@ class DevFestTheme extends ThemeExtension { } @override - DevFestTheme lerp(DevFestTheme? other, double t) { - if (other is! DevFestTheme) return this; - return DevFestTheme( + DevFestThemeData lerp(DevFestThemeData? other, double t) { + if (other is! DevFestThemeData) return this; + return DevFestThemeData( textTheme: textTheme?.lerp(other.textTheme, t), backgroundColor: Color.lerp(backgroundColor, other.backgroundColor, t), buttonTheme: buttonTheme?.lerp(other.buttonTheme, t), diff --git a/packages/cave/lib/themes/theme_widget.dart b/packages/cave/lib/themes/theme_widget.dart index d79e86f..7ed0c3a 100644 --- a/packages/cave/lib/themes/theme_widget.dart +++ b/packages/cave/lib/themes/theme_widget.dart @@ -2,7 +2,7 @@ import 'theme_data.dart'; import 'package:flutter/material.dart'; class DevfestTheme extends StatelessWidget { - final DevFestTheme data; + final DevFestThemeData data; final Widget child; const DevfestTheme({ @@ -11,12 +11,15 @@ class DevfestTheme extends StatelessWidget { required this.child, }); + static DevFestThemeData of(BuildContext context) => + Theme.of(context).extension()!; + @override Widget build(BuildContext context) { final theme = Theme.of(context); final themeExtensions = Map.from(theme.extensions); - themeExtensions[DevFestTheme] = data; + themeExtensions[DevFestThemeData] = data; return Theme( data: theme.copyWith(extensions: themeExtensions.values), child: child, diff --git a/packages/cave/lib/themes/typography.dart b/packages/cave/lib/themes/typography.dart index fb5e090..f62a42d 100644 --- a/packages/cave/lib/themes/typography.dart +++ b/packages/cave/lib/themes/typography.dart @@ -1,5 +1,8 @@ +import 'package:cave/cave.dart'; import 'package:flutter/material.dart'; +import 'colors.dart'; + @immutable class DevfestTextTheme extends ThemeExtension { final TextStyle? headerH1; @@ -78,6 +81,578 @@ class DevfestTextTheme extends ThemeExtension { this.buttonSmallBold, }); + DevfestTextTheme.light() + : this( + headerH1: TextStyle( + fontSize: 80.sp, + fontWeight: FontWeight.w700, + height: 1.15, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + headerH2: TextStyle( + fontSize: 62.sp, + fontWeight: FontWeight.w700, + height: 1.23, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + headerH3: TextStyle( + fontSize: 56.sp, + fontWeight: FontWeight.w700, + height: 1.25, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + headerH4: TextStyle( + fontSize: 40.sp, + fontWeight: FontWeight.w700, + height: 1.2, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + headerH5: TextStyle( + fontSize: 32.sp, + fontWeight: FontWeight.w700, + height: 1.25, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + headerH6: TextStyle( + fontSize: 28.sp, + fontWeight: FontWeight.w400, + height: 1.29, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + titleTitle1Regular: TextStyle( + fontSize: 24.sp, + fontWeight: FontWeight.w400, + height: 1.33, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + titleTitle1Medium: TextStyle( + fontSize: 24.sp, + fontWeight: FontWeight.w500, + height: 1.33, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + titleTitle1Semibold: TextStyle( + fontSize: 24.sp, + fontWeight: FontWeight.w400, + height: 1.33, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + titleTitle2Regular: TextStyle( + fontSize: 22.sp, + fontWeight: FontWeight.w400, + height: 1.45, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + titleTitle2Medium: TextStyle( + fontSize: 22.sp, + fontWeight: FontWeight.w500, + height: 1.45, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + titleTitle2Semibold: TextStyle( + fontSize: 22.sp, + fontWeight: FontWeight.w400, + height: 1.45, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + bodyBody1Regular: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.w400, + height: 1.33, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + bodyBody1Medium: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.w500, + height: 1.33, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + bodyBody1Semibold: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.w400, + height: 1.33, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + bodyBody2Regular: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.w400, + height: 1.5, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + bodyBody2Medium: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.w500, + height: 1.5, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + bodyBody2Semibold: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.w400, + height: 1.5, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + bodyBody3Regular: TextStyle( + fontSize: 14.sp, + fontWeight: FontWeight.w400, + height: 1.43, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + bodyBody3Medium: TextStyle( + fontSize: 14.sp, + fontWeight: FontWeight.w500, + height: 1.43, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + bodyBody3Semibold: TextStyle( + fontSize: 14.sp, + fontWeight: FontWeight.w400, + height: 1.43, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + bodyBody4Regular: TextStyle( + fontSize: 12.sp, + fontWeight: FontWeight.w400, + height: 1.5, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + bodyBody4Medium: TextStyle( + fontSize: 12.sp, + fontWeight: FontWeight.w500, + height: 1.5, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + bodyBody4Semibold: TextStyle( + fontSize: 12.sp, + fontWeight: FontWeight.w400, + height: 1.5, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + bodyBody5Regular: TextStyle( + fontSize: 10.sp, + fontWeight: FontWeight.w400, + height: 1.4, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + bodyBody5Medium: TextStyle( + fontSize: 10.sp, + fontWeight: FontWeight.w500, + height: 1.4, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + bodyBody5Semibold: TextStyle( + fontSize: 10.sp, + fontWeight: FontWeight.w400, + height: 1.4, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + buttonLargeMedium: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.w500, + height: 1.33, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + buttonLargeSemibold: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.w400, + height: 1.33, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + buttonLargeBold: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.w700, + height: 1.33, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + buttonMediumMedium: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.w500, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + buttonMediumSemibold: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.w400, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + buttonMediumBold: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.w700, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + buttonSmallMedium: TextStyle( + fontSize: 12.sp, + fontWeight: FontWeight.w500, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + buttonSmallSemibold: TextStyle( + fontSize: 12.sp, + fontWeight: FontWeight.w400, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + buttonSmallBold: TextStyle( + fontSize: 12.sp, + fontWeight: FontWeight.w700, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey10, + ), + ); + + DevfestTextTheme.dark() + : this( + headerH1: TextStyle( + fontSize: 80.sp, + fontWeight: FontWeight.w700, + height: 1.15, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + headerH2: TextStyle( + fontSize: 62.sp, + fontWeight: FontWeight.w700, + height: 1.23, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + headerH3: TextStyle( + fontSize: 56.sp, + fontWeight: FontWeight.w700, + height: 1.25, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + headerH4: TextStyle( + fontSize: 40.sp, + fontWeight: FontWeight.w700, + height: 1.2, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + headerH5: TextStyle( + fontSize: 32.sp, + fontWeight: FontWeight.w700, + height: 1.25, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + headerH6: TextStyle( + fontSize: 28.sp, + fontWeight: FontWeight.w400, + height: 1.29, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + titleTitle1Regular: TextStyle( + fontSize: 24.sp, + fontWeight: FontWeight.w400, + height: 1.33, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + titleTitle1Medium: TextStyle( + fontSize: 24.sp, + fontWeight: FontWeight.w500, + height: 1.33, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + titleTitle1Semibold: TextStyle( + fontSize: 24.sp, + fontWeight: FontWeight.w400, + height: 1.33, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + titleTitle2Regular: TextStyle( + fontSize: 22.sp, + fontWeight: FontWeight.w400, + height: 1.45, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + titleTitle2Medium: TextStyle( + fontSize: 22.sp, + fontWeight: FontWeight.w500, + height: 1.45, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + titleTitle2Semibold: TextStyle( + fontSize: 22.sp, + fontWeight: FontWeight.w400, + height: 1.45, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + bodyBody1Regular: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.w400, + height: 1.33, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + bodyBody1Medium: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.w500, + height: 1.33, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + bodyBody1Semibold: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.w400, + height: 1.33, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + bodyBody2Regular: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.w400, + height: 1.5, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + bodyBody2Medium: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.w500, + height: 1.5, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + bodyBody2Semibold: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.w400, + height: 1.5, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + bodyBody3Regular: TextStyle( + fontSize: 14.sp, + fontWeight: FontWeight.w400, + height: 1.43, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + bodyBody3Medium: TextStyle( + fontSize: 14.sp, + fontWeight: FontWeight.w500, + height: 1.43, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + bodyBody3Semibold: TextStyle( + fontSize: 14.sp, + fontWeight: FontWeight.w400, + height: 1.43, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + bodyBody4Regular: TextStyle( + fontSize: 12.sp, + fontWeight: FontWeight.w400, + height: 1.5, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + bodyBody4Medium: TextStyle( + fontSize: 12.sp, + fontWeight: FontWeight.w500, + height: 1.5, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + bodyBody4Semibold: TextStyle( + fontSize: 12.sp, + fontWeight: FontWeight.w400, + height: 1.5, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + bodyBody5Regular: TextStyle( + fontSize: 10.sp, + fontWeight: FontWeight.w400, + height: 1.4, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + bodyBody5Medium: TextStyle( + fontSize: 10.sp, + fontWeight: FontWeight.w500, + height: 1.4, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + bodyBody5Semibold: TextStyle( + fontSize: 10.sp, + fontWeight: FontWeight.w400, + height: 1.4, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + buttonLargeMedium: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.w500, + height: 1.33, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + buttonLargeSemibold: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.w400, + height: 1.33, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + buttonLargeBold: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.w700, + height: 1.33, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + buttonMediumMedium: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.w500, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + buttonMediumSemibold: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.w400, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + buttonMediumBold: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.w700, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + buttonSmallMedium: TextStyle( + fontSize: 12.sp, + fontWeight: FontWeight.w500, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + buttonSmallSemibold: TextStyle( + fontSize: 12.sp, + fontWeight: FontWeight.w400, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + buttonSmallBold: TextStyle( + fontSize: 12.sp, + fontWeight: FontWeight.w700, + fontStyle: FontStyle.normal, + decoration: TextDecoration.none, + color: DevfestColors.grey100, + ), + ); + const DevfestTextTheme.responsive() : this( headerH1: const TextStyle( @@ -480,3 +1055,26 @@ class DevfestTextTheme extends ThemeExtension { ); } } + +extension TypographyX on TextStyle { + /// fontweight: 400 + TextStyle get regular => copyWith(fontWeight: FontWeight.w400); + + /// fontweight: 500 + TextStyle get medium => copyWith(fontWeight: FontWeight.w500); + + /// fontweight: 600 + TextStyle get semi => copyWith(fontWeight: FontWeight.w600); + + /// fontweight: 700 + TextStyle get bold => copyWith(fontWeight: FontWeight.w700); + + /// Italic + TextStyle get italic => copyWith(fontStyle: FontStyle.italic); + + /// fontweight: 800 + TextStyle get extraBold => copyWith(fontWeight: FontWeight.w800); + + /// underlined text + TextStyle get underlined => copyWith(decoration: TextDecoration.underline); +} diff --git a/packages/cave/lib/widgets/bottom_nav.dart b/packages/cave/lib/widgets/bottom_nav.dart index cd331e9..7c9bd9e 100644 --- a/packages/cave/lib/widgets/bottom_nav.dart +++ b/packages/cave/lib/widgets/bottom_nav.dart @@ -40,8 +40,8 @@ class _DevfestBottomNavState extends State { Widget build(BuildContext context) { final additionalBottomPadding = MediaQuery.viewPaddingOf(context).bottom; return DevfestTheme( - data: DevFestTheme.of(context).copyWith( - bottomNavTheme: DevFestTheme.of(context).bottomNavTheme?.copyWith( + data: DevfestTheme.of(context).copyWith( + bottomNavTheme: DevfestTheme.of(context).bottomNavTheme?.copyWith( labelStyle: widget.labelStyle, selectedColor: widget.selectedColor, unselectedColor: widget.unselectedColor, @@ -56,10 +56,10 @@ class _DevfestBottomNavState extends State { height: 88 + additionalBottomPadding, padding: EdgeInsets.only(bottom: additionalBottomPadding), decoration: BoxDecoration( - color: DevFestTheme.of(context).bottomNavTheme?.backgroundColor, + color: DevfestTheme.of(context).bottomNavTheme?.backgroundColor, border: Border( top: BorderSide( - color: DevFestTheme.of(context).bottomNavTheme?.borderColor ?? + color: DevfestTheme.of(context).bottomNavTheme?.borderColor ?? const Color(0xFF000000), width: 1), ), @@ -114,7 +114,7 @@ class _DevfestBottomNavTile extends StatelessWidget { @override Widget build(BuildContext context) { - final bottomNavItemTheme = DevFestTheme.of(context).bottomNavTheme ?? + final bottomNavItemTheme = DevfestTheme.of(context).bottomNavTheme ?? const DevfestBottomNavTheme.light(); final itemColor = selected diff --git a/packages/cave/lib/widgets/buttons.dart b/packages/cave/lib/widgets/buttons.dart index ccacdcd..f4005c3 100644 --- a/packages/cave/lib/widgets/buttons.dart +++ b/packages/cave/lib/widgets/buttons.dart @@ -22,7 +22,7 @@ class DevfestFilledButton extends StatelessWidget { @override Widget build(BuildContext context) { - final buttonTheme = DevFestTheme.of(context).buttonTheme ?? + final buttonTheme = DevfestTheme.of(context).buttonTheme ?? const DevfestButtonTheme.light(); return Material( type: MaterialType.transparency, @@ -103,7 +103,7 @@ class DevfestOutlinedButton extends StatelessWidget { @override Widget build(BuildContext context) { - final outlinedButtonTheme = DevFestTheme.of(context).outlinedButtonTheme ?? + final outlinedButtonTheme = DevfestTheme.of(context).outlinedButtonTheme ?? const DevfestOutlinedButtonTheme.light(); return Material( type: MaterialType.transparency, diff --git a/packages/conferenceapp/lib/conference_app.dart b/packages/conferenceapp/lib/conference_app.dart new file mode 100644 index 0000000..c0fc3bb --- /dev/null +++ b/packages/conferenceapp/lib/conference_app.dart @@ -0,0 +1,73 @@ +import 'package:accessibility_tools/accessibility_tools.dart'; +import 'package:cave/cave.dart'; +import 'package:devfest24/src/routing/routing.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +class ConferenceApp extends ConsumerStatefulWidget { + const ConferenceApp({super.key}); + + @override + ConsumerState createState() => _ConferenceAppState(); +} + +class _ConferenceAppState extends ConsumerState { + final designSize = const Size(430, 956); + + @override + void initState() { + super.initState(); + Devfest2024Router.instance.initialiseRouter(ref); + } + + // This widget is the root of your application. + @override + Widget build(BuildContext context) { + return ScreenUtilInit( + designSize: designSize, + minTextAdapt: true, + builder: (_, child) { + return MaterialApp.router( + title: 'Devfest24 Conference App', + routerConfig: Devfest2024Router.instance.router, + builder: (context, child) => AccessibilityTools(child: child), + theme: ThemeData( + colorScheme: ColorScheme.fromSeed( + seedColor: Colors.deepPurple, + surface: DevFestThemeData.light().backgroundColor, + ), + scaffoldBackgroundColor: DevFestThemeData.light().backgroundColor, + useMaterial3: true, + textTheme: const TextTheme( + displayMedium: TextStyle(color: DevfestColors.grey10), + ), + // appBarTheme: AppBarTheme( + // color: DevFestThemeData.light().backgroundColor, + // ), + extensions: >[ + /// Use the below format for raw theme data + /// DevFestTheme(textTheme: DevfestTextTheme()), + DevFestThemeData.light(), + ], + ), + darkTheme: ThemeData( + colorScheme: ColorScheme.fromSeed( + seedColor: Colors.deepPurple, + surface: DevFestThemeData.dark().backgroundColor, + ), + scaffoldBackgroundColor: DevFestThemeData.dark().backgroundColor, + useMaterial3: true, + textTheme: const TextTheme( + displayMedium: TextStyle(color: DevfestColors.grey100), + ), + extensions: >[ + /// Use the below format for raw theme data + /// DevFestTheme(textTheme: DevfestTextTheme()), + DevFestThemeData.dark(), + ], + ), + ); + }, + ); + } +} diff --git a/packages/conferenceapp/lib/main.dart b/packages/conferenceapp/lib/main.dart index 1abdf2c..08e1b60 100644 --- a/packages/conferenceapp/lib/main.dart +++ b/packages/conferenceapp/lib/main.dart @@ -1,92 +1,7 @@ -import 'package:cave/cave.dart'; import 'package:flutter/material.dart'; -void main() { - runApp(const MyApp()); -} - -class MyApp extends StatelessWidget { - const MyApp({super.key}); - - final designSize = const Size(430, 956); - - // This widget is the root of your application. - @override - Widget build(BuildContext context) { - return ScreenUtilInit( - designSize: designSize, - minTextAdapt: true, - builder: (_, child) { - return MaterialApp( - title: 'Flutter Demo', - theme: ThemeData( - colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), - useMaterial3: true, - extensions: >[ - /// Use the below format for raw theme data - /// DevFestTheme(textTheme: DevfestTextTheme()), - DevFestTheme.light(), - ], - ), - darkTheme: ThemeData( - colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), - useMaterial3: true, - extensions: >[ - /// Use the below format for raw theme data - /// DevFestTheme(textTheme: DevfestTextTheme()), - DevFestTheme.dark(), - ], - ), - home: const MyHomePage(title: 'Flutter Demo Home Page'), - ); - }); - } -} - -class MyHomePage extends StatefulWidget { - const MyHomePage({super.key, required this.title}); +import 'conference_app.dart'; - final String title; - - @override - State createState() => _MyHomePageState(); -} - -class _MyHomePageState extends State { - int _counter = 0; - - void _incrementCounter() { - setState(() { - _counter++; - }); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - backgroundColor: Theme.of(context).colorScheme.inversePrimary, - title: Text(widget.title), - ), - body: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const Text( - 'You have pushed the button this many times:', - ), - Text( - '$_counter', - style: Theme.of(context).textTheme.headlineMedium, - ), - ], - ), - ), - floatingActionButton: FloatingActionButton( - onPressed: _incrementCounter, - tooltip: 'Increment', - child: const Icon(Icons.add), - ), - ); - } +void main() { + runApp(const ConferenceApp()); } diff --git a/packages/conferenceapp/lib/src/features/dashboard/presentation/screens/dashboard.dart b/packages/conferenceapp/lib/src/features/dashboard/presentation/screens/dashboard.dart new file mode 100644 index 0000000..ce5b0a6 --- /dev/null +++ b/packages/conferenceapp/lib/src/features/dashboard/presentation/screens/dashboard.dart @@ -0,0 +1,39 @@ +import 'package:devfest24/src/features/home/presentation/presentation.dart'; +import 'package:devfest24/src/features/more/presentation/presentation.dart'; +import 'package:devfest24/src/features/reserve/presentation/presentation.dart'; +import 'package:devfest24/src/features/schedule/presentation/presentation.dart'; +import 'package:devfest24/src/features/speakers/presentation/presentation.dart'; +import 'package:flutter/material.dart'; + +class DashboardScreen extends StatelessWidget { + const DashboardScreen({super.key}); + + @override + Widget build(BuildContext context) { + return const DefaultTabController(length: 5, child: _View()); + } +} + +class _View extends StatefulWidget { + const _View(); + + @override + State<_View> createState() => _ViewState(); +} + +class _ViewState extends State<_View> { + static const _tabs = [ + HomeScreen(), + ScheduleHomeScreen(), + SpeakersHomeScreen(), + ReserveHomeScreen(), + MoreHomeScreen(), + ]; + + @override + Widget build(BuildContext context) { + return const Scaffold( + body: TabBarView(children: _tabs), + ); + } +} diff --git a/packages/conferenceapp/lib/src/features/home/application/.gitkeep b/packages/conferenceapp/lib/src/features/home/application/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/packages/conferenceapp/lib/src/features/home/presentation/presentation.dart b/packages/conferenceapp/lib/src/features/home/presentation/presentation.dart new file mode 100644 index 0000000..80f5a18 --- /dev/null +++ b/packages/conferenceapp/lib/src/features/home/presentation/presentation.dart @@ -0,0 +1 @@ +export 'screens/screens.dart'; diff --git a/packages/conferenceapp/lib/src/features/home/presentation/screens/home.dart b/packages/conferenceapp/lib/src/features/home/presentation/screens/home.dart new file mode 100644 index 0000000..2831845 --- /dev/null +++ b/packages/conferenceapp/lib/src/features/home/presentation/screens/home.dart @@ -0,0 +1,10 @@ +import 'package:flutter/material.dart'; + +class HomeScreen extends StatelessWidget { + const HomeScreen({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold(); + } +} diff --git a/packages/conferenceapp/lib/src/features/home/presentation/screens/screens.dart b/packages/conferenceapp/lib/src/features/home/presentation/screens/screens.dart new file mode 100644 index 0000000..78a262f --- /dev/null +++ b/packages/conferenceapp/lib/src/features/home/presentation/screens/screens.dart @@ -0,0 +1,2 @@ +//GENERATED BARREL FILE +export 'home.dart'; diff --git a/packages/conferenceapp/lib/src/features/more/application/.gitkeep b/packages/conferenceapp/lib/src/features/more/application/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/packages/conferenceapp/lib/src/features/more/presentation/presentation.dart b/packages/conferenceapp/lib/src/features/more/presentation/presentation.dart new file mode 100644 index 0000000..80f5a18 --- /dev/null +++ b/packages/conferenceapp/lib/src/features/more/presentation/presentation.dart @@ -0,0 +1 @@ +export 'screens/screens.dart'; diff --git a/packages/conferenceapp/lib/src/features/more/presentation/screens/home.dart b/packages/conferenceapp/lib/src/features/more/presentation/screens/home.dart new file mode 100644 index 0000000..0a53246 --- /dev/null +++ b/packages/conferenceapp/lib/src/features/more/presentation/screens/home.dart @@ -0,0 +1,10 @@ +import 'package:flutter/material.dart'; + +class MoreHomeScreen extends StatelessWidget { + const MoreHomeScreen({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold(); + } +} diff --git a/packages/conferenceapp/lib/src/features/more/presentation/screens/my_qr_code.dart b/packages/conferenceapp/lib/src/features/more/presentation/screens/my_qr_code.dart new file mode 100644 index 0000000..2c3d0d7 --- /dev/null +++ b/packages/conferenceapp/lib/src/features/more/presentation/screens/my_qr_code.dart @@ -0,0 +1,10 @@ +import 'package:flutter/material.dart'; + +class MyQrCodeScreen extends StatelessWidget { + const MyQrCodeScreen({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold(); + } +} diff --git a/packages/conferenceapp/lib/src/features/more/presentation/screens/profile.dart b/packages/conferenceapp/lib/src/features/more/presentation/screens/profile.dart new file mode 100644 index 0000000..c92d801 --- /dev/null +++ b/packages/conferenceapp/lib/src/features/more/presentation/screens/profile.dart @@ -0,0 +1,10 @@ +import 'package:flutter/material.dart'; + +class ProfileScreen extends StatelessWidget { + const ProfileScreen({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold(); + } +} diff --git a/packages/conferenceapp/lib/src/features/more/presentation/screens/screens.dart b/packages/conferenceapp/lib/src/features/more/presentation/screens/screens.dart new file mode 100644 index 0000000..5d54abf --- /dev/null +++ b/packages/conferenceapp/lib/src/features/more/presentation/screens/screens.dart @@ -0,0 +1,5 @@ +//GENERATED BARREL FILE +export 'home.dart'; +export 'my_qr_code.dart'; +export 'profile.dart'; +export 'venue_map.dart'; diff --git a/packages/conferenceapp/lib/src/features/more/presentation/screens/venue_map.dart b/packages/conferenceapp/lib/src/features/more/presentation/screens/venue_map.dart new file mode 100644 index 0000000..47b5073 --- /dev/null +++ b/packages/conferenceapp/lib/src/features/more/presentation/screens/venue_map.dart @@ -0,0 +1,10 @@ +import 'package:flutter/material.dart'; + +class VenueMapScreen extends StatelessWidget { + const VenueMapScreen({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold(); + } +} diff --git a/packages/conferenceapp/lib/src/features/onboarding/application/.gitkeep b/packages/conferenceapp/lib/src/features/onboarding/application/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/packages/conferenceapp/lib/src/features/onboarding/presentation/presentation.dart b/packages/conferenceapp/lib/src/features/onboarding/presentation/presentation.dart new file mode 100644 index 0000000..3280cc1 --- /dev/null +++ b/packages/conferenceapp/lib/src/features/onboarding/presentation/presentation.dart @@ -0,0 +1,2 @@ +//GENERATED BARREL FILE +export './screens/screens.dart'; diff --git a/packages/conferenceapp/lib/src/features/onboarding/presentation/screens/home.dart b/packages/conferenceapp/lib/src/features/onboarding/presentation/screens/home.dart new file mode 100644 index 0000000..32f4074 --- /dev/null +++ b/packages/conferenceapp/lib/src/features/onboarding/presentation/screens/home.dart @@ -0,0 +1,37 @@ +import 'package:cave/cave.dart'; +import 'package:cave/constants.dart'; +import 'package:devfest24/src/routing/routing.dart'; +import 'package:devfest24/src/shared/shared.dart'; +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; + +class OnboardingHomeScreen extends StatelessWidget { + const OnboardingHomeScreen({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(), + body: Padding( + padding: EdgeInsets.symmetric(horizontal: Constants.horizontalMargin.w), + child: Column( + children: [ + const HeaderText( + title: Text('DevFest Lagos like you have never seen it before'), + subtitle: Text( + 'We said we will see you again next year, here we are, we have missed you and prepared amazing things for you 🥺', + ), + ), + SizedBox(height: (Constants.largeVerticalGutter * 3).h), + DevfestFilledButton( + onPressed: () { + context.goNamed(Devfest2024Routes.onboardingLogin.name); + }, + title: const Text('Let\'s Get This Bread Quickly'), + ) + ], + ), + ), + ); + } +} diff --git a/packages/conferenceapp/lib/src/features/onboarding/presentation/screens/login.dart b/packages/conferenceapp/lib/src/features/onboarding/presentation/screens/login.dart new file mode 100644 index 0000000..8682070 --- /dev/null +++ b/packages/conferenceapp/lib/src/features/onboarding/presentation/screens/login.dart @@ -0,0 +1,27 @@ +import 'package:cave/cave.dart'; +import 'package:cave/constants.dart'; +import 'package:devfest24/src/shared/shared.dart'; +import 'package:flutter/material.dart'; + +class OnboardingLoginScreen extends StatelessWidget { + const OnboardingLoginScreen({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(), + body: Padding( + padding: EdgeInsets.symmetric(horizontal: Constants.horizontalMargin.w), + child: Column( + children: [ + const HeaderText( + title: Text('Welcome to DevFest Lagos 2024 🥳'), + subtitle: Text('Enter your details to continue!'), + ), + SizedBox(height: Constants.largeVerticalGutter.h), + ], + ), + ), + ); + } +} diff --git a/packages/conferenceapp/lib/src/features/onboarding/presentation/screens/screens.dart b/packages/conferenceapp/lib/src/features/onboarding/presentation/screens/screens.dart new file mode 100644 index 0000000..3d710f1 --- /dev/null +++ b/packages/conferenceapp/lib/src/features/onboarding/presentation/screens/screens.dart @@ -0,0 +1,4 @@ +//GENERATED BARREL FILE +export 'home.dart'; +export 'login.dart'; +export 'signature.dart'; diff --git a/packages/conferenceapp/lib/src/features/onboarding/presentation/screens/signature.dart b/packages/conferenceapp/lib/src/features/onboarding/presentation/screens/signature.dart new file mode 100644 index 0000000..01ae37d --- /dev/null +++ b/packages/conferenceapp/lib/src/features/onboarding/presentation/screens/signature.dart @@ -0,0 +1,10 @@ +import 'package:flutter/material.dart'; + +class OnboardingSignatureScreen extends StatelessWidget { + const OnboardingSignatureScreen({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold(); + } +} diff --git a/packages/conferenceapp/lib/src/features/reserve/application/.gitkeep b/packages/conferenceapp/lib/src/features/reserve/application/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/packages/conferenceapp/lib/src/features/reserve/presentation/presentation.dart b/packages/conferenceapp/lib/src/features/reserve/presentation/presentation.dart new file mode 100644 index 0000000..3280cc1 --- /dev/null +++ b/packages/conferenceapp/lib/src/features/reserve/presentation/presentation.dart @@ -0,0 +1,2 @@ +//GENERATED BARREL FILE +export './screens/screens.dart'; diff --git a/packages/conferenceapp/lib/src/features/reserve/presentation/screens/home.dart b/packages/conferenceapp/lib/src/features/reserve/presentation/screens/home.dart new file mode 100644 index 0000000..569df2b --- /dev/null +++ b/packages/conferenceapp/lib/src/features/reserve/presentation/screens/home.dart @@ -0,0 +1,10 @@ +import 'package:flutter/material.dart'; + +class ReserveHomeScreen extends StatelessWidget { + const ReserveHomeScreen({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold(); + } +} diff --git a/packages/conferenceapp/lib/src/features/reserve/presentation/screens/screens.dart b/packages/conferenceapp/lib/src/features/reserve/presentation/screens/screens.dart new file mode 100644 index 0000000..78a262f --- /dev/null +++ b/packages/conferenceapp/lib/src/features/reserve/presentation/screens/screens.dart @@ -0,0 +1,2 @@ +//GENERATED BARREL FILE +export 'home.dart'; diff --git a/packages/conferenceapp/lib/src/features/schedule/application/.gitkeep b/packages/conferenceapp/lib/src/features/schedule/application/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/packages/conferenceapp/lib/src/features/schedule/presentation/presentation.dart b/packages/conferenceapp/lib/src/features/schedule/presentation/presentation.dart new file mode 100644 index 0000000..3280cc1 --- /dev/null +++ b/packages/conferenceapp/lib/src/features/schedule/presentation/presentation.dart @@ -0,0 +1,2 @@ +//GENERATED BARREL FILE +export './screens/screens.dart'; diff --git a/packages/conferenceapp/lib/src/features/schedule/presentation/screens/home.dart b/packages/conferenceapp/lib/src/features/schedule/presentation/screens/home.dart new file mode 100644 index 0000000..3e4e072 --- /dev/null +++ b/packages/conferenceapp/lib/src/features/schedule/presentation/screens/home.dart @@ -0,0 +1,10 @@ +import 'package:flutter/material.dart'; + +class ScheduleHomeScreen extends StatelessWidget { + const ScheduleHomeScreen({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold(); + } +} diff --git a/packages/conferenceapp/lib/src/features/schedule/presentation/screens/schedule_details.dart b/packages/conferenceapp/lib/src/features/schedule/presentation/screens/schedule_details.dart new file mode 100644 index 0000000..e66e989 --- /dev/null +++ b/packages/conferenceapp/lib/src/features/schedule/presentation/screens/schedule_details.dart @@ -0,0 +1,10 @@ +import 'package:flutter/material.dart'; + +class ScheduleDetailsScreen extends StatelessWidget { + const ScheduleDetailsScreen({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold(); + } +} diff --git a/packages/conferenceapp/lib/src/features/schedule/presentation/screens/screens.dart b/packages/conferenceapp/lib/src/features/schedule/presentation/screens/screens.dart new file mode 100644 index 0000000..ca74e1e --- /dev/null +++ b/packages/conferenceapp/lib/src/features/schedule/presentation/screens/screens.dart @@ -0,0 +1,4 @@ +//GENERATED BARREL FILE +export 'home.dart'; +export 'schedule_details.dart'; + diff --git a/packages/conferenceapp/lib/src/features/speakers/application/.gitkeep b/packages/conferenceapp/lib/src/features/speakers/application/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/packages/conferenceapp/lib/src/features/speakers/presentation/presentation.dart b/packages/conferenceapp/lib/src/features/speakers/presentation/presentation.dart new file mode 100644 index 0000000..3280cc1 --- /dev/null +++ b/packages/conferenceapp/lib/src/features/speakers/presentation/presentation.dart @@ -0,0 +1,2 @@ +//GENERATED BARREL FILE +export './screens/screens.dart'; diff --git a/packages/conferenceapp/lib/src/features/speakers/presentation/screens/home.dart b/packages/conferenceapp/lib/src/features/speakers/presentation/screens/home.dart new file mode 100644 index 0000000..922718b --- /dev/null +++ b/packages/conferenceapp/lib/src/features/speakers/presentation/screens/home.dart @@ -0,0 +1,10 @@ +import 'package:flutter/material.dart'; + +class SpeakersHomeScreen extends StatelessWidget { + const SpeakersHomeScreen({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold(); + } +} diff --git a/packages/conferenceapp/lib/src/features/speakers/presentation/screens/screens.dart b/packages/conferenceapp/lib/src/features/speakers/presentation/screens/screens.dart new file mode 100644 index 0000000..2461205 --- /dev/null +++ b/packages/conferenceapp/lib/src/features/speakers/presentation/screens/screens.dart @@ -0,0 +1,3 @@ +//GENERATED BARREL FILE +export 'home.dart'; +export 'speaker_details.dart'; diff --git a/packages/conferenceapp/lib/src/features/speakers/presentation/screens/speaker_details.dart b/packages/conferenceapp/lib/src/features/speakers/presentation/screens/speaker_details.dart new file mode 100644 index 0000000..be6afff --- /dev/null +++ b/packages/conferenceapp/lib/src/features/speakers/presentation/screens/speaker_details.dart @@ -0,0 +1,10 @@ +import 'package:flutter/material.dart'; + +class SpeakerDetailsScreen extends StatelessWidget { + const SpeakerDetailsScreen({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold(); + } +} diff --git a/packages/conferenceapp/lib/src/routing/router.dart b/packages/conferenceapp/lib/src/routing/router.dart new file mode 100644 index 0000000..d59164c --- /dev/null +++ b/packages/conferenceapp/lib/src/routing/router.dart @@ -0,0 +1,78 @@ +import 'package:devfest24/src/features/dashboard/presentation/screens/dashboard.dart'; +import 'package:devfest24/src/features/more/presentation/presentation.dart'; +import 'package:devfest24/src/features/onboarding/presentation/presentation.dart'; +import 'package:devfest24/src/features/schedule/presentation/presentation.dart'; +import 'package:devfest24/src/features/speakers/presentation/presentation.dart'; + +import 'routes.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:go_router/go_router.dart'; + +class Devfest2024Router { + static final rootNavigatorKey = GlobalKey(); + + Devfest2024Router._(); + + static final Devfest2024Router instance = Devfest2024Router._(); + + void initialiseRouter(WidgetRef ref) { + router = _getRouter(ref); + } + + late GoRouter router; + + GoRouter _getRouter(WidgetRef ref) { + return GoRouter(initialLocation: '/onboarding', routes: [ + GoRoute( + path: '/${Devfest2024Routes.onboardingHome.path}', + name: Devfest2024Routes.onboardingHome.name, + builder: (context, state) => const OnboardingHomeScreen(), + routes: [ + GoRoute( + path: Devfest2024Routes.onboardingLogin.path, + name: Devfest2024Routes.onboardingLogin.name, + builder: (context, state) => const OnboardingLoginScreen(), + ), + GoRoute( + path: Devfest2024Routes.onboardingSignature.path, + name: Devfest2024Routes.onboardingSignature.name, + builder: (context, state) => const OnboardingSignatureScreen(), + ), + ], + ), + GoRoute( + path: '/', + name: Devfest2024Routes.dashboard.name, + builder: (context, state) => const DashboardScreen(), + routes: [ + GoRoute( + path: Devfest2024Routes.speakerDetails.path, + name: Devfest2024Routes.speakerDetails.name, + builder: (context, state) => const SpeakerDetailsScreen(), + ), + GoRoute( + path: Devfest2024Routes.scheduleDetails.path, + name: Devfest2024Routes.scheduleDetails.name, + builder: (context, state) => const ScheduleDetailsScreen(), + ), + GoRoute( + path: Devfest2024Routes.profile.path, + name: Devfest2024Routes.profile.name, + builder: (context, state) => const ProfileScreen(), + ), + GoRoute( + path: Devfest2024Routes.myQrCode.path, + name: Devfest2024Routes.myQrCode.name, + builder: (context, state) => const MyQrCodeScreen(), + ), + GoRoute( + path: Devfest2024Routes.venueMap.path, + name: Devfest2024Routes.venueMap.name, + builder: (context, state) => const VenueMapScreen(), + ), + ], + ), + ]); + } +} diff --git a/packages/conferenceapp/lib/src/routing/routes.dart b/packages/conferenceapp/lib/src/routing/routes.dart new file mode 100644 index 0000000..7a8cd6d --- /dev/null +++ b/packages/conferenceapp/lib/src/routing/routes.dart @@ -0,0 +1,15 @@ +enum Devfest2024Routes { + onboardingHome('onboarding'), + onboardingLogin('log-in'), + onboardingSignature('signature'), + dashboard(''), + speakerDetails('speaker-details'), + scheduleDetails('schedule-details'), + profile('profile'), + myQrCode('qr-code'), + venueMap('map'); + + const Devfest2024Routes(this.path); + + final String path; +} diff --git a/packages/conferenceapp/lib/src/routing/routing.dart b/packages/conferenceapp/lib/src/routing/routing.dart new file mode 100644 index 0000000..57031bf --- /dev/null +++ b/packages/conferenceapp/lib/src/routing/routing.dart @@ -0,0 +1,3 @@ +//GENERATED BARREL FILE +export 'router.dart'; +export 'routes.dart'; diff --git a/packages/conferenceapp/lib/src/shared/exceptions/base_exception.dart b/packages/conferenceapp/lib/src/shared/exceptions/base_exception.dart new file mode 100644 index 0000000..d520315 --- /dev/null +++ b/packages/conferenceapp/lib/src/shared/exceptions/base_exception.dart @@ -0,0 +1,3 @@ +base class Devfest2024Exception implements Exception { + const Devfest2024Exception(); +} diff --git a/packages/conferenceapp/lib/src/shared/exceptions/empty_exception.dart b/packages/conferenceapp/lib/src/shared/exceptions/empty_exception.dart new file mode 100644 index 0000000..1baa568 --- /dev/null +++ b/packages/conferenceapp/lib/src/shared/exceptions/empty_exception.dart @@ -0,0 +1,8 @@ +import 'package:devfest24/src/shared/exceptions/base_exception.dart'; + +final class EmptyException extends Devfest2024Exception { + const EmptyException(); + + @override + String toString() => ''; +} diff --git a/packages/conferenceapp/lib/src/shared/exceptions/exceptions.dart b/packages/conferenceapp/lib/src/shared/exceptions/exceptions.dart new file mode 100644 index 0000000..5a699f2 --- /dev/null +++ b/packages/conferenceapp/lib/src/shared/exceptions/exceptions.dart @@ -0,0 +1,4 @@ +//GENERATED BARREL FILE +export 'base_exception.dart'; +export 'empty_exception.dart'; + diff --git a/packages/conferenceapp/lib/src/shared/shared.dart b/packages/conferenceapp/lib/src/shared/shared.dart new file mode 100644 index 0000000..94e2573 --- /dev/null +++ b/packages/conferenceapp/lib/src/shared/shared.dart @@ -0,0 +1,3 @@ +export 'exceptions/exceptions.dart'; +export 'ui_model/ui_state_model.dart'; +export 'widgets/widgets.dart'; diff --git a/packages/conferenceapp/lib/src/shared/ui_model/ui_state_model.dart b/packages/conferenceapp/lib/src/shared/ui_model/ui_state_model.dart new file mode 100644 index 0000000..57a025c --- /dev/null +++ b/packages/conferenceapp/lib/src/shared/ui_model/ui_state_model.dart @@ -0,0 +1,104 @@ +import 'dart:async'; +import 'package:equatable/equatable.dart'; +import 'package:flutter/material.dart'; + +import '../exceptions/exceptions.dart'; + +part 'ui_state_model_mutex.dart'; + +final _$vmWriteMutex = UiStateMutex(); + +typedef Devfest2024UiModelRef = List; + +enum UiState { + idle, + loading, + success, + error; + + bool get isLoading => this == UiState.loading; + + bool get isError => this == UiState.error; + + bool get isSuccess => this == UiState.success; + + bool get isIdle => this == UiState.idle; +} + +@immutable +abstract base class Devfest2024UiState extends Equatable { + const Devfest2024UiState({ + this.error = const EmptyException(), + this.uiState = UiState.idle, + }); + + final UiState uiState; + + final Devfest2024Exception error; + + @override + bool? get stringify => true; +} + +Future launch( + Devfest2024UiStateRef model, + FutureOr Function(Devfest2024UiStateRef model) function, { + bool displayError = true, + bool Function(E state) canDisplayError = _kDisplayError, +}) async { + final result = await _$vmWriteMutex.protect(() async { + await function(model); + return model._state; + }); + + if (!displayError || !canDisplayError(result)) return; + result.displayError(); +} + +bool _kDisplayError([_]) => true; + +extension ViewModelX on T { + Devfest2024UiStateRef get ref => Devfest2024UiStateRef(this); + + void displayError() async { + if (uiState != UiState.error) return; + assert(error is! EmptyException, 'Please pass appropriate exception'); + + // final context = Devfest2024Router.rootNavigatorKey.currentContext!; + // + // final snackbar = SnackBar( + // content: Text(error.toString()), + // backgroundColor: Theme.of(context).colorScheme.error, + // behavior: SnackBarBehavior.floating, + // ); + // ScaffoldMessenger.of(context).showSnackBar(snackbar); + } +} + +extension Devfest2024UiModelRefX + on Devfest2024UiStateRef { + Devfest2024UiStateRef _assign(T value) => this.._state = value; + + T emit(T value) => _assign(value)._state; +} + +class Devfest2024UiStateRef { + T _state; + + Devfest2024UiStateRef(this._state); + + T emit(T value) { + _state = value; + return _state; + } + + @override + int get hashCode => _state.hashCode; + + @override + bool operator ==(Object other) { + if (other is! Devfest2024UiStateRef) return false; + + return _state == other._state; + } +} diff --git a/packages/conferenceapp/lib/src/shared/ui_model/ui_state_model_mutex.dart b/packages/conferenceapp/lib/src/shared/ui_model/ui_state_model_mutex.dart new file mode 100644 index 0000000..da07df8 --- /dev/null +++ b/packages/conferenceapp/lib/src/shared/ui_model/ui_state_model_mutex.dart @@ -0,0 +1,81 @@ +part of 'ui_state_model.dart'; + +class _MutexRequest { + final Completer completer = Completer(); +} + +class _Atom { + int _semaphore = 1; + final _waiting = <_MutexRequest>[]; + + bool get isLocked => _semaphore <= 0; +} + +@visibleForTesting +class UiStateMutex { + final _atoms = {}; + + bool get atomsCleared => _atoms.isEmpty; + + _Atom _atom(String id) { + if (_atoms[id] == null) throw StateError('failed to create atom'); + + return _atoms[id]!; + } + + Future protect(Future Function() criticalSection) async { + return await _protectWriteForId(criticalSection, R.toString()); + } + + Future _protectWriteForId( + Future Function() criticalSection, String id) async { + _atoms.putIfAbsent(id, () => _Atom()); + await _waitWithId(id); + try { + return await criticalSection(); + } finally { + _signalWithId(id); + } + } + + Future _waitWithId(String id) async { + final job = _MutexRequest(); + // if atom is locked + if (!_jobAcquiredWithId(job, id)) { + _atom(id)._waiting.add(job); + } + + return job.completer.future; + } + + void _signalWithId(String id) { + _atom(id)._semaphore++; // unlock + + while (_atom(id)._waiting.isNotEmpty) { + final nextJob = _atom(id)._waiting.first; + // if the next job completes + if (_jobAcquiredWithId(nextJob, id)) { + _atom(id)._waiting.removeAt(0); // remove the entry + } else { + break; + } + } + + // dispose atom from memory after finishing + if (_atom(id)._waiting.isEmpty && !_atom(id).isLocked) { + _atoms.removeWhere((atomId, atom) => atomId == id); + } + } + + bool _jobAcquiredWithId(_MutexRequest job, String id) { + assert(0 <= _atom(id)._semaphore); + + // atom is unlocked + if (!_atom(id).isLocked) { + _atom(id)._semaphore--; // lock mutex + job.completer.complete(); + return true; + } + return false; + } +} diff --git a/packages/conferenceapp/lib/src/shared/widgets/header.dart b/packages/conferenceapp/lib/src/shared/widgets/header.dart new file mode 100644 index 0000000..1b31edd --- /dev/null +++ b/packages/conferenceapp/lib/src/shared/widgets/header.dart @@ -0,0 +1,46 @@ +import 'package:cave/cave.dart'; +import 'package:cave/constants.dart'; +import 'package:flutter/material.dart'; + +class HeaderText extends StatelessWidget { + const HeaderText({ + super.key, + this.title, + this.subtitle, + this.titleStyle, + this.subtitleStyle, + }); + + final Widget? title; + final Widget? subtitle; + final TextStyle? titleStyle; + final TextStyle? subtitleStyle; + + @override + Widget build(BuildContext context) { + return Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + if (title != null) ...[ + AnimatedDefaultTextStyle( + style: DevfestTheme.of(context).textTheme!.headerH6!.semi, + duration: Constants.kAnimationDur, + child: title!, + ), + SizedBox(height: Constants.smallVerticalGutter.h), + ], + if (subtitle != null) + AnimatedDefaultTextStyle( + style: DevfestTheme.of(context) + .textTheme! + .bodyBody1Medium! + .medium + .copyWith(color: DevfestColors.grey40), + duration: Constants.kAnimationDur, + child: subtitle!, + ), + ], + ); + } +} diff --git a/packages/conferenceapp/lib/src/shared/widgets/widgets.dart b/packages/conferenceapp/lib/src/shared/widgets/widgets.dart new file mode 100644 index 0000000..3a6eb89 --- /dev/null +++ b/packages/conferenceapp/lib/src/shared/widgets/widgets.dart @@ -0,0 +1,2 @@ +//GENERATED BARREL FILE +export 'header.dart'; diff --git a/packages/conferenceapp/pubspec.lock b/packages/conferenceapp/pubspec.lock index f28e73e..ff690a4 100644 --- a/packages/conferenceapp/pubspec.lock +++ b/packages/conferenceapp/pubspec.lock @@ -1,6 +1,14 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + accessibility_tools: + dependency: "direct main" + description: + name: accessibility_tools + sha256: "4627f89350b9997c68279b72b6cb3f262c83468a857956c6f8439215a727ab63" + url: "https://pub.dev" + source: hosted + version: "2.2.1" async: dependency: transitive description: @@ -64,6 +72,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.8" + equatable: + dependency: "direct main" + description: + name: equatable + sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2 + url: "https://pub.dev" + source: hosted + version: "2.0.5" fake_async: dependency: transitive description: @@ -89,10 +105,18 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1" + sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c" url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "4.0.0" + flutter_riverpod: + dependency: "direct main" + description: + name: flutter_riverpod + sha256: "0f1974eff5bbe774bf1d870e406fc6f29e3d6f1c46bd9c58e7172ff68a785d7d" + url: "https://pub.dev" + source: hosted + version: "2.5.1" flutter_screenutil: dependency: transitive description: @@ -106,6 +130,19 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + go_router: + dependency: "direct main" + description: + name: go_router + sha256: "2ddb88e9ad56ae15ee144ed10e33886777eb5ca2509a914850a5faa7b52ff459" + url: "https://pub.dev" + source: hosted + version: "14.2.7" leak_tracker: dependency: transitive description: @@ -134,10 +171,18 @@ packages: dependency: transitive description: name: lints - sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 + sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235" + url: "https://pub.dev" + source: hosted + version: "4.0.0" + logging: + dependency: transitive + description: + name: logging + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "1.2.0" matcher: dependency: transitive description: @@ -170,6 +215,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.0" + riverpod: + dependency: transitive + description: + name: riverpod + sha256: f21b32ffd26a36555e501b04f4a5dca43ed59e16343f1a30c13632b2351dfa4d + url: "https://pub.dev" + source: hosted + version: "2.5.1" sky_engine: dependency: transitive description: flutter @@ -191,6 +244,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.11.1" + state_notifier: + dependency: transitive + description: + name: state_notifier + sha256: b8677376aa54f2d7c58280d5a007f9e8774f1968d1fb1c096adcb4792fba29bb + url: "https://pub.dev" + source: hosted + version: "1.0.0" stream_channel: dependency: transitive description: @@ -241,4 +302,4 @@ packages: version: "14.2.5" sdks: dart: ">=3.4.4 <4.0.0" - flutter: ">=3.18.0-18.0.pre.54" + flutter: ">=3.19.0" diff --git a/packages/conferenceapp/pubspec.yaml b/packages/conferenceapp/pubspec.yaml index da7b4cd..67087bf 100644 --- a/packages/conferenceapp/pubspec.yaml +++ b/packages/conferenceapp/pubspec.yaml @@ -10,13 +10,19 @@ environment: sdk: '>=3.4.4 <4.0.0' dependencies: - cupertino_icons: ^1.0.6 + cupertino_icons: ^1.0.8 flutter: sdk: flutter cave: path: ../cave + + equatable: ^2.0.5 + go_router: ^14.2.7 + flutter_riverpod: ^2.5.1 + accessibility_tools: ^2.2.1 + dev_dependencies: - flutter_lints: ^3.0.0 + flutter_lints: ^4.0.0 flutter_test: sdk: flutter diff --git a/packages/conferenceapp/test/widget_test.dart b/packages/conferenceapp/test/widget_test.dart index 1554492..bfd719b 100644 --- a/packages/conferenceapp/test/widget_test.dart +++ b/packages/conferenceapp/test/widget_test.dart @@ -5,15 +5,14 @@ // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the values of widget properties are correct. +import 'package:devfest24/conference_app.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:devfest24/main.dart'; - void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame. - await tester.pumpWidget(const MyApp()); + await tester.pumpWidget(const ConferenceApp()); // Verify that our counter starts at 0. expect(find.text('0'), findsOneWidget); From 5625c5f766fa3211d328aa469e8ecf00571ce9fb Mon Sep 17 00:00:00 2001 From: Sebastine Odeh Date: Wed, 4 Sep 2024 23:56:39 +0100 Subject: [PATCH 2/2] merge conflicts --- packages/catalog/lib/usecases/text_field.dart | 2 +- packages/cave/lib/widgets/text_field.dart | 7 +++--- packages/cave/pubspec.yaml | 4 ++-- packages/conferenceapp/pubspec.lock | 22 +++++++++---------- pubspec.lock | 12 +++++----- 5 files changed, 23 insertions(+), 24 deletions(-) diff --git a/packages/catalog/lib/usecases/text_field.dart b/packages/catalog/lib/usecases/text_field.dart index 244fe24..b86bcfd 100644 --- a/packages/catalog/lib/usecases/text_field.dart +++ b/packages/catalog/lib/usecases/text_field.dart @@ -9,7 +9,7 @@ import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; Widget devfestTextField(BuildContext context) { return StatefulBuilder(builder: (context, setState) { return Scaffold( - backgroundColor: DevFestTheme.of(context).backgroundColor, + backgroundColor: DevfestTheme.of(context).backgroundColor, body: Center( child: Padding( padding: const EdgeInsets.symmetric(horizontal: 16.0), diff --git a/packages/cave/lib/widgets/text_field.dart b/packages/cave/lib/widgets/text_field.dart index 7e9267b..368cd41 100644 --- a/packages/cave/lib/widgets/text_field.dart +++ b/packages/cave/lib/widgets/text_field.dart @@ -2,9 +2,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import '../constants.dart'; -import '../themes/colors.dart'; import '../themes/text_field_theme.dart'; -import '../themes/theme_data.dart'; +import '../themes/themes.dart'; class DevfestTextFormField extends StatelessWidget { const DevfestTextFormField({ @@ -34,7 +33,7 @@ class DevfestTextFormField extends StatelessWidget { @override Widget build(BuildContext context) { - final textFieldTheme = DevFestTheme.of(context).textFieldTheme ?? + final textFieldTheme = DevfestTheme.of(context).textFieldTheme ?? DevfestTextFieldTheme.light(); return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -42,7 +41,7 @@ class DevfestTextFormField extends StatelessWidget { if (title != null) ...[ Text( title!, - style: DevFestTheme.of(context).textTheme?.bodyBody3Medium, + style: DevfestTheme.of(context).textTheme?.bodyBody3Medium, ), Constants.smallVerticalGutter.verticalSpace, ], diff --git a/packages/cave/pubspec.yaml b/packages/cave/pubspec.yaml index aff6aed..0159000 100644 --- a/packages/cave/pubspec.yaml +++ b/packages/cave/pubspec.yaml @@ -1,7 +1,7 @@ name: cave description: "A new Flutter package project." version: 0.0.1 -homepage: +homepage: none environment: sdk: '>=3.4.4 <4.0.0' @@ -15,7 +15,7 @@ dependencies: flutter_screenutil: ^5.9.3 dev_dependencies: - flutter_lints: ^3.0.0 + flutter_lints: ^4.0.0 flutter_test: sdk: flutter diff --git a/packages/conferenceapp/pubspec.lock b/packages/conferenceapp/pubspec.lock index ff690a4..1c21d2b 100644 --- a/packages/conferenceapp/pubspec.lock +++ b/packages/conferenceapp/pubspec.lock @@ -52,10 +52,10 @@ packages: dependency: transitive description: name: collection - sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.19.0" + version: "1.18.0" control_style: dependency: transitive description: @@ -147,18 +147,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" url: "https://pub.dev" source: hosted - version: "10.0.7" + version: "10.0.5" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" url: "https://pub.dev" source: hosted - version: "3.0.8" + version: "3.0.5" leak_tracker_testing: dependency: transitive description: @@ -227,7 +227,7 @@ packages: dependency: transitive description: flutter source: sdk - version: "0.0.0" + version: "0.0.99" source_span: dependency: transitive description: @@ -264,10 +264,10 @@ packages: dependency: transitive description: name: string_scanner - sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.2.0" term_glyph: dependency: transitive description: @@ -280,10 +280,10 @@ packages: dependency: transitive description: name: test_api - sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.7.3" + version: "0.7.2" vector_math: dependency: transitive description: diff --git a/pubspec.lock b/pubspec.lock index d62a811..482987c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -69,10 +69,10 @@ packages: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.19.0" conventional_commit: dependency: transitive description: @@ -117,10 +117,10 @@ packages: dependency: transitive description: name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + sha256: "40f592dd352890c3b60fec1b68e786cefb9603e05ff303dbc4dda49b304ecdf4" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.1.0" intl: dependency: transitive description: @@ -245,10 +245,10 @@ packages: dependency: transitive description: name: quiver - sha256: b1c1ac5ce6688d77f65f3375a9abb9319b3cb32486bdc7a1e0fdf004d7ba4e47 + sha256: ea0b925899e64ecdfbf9c7becb60d5b50e706ade44a85b2363be2a22d88117d2 url: "https://pub.dev" source: hosted - version: "3.2.1" + version: "3.2.2" source_span: dependency: transitive description: