diff --git a/packages/mobile/example/lib/component/button/zero_button_example.dart b/packages/mobile/example/lib/component/button/zero_button_example.dart index 546cda53..9b2a7a5a 100644 --- a/packages/mobile/example/lib/component/button/zero_button_example.dart +++ b/packages/mobile/example/lib/component/button/zero_button_example.dart @@ -284,9 +284,9 @@ class ZeroButtonExample extends StatelessWidget { ], ), const SizedBox(height: 16), - Row( + const Row( mainAxisSize: MainAxisSize.min, - children: const [ + children: [ ZeroButtonIcon.disabled( icon: Icon(Icons.search), size: ZeroButtonSize.small, diff --git a/packages/mobile/example/lib/component/divider/divider_example.dart b/packages/mobile/example/lib/component/divider/divider_example.dart index 7677c88b..1b508bd8 100644 --- a/packages/mobile/example/lib/component/divider/divider_example.dart +++ b/packages/mobile/example/lib/component/divider/divider_example.dart @@ -12,9 +12,9 @@ class ZeroDividerExample extends StatelessWidget { ), body: Column( children: [ - Expanded( + const Expanded( child: Column( - children: const [ + children: [ SizedBox(height: 32), Text('Default'), ZeroDivider(), @@ -48,9 +48,9 @@ class ZeroDividerExample extends StatelessWidget { ), ), ), - Expanded( + const Expanded( child: Row( - children: const [ + children: [ SizedBox(width: 32), Text('Default'), ZeroDivider.vertical(), diff --git a/packages/mobile/example/lib/component/progress_indicator/zero_progress_indicator_example.dart b/packages/mobile/example/lib/component/progress_indicator/zero_progress_indicator_example.dart index 9a199ffb..bd04a4aa 100644 --- a/packages/mobile/example/lib/component/progress_indicator/zero_progress_indicator_example.dart +++ b/packages/mobile/example/lib/component/progress_indicator/zero_progress_indicator_example.dart @@ -10,10 +10,10 @@ class ZeroProgressIndicatorExample extends StatelessWidget { appBar: AppBar( title: const Text('Zero Progress Indicator'), ), - body: Center( + body: const Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, - children: const [ + children: [ ZeroProgressIndicator.circular(), SizedBox(height: 20), ZeroProgressIndicator.circular( diff --git a/packages/mobile/example/lib/component/tooltip/zero_tooltip_example.dart b/packages/mobile/example/lib/component/tooltip/zero_tooltip_example.dart index 357daef1..6745f0fe 100644 --- a/packages/mobile/example/lib/component/tooltip/zero_tooltip_example.dart +++ b/packages/mobile/example/lib/component/tooltip/zero_tooltip_example.dart @@ -19,10 +19,10 @@ class _ZeroTooltipExampleState extends State { child: Container( width: MediaQuery.of(context).size.width, padding: const EdgeInsets.all(8.0), - child: Column( + child: const Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, - children: const [ + children: [ ZeroTooltip( position: ZeroTooltipPosition.right, variant: ZeroTooltipVariant.custom, diff --git a/packages/mobile/example/pubspec.lock b/packages/mobile/example/pubspec.lock index 4860827d..fdb50072 100644 --- a/packages/mobile/example/pubspec.lock +++ b/packages/mobile/example/pubspec.lock @@ -13,10 +13,10 @@ packages: dependency: transitive description: name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.11.0" boolean_selector: dependency: transitive description: @@ -29,10 +29,10 @@ packages: dependency: transitive description: name: characters - sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" clock: dependency: transitive description: @@ -45,10 +45,10 @@ packages: dependency: transitive description: name: collection - sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "1.17.1" crypto: dependency: transitive description: @@ -167,10 +167,10 @@ packages: dependency: transitive description: name: js - sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 url: "https://pub.dev" source: hosted - version: "0.6.5" + version: "0.6.7" lints: dependency: transitive description: @@ -183,10 +183,10 @@ packages: dependency: transitive description: name: matcher - sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" url: "https://pub.dev" source: hosted - version: "0.12.13" + version: "0.12.15" material_color_utilities: dependency: transitive description: @@ -199,18 +199,18 @@ packages: dependency: transitive description: name: meta - sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" path: dependency: transitive description: name: path - sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" path_parsing: dependency: transitive description: @@ -348,10 +348,10 @@ packages: dependency: transitive description: name: test_api - sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb url: "https://pub.dev" source: hosted - version: "0.4.16" + version: "0.5.1" typed_data: dependency: transitive description: @@ -422,7 +422,7 @@ packages: path: ".." relative: true source: path - version: "0.0.1-alpha.13" + version: "0.0.1-alpha.17" sdks: - dart: ">=2.19.0-0 <3.0.0" + dart: ">=3.0.0-0 <4.0.0" flutter: ">=3.7.0-0" diff --git a/packages/mobile/lib/components/app.dart b/packages/mobile/lib/components/app.dart index f5fb58da..335b608f 100644 --- a/packages/mobile/lib/components/app.dart +++ b/packages/mobile/lib/components/app.dart @@ -81,7 +81,6 @@ class ZeroApp extends StatelessWidget { this.darkTheme, this.themeMode = ThemeMode.system, this.restorationScopeId, - this.useInheritedMediaQuery = false, this.scrollBehavior, }) : routeInformationProvider = null, routeInformationParser = null, @@ -121,7 +120,6 @@ class ZeroApp extends StatelessWidget { this.shortcuts, this.actions, this.restorationScopeId, - this.useInheritedMediaQuery = false, this.scrollBehavior, }) : assert(routerDelegate != null || routerConfig != null), navigatorObservers = null, @@ -355,9 +353,6 @@ class ZeroApp extends StatelessWidget { /// in a subtree. final ScrollBehavior? scrollBehavior; - /// {@macro flutter.widgets.widgetsApp.useInheritedMediaQuery} - final bool useInheritedMediaQuery; - @override Widget build(BuildContext context) { if (routerDelegate != null || routerConfig != null) { @@ -383,7 +378,6 @@ class ZeroApp extends StatelessWidget { actions: actions, restorationScopeId: restorationScopeId, localizationsDelegates: localizationsDelegates, - useInheritedMediaQuery: useInheritedMediaQuery, theme: theme?.toThemeData(), darkTheme: darkTheme?.toThemeData(), themeMode: themeMode, @@ -418,7 +412,6 @@ class ZeroApp extends StatelessWidget { actions: actions, restorationScopeId: restorationScopeId, localizationsDelegates: localizationsDelegates, - useInheritedMediaQuery: useInheritedMediaQuery, theme: theme?.toThemeData(), darkTheme: darkTheme?.toThemeData(), themeMode: themeMode, diff --git a/packages/mobile/lib/components/dropdown_button/dropdown_button.dart b/packages/mobile/lib/components/dropdown_button/dropdown_button.dart index 708ef2ce..7ac7df0f 100644 --- a/packages/mobile/lib/components/dropdown_button/dropdown_button.dart +++ b/packages/mobile/lib/components/dropdown_button/dropdown_button.dart @@ -1401,7 +1401,7 @@ class _ZeroDropdownButtonState extends State> if (result == null) { // If there's no MediaQuery, then use the window aspect to determine // orientation. - final Size size = WidgetsBinding.instance.window.physicalSize; + final Size size = View.of(context).physicalSize; result = size.width > size.height ? Orientation.landscape : Orientation.portrait; diff --git a/packages/mobile/lib/components/dropdown_menu/dropdown_menu.dart b/packages/mobile/lib/components/dropdown_menu/dropdown_menu.dart index b0aee37a..2c6fc2b6 100644 --- a/packages/mobile/lib/components/dropdown_menu/dropdown_menu.dart +++ b/packages/mobile/lib/components/dropdown_menu/dropdown_menu.dart @@ -586,7 +586,7 @@ class _ArrowDownIntent extends Intent { } class _DropdownMenuBody extends MultiChildRenderObjectWidget { - _DropdownMenuBody({ + const _DropdownMenuBody({ super.key, super.children, this.width, diff --git a/packages/mobile/lib/components/stepper/zero_stepper.dart b/packages/mobile/lib/components/stepper/zero_stepper.dart index 5c7c6cbe..71b981be 100644 --- a/packages/mobile/lib/components/stepper/zero_stepper.dart +++ b/packages/mobile/lib/components/stepper/zero_stepper.dart @@ -199,7 +199,7 @@ class _ZeroStepperState extends State child: Center( child: _buildCircleChild( index, - oldState && widget.steps[index].state == StepState.error, + oldState && widget.steps[index].state == ZeroStepState.error, ), ), ), @@ -227,7 +227,7 @@ class _ZeroStepperState extends State alignment: const Alignment(0.0, 0.8), child: _buildCircleChild( index, - oldState && widget.steps[index].state != StepState.error, + oldState && widget.steps[index].state != ZeroStepState.error, ), ), ), @@ -244,13 +244,13 @@ class _ZeroStepperState extends State firstCurve: const Interval(0.0, 0.6, curve: Curves.fastOutSlowIn), secondCurve: const Interval(0.4, 1.0, curve: Curves.fastOutSlowIn), sizeCurve: Curves.fastOutSlowIn, - crossFadeState: widget.steps[index].state == StepState.error + crossFadeState: widget.steps[index].state == ZeroStepState.error ? CrossFadeState.showSecond : CrossFadeState.showFirst, duration: kThemeAnimationDuration, ); } else { - if (widget.steps[index].state != StepState.error) { + if (widget.steps[index].state != ZeroStepState.error) { return _buildCircle(index, false); } else { return _buildTriangle(index, false); @@ -492,7 +492,7 @@ class _ZeroStepperState extends State key: _keys[i], children: [ InkWell( - onTap: widget.steps[i].state != StepState.disabled + onTap: widget.steps[i].state != ZeroStepState.disabled ? () { // In the vertical case we need to scroll to the newly tapped // step. @@ -505,7 +505,8 @@ class _ZeroStepperState extends State widget.onStepTapped?.call(i); } : null, - canRequestFocus: widget.steps[i].state != StepState.disabled, + canRequestFocus: + widget.steps[i].state != ZeroStepState.disabled, child: _buildVerticalHeader(i), ), _buildVerticalBody(i), @@ -522,12 +523,12 @@ class _ZeroStepperState extends State final List children = [ for (int i = 0; i < widget.steps.length; i += 1) ...[ InkResponse( - onTap: widget.steps[i].state != StepState.disabled + onTap: widget.steps[i].state != ZeroStepState.disabled ? () { widget.onStepTapped?.call(i); } : null, - canRequestFocus: widget.steps[i].state != StepState.disabled, + canRequestFocus: widget.steps[i].state != ZeroStepState.disabled, child: Row( mainAxisSize: MainAxisSize.min, children: [ diff --git a/packages/mobile/lib/components/timepicker/zero_time_picker.dart b/packages/mobile/lib/components/timepicker/zero_time_picker.dart index dace5713..e90b0170 100644 --- a/packages/mobile/lib/components/timepicker/zero_time_picker.dart +++ b/packages/mobile/lib/components/timepicker/zero_time_picker.dart @@ -1952,7 +1952,7 @@ class _HourMinuteTextFieldState extends State<_HourMinuteTextField> // resolved, remove the window check for semantics being enabled on web. final String? hintText = MediaQuery.of(context).accessibleNavigation || - WidgetsBinding.instance.window.semanticsEnabled + WidgetsBinding.instance.semanticsEnabled ? widget.semanticHintText : (focusNode.hasFocus ? null : _formattedValue); inputDecoration = inputDecoration.copyWith( diff --git a/packages/mobile/pubspec.yaml b/packages/mobile/pubspec.yaml index 0eea896a..cd71cddc 100644 --- a/packages/mobile/pubspec.yaml +++ b/packages/mobile/pubspec.yaml @@ -9,7 +9,7 @@ screenshots: path: screenshot/logo.png environment: - sdk: '>=2.18.1 <3.0.0' + sdk: '>=2.18.1 <4.0.0' flutter: '>=1.17.0' dependencies: