From 04e6e73b26adff462b8dc4b1a7890bfd17a72732 Mon Sep 17 00:00:00 2001 From: Eric Windmill Date: Fri, 1 Aug 2025 15:06:18 -0400 Subject: [PATCH] lots of dart formats --- .../books/flutter_module_books/lib/api.dart | 10 +++--- .../lib/src/basics/animated_container.dart | 3 +- .../lib/src/misc/animated_switcher.dart | 3 +- animations/lib/src/misc/card_swipe.dart | 3 +- animations/lib/src/misc/curved_animation.dart | 3 +- .../test/basics/animated_builder_test.dart | 3 +- animations/test/misc/animated_list_test.dart | 12 ++----- animations/test/misc/expand_card_test.dart | 3 +- animations/test/misc/focus_image_test.dart | 3 +- background_isolate_channels/lib/main.dart | 7 ++-- .../lib/simple_database.dart | 3 +- context_menus/lib/cascading_menu_page.dart | 4 +-- context_menus/lib/context_menu_region.dart | 3 +- context_menus/lib/field_types_page.dart | 15 ++++---- context_menus/lib/platform_selector.dart | 3 +- context_menus/lib/reordered_buttons_page.dart | 10 ++---- .../fluent_ui/lib/src/model/search.g.dart | 4 +-- .../unsplash/current_user_collections.dart | 3 +- .../unsplash/current_user_collections.g.dart | 6 ++-- .../fluent_ui/lib/src/unsplash/exif.g.dart | 3 +- .../lib/src/unsplash/location.g.dart | 3 +- .../fluent_ui/lib/src/unsplash/photo.g.dart | 6 ++-- .../lib/src/unsplash/position.g.dart | 3 +- .../fluent_ui/lib/src/widgets/split.dart | 12 ++----- .../src/widgets/unsplash_search_content.dart | 7 ++-- .../fluent_ui/tool/grind.dart | 3 +- .../material/lib/src/model/search.g.dart | 4 +-- .../unsplash/current_user_collections.dart | 3 +- .../unsplash/current_user_collections.g.dart | 6 ++-- .../material/lib/src/unsplash/exif.g.dart | 3 +- .../material/lib/src/unsplash/location.g.dart | 3 +- .../material/lib/src/unsplash/photo.g.dart | 6 ++-- .../material/lib/src/unsplash/position.g.dart | 3 +- .../material/lib/src/widgets/split.dart | 12 ++----- .../src/widgets/unsplash_search_content.dart | 7 ++-- desktop_photo_search/material/tool/grind.dart | 3 +- form_app/lib/src/form_widgets.dart | 3 +- form_app/lib/src/sign_in_http.g.dart | 9 +++-- google_maps/lib/src/locations.dart | 12 +++---- isolate_example/lib/performance_page.dart | 10 +++--- material_3_demo/lib/main.dart | 3 +- material_3_demo/lib/src/buttons.dart | 3 +- material_3_demo/lib/src/component_screen.dart | 9 ++--- material_3_demo/lib/src/home.dart | 34 +++++++++---------- .../lib/src/navigation_transition.dart | 3 +- tool/ci_script.dart | 18 +++++----- 46 files changed, 103 insertions(+), 189 deletions(-) diff --git a/add_to_app/books/flutter_module_books/lib/api.dart b/add_to_app/books/flutter_module_books/lib/api.dart index 7c2c2e5be..6076a41bc 100644 --- a/add_to_app/books/flutter_module_books/lib/api.dart +++ b/add_to_app/books/flutter_module_books/lib/api.dart @@ -24,8 +24,7 @@ class Book { pigeonMap['summary'] = summary; pigeonMap['publishDate'] = publishDate; pigeonMap['pageCount'] = pageCount; - pigeonMap['thumbnail'] = - thumbnail == null ? null : thumbnail!.encode(); + pigeonMap['thumbnail'] = thumbnail == null ? null : thumbnail!.encode(); return pigeonMap; } @@ -168,10 +167,9 @@ class HostBookApi { } Future finishEditingBook(Book arg_book) async { - final BasicMessageChannel channel = - BasicMessageChannel( - 'dev.flutter.pigeon.HostBookApi.finishEditingBook', codec, - binaryMessenger: _binaryMessenger); + final BasicMessageChannel channel = BasicMessageChannel( + 'dev.flutter.pigeon.HostBookApi.finishEditingBook', codec, + binaryMessenger: _binaryMessenger); final Map? replyMap = await channel.send([arg_book]) as Map?; if (replyMap == null) { diff --git a/animations/lib/src/basics/animated_container.dart b/animations/lib/src/basics/animated_container.dart index 396addc3f..7a772a9fa 100644 --- a/animations/lib/src/basics/animated_container.dart +++ b/animations/lib/src/basics/animated_container.dart @@ -15,8 +15,7 @@ class AnimatedContainerDemo extends StatefulWidget { static String routeName = 'basics/animated_container'; @override - State createState() => - _AnimatedContainerDemoState(); + State createState() => _AnimatedContainerDemoState(); } class _AnimatedContainerDemoState extends State { diff --git a/animations/lib/src/misc/animated_switcher.dart b/animations/lib/src/misc/animated_switcher.dart index 0eb1997b5..96427f8d1 100644 --- a/animations/lib/src/misc/animated_switcher.dart +++ b/animations/lib/src/misc/animated_switcher.dart @@ -27,8 +27,7 @@ class AnimatedSwitcherDemo extends StatefulWidget { static String routeName = 'misc/animated_switcher'; @override - State createState() => - _AnimatedSwitcherDemoState(); + State createState() => _AnimatedSwitcherDemoState(); } class _AnimatedSwitcherDemoState extends State { diff --git a/animations/lib/src/misc/card_swipe.dart b/animations/lib/src/misc/card_swipe.dart index 5eb4aeac5..7458c983c 100644 --- a/animations/lib/src/misc/card_swipe.dart +++ b/animations/lib/src/misc/card_swipe.dart @@ -174,8 +174,7 @@ class _SwipeableCardState extends State return; } - var velocity = (details.velocity.pixelsPerSecond.dx / size.width) - .abs(); + var velocity = (details.velocity.pixelsPerSecond.dx / size.width).abs(); _animate(velocity: velocity); } diff --git a/animations/lib/src/misc/curved_animation.dart b/animations/lib/src/misc/curved_animation.dart index 045e37ab2..e460653fd 100644 --- a/animations/lib/src/misc/curved_animation.dart +++ b/animations/lib/src/misc/curved_animation.dart @@ -123,8 +123,7 @@ class _CurvedAnimationDemoState extends State if (newCurve != null) { setState(() { selectedReverseCurve = newCurve; - curvedAnimation.reverseCurve = - selectedReverseCurve.curve; + curvedAnimation.reverseCurve = selectedReverseCurve.curve; }); } }, diff --git a/animations/test/basics/animated_builder_test.dart b/animations/test/basics/animated_builder_test.dart index 1ca3809b8..e60f9246c 100644 --- a/animations/test/basics/animated_builder_test.dart +++ b/animations/test/basics/animated_builder_test.dart @@ -56,8 +56,7 @@ void main() { // Check that the color has changed to the final color. button = tester.widget(find.byType(ElevatedButton)); - WidgetStateProperty? finalColor = - button.style!.backgroundColor; + WidgetStateProperty? finalColor = button.style!.backgroundColor; expect(changedColor, isNot(finalColor)); }); }); diff --git a/animations/test/misc/animated_list_test.dart b/animations/test/misc/animated_list_test.dart index f05020726..bc03fca99 100644 --- a/animations/test/misc/animated_list_test.dart +++ b/animations/test/misc/animated_list_test.dart @@ -46,9 +46,7 @@ void main() { await tester.pumpWidget(createAnimatedListDemoScreen()); // Get the initial length of list. - var initialLength = tester - .widgetList(find.byType(ListTile)) - .length; + var initialLength = tester.widgetList(find.byType(ListTile)).length; // Tap on the Delete Icon Button at middle index. await tester.tap(find.byIcon(Icons.delete).at(initialLength ~/ 2)); @@ -68,9 +66,7 @@ void main() { await tester.pumpWidget(createAnimatedListDemoScreen()); // Get the initial length of list. - var initialLength = tester - .widgetList(find.byType(ListTile)) - .length; + var initialLength = tester.widgetList(find.byType(ListTile)).length; // Tap on the Delete Icon Button at start index. await tester.tap(find.byIcon(Icons.delete).at(0)); @@ -90,9 +86,7 @@ void main() { await tester.pumpWidget(createAnimatedListDemoScreen()); // Get the initial length of list. - var initialLength = tester - .widgetList(find.byType(ListTile)) - .length; + var initialLength = tester.widgetList(find.byType(ListTile)).length; // Tap on the Delete Icon Button at end index. await tester.tap(find.byIcon(Icons.delete).at(initialLength - 1)); diff --git a/animations/test/misc/expand_card_test.dart b/animations/test/misc/expand_card_test.dart index e5f09be33..b955d27a9 100644 --- a/animations/test/misc/expand_card_test.dart +++ b/animations/test/misc/expand_card_test.dart @@ -6,8 +6,7 @@ import 'package:animations/src/misc/expand_card.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -Widget createExpandCardScreen() => - const MaterialApp(home: ExpandCardDemo()); +Widget createExpandCardScreen() => const MaterialApp(home: ExpandCardDemo()); void main() { group('ExpandCard Tests', () { diff --git a/animations/test/misc/focus_image_test.dart b/animations/test/misc/focus_image_test.dart index 8a94d94a1..7b3f8e0e3 100644 --- a/animations/test/misc/focus_image_test.dart +++ b/animations/test/misc/focus_image_test.dart @@ -6,8 +6,7 @@ import 'package:animations/src/misc/focus_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -Widget createFocusImageScreen() => - const MaterialApp(home: FocusImageDemo()); +Widget createFocusImageScreen() => const MaterialApp(home: FocusImageDemo()); void main() { group('FocusImage Tests', () { diff --git a/background_isolate_channels/lib/main.dart b/background_isolate_channels/lib/main.dart index 36921aafb..a0c874e34 100644 --- a/background_isolate_channels/lib/main.dart +++ b/background_isolate_channels/lib/main.dart @@ -65,10 +65,9 @@ class _MyHomePageState extends State { // Write the value to [SharedPreferences] which will get read on the // [SimpleDatabase]'s isolate. For this example the value is always true // just for demonstration purposes. - final Future sharedPreferencesSet = - SharedPreferences.getInstance().then( - (sharedPreferences) => - sharedPreferences.setBool('isDebug', true), + final Future sharedPreferencesSet = SharedPreferences.getInstance() + .then( + (sharedPreferences) => sharedPreferences.setBool('isDebug', true), ); final Future tempDirFuture = path_provider .getTemporaryDirectory(); diff --git a/background_isolate_channels/lib/simple_database.dart b/background_isolate_channels/lib/simple_database.dart index 447f10dbb..8424123ad 100644 --- a/background_isolate_channels/lib/simple_database.dart +++ b/background_isolate_channels/lib/simple_database.dart @@ -181,8 +181,7 @@ class _SimpleDatabaseServer { // obtained on the root isolate and passed into the background isolate via // a [SendPort]. // ---------------------------------------------------------------------- - RootIsolateToken rootIsolateToken = - command.arg1 as RootIsolateToken; + RootIsolateToken rootIsolateToken = command.arg1 as RootIsolateToken; // ---------------------------------------------------------------------- // [BackgroundIsolateBinaryMessenger.ensureInitialized] for each // background isolate that will use plugins. This sets up the diff --git a/context_menus/lib/cascading_menu_page.dart b/context_menus/lib/cascading_menu_page.dart index 4784ca0fa..173f556ed 100644 --- a/context_menus/lib/cascading_menu_page.dart +++ b/context_menus/lib/cascading_menu_page.dart @@ -112,9 +112,7 @@ class _MyContextMenuRegionState extends State<_MyContextMenuRegion> { ), ), Text( - _lastSelection != null - ? 'Last Selected: $_lastSelection' - : '', + _lastSelection != null ? 'Last Selected: $_lastSelection' : '', ), ], ), diff --git a/context_menus/lib/context_menu_region.dart b/context_menus/lib/context_menu_region.dart index 0f1b05b32..89aa5f842 100644 --- a/context_menus/lib/context_menu_region.dart +++ b/context_menus/lib/context_menu_region.dart @@ -28,8 +28,7 @@ class ContextMenuRegion extends StatefulWidget { class _ContextMenuRegionState extends State { Offset? _longPressOffset; - final ContextMenuController _contextMenuController = - ContextMenuController(); + final ContextMenuController _contextMenuController = ContextMenuController(); static bool get _longPressEnabled { switch (defaultTargetPlatform) { diff --git a/context_menus/lib/field_types_page.dart b/context_menus/lib/field_types_page.dart index 46d8feb45..9c6850581 100644 --- a/context_menus/lib/field_types_page.dart +++ b/context_menus/lib/field_types_page.dart @@ -34,8 +34,7 @@ class FieldTypesPage extends StatelessWidget { final TextEditingController _cupertinoControllerForced = TextEditingController( - text: - 'Or forced to always show a specific menu (Material desktop menu).', + text: 'Or forced to always show a specific menu (Material desktop menu).', ); final TextEditingController _editableController = TextEditingController( @@ -88,13 +87,11 @@ class FieldTypesPage extends StatelessWidget { controller: _cupertinoControllerForced, contextMenuBuilder: (context, editableTextState) { return DesktopTextSelectionToolbar( - anchor: - editableTextState.contextMenuAnchors.primaryAnchor, - children: - AdaptiveTextSelectionToolbar.getAdaptiveButtons( - context, - editableTextState.contextMenuButtonItems, - ).toList(), + anchor: editableTextState.contextMenuAnchors.primaryAnchor, + children: AdaptiveTextSelectionToolbar.getAdaptiveButtons( + context, + editableTextState.contextMenuButtonItems, + ).toList(), ); }, ), diff --git a/context_menus/lib/platform_selector.dart b/context_menus/lib/platform_selector.dart index acdc1c35d..9df3e99d2 100644 --- a/context_menus/lib/platform_selector.dart +++ b/context_menus/lib/platform_selector.dart @@ -13,8 +13,7 @@ class PlatformSelector extends StatefulWidget { } class _PlatformSelectorState extends State { - static const int targetPlatformStringLength = - 15; // 'TargetPlatform.'.length + static const int targetPlatformStringLength = 15; // 'TargetPlatform.'.length static String _platformToString(TargetPlatform platform) { return platform.toString().substring(targetPlatformStringLength); diff --git a/context_menus/lib/reordered_buttons_page.dart b/context_menus/lib/reordered_buttons_page.dart index 36b40475e..bc138469f 100644 --- a/context_menus/lib/reordered_buttons_page.dart +++ b/context_menus/lib/reordered_buttons_page.dart @@ -55,15 +55,9 @@ class ReorderedButtonsPage extends StatelessWidget { maxLines: 2, contextMenuBuilder: (context, editableTextState) { // Reorder the button datas by type. - final HashMap< - ContextMenuButtonType, - ContextMenuButtonItem - > + final HashMap buttonItemsMap = - HashMap< - ContextMenuButtonType, - ContextMenuButtonItem - >(); + HashMap(); for (ContextMenuButtonItem buttonItem in editableTextState.contextMenuButtonItems) { buttonItemsMap[buttonItem.type] = buttonItem; diff --git a/desktop_photo_search/fluent_ui/lib/src/model/search.g.dart b/desktop_photo_search/fluent_ui/lib/src/model/search.g.dart index 1cec6f231..578c88f1b 100644 --- a/desktop_photo_search/fluent_ui/lib/src/model/search.g.dart +++ b/desktop_photo_search/fluent_ui/lib/src/model/search.g.dart @@ -106,9 +106,7 @@ class _$Search extends Search { @override bool operator ==(Object other) { if (identical(other, this)) return true; - return other is Search && - query == other.query && - results == other.results; + return other is Search && query == other.query && results == other.results; } @override diff --git a/desktop_photo_search/fluent_ui/lib/src/unsplash/current_user_collections.dart b/desktop_photo_search/fluent_ui/lib/src/unsplash/current_user_collections.dart index d9d88e67b..610ae215d 100644 --- a/desktop_photo_search/fluent_ui/lib/src/unsplash/current_user_collections.dart +++ b/desktop_photo_search/fluent_ui/lib/src/unsplash/current_user_collections.dart @@ -12,8 +12,7 @@ import '../serializers.dart'; part 'current_user_collections.g.dart'; abstract class CurrentUserCollections - implements - Built { + implements Built { factory CurrentUserCollections([ void Function(CurrentUserCollectionsBuilder)? updates, ]) = _$CurrentUserCollections; diff --git a/desktop_photo_search/fluent_ui/lib/src/unsplash/current_user_collections.g.dart b/desktop_photo_search/fluent_ui/lib/src/unsplash/current_user_collections.g.dart index 914869ea5..f37c6c9eb 100644 --- a/desktop_photo_search/fluent_ui/lib/src/unsplash/current_user_collections.g.dart +++ b/desktop_photo_search/fluent_ui/lib/src/unsplash/current_user_collections.g.dart @@ -192,8 +192,7 @@ class _$CurrentUserCollections extends CurrentUserCollections { } class CurrentUserCollectionsBuilder - implements - Builder { + implements Builder { _$CurrentUserCollections? _$v; int? _id; @@ -206,8 +205,7 @@ class CurrentUserCollectionsBuilder String? _publishedAt; String? get publishedAt => _$this._publishedAt; - set publishedAt(String? publishedAt) => - _$this._publishedAt = publishedAt; + set publishedAt(String? publishedAt) => _$this._publishedAt = publishedAt; String? _updatedAt; String? get updatedAt => _$this._updatedAt; diff --git a/desktop_photo_search/fluent_ui/lib/src/unsplash/exif.g.dart b/desktop_photo_search/fluent_ui/lib/src/unsplash/exif.g.dart index 9f4de4e6a..1896c86fe 100644 --- a/desktop_photo_search/fluent_ui/lib/src/unsplash/exif.g.dart +++ b/desktop_photo_search/fluent_ui/lib/src/unsplash/exif.g.dart @@ -254,8 +254,7 @@ class ExifBuilder implements Builder { String? _focalLength; String? get focalLength => _$this._focalLength; - set focalLength(String? focalLength) => - _$this._focalLength = focalLength; + set focalLength(String? focalLength) => _$this._focalLength = focalLength; int? _iso; int? get iso => _$this._iso; diff --git a/desktop_photo_search/fluent_ui/lib/src/unsplash/location.g.dart b/desktop_photo_search/fluent_ui/lib/src/unsplash/location.g.dart index 497c3ccc3..7fe7b1ca9 100644 --- a/desktop_photo_search/fluent_ui/lib/src/unsplash/location.g.dart +++ b/desktop_photo_search/fluent_ui/lib/src/unsplash/location.g.dart @@ -169,8 +169,7 @@ class LocationBuilder implements Builder { set country(String? country) => _$this._country = country; PositionBuilder? _position; - PositionBuilder get position => - _$this._position ??= new PositionBuilder(); + PositionBuilder get position => _$this._position ??= new PositionBuilder(); set position(PositionBuilder? position) => _$this._position = position; LocationBuilder(); diff --git a/desktop_photo_search/fluent_ui/lib/src/unsplash/photo.g.dart b/desktop_photo_search/fluent_ui/lib/src/unsplash/photo.g.dart index 871f69ec7..c032a759c 100644 --- a/desktop_photo_search/fluent_ui/lib/src/unsplash/photo.g.dart +++ b/desktop_photo_search/fluent_ui/lib/src/unsplash/photo.g.dart @@ -551,16 +551,14 @@ class PhotoBuilder implements Builder { String? _description; String? get description => _$this._description; - set description(String? description) => - _$this._description = description; + set description(String? description) => _$this._description = description; ExifBuilder? _exif; ExifBuilder get exif => _$this._exif ??= new ExifBuilder(); set exif(ExifBuilder? exif) => _$this._exif = exif; LocationBuilder? _location; - LocationBuilder get location => - _$this._location ??= new LocationBuilder(); + LocationBuilder get location => _$this._location ??= new LocationBuilder(); set location(LocationBuilder? location) => _$this._location = location; ListBuilder? _tags; diff --git a/desktop_photo_search/fluent_ui/lib/src/unsplash/position.g.dart b/desktop_photo_search/fluent_ui/lib/src/unsplash/position.g.dart index 6d48bb844..c8619d5c6 100644 --- a/desktop_photo_search/fluent_ui/lib/src/unsplash/position.g.dart +++ b/desktop_photo_search/fluent_ui/lib/src/unsplash/position.g.dart @@ -86,8 +86,7 @@ class _$Position extends Position { factory _$Position([void Function(PositionBuilder)? updates]) => (new PositionBuilder()..update(updates))._build(); - _$Position._({required this.latitude, required this.longitude}) - : super._() { + _$Position._({required this.latitude, required this.longitude}) : super._() { BuiltValueNullFieldError.checkNotNull( latitude, r'Position', diff --git a/desktop_photo_search/fluent_ui/lib/src/widgets/split.dart b/desktop_photo_search/fluent_ui/lib/src/widgets/split.dart index afd378a88..a4890e3de 100644 --- a/desktop_photo_search/fluent_ui/lib/src/widgets/split.dart +++ b/desktop_photo_search/fluent_ui/lib/src/widgets/split.dart @@ -115,9 +115,7 @@ class _SplitState extends State { secondSize = secondSize - halfDivider; void updateSpacing(DragUpdateDetails dragDetails) { - final delta = isHorizontal - ? dragDetails.delta.dx - : dragDetails.delta.dy; + final delta = isHorizontal ? dragDetails.delta.dx : dragDetails.delta.dy; final fractionalDelta = delta / axisSize; setState(() { // Update the fraction of space consumed by the children, @@ -151,12 +149,8 @@ class _SplitState extends State { ), ), child: SizedBox( - height: isHorizontal - ? 2.0 - : Split.dividerMainAxisSize - 2.0, - width: isHorizontal - ? Split.dividerMainAxisSize - 2.0 - : 2.0, + height: isHorizontal ? 2.0 : Split.dividerMainAxisSize - 2.0, + width: isHorizontal ? Split.dividerMainAxisSize - 2.0 : 2.0, ), ), ), diff --git a/desktop_photo_search/fluent_ui/lib/src/widgets/unsplash_search_content.dart b/desktop_photo_search/fluent_ui/lib/src/widgets/unsplash_search_content.dart index d084387f5..a805cad43 100644 --- a/desktop_photo_search/fluent_ui/lib/src/widgets/unsplash_search_content.dart +++ b/desktop_photo_search/fluent_ui/lib/src/widgets/unsplash_search_content.dart @@ -15,8 +15,7 @@ class UnsplashSearchContent extends StatefulWidget { const UnsplashSearchContent({super.key}); @override - State createState() => - _UnsplashSearchContentState(); + State createState() => _UnsplashSearchContentState(); } class _UnsplashSearchContentState extends State { @@ -40,9 +39,7 @@ class _UnsplashSearchContentState extends State { child: SingleChildScrollView( controller: _treeViewScrollController, child: TreeView( - items: photoSearchModel.entries - .map(_buildSearchEntry) - .toList(), + items: photoSearchModel.entries.map(_buildSearchEntry).toList(), ), ), ), diff --git a/desktop_photo_search/fluent_ui/tool/grind.dart b/desktop_photo_search/fluent_ui/tool/grind.dart index 2028b84b5..4bd6473af 100644 --- a/desktop_photo_search/fluent_ui/tool/grind.dart +++ b/desktop_photo_search/fluent_ui/tool/grind.dart @@ -44,8 +44,7 @@ Future test() async => _logProcessOutput(Process.start('flutter', ['test'])); @Task() -Future clean() => - _logProcessOutput(Process.start('flutter', ['clean'])); +Future clean() => _logProcessOutput(Process.start('flutter', ['clean'])); Future _logProcessOutput(Future proc) async { final process = await proc; diff --git a/desktop_photo_search/material/lib/src/model/search.g.dart b/desktop_photo_search/material/lib/src/model/search.g.dart index 1cec6f231..578c88f1b 100644 --- a/desktop_photo_search/material/lib/src/model/search.g.dart +++ b/desktop_photo_search/material/lib/src/model/search.g.dart @@ -106,9 +106,7 @@ class _$Search extends Search { @override bool operator ==(Object other) { if (identical(other, this)) return true; - return other is Search && - query == other.query && - results == other.results; + return other is Search && query == other.query && results == other.results; } @override diff --git a/desktop_photo_search/material/lib/src/unsplash/current_user_collections.dart b/desktop_photo_search/material/lib/src/unsplash/current_user_collections.dart index d9d88e67b..610ae215d 100644 --- a/desktop_photo_search/material/lib/src/unsplash/current_user_collections.dart +++ b/desktop_photo_search/material/lib/src/unsplash/current_user_collections.dart @@ -12,8 +12,7 @@ import '../serializers.dart'; part 'current_user_collections.g.dart'; abstract class CurrentUserCollections - implements - Built { + implements Built { factory CurrentUserCollections([ void Function(CurrentUserCollectionsBuilder)? updates, ]) = _$CurrentUserCollections; diff --git a/desktop_photo_search/material/lib/src/unsplash/current_user_collections.g.dart b/desktop_photo_search/material/lib/src/unsplash/current_user_collections.g.dart index 914869ea5..f37c6c9eb 100644 --- a/desktop_photo_search/material/lib/src/unsplash/current_user_collections.g.dart +++ b/desktop_photo_search/material/lib/src/unsplash/current_user_collections.g.dart @@ -192,8 +192,7 @@ class _$CurrentUserCollections extends CurrentUserCollections { } class CurrentUserCollectionsBuilder - implements - Builder { + implements Builder { _$CurrentUserCollections? _$v; int? _id; @@ -206,8 +205,7 @@ class CurrentUserCollectionsBuilder String? _publishedAt; String? get publishedAt => _$this._publishedAt; - set publishedAt(String? publishedAt) => - _$this._publishedAt = publishedAt; + set publishedAt(String? publishedAt) => _$this._publishedAt = publishedAt; String? _updatedAt; String? get updatedAt => _$this._updatedAt; diff --git a/desktop_photo_search/material/lib/src/unsplash/exif.g.dart b/desktop_photo_search/material/lib/src/unsplash/exif.g.dart index 9f4de4e6a..1896c86fe 100644 --- a/desktop_photo_search/material/lib/src/unsplash/exif.g.dart +++ b/desktop_photo_search/material/lib/src/unsplash/exif.g.dart @@ -254,8 +254,7 @@ class ExifBuilder implements Builder { String? _focalLength; String? get focalLength => _$this._focalLength; - set focalLength(String? focalLength) => - _$this._focalLength = focalLength; + set focalLength(String? focalLength) => _$this._focalLength = focalLength; int? _iso; int? get iso => _$this._iso; diff --git a/desktop_photo_search/material/lib/src/unsplash/location.g.dart b/desktop_photo_search/material/lib/src/unsplash/location.g.dart index 497c3ccc3..7fe7b1ca9 100644 --- a/desktop_photo_search/material/lib/src/unsplash/location.g.dart +++ b/desktop_photo_search/material/lib/src/unsplash/location.g.dart @@ -169,8 +169,7 @@ class LocationBuilder implements Builder { set country(String? country) => _$this._country = country; PositionBuilder? _position; - PositionBuilder get position => - _$this._position ??= new PositionBuilder(); + PositionBuilder get position => _$this._position ??= new PositionBuilder(); set position(PositionBuilder? position) => _$this._position = position; LocationBuilder(); diff --git a/desktop_photo_search/material/lib/src/unsplash/photo.g.dart b/desktop_photo_search/material/lib/src/unsplash/photo.g.dart index 871f69ec7..c032a759c 100644 --- a/desktop_photo_search/material/lib/src/unsplash/photo.g.dart +++ b/desktop_photo_search/material/lib/src/unsplash/photo.g.dart @@ -551,16 +551,14 @@ class PhotoBuilder implements Builder { String? _description; String? get description => _$this._description; - set description(String? description) => - _$this._description = description; + set description(String? description) => _$this._description = description; ExifBuilder? _exif; ExifBuilder get exif => _$this._exif ??= new ExifBuilder(); set exif(ExifBuilder? exif) => _$this._exif = exif; LocationBuilder? _location; - LocationBuilder get location => - _$this._location ??= new LocationBuilder(); + LocationBuilder get location => _$this._location ??= new LocationBuilder(); set location(LocationBuilder? location) => _$this._location = location; ListBuilder? _tags; diff --git a/desktop_photo_search/material/lib/src/unsplash/position.g.dart b/desktop_photo_search/material/lib/src/unsplash/position.g.dart index 6d48bb844..c8619d5c6 100644 --- a/desktop_photo_search/material/lib/src/unsplash/position.g.dart +++ b/desktop_photo_search/material/lib/src/unsplash/position.g.dart @@ -86,8 +86,7 @@ class _$Position extends Position { factory _$Position([void Function(PositionBuilder)? updates]) => (new PositionBuilder()..update(updates))._build(); - _$Position._({required this.latitude, required this.longitude}) - : super._() { + _$Position._({required this.latitude, required this.longitude}) : super._() { BuiltValueNullFieldError.checkNotNull( latitude, r'Position', diff --git a/desktop_photo_search/material/lib/src/widgets/split.dart b/desktop_photo_search/material/lib/src/widgets/split.dart index afd378a88..a4890e3de 100644 --- a/desktop_photo_search/material/lib/src/widgets/split.dart +++ b/desktop_photo_search/material/lib/src/widgets/split.dart @@ -115,9 +115,7 @@ class _SplitState extends State { secondSize = secondSize - halfDivider; void updateSpacing(DragUpdateDetails dragDetails) { - final delta = isHorizontal - ? dragDetails.delta.dx - : dragDetails.delta.dy; + final delta = isHorizontal ? dragDetails.delta.dx : dragDetails.delta.dy; final fractionalDelta = delta / axisSize; setState(() { // Update the fraction of space consumed by the children, @@ -151,12 +149,8 @@ class _SplitState extends State { ), ), child: SizedBox( - height: isHorizontal - ? 2.0 - : Split.dividerMainAxisSize - 2.0, - width: isHorizontal - ? Split.dividerMainAxisSize - 2.0 - : 2.0, + height: isHorizontal ? 2.0 : Split.dividerMainAxisSize - 2.0, + width: isHorizontal ? Split.dividerMainAxisSize - 2.0 : 2.0, ), ), ), diff --git a/desktop_photo_search/material/lib/src/widgets/unsplash_search_content.dart b/desktop_photo_search/material/lib/src/widgets/unsplash_search_content.dart index c4c198c49..93e181462 100644 --- a/desktop_photo_search/material/lib/src/widgets/unsplash_search_content.dart +++ b/desktop_photo_search/material/lib/src/widgets/unsplash_search_content.dart @@ -16,8 +16,7 @@ class UnsplashSearchContent extends StatefulWidget { const UnsplashSearchContent({super.key}); @override - State createState() => - _UnsplashSearchContentState(); + State createState() => _UnsplashSearchContentState(); } class _UnsplashSearchContentState extends State { @@ -41,9 +40,7 @@ class _UnsplashSearchContentState extends State { child: SingleChildScrollView( controller: _treeViewScrollController, child: TreeView( - nodes: photoSearchModel.entries - .map(_buildSearchEntry) - .toList(), + nodes: photoSearchModel.entries.map(_buildSearchEntry).toList(), indent: 0, ), ), diff --git a/desktop_photo_search/material/tool/grind.dart b/desktop_photo_search/material/tool/grind.dart index 2028b84b5..4bd6473af 100644 --- a/desktop_photo_search/material/tool/grind.dart +++ b/desktop_photo_search/material/tool/grind.dart @@ -44,8 +44,7 @@ Future test() async => _logProcessOutput(Process.start('flutter', ['test'])); @Task() -Future clean() => - _logProcessOutput(Process.start('flutter', ['clean'])); +Future clean() => _logProcessOutput(Process.start('flutter', ['clean'])); Future _logProcessOutput(Future proc) async { final process = await proc; diff --git a/form_app/lib/src/form_widgets.dart b/form_app/lib/src/form_widgets.dart index 89c00473c..b527eb40d 100644 --- a/form_app/lib/src/form_widgets.dart +++ b/form_app/lib/src/form_widgets.dart @@ -131,8 +131,7 @@ class _FormWidgetsDemoState extends State { ], ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Text( diff --git a/form_app/lib/src/sign_in_http.g.dart b/form_app/lib/src/sign_in_http.g.dart index 160681371..6b70755fe 100644 --- a/form_app/lib/src/sign_in_http.g.dart +++ b/form_app/lib/src/sign_in_http.g.dart @@ -13,8 +13,7 @@ FormData _$FormDataFromJson(Map json) { ); } -Map _$FormDataToJson(FormData instance) => - { - 'email': instance.email, - 'password': instance.password, - }; +Map _$FormDataToJson(FormData instance) => { + 'email': instance.email, + 'password': instance.password, +}; diff --git a/google_maps/lib/src/locations.dart b/google_maps/lib/src/locations.dart index 69164b5ee..cdc4a01ac 100644 --- a/google_maps/lib/src/locations.dart +++ b/google_maps/lib/src/locations.dart @@ -27,8 +27,7 @@ part 'locations.g.dart'; class LatLng { LatLng({required this.lat, required this.lng}); - factory LatLng.fromJson(Map json) => - _$LatLngFromJson(json); + factory LatLng.fromJson(Map json) => _$LatLngFromJson(json); Map toJson() => _$LatLngToJson(this); final double lat; @@ -44,8 +43,7 @@ class Region { required this.zoom, }); - factory Region.fromJson(Map json) => - _$RegionFromJson(json); + factory Region.fromJson(Map json) => _$RegionFromJson(json); Map toJson() => _$RegionToJson(this); final LatLng coords; @@ -67,8 +65,7 @@ class Office { required this.region, }); - factory Office.fromJson(Map json) => - _$OfficeFromJson(json); + factory Office.fromJson(Map json) => _$OfficeFromJson(json); Map toJson() => _$OfficeToJson(this); final String address; @@ -94,8 +91,7 @@ class Locations { } Future getGoogleOffices() async { - const googleLocationsURL = - 'https://about.google/static/data/locations.json'; + const googleLocationsURL = 'https://about.google/static/data/locations.json'; // Retrieve the locations of Google offices try { diff --git a/isolate_example/lib/performance_page.dart b/isolate_example/lib/performance_page.dart index 067248efb..6fa1c3ab5 100644 --- a/isolate_example/lib/performance_page.dart +++ b/isolate_example/lib/performance_page.dart @@ -72,10 +72,9 @@ class _PerformancePageState extends State { return ElevatedButton( style: ElevatedButton.styleFrom(elevation: 8.0), onPressed: switch (snapshot.connectionState) { - ConnectionState.done => - () => handleComputeOnSecondary( - context, - ), + ConnectionState.done => () => handleComputeOnSecondary( + context, + ), _ => null, }, child: const Text('Compute on Secondary'), @@ -136,8 +135,7 @@ class SmoothAnimationWidget extends StatefulWidget { const SmoothAnimationWidget({super.key}); @override - State createState() => - _SmoothAnimationWidgetState(); + State createState() => _SmoothAnimationWidgetState(); } class _SmoothAnimationWidgetState extends State diff --git a/material_3_demo/lib/main.dart b/material_3_demo/lib/main.dart index 1b208aefd..07c5b86c5 100644 --- a/material_3_demo/lib/main.dart +++ b/material_3_demo/lib/main.dart @@ -24,8 +24,7 @@ class _AppState extends State { ColorSeed _colorSelected = ColorSeed.baseColor; ColorImageProvider _imageSelected = ColorImageProvider.leaves; ColorScheme? _imageColorScheme = const ColorScheme.light(); - ColorSelectionMethod _colorSelectionMethod = - ColorSelectionMethod.colorSeed; + ColorSelectionMethod _colorSelectionMethod = ColorSelectionMethod.colorSeed; bool get _useLightMode => switch (_themeMode) { ThemeMode.system => diff --git a/material_3_demo/lib/src/buttons.dart b/material_3_demo/lib/src/buttons.dart index d4546bb96..7ec515397 100644 --- a/material_3_demo/lib/src/buttons.dart +++ b/material_3_demo/lib/src/buttons.dart @@ -93,8 +93,7 @@ class ColorSeedButton extends StatelessWidget { padding: const EdgeInsets.only(left: 10), child: Icon( currentColor == colorSelected && - colorSelectionMethod != - ColorSelectionMethod.image + colorSelectionMethod != ColorSelectionMethod.image ? Icons.color_lens : Icons.color_lens_outlined, color: currentColor.color, diff --git a/material_3_demo/lib/src/component_screen.dart b/material_3_demo/lib/src/component_screen.dart index 09fe894d7..78f0b7772 100644 --- a/material_3_demo/lib/src/component_screen.dart +++ b/material_3_demo/lib/src/component_screen.dart @@ -593,8 +593,7 @@ class TextFields extends StatefulWidget { class _TextFieldsState extends State { final TextEditingController _controllerFilled = TextEditingController(); - final TextEditingController _controllerOutlined = - TextEditingController(); + final TextEditingController _controllerOutlined = TextEditingController(); @override Widget build(BuildContext context) { @@ -1938,8 +1937,7 @@ class NavigationDrawerSection extends StatefulWidget { _NavigationDrawerSectionState(); } -class _NavigationDrawerSectionState - extends State { +class _NavigationDrawerSectionState extends State { int navDrawerIndex = 0; @override @@ -2054,8 +2052,7 @@ class NavigationRailSection extends StatefulWidget { const NavigationRailSection({super.key}); @override - State createState() => - _NavigationRailSectionState(); + State createState() => _NavigationRailSectionState(); } class _NavigationRailSectionState extends State { diff --git a/material_3_demo/lib/src/home.dart b/material_3_demo/lib/src/home.dart index 40ac7e846..8b2cadfe3 100644 --- a/material_3_demo/lib/src/home.dart +++ b/material_3_demo/lib/src/home.dart @@ -222,8 +222,7 @@ class _HomeState extends State with SingleTickerProviderStateMixin { child: showLargeSizeLayout ? ExpandedTrailingActions( useLightMode: widget.useLightMode, - handleBrightnessChange: - widget.handleBrightnessChange, + handleBrightnessChange: widget.handleBrightnessChange, useMaterial3: widget.useMaterial3, handleMaterialVersionChange: widget.handleMaterialVersionChange, @@ -253,19 +252,18 @@ class _HomeState extends State with SingleTickerProviderStateMixin { } } -final List _navRailDestinations = - appBarDestinations - .map( - (destination) => NavigationRailDestination( - icon: Tooltip( - message: destination.label, - child: destination.icon, - ), - selectedIcon: Tooltip( - message: destination.label, - child: destination.selectedIcon, - ), - label: Text(destination.label), - ), - ) - .toList(growable: false); +final List _navRailDestinations = appBarDestinations + .map( + (destination) => NavigationRailDestination( + icon: Tooltip( + message: destination.label, + child: destination.icon, + ), + selectedIcon: Tooltip( + message: destination.label, + child: destination.selectedIcon, + ), + label: Text(destination.label), + ), + ) + .toList(growable: false); diff --git a/material_3_demo/lib/src/navigation_transition.dart b/material_3_demo/lib/src/navigation_transition.dart index ebff0fd40..2159a60c5 100644 --- a/material_3_demo/lib/src/navigation_transition.dart +++ b/material_3_demo/lib/src/navigation_transition.dart @@ -29,8 +29,7 @@ class NavigationTransition extends StatefulWidget { final Widget body; @override - State createState() => - _NavigationTransitionState(); + State createState() => _NavigationTransitionState(); } class _NavigationTransitionState extends State { diff --git a/tool/ci_script.dart b/tool/ci_script.dart index c87730eff..eb912cbd2 100644 --- a/tool/ci_script.dart +++ b/tool/ci_script.dart @@ -8,14 +8,15 @@ Future main() async { final pubspecContent = await pubspecFile.readAsString(); final pubspecYaml = loadYaml(pubspecContent); - // pub workspace, only run 'get' once final workspace = pubspecYaml['workspace'] as YamlList?; - await _runCommand('flutter', ['pub', 'get']); if (workspace == null) { print('No workspace found in pubspec.yaml'); exit(1); } + // pub workspace, only run 'get' once + await _runCommand('flutter', ['pub', 'get'], workingDirectory: './'); + final packages = workspace.map((e) => e.toString()).toList(); for (final package in packages) { @@ -26,18 +27,17 @@ Future main() async { '--fatal-infos', '--fatal-warnings', ], workingDirectory: packagePath); - await _runCommand('dart', [ - 'format', - '--output', - 'none', - '.', - ], workingDirectory: packagePath); + + await _runCommand('dart', ['format', '.'], workingDirectory: packagePath); if (await Directory(path.join(packagePath, 'test')).exists()) { final packagePubspecFile = File(path.join(packagePath, 'pubspec.yaml')); final packagePubspecContent = await packagePubspecFile.readAsString(); if (packagePubspecContent.contains('flutter:')) { - await _runCommand('flutter', ['test'], workingDirectory: packagePath); + await _runCommand('flutter', [ + 'test', + '--no-pub', + ], workingDirectory: packagePath); } else { await _runCommand('dart', ['test'], workingDirectory: packagePath); }