-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.dart
46 lines (43 loc) · 1.65 KB
/
main.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import 'package:device_preview/device_preview.dart';
import 'package:yumyumnavigator/src/core/animations/page_transition.dart';
import 'package:yumyumnavigator/src/core/theme/app_theme.dart';
import 'package:yumyumnavigator/src/onboarding/onboarding_screen.dart';
import 'package:yumyumnavigator/src/recipes/domain/recipe.dart';
import 'package:yumyumnavigator/src/recipes/presentation/screens/home_screen.dart';
import 'package:yumyumnavigator/src/recipes/presentation/screens/recipe_details_screen.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
void main() {
runApp(const ProviderScope(child: yumyumNavigator()));
// runApp(DevicePreview(
// enabled: true,
// builder: (context) {
// return const ProviderScope(child: DribbleChallenge());
// }));
}
class yumyumNavigator extends StatelessWidget {
const yumyumNavigator({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
locale: DevicePreview.locale(context),
home: const OnBoardingScreen(),
onGenerateRoute: (settings) {
return switch (settings.name) {
'home' => NoAnimationTransition(
builder: (context) => const HomeScreen(),
),
'recipe_details' => NoAnimationTransition(
builder: (context) =>
RecipeDetailsScreen(recipe: settings.arguments as Recipe),
),
_ => NoAnimationTransition(builder: (context) => const HomeScreen())
};
},
theme: mainTheme,
darkTheme: mainTheme,
themeMode: ThemeMode.dark,
debugShowCheckedModeBanner: false,
);
}
}