diff --git a/CHANGELOG.md b/CHANGELOG.md index a5e81b7c5..c09f0072e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ -## next +## 4.6.0 - Flutter 3.10 +- **BREAKING** Removed `FluentApp.useInheritedMediaQuery` - Upgrade the `scroll_pos` dependency (from @WinXaito) to version v0.4.0 ([#831](https://github.com/bdlukaa/fluent_ui/pull/831)) - Added support for Urdu language ([#832](https://github.com/bdlukaa/fluent_ui/pull/832)) diff --git a/example/lib/main.dart b/example/lib/main.dart index 0425b9f6e..43564d314 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -91,14 +91,14 @@ class MyApp extends StatelessWidget { accentColor: appTheme.color, visualDensity: VisualDensity.standard, focusTheme: FocusThemeData( - glowFactor: is10footScreen() ? 2.0 : 0.0, + glowFactor: is10footScreen(context) ? 2.0 : 0.0, ), ), theme: FluentThemeData( accentColor: appTheme.color, visualDensity: VisualDensity.standard, focusTheme: FocusThemeData( - glowFactor: is10footScreen() ? 2.0 : 0.0, + glowFactor: is10footScreen(context) ? 2.0 : 0.0, ), ), locale: appTheme.locale, diff --git a/example/lib/screens/forms/text_box.dart b/example/lib/screens/forms/text_box.dart index 6911fde6e..c86ac8e75 100644 --- a/example/lib/screens/forms/text_box.dart +++ b/example/lib/screens/forms/text_box.dart @@ -24,8 +24,8 @@ class TextBoxPage extends ScrollablePage { 'enabled by default.', ), subtitle(content: const Text('A simple TextBox')), - CardHighlight( - child: Row(children: const [ + const CardHighlight( + child: Row(children: [ Expanded(child: TextBox()), SizedBox(width: 10.0), Expanded( diff --git a/example/lib/screens/surface/acrylic.dart b/example/lib/screens/surface/acrylic.dart index 803b53951..78fad2bfa 100644 --- a/example/lib/screens/surface/acrylic.dart +++ b/example/lib/screens/surface/acrylic.dart @@ -51,11 +51,11 @@ class _AcrylicPageState extends State with PageMixin { 'to app surfaces to add depth and help establish a visual hierarchy.', ), subtitle(content: const Text('Default background acrylic brush.')), - Card( + const Card( child: SizedBox( height: 300, width: 500, - child: Stack(children: const [ + child: Stack(children: [ _AcrylicChildren(), Positioned.fill( child: Padding( diff --git a/example/lib/screens/surface/progress_indicators.dart b/example/lib/screens/surface/progress_indicators.dart index 5d4eb472d..0ce7ec18e 100644 --- a/example/lib/screens/surface/progress_indicators.dart +++ b/example/lib/screens/surface/progress_indicators.dart @@ -35,9 +35,9 @@ class _ProgressIndicatorsPageState extends State 'completion time is unknown.', ), ), - CardHighlight( + const CardHighlight( child: RepaintBoundary( - child: Row(children: const [ + child: Row(children: [ ProgressBar(), SizedBox(width: 20.0), ProgressRing(), diff --git a/example/lib/screens/theming/colors.dart b/example/lib/screens/theming/colors.dart index 1caf1f742..896978884 100644 --- a/example/lib/screens/theming/colors.dart +++ b/example/lib/screens/theming/colors.dart @@ -105,7 +105,7 @@ class ColorsPage extends ScrollablePage { InfoLabel( label: 'All Shades', child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row(children: const [ + const Row(children: [ ColorBlock( name: 'Black', color: Colors.black, diff --git a/example/lib/widgets/card_highlight.dart b/example/lib/widgets/card_highlight.dart index 7c1ba286f..484631e4f 100644 --- a/example/lib/widgets/card_highlight.dart +++ b/example/lib/widgets/card_highlight.dart @@ -76,7 +76,7 @@ class _CardHighlightState extends State color: theme.resources.textOnAccentFillColorPrimary, size: 18, ) - : Row(children: const [ + : const Row(children: [ Icon(FluentIcons.copy), SizedBox(width: 6.0), Text('Copy') diff --git a/example/lib/widgets/sponsor.dart b/example/lib/widgets/sponsor.dart index 39d1f4cd0..9eac3d3a5 100644 --- a/example/lib/widgets/sponsor.dart +++ b/example/lib/widgets/sponsor.dart @@ -25,9 +25,9 @@ class SponsorDialog extends StatelessWidget { ), ], ), - content: Row( + content: const Row( crossAxisAlignment: CrossAxisAlignment.start, - children: const [ + children: [ Expanded( child: _Tier( name: 'Royal Secretary', diff --git a/example/pubspec.lock b/example/pubspec.lock index 41c458a6d..88074acd2 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -21,10 +21,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: @@ -37,10 +37,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" checked_yaml: dependency: transitive description: @@ -77,10 +77,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" convert: dependency: transitive description: @@ -241,18 +241,18 @@ packages: dependency: transitive description: name: intl - sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" + sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6 url: "https://pub.dev" source: hosted - version: "0.17.0" + version: "0.18.0" js: dependency: transitive description: name: js - sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 url: "https://pub.dev" source: hosted - version: "0.6.5" + version: "0.6.7" json_annotation: dependency: transitive description: @@ -297,10 +297,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: @@ -321,10 +321,10 @@ packages: dependency: transitive description: name: meta - sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" nested: dependency: transitive description: @@ -337,10 +337,10 @@ packages: dependency: transitive description: name: path - sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" petitparser: dependency: transitive description: @@ -462,10 +462,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: @@ -587,5 +587,5 @@ packages: source: hosted version: "3.1.1" sdks: - dart: ">=2.18.5 <3.0.0" + dart: ">=3.0.0-0 <4.0.0" flutter: ">=3.7.0" diff --git a/lib/src/app.dart b/lib/src/app.dart index 2ff7521b7..14523eb46 100644 --- a/lib/src/app.dart +++ b/lib/src/app.dart @@ -80,7 +80,6 @@ class FluentApp extends StatefulWidget { this.themeMode, this.restorationScopeId, this.scrollBehavior = const FluentScrollBehavior(), - this.useInheritedMediaQuery = false, }) : routeInformationProvider = null, routeInformationParser = null, routerDelegate = null, @@ -116,7 +115,6 @@ class FluentApp extends StatefulWidget { this.actions, this.restorationScopeId, this.scrollBehavior = const FluentScrollBehavior(), - this.useInheritedMediaQuery = false, }) : assert(() { if (routerConfig != null) { assert( @@ -368,9 +366,6 @@ class FluentApp extends StatefulWidget { /// in a subtree. final ScrollBehavior scrollBehavior; - /// {@macro flutter.widgets.widgetsApp.useInheritedMediaQuery} - final bool useInheritedMediaQuery; - @override State createState() => _FluentAppState(); } @@ -500,7 +495,6 @@ class _FluentAppState extends State { actions: widget.actions, restorationScopeId: widget.restorationScopeId, localizationsDelegates: _localizationsDelegates, - useInheritedMediaQuery: widget.useInheritedMediaQuery, ); } @@ -531,7 +525,6 @@ class _FluentAppState extends State { actions: widget.actions, restorationScopeId: widget.restorationScopeId, localizationsDelegates: _localizationsDelegates, - useInheritedMediaQuery: widget.useInheritedMediaQuery, pageRouteBuilder: (RouteSettings settings, WidgetBuilder builder) { return FluentPageRoute(settings: settings, builder: builder); }, diff --git a/lib/src/controls/form/text_box.dart b/lib/src/controls/form/text_box.dart index 26d1b3451..f6294c19f 100644 --- a/lib/src/controls/form/text_box.dart +++ b/lib/src/controls/form/text_box.dart @@ -42,14 +42,14 @@ class _TextBoxSelectionGestureDetectorBuilder final _TextBoxState _state; @override - void onSingleTapUp(TapUpDetails details) { + void onSingleTapUp(TapDragUpDetails details) { super.onSingleTapUp(details); _state._requestKeyboard(); _state.widget.onTap?.call(); } @override - void onDragSelectionEnd(DragEndDetails details) { + void onDragSelectionEnd(TapDragEndDetails details) { _state._requestKeyboard(); } } diff --git a/lib/src/utils.dart b/lib/src/utils.dart index 5b772813d..2ad866b19 100644 --- a/lib/src/utils.dart +++ b/lib/src/utils.dart @@ -1,5 +1,4 @@ import 'dart:math' as math; -import 'dart:ui' as ui; import 'package:fluent_ui/fluent_ui.dart'; @@ -78,8 +77,8 @@ bool debugCheckHasFluentLocalizations(BuildContext context) { /// /// [width] is the width of the current screen. If not provided, /// [SingletonFlutterWindow.physicalSize] is used -bool is10footScreen([double? width]) { - width ??= ui.window.physicalSize.width; +bool is10footScreen(BuildContext context) { + final width = View.of(context).physicalSize.width; return width >= 11520; } diff --git a/pubspec.lock b/pubspec.lock index 8e8de78d8..44e029a99 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -37,10 +37,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: @@ -53,10 +53,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: @@ -69,10 +69,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" convert: dependency: transitive description: @@ -164,26 +164,26 @@ packages: dependency: "direct main" description: name: intl - sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" + sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6 url: "https://pub.dev" source: hosted - version: "0.17.0" + version: "0.18.0" intl_utils: dependency: "direct dev" description: name: intl_utils - sha256: "413699c0f7a1123a9306c1f2f5ea8662677d25bdebf22ba4f3960e0069be3be2" + sha256: db392393fbf891e3eb32f6beb1928b00cdb33e3c54597fd5f5dc5c43e5ba601c url: "https://pub.dev" source: hosted - version: "2.8.1" + version: "2.8.2" js: 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: @@ -196,10 +196,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: @@ -220,10 +220,10 @@ packages: dependency: transitive description: name: meta - sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" package_config: dependency: transitive description: @@ -236,10 +236,10 @@ packages: dependency: transitive description: name: path - sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" petitparser: dependency: transitive description: @@ -329,10 +329,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: @@ -366,5 +366,5 @@ packages: source: hosted version: "3.1.1" sdks: - dart: ">=2.18.0 <3.0.0" + dart: ">=3.0.0-0 <4.0.0" flutter: ">=3.7.0"