fixed profile, recipeis and diets

This commit is contained in:
Username1548
2025-02-10 21:50:13 +07:00
parent 5ea3264474
commit 070d7e1047
51 changed files with 1382 additions and 1360 deletions

View File

@@ -54,11 +54,10 @@ class AppRouter {
initialLocation: '/auth-screen',
navigatorKey: navigatorKey,
routes: [
GoRoute(
GoRoute(
path: '/auth-screen',
name: 'authScreen',
redirect: (context, state) async {
// TokenStorage.removeTokenInStorage();
if (await TokenStorage.haveTokenInStorage()) {
return '/my-profile-screen';
}
@@ -276,7 +275,10 @@ class AppRouter {
GoRoute(
path: CreateDietScreen.path,
name: CreateDietScreen.name,
builder: (context, state) => CreateDietScreen(),
builder: (context, state) {
final diet = state.extra as Diet?;
return CreateDietScreen(diet: diet);
},
),
GoRoute(
path: DietPreviewScreen.path,

View File

@@ -4,42 +4,44 @@ import 'package:eatvio_app/core/theme/theme_helper.dart';
import 'package:flutter/material.dart';
Future<void> showBottomSheetWithBlur({
required BuildContext context,
required Widget child,
double height = 200,
bool hasBlur = true,
bool enableDrag = true,
}) {
return showModalBottomSheet(
context: context,
isScrollControlled: true,
barrierColor: appTheme.transparentBlack,
backgroundColor: Colors.transparent,
elevation: 0,
useSafeArea: true,
enableDrag: enableDrag,
builder: (context) => GestureDetector(
behavior: HitTestBehavior.opaque,
child: BackdropFilter(
filter: ImageFilter.blur(
sigmaX: hasBlur ? 24 : 0,
sigmaY: hasBlur ? 24 : 0,
tileMode: TileMode.mirror,
),
child: SizedBox(
child: Container(
height: height,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20),
topRight: Radius.circular(20),
),
color: appTheme.whiteA700,
required BuildContext context,
required Widget child,
double height = 200,
bool hasBlur = true,
bool enableDrag = true,
bool userRootNavigator = false,
}) {
return showModalBottomSheet(
context: context,
isScrollControlled: true,
barrierColor: appTheme.transparentBlack,
backgroundColor: Colors.transparent,
useRootNavigator: userRootNavigator,
elevation: 0,
useSafeArea: true,
enableDrag: enableDrag,
builder: (context) => GestureDetector(
behavior: HitTestBehavior.opaque,
child: BackdropFilter(
filter: ImageFilter.blur(
sigmaX: hasBlur ? 24 : 0,
sigmaY: hasBlur ? 24 : 0,
tileMode: TileMode.mirror,
),
child: SizedBox(
child: Container(
height: height,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20),
topRight: Radius.circular(20),
),
child: child,
color: appTheme.whiteA700,
),
child: child,
),
),
),
);
}
),
);
}