forked from eatvio/eatvio_app
Merge remote-tracking branch 'upstream/main'
This commit is contained in:
@@ -68,16 +68,8 @@ class AppRouter {
|
||||
name: 'authScreen',
|
||||
builder: (context, state) => const AuthScreen(),
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: 'webView-registration-screen',
|
||||
name: 'webViewRegistrationScreen',
|
||||
builder: (context, state) => const WebViewRegistrationScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: 'registration-screen',
|
||||
name: 'registrationScreen',
|
||||
builder: (context, state) => const RegistrationScreen(),
|
||||
),
|
||||
GoRoute(path: 'webView-registration-screen', name: 'webViewRegistrationScreen', builder: (context, state) => const WebViewRegistrationScreen()),
|
||||
GoRoute(path: 'registration-screen', name: 'registrationScreen', builder: (context, state) => const RegistrationScreen()),
|
||||
],
|
||||
),
|
||||
ShellRoute(
|
||||
@@ -85,10 +77,7 @@ class AppRouter {
|
||||
return BlocBuilder<ProfileAvatarCubit, ProfileAvatarState>(
|
||||
builder: (BuildContext context, ProfileAvatarState state) {
|
||||
if (state is ProfileAvatarStateLoaded) {
|
||||
return BottomNavigationBarWidget(
|
||||
child: child,
|
||||
profileModel: state.profile,
|
||||
);
|
||||
return BottomNavigationBarWidget(child: child, profileModel: state.profile);
|
||||
}
|
||||
return SizedBox.shrink();
|
||||
},
|
||||
@@ -106,44 +95,25 @@ class AppRouter {
|
||||
return NoTransitionPage(child: ProfileScreen());
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
path: '/feed-screen',
|
||||
name: 'feedScreen',
|
||||
pageBuilder: (context, state) => NoTransitionPage(child: FeedScreen()),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/diary-screen',
|
||||
name: 'diaryScreen',
|
||||
pageBuilder: (context, state) => NoTransitionPage(child: DiaryScreen()),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/consultations-screen',
|
||||
name: 'consultationsScreen',
|
||||
pageBuilder: (context, state) => NoTransitionPage(child: ConsultationsScreen()),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/chat-select-screen',
|
||||
name: 'chatSelectScreen',
|
||||
pageBuilder: (context, state) => NoTransitionPage(child: ChatsScreen()),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/notifications-screen',
|
||||
name: 'notificationsScreen',
|
||||
pageBuilder: (context, state) => NoTransitionPage(child: NotificationsScreen()),
|
||||
),
|
||||
GoRoute(path: '/feed-screen', name: 'feedScreen', pageBuilder: (context, state) => NoTransitionPage(child: FeedScreen())),
|
||||
GoRoute(path: '/diary-screen', name: 'diaryScreen', pageBuilder: (context, state) => NoTransitionPage(child: DiaryScreen())),
|
||||
GoRoute(path: '/consultations-screen', name: 'consultationsScreen', pageBuilder: (context, state) => NoTransitionPage(child: ConsultationsScreen())),
|
||||
GoRoute(path: '/chat-select-screen', name: 'chatSelectScreen', pageBuilder: (context, state) => NoTransitionPage(child: ChatsScreen())),
|
||||
GoRoute(path: '/notifications-screen', name: 'notificationsScreen', pageBuilder: (context, state) => NoTransitionPage(child: NotificationsScreen())),
|
||||
GoRoute(
|
||||
path: '/menu-screen',
|
||||
name: 'menuScreen',
|
||||
pageBuilder: (context, state) => NoTransitionPage(
|
||||
child: BlocBuilder<ProfileAvatarCubit, ProfileAvatarState>(
|
||||
builder: (BuildContext context, ProfileAvatarState state) {
|
||||
if (state is ProfileAvatarStateLoaded) {
|
||||
return MenuScreen(profileModel: state.profile);
|
||||
}
|
||||
return SizedBox.shrink();
|
||||
},
|
||||
),
|
||||
),
|
||||
pageBuilder:
|
||||
(context, state) => NoTransitionPage(
|
||||
child: BlocBuilder<ProfileAvatarCubit, ProfileAvatarState>(
|
||||
builder: (BuildContext context, ProfileAvatarState state) {
|
||||
if (state is ProfileAvatarStateLoaded) {
|
||||
return MenuScreen(profileModel: state.profile);
|
||||
}
|
||||
return SizedBox.shrink();
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -167,85 +137,46 @@ class AppRouter {
|
||||
name: 'aboutPlanScreen',
|
||||
builder: (context, state) {
|
||||
final data = state.extra as Map<String, dynamic>;
|
||||
return AboutPlanScreen(
|
||||
plan: data['plan'] as PlanModel,
|
||||
index: data['index'] as int?,
|
||||
navigateToComments: data['navigateToComments'] as bool,
|
||||
);
|
||||
return AboutPlanScreen(plan: data['plan'] as PlanModel, index: data['index'] as int?, navigateToComments: data['navigateToComments'] as bool);
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
path: '/glossary-screen',
|
||||
name: 'glossaryScreen',
|
||||
builder: (context, state) => GlossaryScreen(),
|
||||
),
|
||||
GoRoute(path: '/glossary-screen', name: 'glossaryScreen', builder: (context, state) => GlossaryScreen()),
|
||||
GoRoute(
|
||||
path: '/about-recipes-screen',
|
||||
name: 'aboutRecipesScreen',
|
||||
builder: (context, state) {
|
||||
final data = state.extra as Map<String, dynamic>;
|
||||
return AboutRecipeScreen(
|
||||
recipe: data['recipe'] as Recipe,
|
||||
index: data['index'] as int?,
|
||||
navigateToComments: data['navigateToComments'] as bool,
|
||||
);
|
||||
return AboutRecipeScreen(recipe: data['recipe'] as Recipe, index: data['index'] as int?, navigateToComments: data['navigateToComments'] as bool);
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
path: RecipeCreateScreen.path,
|
||||
name: RecipeCreateScreen.name,
|
||||
builder: (context, state) => RecipeCreateScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/profile-screen',
|
||||
name: 'profileScreen',
|
||||
builder: (context, state) => ProfileScreen(
|
||||
author: state.extra as Author,
|
||||
),
|
||||
),
|
||||
GoRoute(path: RecipeCreateScreen.path, name: RecipeCreateScreen.name, builder: (context, state) => RecipeCreateScreen()),
|
||||
GoRoute(path: '/profile-screen', name: 'profileScreen', builder: (context, state) => ProfileScreen(author: state.extra as Author)),
|
||||
GoRoute(
|
||||
path: '/subs-screen/:slug',
|
||||
name: 'subsScreen',
|
||||
builder: (context, state) => SubsScreen(
|
||||
slug: state.pathParameters['slug']!,
|
||||
subType: state.extra as SubType,
|
||||
),
|
||||
builder: (context, state) => SubsScreen(slug: state.pathParameters['slug']!, subType: state.extra as SubType),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/about-diet-screen',
|
||||
name: 'aboutDietScreen',
|
||||
builder: (context, state) {
|
||||
final data = state.extra as Map<String, dynamic>;
|
||||
return AboutDietScreen(
|
||||
diet: data['diet'] as Diet,
|
||||
index: data['index'] as int?,
|
||||
navigateToComments: data['navigateToComments'] as bool,
|
||||
);
|
||||
return AboutDietScreen(diet: data['diet'] as Diet, index: data['index'] as int?, navigateToComments: data['navigateToComments'] as bool);
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
path: '/blog-post-create-screen',
|
||||
name: 'blogPostCreateScreen',
|
||||
builder: (context, state) => BlogPostCreateScreen(
|
||||
feedBlogPostModel: state.extra != null ? state.extra as FeedBlogPostModel : null,
|
||||
),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/blog-post-screen',
|
||||
name: 'blogPostScreen',
|
||||
builder: (context, state) => BlogPostScreen(
|
||||
blogPost: state.extra as FeedBlogPostModel,
|
||||
),
|
||||
builder: (context, state) => BlogPostCreateScreen(feedBlogPostModel: state.extra != null ? state.extra as FeedBlogPostModel : null),
|
||||
),
|
||||
GoRoute(path: '/blog-post-screen', name: 'blogPostScreen', builder: (context, state) => BlogPostScreen(blogPost: state.extra as FeedBlogPostModel)),
|
||||
GoRoute(
|
||||
path: '/chat-screen',
|
||||
name: 'chatScreen',
|
||||
builder: (context, state) {
|
||||
final data = state.extra as Map<String, dynamic>;
|
||||
final data = state.extra as Map<String, dynamic>;
|
||||
final chatId = data['chatId'] as String;
|
||||
return ChatScreen(
|
||||
chatId: chatId,
|
||||
);
|
||||
return ChatScreen(chatId: chatId);
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
@@ -256,81 +187,44 @@ class AppRouter {
|
||||
GoRoute(
|
||||
path: 'general-info-screen',
|
||||
name: 'generalInfoScreen',
|
||||
builder: (context, state) => GeneralInfoScreen(
|
||||
settingsEntity: state.extra as SettingsEntity,
|
||||
),
|
||||
builder: (context, state) => GeneralInfoScreen(settingsEntity: state.extra as SettingsEntity),
|
||||
),
|
||||
GoRoute(
|
||||
path: 'other-info-screen',
|
||||
name: 'otherInfoScreen',
|
||||
builder: (context, state) => OtherInfoScreen(
|
||||
settingsEntity: state.extra as SettingsEntity,
|
||||
),
|
||||
builder: (context, state) => OtherInfoScreen(settingsEntity: state.extra as SettingsEntity),
|
||||
),
|
||||
GoRoute(
|
||||
path: 'physical-activity-screen',
|
||||
name: 'physicalActivityScreen',
|
||||
builder: (context, state) => PhysicalActivityScreen(
|
||||
settingsEntity: state.extra as SettingsEntity,
|
||||
),
|
||||
builder: (context, state) => PhysicalActivityScreen(settingsEntity: state.extra as SettingsEntity),
|
||||
),
|
||||
GoRoute(
|
||||
path: 'physical-form-screen',
|
||||
name: 'physicalFormScreen',
|
||||
builder: (context, state) => PhysicalFormScreen(
|
||||
settingsEntity: state.extra as SettingsEntity,
|
||||
),
|
||||
),
|
||||
GoRoute(
|
||||
path: 'pressure-screen',
|
||||
name: 'pressureScreen',
|
||||
builder: (context, state) => PressureScreen(
|
||||
settingsEntity: state.extra as SettingsEntity,
|
||||
),
|
||||
builder: (context, state) => PhysicalFormScreen(settingsEntity: state.extra as SettingsEntity),
|
||||
),
|
||||
GoRoute(path: 'pressure-screen', name: 'pressureScreen', builder: (context, state) => PressureScreen(settingsEntity: state.extra as SettingsEntity)),
|
||||
GoRoute(
|
||||
path: 'change-password-screen',
|
||||
name: 'changePasswordScreen',
|
||||
builder: (context, state) => ChangePasswordScreen(
|
||||
settingsEntity: state.extra as SettingsEntity,
|
||||
),
|
||||
builder: (context, state) => ChangePasswordScreen(settingsEntity: state.extra as SettingsEntity),
|
||||
),
|
||||
GoRoute(
|
||||
path: 'change-email-screen',
|
||||
name: 'changeEmailScreen',
|
||||
builder: (context, state) => ChangeEmailScreen(
|
||||
settingsEntity: state.extra as SettingsEntity,
|
||||
),
|
||||
builder: (context, state) => ChangeEmailScreen(settingsEntity: state.extra as SettingsEntity),
|
||||
),
|
||||
],
|
||||
),
|
||||
GoRoute(
|
||||
path: '/become-consultant-screen',
|
||||
name: 'becomeConsultantScreen',
|
||||
builder: (context, state) => BecomeConsultantScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/stepper-become-consultant-screen',
|
||||
name: 'stepperBecomeConsultantScreen',
|
||||
builder: (context, state) => StepperBecomeConsultantScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/calendar-screen',
|
||||
name: 'calendarScreen',
|
||||
builder: (context, state) => CalendarScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/support-screen',
|
||||
name: 'supportScreen',
|
||||
builder: (context, state) => SupportScreen(),
|
||||
),
|
||||
GoRoute(path: '/become-consultant-screen', name: 'becomeConsultantScreen', builder: (context, state) => BecomeConsultantScreen()),
|
||||
GoRoute(path: '/stepper-become-consultant-screen', name: 'stepperBecomeConsultantScreen', builder: (context, state) => StepperBecomeConsultantScreen()),
|
||||
GoRoute(path: '/calendar-screen', name: 'calendarScreen', builder: (context, state) => CalendarScreen()),
|
||||
GoRoute(path: '/support-screen', name: 'supportScreen', builder: (context, state) => SupportScreen()),
|
||||
GoRoute(
|
||||
path: '/photo-view-screen/:index',
|
||||
name: 'photoViewScreen',
|
||||
builder: (context, state) => PhotoViewScreen(
|
||||
imageUrls: state.extra as List<String>,
|
||||
index: int.parse(state.pathParameters['index']!),
|
||||
),
|
||||
builder: (context, state) => PhotoViewScreen(imageUrls: state.extra as List<String>, index: int.parse(state.pathParameters['index']!)),
|
||||
),
|
||||
GoRoute(
|
||||
path: CreateDietScreen.path,
|
||||
@@ -345,48 +239,16 @@ class AppRouter {
|
||||
name: DietPreviewScreen.name,
|
||||
builder: (context, state) {
|
||||
final data = state.extra as Diet;
|
||||
return DietPreviewScreen(
|
||||
diet: data,
|
||||
);
|
||||
return DietPreviewScreen(diet: data);
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
path: CreatePlanScreen.path,
|
||||
name: CreatePlanScreen.name,
|
||||
builder: (context, state) => CreatePlanScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: MyDietsScreen.path,
|
||||
name: MyDietsScreen.name,
|
||||
builder: (context, state) => MyDietsScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: MyPlansScreen.path,
|
||||
name: MyPlansScreen.name,
|
||||
builder: (context, state) => MyPlansScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: UserDetailsScreen.path,
|
||||
name: UserDetailsScreen.name,
|
||||
builder: (context, state) => UserDetailsScreen(
|
||||
slug: state.extra as String,
|
||||
),
|
||||
),
|
||||
GoRoute(
|
||||
path: DevToolsScreen.path,
|
||||
name: DevToolsScreen.name,
|
||||
builder: (context, state) => DevToolsScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: ConsultantRatingScreen.path,
|
||||
name: ConsultantRatingScreen.name,
|
||||
builder: (context, state) => ConsultantRatingScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: InfoByOrderScreen.path,
|
||||
name: InfoByOrderScreen.name,
|
||||
builder: (context, state) => InfoByOrderScreen(),
|
||||
),
|
||||
GoRoute(path: CreatePlanScreen.path, name: CreatePlanScreen.name, builder: (context, state) => CreatePlanScreen()),
|
||||
GoRoute(path: MyDietsScreen.path, name: MyDietsScreen.name, builder: (context, state) => MyDietsScreen()),
|
||||
GoRoute(path: MyPlansScreen.path, name: MyPlansScreen.name, builder: (context, state) => MyPlansScreen()),
|
||||
GoRoute(path: UserDetailsScreen.path, name: UserDetailsScreen.name, builder: (context, state) => UserDetailsScreen(slug: state.extra as String)),
|
||||
GoRoute(path: DevToolsScreen.path, name: DevToolsScreen.name, builder: (context, state) => DevToolsScreen()),
|
||||
GoRoute(path: ConsultantRatingScreen.path, name: ConsultantRatingScreen.name, builder: (context, state) => ConsultantRatingScreen()),
|
||||
GoRoute(path: InfoByOrderScreen.path, name: InfoByOrderScreen.name, builder: (context, state) => InfoByOrderScreen()),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user