@@ -35,37 +35,40 @@ class MyApp extends StatelessWidget {
35
35
// behavior for a page.
36
36
onGenerateRoute: (RouteSettings settings) {
37
37
// A custom `fadeThrough` route transition animation.
38
- return Routes .fadeThrough (settings, (context) {
39
- // Wrap widgets with another widget based on the route.
40
- // Wrap the page with the ResponsiveScaledBox for desired pages.
41
- return ConditionalRouteWidget (
42
- routesExcluded: const [
43
- TypographyPage .name
44
- ], // Excluding a page from AutoScale.
45
- builder: (context, child) => MaxWidthBox (
46
- // A widget that limits the maximum width.
47
- // This is used to create a gutter area on either side of the content.
48
- maxWidth: 1200 ,
49
- background: Container (color: const Color (0xFFF5F5F5 )),
50
- child: ResponsiveScaledBox (
51
- // ResponsiveScaledBox renders its child with a FittedBox set to the `width` value.
52
- // Set the fixed width value based on the active breakpoint.
53
- width: ResponsiveValue <double >(context,
54
- conditionalValues: [
55
- const Condition .equals (name: MOBILE , value: 450 ),
56
- const Condition .between (
57
- start: 800 , end: 1100 , value: 800 ),
58
- const Condition .between (
59
- start: 1000 , end: 1200 , value: 1000 ),
60
- // There are no conditions for width over 1200
61
- // because the `maxWidth` is set to 1200 via the MaxWidthBox.
62
- ]).value,
63
- child: child! ),
64
- ),
65
- child: BouncingScrollWrapper .builder (
66
- context, buildPage (settings.name ?? '' ),
67
- dragWithMouse: true ));
68
- });
38
+ return Routes .fadeThrough (
39
+ settings: settings,
40
+ builder: (context) {
41
+ // Wrap widgets with another widget based on the route.
42
+ // Wrap the page with the ResponsiveScaledBox for desired pages.
43
+ return ConditionalRouteWidget (
44
+ routesExcluded: const [
45
+ TypographyPage .name
46
+ ], // Excluding a page from AutoScale.
47
+ builder: (context, child) => MaxWidthBox (
48
+ // A widget that limits the maximum width.
49
+ // This is used to create a gutter area on either side of the content.
50
+ maxWidth: 1200 ,
51
+ background: Container (color: const Color (0xFFF5F5F5 )),
52
+ child: ResponsiveScaledBox (
53
+ // ResponsiveScaledBox renders its child with a FittedBox set to the `width` value.
54
+ // Set the fixed width value based on the active breakpoint.
55
+ width: ResponsiveValue <double >(context,
56
+ conditionalValues: [
57
+ const Condition .equals (
58
+ name: MOBILE , value: 450 ),
59
+ const Condition .between (
60
+ start: 800 , end: 1100 , value: 800 ),
61
+ const Condition .between (
62
+ start: 1000 , end: 1200 , value: 1000 ),
63
+ // There are no conditions for width over 1200
64
+ // because the `maxWidth` is set to 1200 via the MaxWidthBox.
65
+ ]).value,
66
+ child: child! ),
67
+ ),
68
+ child: BouncingScrollWrapper .builder (
69
+ context, buildPage (settings.name ?? '' ),
70
+ dragWithMouse: true ));
71
+ });
69
72
},
70
73
debugShowCheckedModeBanner: false ,
71
74
);
0 commit comments