From a94af64678e9c8fd645d2af1d2ba664b907ef6b1 Mon Sep 17 00:00:00 2001 From: Eric Windmill Date: Thu, 31 Jul 2025 13:22:49 -0400 Subject: [PATCH] gemini ran ci --- .gemini/RELEASE.md | 0 .github/workflows/beta.yml | 26 +-- .github/workflows/main.yml | 28 +-- .../flutter_module_using_plugin/lib/cell.dart | 22 +-- .../flutter_module_using_plugin/pubspec.yaml | 6 +- .../books/flutter_module_books/lib/main.dart | 36 ++-- .../books/flutter_module_books/pubspec.yaml | 2 +- .../test/widget_test.dart | 4 +- .../fullscreen/flutter_module/pubspec.yaml | 2 +- .../multiple_flutters_module/pubspec.yaml | 2 +- .../flutter_module_using_plugin/lib/cell.dart | 18 +- .../flutter_module_using_plugin/pubspec.yaml | 2 +- .../flutter_module/pubspec.yaml | 2 +- analysis_defaults/pubspec.yaml | 2 +- android_splash_screen/pubspec.yaml | 2 +- .../lib/src/basics/fade_transition.dart | 15 +- .../lib/src/misc/animated_positioned.dart | 15 +- .../lib/src/misc/animated_switcher.dart | 9 +- animations/lib/src/misc/carousel.dart | 45 +++-- animations/lib/src/misc/curved_animation.dart | 26 ++- animations/lib/src/misc/expand_card.dart | 32 ++-- animations/lib/src/misc/flutter_animate.dart | 29 +-- animations/lib/src/misc/focus_image.dart | 4 +- animations/lib/src/misc/hero_animation.dart | 7 +- .../lib/src/misc/physics_card_drag.dart | 23 +-- animations/pubspec.yaml | 2 +- .../grayscale_transformer/pubspec.yaml | 2 +- asset_transformation/pubspec.yaml | 2 +- background_isolate_channels/lib/main.dart | 9 +- background_isolate_channels/pubspec.yaml | 2 +- code_sharing/client/pubspec.yaml | 2 +- code_sharing/server/bin/server.dart | 7 +- code_sharing/server/pubspec.yaml | 2 +- .../shared/lib/src/models.freezed.dart | 29 ++- code_sharing/shared/pubspec.yaml | 2 +- compass_app/app/lib/config/dependencies.dart | 94 ++++----- .../activity/activity_repository_local.dart | 7 +- .../booking/booking_repository_local.dart | 9 +- .../booking/booking_repository_remote.dart | 12 +- .../app/lib/data/services/api/api_client.dart | 10 +- .../booking/booking_api_model.freezed.dart | 108 +++++------ .../model/booking/booking_api_model.g.dart | 5 +- .../login_request/login_request.freezed.dart | 36 ++-- .../login_response.freezed.dart | 36 ++-- .../model/user/user_api_model.freezed.dart | 72 ++++--- .../models/activity/activity.freezed.dart | 180 ++++++++---------- .../models/booking/booking.freezed.dart | 90 ++++----- .../lib/domain/models/booking/booking.g.dart | 7 +- .../booking/booking_summary.freezed.dart | 72 ++++--- .../models/continent/continent.freezed.dart | 36 ++-- .../destination/destination.freezed.dart | 126 ++++++------ .../itinerary_config.freezed.dart | 108 +++++------ .../itinerary_config/itinerary_config.g.dart | 14 +- .../lib/domain/models/user/user.freezed.dart | 36 ++-- .../booking/booking_create_use_case.dart | 9 +- .../view_models/activities_viewmodel.dart | 38 ++-- .../activities/widgets/activities_screen.dart | 14 +- .../ui/auth/login/widgets/login_screen.dart | 9 +- .../view_models/booking_viewmodel.dart | 4 +- .../ui/booking/widgets/booking_header.dart | 23 ++- .../ui/booking/widgets/booking_screen.dart | 22 +-- .../app/lib/ui/core/themes/dimens.dart | 11 +- .../app/lib/ui/core/ui/custom_checkbox.dart | 7 +- .../app/lib/ui/home/widgets/home_screen.dart | 46 +++-- .../app/lib/ui/home/widgets/home_title.dart | 11 +- .../view_models/results_viewmodel.dart | 13 +- .../lib/ui/results/widgets/result_card.dart | 5 +- .../ui/results/widgets/results_screen.dart | 7 +- .../widgets/search_form_guests.dart | 14 +- .../widgets/search_form_submit.dart | 7 +- compass_app/app/pubspec.yaml | 2 +- compass_app/server/bin/compass_server.dart | 13 +- .../lib/model/activity/activity.freezed.dart | 180 ++++++++---------- .../lib/model/booking/booking.freezed.dart | 108 +++++------ .../server/lib/model/booking/booking.g.dart | 7 +- .../model/continent/continent.freezed.dart | 36 ++-- .../destination/destination.freezed.dart | 126 ++++++------ .../login_request/login_request.freezed.dart | 36 ++-- .../login_response.freezed.dart | 36 ++-- .../server/lib/model/user/user.freezed.dart | 72 ++++--- compass_app/server/lib/routes/booking.dart | 19 +- .../server/lib/routes/destination.dart | 7 +- compass_app/server/pubspec.yaml | 2 +- context_menus/lib/cascading_menu_page.dart | 15 +- context_menus/lib/custom_buttons_page.dart | 39 ++-- context_menus/lib/custom_menu_page.dart | 9 +- context_menus/lib/email_button_page.dart | 5 +- context_menus/lib/field_types_page.dart | 9 +- context_menus/lib/full_page.dart | 37 ++-- context_menus/lib/image_page.dart | 6 +- context_menus/lib/main.dart | 54 +++--- context_menus/lib/modified_action_page.dart | 7 +- context_menus/lib/platform_selector.dart | 25 ++- context_menus/pubspec.yaml | 2 +- date_planner/pubspec.yaml | 2 +- .../lib/product_category_list.dart | 7 +- deeplink_store_example/lib/product_list.dart | 7 +- deeplink_store_example/pubspec.yaml | 2 +- desktop_photo_search/fluent_ui/lib/main.dart | 20 +- .../lib/src/unsplash/api_error.g.dart | 5 +- .../fluent_ui/lib/src/unsplash/tags.g.dart | 5 +- .../lib/src/widgets/photo_details.dart | 18 +- .../lib/src/widgets/photo_search_dialog.dart | 13 +- .../lib/src/widgets/policy_dialog.dart | 34 ++-- .../lib/src/widgets/unsplash_notice.dart | 31 +-- .../src/widgets/unsplash_search_content.dart | 88 +++++---- desktop_photo_search/fluent_ui/pubspec.yaml | 2 +- desktop_photo_search/material/lib/main.dart | 32 ++-- .../lib/src/unsplash/api_error.g.dart | 5 +- .../material/lib/src/unsplash/tags.g.dart | 5 +- .../lib/src/widgets/photo_details.dart | 16 +- .../lib/src/widgets/photo_search_dialog.dart | 13 +- .../lib/src/widgets/policy_dialog.dart | 34 ++-- .../lib/src/widgets/unsplash_notice.dart | 31 +-- .../src/widgets/unsplash_search_content.dart | 90 +++++---- desktop_photo_search/material/pubspec.yaml | 2 +- dynamic_theme/lib/main.dart | 43 ++--- dynamic_theme/lib/widgets/api_key_widget.dart | 9 +- dynamic_theme/lib/widgets/message_widget.dart | 12 +- dynamic_theme/pubspec.yaml | 2 +- flutter_maps_firestore/lib/main.dart | 55 +++--- flutter_maps_firestore/pubspec.yaml | 2 +- form_app/lib/main.dart | 9 +- form_app/lib/src/sign_in_http.dart | 17 +- form_app/lib/src/validation.dart | 32 ++-- form_app/pubspec.yaml | 2 +- game_template/lib/main.dart | 28 ++- game_template/lib/src/ads/ads_controller.dart | 9 +- .../lib/src/ads/banner_ad_widget.dart | 7 +- .../src/play_session/play_session_screen.dart | 24 +-- .../lib/src/settings/custom_name_dialog.dart | 5 +- .../lib/src/settings/settings_screen.dart | 37 ++-- game_template/lib/src/style/confetti.dart | 20 +- game_template/pubspec.yaml | 2 +- gemini_tasks/lib/main.dart | 55 +++--- gemini_tasks/lib/widgets/api_key_widget.dart | 9 +- gemini_tasks/lib/widgets/message_widget.dart | 12 +- gemini_tasks/pubspec.yaml | 2 +- google_maps/lib/src/locations.g.dart | 14 +- google_maps/pubspec.yaml | 2 +- infinite_list/lib/main.dart | 37 ++-- infinite_list/pubspec.yaml | 2 +- ios_app_clip/pubspec.yaml | 2 +- isolate_example/pubspec.yaml | 2 +- llm_prompt.md | 54 ++++++ material_3_demo/pubspec.yaml | 2 +- navigation_and_routing/lib/src/auth.dart | 7 +- .../lib/src/data/library.dart | 51 +++-- .../lib/src/screens/book_details.dart | 24 +-- .../lib/src/screens/settings.dart | 45 ++--- .../lib/src/widgets/author_list.dart | 11 +- .../lib/src/widgets/book_list.dart | 11 +- navigation_and_routing/pubspec.yaml | 2 +- pedometer/example/lib/main.dart | 39 ++-- pedometer/example/lib/steps_repo.dart | 34 ++-- pedometer/example/pubspec.yaml | 2 +- pedometer/pubspec.yaml | 4 +- place_tracker/lib/place_details.dart | 28 ++- place_tracker/lib/place_list.dart | 29 ++- place_tracker/lib/place_map.dart | 22 ++- place_tracker/pubspec.yaml | 2 +- platform_channels/pubspec.yaml | 2 +- platform_design/pubspec.yaml | 2 +- platform_view_swift/pubspec.yaml | 2 +- provider_counter/lib/main.dart | 9 +- provider_counter/pubspec.yaml | 2 +- provider_shopper/lib/screens/cart.dart | 26 ++- provider_shopper/lib/screens/catalog.dart | 28 ++- provider_shopper/pubspec.yaml | 2 +- simple_shader/pubspec.yaml | 2 +- simplistic_calculator/lib/main.dart | 44 ++--- simplistic_calculator/pubspec.yaml | 2 +- simplistic_editor/pubspec.yaml | 2 +- .../integration_test/state_mgmt_test.dart | 12 +- testing_app/pubspec.yaml | 2 +- testing_app/test/favorites_test.dart | 12 +- testing_app/test/home_test.dart | 6 +- tool/flutter_ci_script_stable.sh | 45 ----- veggieseasons/lib/data/app_state.dart | 7 +- veggieseasons/lib/screens/details.dart | 7 +- veggieseasons/lib/screens/favorites.dart | 37 ++-- veggieseasons/lib/screens/settings.dart | 54 +++--- veggieseasons/lib/styles.dart | 16 +- veggieseasons/lib/widgets/detail_buttons.dart | 7 +- veggieseasons/lib/widgets/veggie_card.dart | 5 +- veggieseasons/pubspec.yaml | 2 +- .../element_embedding_demo/pubspec.yaml | 2 +- web_embedding/ng-flutter/flutter/pubspec.yaml | 2 +- 188 files changed, 1955 insertions(+), 2233 deletions(-) create mode 100644 .gemini/RELEASE.md create mode 100644 llm_prompt.md diff --git a/.gemini/RELEASE.md b/.gemini/RELEASE.md new file mode 100644 index 000000000..e69de29bb diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 9f74ca87b..9528fd676 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -38,19 +38,19 @@ jobs: # Verify the Android add-to-app samples build and pass tests with the beta # channel. - # android-build: - # runs-on: ubuntu-latest - # if: github.repository == 'flutter/samples' - # steps: - # - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - # - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 - # with: - # distribution: 'zulu' - # java-version: '17' - # - uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 - # with: - # channel: beta - # - run: ./tool/android_ci_script.sh + android-build: + runs-on: ubuntu-latest + if: github.repository == 'flutter/samples' + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 + with: + distribution: 'zulu' + java-version: '17' + - uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 + with: + channel: beta + - run: ./tool/android_ci_script.sh # Verify the iOS add-to-app samples build and pass tests with the beta # channel. diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index df7dead6c..e3699bb41 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,7 +24,7 @@ jobs: strategy: fail-fast: false matrix: - flutter_version: [stable, beta, master] + flutter_version: [stable] os: [ubuntu-latest, macos-latest, windows-latest] steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 @@ -37,19 +37,19 @@ jobs: channel: ${{ matrix.flutter_version }} - run: ./tool/flutter_ci_script_${{ matrix.flutter_version }}.sh - # android-build: - # runs-on: ubuntu-latest - # if: github.repository == 'flutter/samples' - # steps: - # - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - # - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 - # with: - # distribution: 'zulu' - # java-version: '17' - # - uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 - # with: - # channel: stable - # - run: ./tool/android_ci_script.sh + android-build: + runs-on: ubuntu-latest + if: github.repository == 'flutter/samples' + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 + with: + distribution: 'zulu' + java-version: '17' + - uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 + with: + channel: stable + - run: ./tool/android_ci_script.sh ios-build: runs-on: macos-latest diff --git a/add_to_app/android_view/flutter_module_using_plugin/lib/cell.dart b/add_to_app/android_view/flutter_module_using_plugin/lib/cell.dart index 13eb90075..ece14e22f 100644 --- a/add_to_app/android_view/flutter_module_using_plugin/lib/cell.dart +++ b/add_to_app/android_view/flutter_module_using_plugin/lib/cell.dart @@ -112,22 +112,22 @@ class _CellState extends State with WidgetsBindingObserver { child: StreamBuilder( // Don't continuously rebuild for nothing when the // cell isn't visible. - stream: - appLifecycleState == AppLifecycleState.resumed - ? accelerometerEventStream() - : Stream.value(defaultPosition), + stream: appLifecycleState == AppLifecycleState.resumed + ? accelerometerEventStream() + : Stream.value(defaultPosition), initialData: defaultPosition, builder: (context, snapshot) { return Transform( // Figure out the phone's orientation relative // to gravity's direction. Ignore the z vector. - transform: Matrix4.rotationX( - snapshot.data!.y / gravity * pi / 2, - )..multiply( - Matrix4.rotationY( - snapshot.data!.x / gravity * pi / 2, - ), - ), + transform: + Matrix4.rotationX( + snapshot.data!.y / gravity * pi / 2, + )..multiply( + Matrix4.rotationY( + snapshot.data!.x / gravity * pi / 2, + ), + ), alignment: Alignment.center, child: const FlutterLogo(size: 72), ); diff --git a/add_to_app/android_view/flutter_module_using_plugin/pubspec.yaml b/add_to_app/android_view/flutter_module_using_plugin/pubspec.yaml index 645caccaf..b851f5b6d 100644 --- a/add_to_app/android_view/flutter_module_using_plugin/pubspec.yaml +++ b/add_to_app/android_view/flutter_module_using_plugin/pubspec.yaml @@ -4,13 +4,13 @@ description: An example Flutter module that uses a plugin. version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: sdk: flutter - provider: ^6.0.2 - url_launcher: ^6.0.20 + provider: ^6.1.5 + url_launcher: ^6.3.2 sensors_plus: ^5.0.1 dev_dependencies: diff --git a/add_to_app/books/flutter_module_books/lib/main.dart b/add_to_app/books/flutter_module_books/lib/main.dart index dfa0c8729..3ef7fa7b5 100644 --- a/add_to_app/books/flutter_module_books/lib/main.dart +++ b/add_to_app/books/flutter_module_books/lib/main.dart @@ -125,28 +125,26 @@ class _BookDetailState extends State { IconButton( icon: const Icon(Icons.check), // Pressing save sends the updated book to the platform. - onPressed: - book != null - ? () { - hostApi.finishEditingBook(book!); - clear(); - } - : null, + onPressed: book != null + ? () { + hostApi.finishEditingBook(book!); + clear(); + } + : null, ), ], ), - body: - book == null - // Draw a spinner until the platform gives us the book to show details - // for. - ? const Center(child: CircularProgressIndicator()) - : BookForm( - book: book!, - focusNode: textFocusNode, - authorTextController: authorTextController, - subtitleTextController: subtitleTextController, - titleTextController: titleTextController, - ), + body: book == null + // Draw a spinner until the platform gives us the book to show details + // for. + ? const Center(child: CircularProgressIndicator()) + : BookForm( + book: book!, + focusNode: textFocusNode, + authorTextController: authorTextController, + subtitleTextController: subtitleTextController, + titleTextController: titleTextController, + ), ); } } diff --git a/add_to_app/books/flutter_module_books/pubspec.yaml b/add_to_app/books/flutter_module_books/pubspec.yaml index a04ec8a54..13acb9a51 100644 --- a/add_to_app/books/flutter_module_books/pubspec.yaml +++ b/add_to_app/books/flutter_module_books/pubspec.yaml @@ -6,7 +6,7 @@ description: A Flutter module using the Pigeon package to demonstrate version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/add_to_app/books/flutter_module_books/test/widget_test.dart b/add_to_app/books/flutter_module_books/test/widget_test.dart index 11b8d3c1f..26c99317f 100644 --- a/add_to_app/books/flutter_module_books/test/widget_test.dart +++ b/add_to_app/books/flutter_module_books/test/widget_test.dart @@ -24,7 +24,9 @@ void main() { MockHostBookApi mockHostApi = MockHostBookApi(); await tester.pumpWidget( - MaterialApp(home: BookDetail(book: Book(), hostApi: mockHostApi)), + MaterialApp( + home: BookDetail(book: Book(), hostApi: mockHostApi), + ), ); await tester.tap(find.byIcon(Icons.check)); diff --git a/add_to_app/fullscreen/flutter_module/pubspec.yaml b/add_to_app/fullscreen/flutter_module/pubspec.yaml index 2c00a2cb1..50a9769c5 100644 --- a/add_to_app/fullscreen/flutter_module/pubspec.yaml +++ b/add_to_app/fullscreen/flutter_module/pubspec.yaml @@ -4,7 +4,7 @@ description: An example Flutter module. version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/add_to_app/multiple_flutters/multiple_flutters_module/pubspec.yaml b/add_to_app/multiple_flutters/multiple_flutters_module/pubspec.yaml index baa095646..23da54cba 100644 --- a/add_to_app/multiple_flutters/multiple_flutters_module/pubspec.yaml +++ b/add_to_app/multiple_flutters/multiple_flutters_module/pubspec.yaml @@ -4,7 +4,7 @@ description: A module that is embedded in the multiple_flutters_ios and multiple version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/add_to_app/plugin/flutter_module_using_plugin/lib/cell.dart b/add_to_app/plugin/flutter_module_using_plugin/lib/cell.dart index b1fe42aff..c41f14166 100644 --- a/add_to_app/plugin/flutter_module_using_plugin/lib/cell.dart +++ b/add_to_app/plugin/flutter_module_using_plugin/lib/cell.dart @@ -112,10 +112,9 @@ class _CellState extends State with WidgetsBindingObserver { child: StreamBuilder( // Don't continuously rebuild for nothing when the // cell isn't visible. - stream: - appLifecycleState == AppLifecycleState.resumed - ? accelerometerEventStream() - : Stream.value(defaultPosition), + stream: appLifecycleState == AppLifecycleState.resumed + ? accelerometerEventStream() + : Stream.value(defaultPosition), initialData: defaultPosition, builder: (context, snapshot) { final data = snapshot.data; @@ -125,11 +124,12 @@ class _CellState extends State with WidgetsBindingObserver { return Transform( // Figure out the phone's orientation relative // to gravity's direction. Ignore the z vector. - transform: Matrix4.rotationX( - data.y / gravity * pi / 2, - )..multiply( - Matrix4.rotationY(data.x / gravity * pi / 2), - ), + transform: + Matrix4.rotationX( + data.y / gravity * pi / 2, + )..multiply( + Matrix4.rotationY(data.x / gravity * pi / 2), + ), alignment: Alignment.center, child: const FlutterLogo(size: 72), ); diff --git a/add_to_app/plugin/flutter_module_using_plugin/pubspec.yaml b/add_to_app/plugin/flutter_module_using_plugin/pubspec.yaml index 645caccaf..76c39bccf 100644 --- a/add_to_app/plugin/flutter_module_using_plugin/pubspec.yaml +++ b/add_to_app/plugin/flutter_module_using_plugin/pubspec.yaml @@ -4,7 +4,7 @@ description: An example Flutter module that uses a plugin. version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/add_to_app/prebuilt_module/flutter_module/pubspec.yaml b/add_to_app/prebuilt_module/flutter_module/pubspec.yaml index 2c00a2cb1..50a9769c5 100644 --- a/add_to_app/prebuilt_module/flutter_module/pubspec.yaml +++ b/add_to_app/prebuilt_module/flutter_module/pubspec.yaml @@ -4,7 +4,7 @@ description: An example Flutter module. version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/analysis_defaults/pubspec.yaml b/analysis_defaults/pubspec.yaml index d6160ec45..7f0f526f2 100644 --- a/analysis_defaults/pubspec.yaml +++ b/analysis_defaults/pubspec.yaml @@ -3,7 +3,7 @@ description: Analysis defaults for flutter/samples publish_to: none environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' # NOTE: Code is not allowed in this package. Do not add more dependencies. # The `flutter_lints` dependency is required for `lib/flutter.yaml`. diff --git a/android_splash_screen/pubspec.yaml b/android_splash_screen/pubspec.yaml index 12f2bae4c..c711583b2 100644 --- a/android_splash_screen/pubspec.yaml +++ b/android_splash_screen/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: "none" version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/animations/lib/src/basics/fade_transition.dart b/animations/lib/src/basics/fade_transition.dart index 8496987b6..5c4229bf0 100644 --- a/animations/lib/src/basics/fade_transition.dart +++ b/animations/lib/src/basics/fade_transition.dart @@ -53,14 +53,13 @@ class _FadeTransitionDemoState extends State ), ElevatedButton( child: const Text('animate'), - onPressed: - () => setState(() { - _controller - .animateTo(1.0) - .then( - (value) => _controller.animateBack(0.0), - ); - }), + onPressed: () => setState(() { + _controller + .animateTo(1.0) + .then( + (value) => _controller.animateBack(0.0), + ); + }), ), ], ), diff --git a/animations/lib/src/misc/animated_positioned.dart b/animations/lib/src/misc/animated_positioned.dart index 4b661147f..8571ac534 100644 --- a/animations/lib/src/misc/animated_positioned.dart +++ b/animations/lib/src/misc/animated_positioned.dart @@ -54,12 +54,10 @@ class _AnimatedPositionedDemoState extends State { left: leftPosition, duration: const Duration(seconds: 1), child: InkWell( - onTap: - () => changePosition( - size.height - - (appBar.preferredSize.height + topPadding + 50), - size.width - 150, - ), + onTap: () => changePosition( + size.height - (appBar.preferredSize.height + topPadding + 50), + size.width - 150, + ), child: Container( alignment: Alignment.center, width: 150, @@ -68,8 +66,9 @@ class _AnimatedPositionedDemoState extends State { child: Text( 'Click Me', style: TextStyle( - color: - Theme.of(context).buttonTheme.colorScheme!.onPrimary, + color: Theme.of( + context, + ).buttonTheme.colorScheme!.onPrimary, ), ), ), diff --git a/animations/lib/src/misc/animated_switcher.dart b/animations/lib/src/misc/animated_switcher.dart index 5f017efb8..96427f8d1 100644 --- a/animations/lib/src/misc/animated_switcher.dart +++ b/animations/lib/src/misc/animated_switcher.dart @@ -48,8 +48,8 @@ class _AnimatedSwitcherDemoState extends State { title: const Text('AnimatedSwitcher'), actions: [ TextButton( - onPressed: - () => setState(() => container = generateContainer(++keyCount)), + onPressed: () => + setState(() => container = generateContainer(++keyCount)), child: const Text('Change Widget'), ), ], @@ -61,9 +61,8 @@ class _AnimatedSwitcherDemoState extends State { child: AnimatedSwitcher( duration: const Duration(seconds: 1), child: container, - transitionBuilder: - (child, animation) => - ScaleTransition(scale: animation, child: child), + transitionBuilder: (child, animation) => + ScaleTransition(scale: animation, child: child), ), ), ); diff --git a/animations/lib/src/misc/carousel.dart b/animations/lib/src/misc/carousel.dart index c2f2b2974..ff3e2631e 100644 --- a/animations/lib/src/misc/carousel.dart +++ b/animations/lib/src/misc/carousel.dart @@ -15,8 +15,9 @@ class CarouselDemo extends StatelessWidget { 'assets/eat_sydney_sm.jpg', ]; - final List images = - fileNames.map((file) => Image.asset(file, fit: BoxFit.cover)).toList(); + final List images = fileNames + .map((file) => Image.asset(file, fit: BoxFit.cover)) + .toList(); @override Widget build(context) { @@ -79,27 +80,25 @@ class _CarouselState extends State { scrollBehavior: ScrollConfiguration.of(context).copyWith( dragDevices: {ui.PointerDeviceKind.touch, ui.PointerDeviceKind.mouse}, ), - itemBuilder: - (context, index) => AnimatedBuilder( - animation: _controller, - builder: (context, child) { - var result = - _pageHasChanged ? _controller.page! : _currentPage * 1.0; - - // The horizontal position of the page between a 1 and 0 - var value = result - index; - value = (1 - (value.abs() * .5)).clamp(0.0, 1.0); - - return Center( - child: SizedBox( - height: Curves.easeOut.transform(value) * size.height, - width: Curves.easeOut.transform(value) * size.width, - child: child, - ), - ); - }, - child: widget.itemBuilder(context, index), - ), + itemBuilder: (context, index) => AnimatedBuilder( + animation: _controller, + builder: (context, child) { + var result = _pageHasChanged ? _controller.page! : _currentPage * 1.0; + + // The horizontal position of the page between a 1 and 0 + var value = result - index; + value = (1 - (value.abs() * .5)).clamp(0.0, 1.0); + + return Center( + child: SizedBox( + height: Curves.easeOut.transform(value) * size.height, + width: Curves.easeOut.transform(value) * size.width, + child: child, + ), + ); + }, + child: widget.itemBuilder(context, index), + ), ); } diff --git a/animations/lib/src/misc/curved_animation.dart b/animations/lib/src/misc/curved_animation.dart index 500d7d28c..e460653fd 100644 --- a/animations/lib/src/misc/curved_animation.dart +++ b/animations/lib/src/misc/curved_animation.dart @@ -91,13 +91,12 @@ class _CurvedAnimationDemoState extends State style: Theme.of(context).textTheme.titleLarge, ), DropdownButton( - items: - curves.map((curve) { - return DropdownMenuItem( - value: curve, - child: Text(curve.name), - ); - }).toList(), + items: curves.map((curve) { + return DropdownMenuItem( + value: curve, + child: Text(curve.name), + ); + }).toList(), onChanged: (newCurve) { if (newCurve != null) { setState(() { @@ -114,13 +113,12 @@ class _CurvedAnimationDemoState extends State style: Theme.of(context).textTheme.titleLarge, ), DropdownButton( - items: - curves.map((curve) { - return DropdownMenuItem( - value: curve, - child: Text(curve.name), - ); - }).toList(), + items: curves.map((curve) { + return DropdownMenuItem( + value: curve, + child: Text(curve.name), + ); + }).toList(), onChanged: (newCurve) { if (newCurve != null) { setState(() { diff --git a/animations/lib/src/misc/expand_card.dart b/animations/lib/src/misc/expand_card.dart index c47829d4c..d537d15b2 100644 --- a/animations/lib/src/misc/expand_card.dart +++ b/animations/lib/src/misc/expand_card.dart @@ -52,26 +52,24 @@ class _ExpandCardState extends State duration: duration, firstCurve: Curves.easeInOutCubic, secondCurve: Curves.easeInOutCubic, - crossFadeState: - selected - ? CrossFadeState.showSecond - : CrossFadeState.showFirst, + crossFadeState: selected + ? CrossFadeState.showSecond + : CrossFadeState.showFirst, // Use Positioned.fill() to pass the constraints to its children. // This allows the Images to use BoxFit.cover to cover the correct // size - layoutBuilder: ( - topChild, - topChildKey, - bottomChild, - bottomChildKey, - ) { - return Stack( - children: [ - Positioned.fill(key: bottomChildKey, child: bottomChild), - Positioned.fill(key: topChildKey, child: topChild), - ], - ); - }, + layoutBuilder: + (topChild, topChildKey, bottomChild, bottomChildKey) { + return Stack( + children: [ + Positioned.fill( + key: bottomChildKey, + child: bottomChild, + ), + Positioned.fill(key: topChildKey, child: topChild), + ], + ); + }, firstChild: Image.asset( 'assets/eat_cape_town_sm.jpg', fit: BoxFit.cover, diff --git a/animations/lib/src/misc/flutter_animate.dart b/animations/lib/src/misc/flutter_animate.dart index 88de877c6..c31dde47c 100644 --- a/animations/lib/src/misc/flutter_animate.dart +++ b/animations/lib/src/misc/flutter_animate.dart @@ -18,20 +18,21 @@ class FlutterAnimateDemo extends StatelessWidget { body: Center( child: Padding( padding: const EdgeInsets.all(16), - child: Text( - "Hello Flutter Animate", - style: Theme.of(context).textTheme.headlineLarge, - ) - .animate(onPlay: (controller) => controller.repeat()) - .then(delay: 250.ms) - .fadeIn(duration: 500.ms) - .then(delay: 250.ms) - .shimmer(duration: 400.ms) - .then(delay: 250.ms) - .slide() - .then(delay: 250.ms) - .blur(duration: 500.ms) - .then(delay: 100.ms), + child: + Text( + "Hello Flutter Animate", + style: Theme.of(context).textTheme.headlineLarge, + ) + .animate(onPlay: (controller) => controller.repeat()) + .then(delay: 250.ms) + .fadeIn(duration: 500.ms) + .then(delay: 250.ms) + .shimmer(duration: 400.ms) + .then(delay: 250.ms) + .slide() + .then(delay: 250.ms) + .blur(duration: 500.ms) + .then(delay: 100.ms), ), ), ); diff --git a/animations/lib/src/misc/focus_image.dart b/animations/lib/src/misc/focus_image.dart index 7031129cd..722de5404 100644 --- a/animations/lib/src/misc/focus_image.dart +++ b/animations/lib/src/misc/focus_image.dart @@ -31,8 +31,8 @@ class Grid extends StatelessWidget { return (index >= 20) ? const SmallCard(imageAssetName: 'assets/eat_cape_town_sm.jpg') : const SmallCard( - imageAssetName: 'assets/eat_new_orleans_sm.jpg', - ); + imageAssetName: 'assets/eat_new_orleans_sm.jpg', + ); }, ), ); diff --git a/animations/lib/src/misc/hero_animation.dart b/animations/lib/src/misc/hero_animation.dart index 08bc030b9..ff96e5b33 100644 --- a/animations/lib/src/misc/hero_animation.dart +++ b/animations/lib/src/misc/hero_animation.dart @@ -17,10 +17,9 @@ class HeroAnimationDemo extends StatelessWidget { tag: 'hero-page-child', child: _createHeroContainer(size: 50.0, color: Colors.grey.shade300), ), - onTap: - () => Navigator.of(context).push( - MaterialPageRoute(builder: (context) => const HeroPage()), - ), + onTap: () => Navigator.of( + context, + ).push(MaterialPageRoute(builder: (context) => const HeroPage())), ), ); } diff --git a/animations/lib/src/misc/physics_card_drag.dart b/animations/lib/src/misc/physics_card_drag.dart index 6249d20d3..7e30bc5d4 100644 --- a/animations/lib/src/misc/physics_card_drag.dart +++ b/animations/lib/src/misc/physics_card_drag.dart @@ -92,17 +92,18 @@ class _DraggableCardState extends State final size = MediaQuery.of(context).size; return GestureDetector( onPanStart: (details) => _controller.stop(canceled: true), - onPanUpdate: - (details) => setState( - () => - _dragAlignment += Alignment( - details.delta.dx / (size.width / 2), - details.delta.dy / (size.height / 2), - ), - ), - onPanEnd: - (details) => _runAnimation(details.velocity.pixelsPerSecond, size), - child: Align(alignment: _dragAlignment, child: Card(child: widget.child)), + onPanUpdate: (details) => setState( + () => _dragAlignment += Alignment( + details.delta.dx / (size.width / 2), + details.delta.dy / (size.height / 2), + ), + ), + onPanEnd: (details) => + _runAnimation(details.velocity.pixelsPerSecond, size), + child: Align( + alignment: _dragAlignment, + child: Card(child: widget.child), + ), ); } } diff --git a/animations/pubspec.yaml b/animations/pubspec.yaml index 10083e849..cbedd858d 100644 --- a/animations/pubspec.yaml +++ b/animations/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/asset_transformation/grayscale_transformer/pubspec.yaml b/asset_transformation/grayscale_transformer/pubspec.yaml index 5fe707dd1..acdba28cf 100644 --- a/asset_transformation/grayscale_transformer/pubspec.yaml +++ b/asset_transformation/grayscale_transformer/pubspec.yaml @@ -3,7 +3,7 @@ description: A sample command-line application. version: 1.0.0 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: args: ^2.4.2 diff --git a/asset_transformation/pubspec.yaml b/asset_transformation/pubspec.yaml index ef57e2379..937ba2cfd 100644 --- a/asset_transformation/pubspec.yaml +++ b/asset_transformation/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 0.1.0 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/background_isolate_channels/lib/main.dart b/background_isolate_channels/lib/main.dart index a566f46ef..a0c874e34 100644 --- a/background_isolate_channels/lib/main.dart +++ b/background_isolate_channels/lib/main.dart @@ -69,8 +69,8 @@ class _MyHomePageState extends State { .then( (sharedPreferences) => sharedPreferences.setBool('isDebug', true), ); - final Future tempDirFuture = - path_provider.getTemporaryDirectory(); + final Future tempDirFuture = path_provider + .getTemporaryDirectory(); // Wait until the [SharedPreferences] value is set and the temporary // directory is received before opening the database. If @@ -130,8 +130,9 @@ class _MyHomePageState extends State { padding: const EdgeInsets.symmetric(horizontal: 8.0), child: SearchBar( hintText: 'Search', - onChanged: - _database == null ? null : (query) => _refresh(query: query), + onChanged: _database == null + ? null + : (query) => _refresh(query: query), trailing: const [Icon(Icons.search), SizedBox(width: 8)], ), ), diff --git a/background_isolate_channels/pubspec.yaml b/background_isolate_channels/pubspec.yaml index 144297a59..9d91e15a7 100644 --- a/background_isolate_channels/pubspec.yaml +++ b/background_isolate_channels/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: cupertino_icons: ^1.0.2 diff --git a/code_sharing/client/pubspec.yaml b/code_sharing/client/pubspec.yaml index ae1e57dbe..fd75151a7 100644 --- a/code_sharing/client/pubspec.yaml +++ b/code_sharing/client/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: "none" version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: cupertino_icons: ^1.0.2 diff --git a/code_sharing/server/bin/server.dart b/code_sharing/server/bin/server.dart index 5a4e45825..60d74c9fd 100644 --- a/code_sharing/server/bin/server.dart +++ b/code_sharing/server/bin/server.dart @@ -9,10 +9,9 @@ import 'package:shelf_router/shelf_router.dart'; int count = 0; // Configure routes. -final _router = - Router() - ..post('/', _incrementHandler) - ..get('/', _getValueHandler); +final _router = Router() + ..post('/', _incrementHandler) + ..get('/', _getValueHandler); Future _incrementHandler(Request request) async { final incr = Increment.fromJson(json.decode(await request.readAsString())); diff --git a/code_sharing/server/pubspec.yaml b/code_sharing/server/pubspec.yaml index d1b5ccd8b..396a8dd49 100644 --- a/code_sharing/server/pubspec.yaml +++ b/code_sharing/server/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0 publish_to: "none" environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: args: ^2.0.0 diff --git a/code_sharing/shared/lib/src/models.freezed.dart b/code_sharing/shared/lib/src/models.freezed.dart index 7f0ca2e2d..bd2ac83ae 100644 --- a/code_sharing/shared/lib/src/models.freezed.dart +++ b/code_sharing/shared/lib/src/models.freezed.dart @@ -52,11 +52,10 @@ class _$IncrementCopyWithImpl<$Res, $Val extends Increment> $Res call({Object? by = null}) { return _then( _value.copyWith( - by: - null == by - ? _value.by - : by // ignore: cast_nullable_to_non_nullable - as int, + by: null == by + ? _value.by + : by // ignore: cast_nullable_to_non_nullable + as int, ) as $Val, ); @@ -89,11 +88,10 @@ class __$$IncrementImplCopyWithImpl<$Res> $Res call({Object? by = null}) { return _then( _$IncrementImpl( - by: - null == by - ? _value.by - : by // ignore: cast_nullable_to_non_nullable - as int, + by: null == by + ? _value.by + : by // ignore: cast_nullable_to_non_nullable + as int, ), ); } @@ -189,11 +187,10 @@ class _$CountCopyWithImpl<$Res, $Val extends Count> $Res call({Object? value = null}) { return _then( _value.copyWith( - value: - null == value - ? _value.value - : value // ignore: cast_nullable_to_non_nullable - as int, + value: null == value + ? _value.value + : value // ignore: cast_nullable_to_non_nullable + as int, ) as $Val, ); @@ -228,7 +225,7 @@ class __$$CountImplCopyWithImpl<$Res> null == value ? _value.value : value // ignore: cast_nullable_to_non_nullable - as int, + as int, ), ); } diff --git a/code_sharing/shared/pubspec.yaml b/code_sharing/shared/pubspec.yaml index ce204412f..9de78c2f7 100644 --- a/code_sharing/shared/pubspec.yaml +++ b/code_sharing/shared/pubspec.yaml @@ -3,7 +3,7 @@ description: Common data models required by our client and server version: 1.0.0 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: freezed_annotation: ">=2.1.0 <4.0.0" diff --git a/compass_app/app/lib/config/dependencies.dart b/compass_app/app/lib/config/dependencies.dart index 3b2bd541a..29e3543eb 100644 --- a/compass_app/app/lib/config/dependencies.dart +++ b/compass_app/app/lib/config/dependencies.dart @@ -36,12 +36,11 @@ import '../domain/use_cases/booking/booking_share_use_case.dart'; List _sharedProviders = [ Provider( lazy: true, - create: - (context) => BookingCreateUseCase( - destinationRepository: context.read(), - activityRepository: context.read(), - bookingRepository: context.read(), - ), + create: (context) => BookingCreateUseCase( + destinationRepository: context.read(), + activityRepository: context.read(), + bookingRepository: context.read(), + ), ), Provider( lazy: true, @@ -57,46 +56,40 @@ List get providersRemote { Provider(create: (context) => ApiClient()), Provider(create: (context) => SharedPreferencesService()), ChangeNotifierProvider( - create: - (context) => - AuthRepositoryRemote( - authApiClient: context.read(), - apiClient: context.read(), - sharedPreferencesService: context.read(), - ) - as AuthRepository, + create: (context) => + AuthRepositoryRemote( + authApiClient: context.read(), + apiClient: context.read(), + sharedPreferencesService: context.read(), + ) + as AuthRepository, ), Provider( - create: - (context) => - DestinationRepositoryRemote(apiClient: context.read()) - as DestinationRepository, + create: (context) => + DestinationRepositoryRemote(apiClient: context.read()) + as DestinationRepository, ), Provider( - create: - (context) => - ContinentRepositoryRemote(apiClient: context.read()) - as ContinentRepository, + create: (context) => + ContinentRepositoryRemote(apiClient: context.read()) + as ContinentRepository, ), Provider( - create: - (context) => - ActivityRepositoryRemote(apiClient: context.read()) - as ActivityRepository, + create: (context) => + ActivityRepositoryRemote(apiClient: context.read()) + as ActivityRepository, ), Provider.value( value: ItineraryConfigRepositoryMemory() as ItineraryConfigRepository, ), Provider( - create: - (context) => - BookingRepositoryRemote(apiClient: context.read()) - as BookingRepository, + create: (context) => + BookingRepositoryRemote(apiClient: context.read()) + as BookingRepository, ), Provider( - create: - (context) => - UserRepositoryRemote(apiClient: context.read()) as UserRepository, + create: (context) => + UserRepositoryRemote(apiClient: context.read()) as UserRepository, ), ..._sharedProviders, ]; @@ -110,37 +103,32 @@ List get providersLocal { ChangeNotifierProvider.value(value: AuthRepositoryDev() as AuthRepository), Provider.value(value: LocalDataService()), Provider( - create: - (context) => - DestinationRepositoryLocal(localDataService: context.read()) - as DestinationRepository, + create: (context) => + DestinationRepositoryLocal(localDataService: context.read()) + as DestinationRepository, ), Provider( - create: - (context) => - ContinentRepositoryLocal(localDataService: context.read()) - as ContinentRepository, + create: (context) => + ContinentRepositoryLocal(localDataService: context.read()) + as ContinentRepository, ), Provider( - create: - (context) => - ActivityRepositoryLocal(localDataService: context.read()) - as ActivityRepository, + create: (context) => + ActivityRepositoryLocal(localDataService: context.read()) + as ActivityRepository, ), Provider( - create: - (context) => - BookingRepositoryLocal(localDataService: context.read()) - as BookingRepository, + create: (context) => + BookingRepositoryLocal(localDataService: context.read()) + as BookingRepository, ), Provider.value( value: ItineraryConfigRepositoryMemory() as ItineraryConfigRepository, ), Provider( - create: - (context) => - UserRepositoryLocal(localDataService: context.read()) - as UserRepository, + create: (context) => + UserRepositoryLocal(localDataService: context.read()) + as UserRepository, ), ..._sharedProviders, ]; diff --git a/compass_app/app/lib/data/repositories/activity/activity_repository_local.dart b/compass_app/app/lib/data/repositories/activity/activity_repository_local.dart index c18c96aef..bb13df13a 100644 --- a/compass_app/app/lib/data/repositories/activity/activity_repository_local.dart +++ b/compass_app/app/lib/data/repositories/activity/activity_repository_local.dart @@ -18,10 +18,9 @@ class ActivityRepositoryLocal implements ActivityRepository { @override Future>> getByDestination(String ref) async { try { - final activities = - (await _localDataService.getActivities()) - .where((activity) => activity.destinationRef == ref) - .toList(); + final activities = (await _localDataService.getActivities()) + .where((activity) => activity.destinationRef == ref) + .toList(); return Result.ok(activities); } on Exception catch (error) { diff --git a/compass_app/app/lib/data/repositories/booking/booking_repository_local.dart b/compass_app/app/lib/data/repositories/booking/booking_repository_local.dart index c8bdf0e70..a83a1f30a 100644 --- a/compass_app/app/lib/data/repositories/booking/booking_repository_local.dart +++ b/compass_app/app/lib/data/repositories/booking/booking_repository_local.dart @@ -68,11 +68,10 @@ class BookingRepositoryLocal implements BookingRepository { // create a default booking the first time if (_bookings.isEmpty) { final destination = (await _localDataService.getDestinations()).first; - final activities = - (await _localDataService.getActivities()) - .where((activity) => activity.destinationRef == destination.ref) - .take(4) - .toList(); + final activities = (await _localDataService.getActivities()) + .where((activity) => activity.destinationRef == destination.ref) + .take(4) + .toList(); _bookings.add( Booking( diff --git a/compass_app/app/lib/data/repositories/booking/booking_repository_remote.dart b/compass_app/app/lib/data/repositories/booking/booking_repository_remote.dart index 6e721778f..c4d410272 100644 --- a/compass_app/app/lib/data/repositories/booking/booking_repository_remote.dart +++ b/compass_app/app/lib/data/repositories/booking/booking_repository_remote.dart @@ -27,8 +27,9 @@ class BookingRepositoryRemote implements BookingRepository { endDate: booking.endDate, name: '${booking.destination.name}, ${booking.destination.continent}', destinationRef: booking.destination.ref, - activitiesRef: - booking.activity.map((activity) => activity.ref).toList(), + activitiesRef: booking.activity + .map((activity) => activity.ref) + .toList(), ); return _apiClient.postBooking(bookingApiModel); } on Exception catch (e) { @@ -72,10 +73,9 @@ class BookingRepositoryRemote implements BookingRepository { return Result.error(resultActivities.error); case Ok>(): } - final activities = - resultActivities.value - .where((activity) => booking.activitiesRef.contains(activity.ref)) - .toList(); + final activities = resultActivities.value + .where((activity) => booking.activitiesRef.contains(activity.ref)) + .toList(); return Result.ok( Booking( diff --git a/compass_app/app/lib/data/services/api/api_client.dart b/compass_app/app/lib/data/services/api/api_client.dart index 22c32e829..bb4934ff5 100644 --- a/compass_app/app/lib/data/services/api/api_client.dart +++ b/compass_app/app/lib/data/services/api/api_client.dart @@ -95,8 +95,9 @@ class ApiClient { if (response.statusCode == 200) { final stringData = await response.transform(utf8.decoder).join(); final json = jsonDecode(stringData) as List; - final activities = - json.map((element) => Activity.fromJson(element)).toList(); + final activities = json + .map((element) => Activity.fromJson(element)) + .toList(); return Result.ok(activities); } else { return const Result.error(HttpException("Invalid response")); @@ -117,8 +118,9 @@ class ApiClient { if (response.statusCode == 200) { final stringData = await response.transform(utf8.decoder).join(); final json = jsonDecode(stringData) as List; - final bookings = - json.map((element) => BookingApiModel.fromJson(element)).toList(); + final bookings = json + .map((element) => BookingApiModel.fromJson(element)) + .toList(); return Result.ok(bookings); } else { return const Result.error(HttpException("Invalid response")); diff --git a/compass_app/app/lib/data/services/api/model/booking/booking_api_model.freezed.dart b/compass_app/app/lib/data/services/api/model/booking/booking_api_model.freezed.dart index 6a6f31722..c63720610 100644 --- a/compass_app/app/lib/data/services/api/model/booking/booking_api_model.freezed.dart +++ b/compass_app/app/lib/data/services/api/model/booking/booking_api_model.freezed.dart @@ -91,36 +91,30 @@ class _$BookingApiModelCopyWithImpl<$Res, $Val extends BookingApiModel> }) { return _then( _value.copyWith( - id: - freezed == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int?, - startDate: - null == startDate - ? _value.startDate - : startDate // ignore: cast_nullable_to_non_nullable - as DateTime, - endDate: - null == endDate - ? _value.endDate - : endDate // ignore: cast_nullable_to_non_nullable - as DateTime, - name: - null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - destinationRef: - null == destinationRef - ? _value.destinationRef - : destinationRef // ignore: cast_nullable_to_non_nullable - as String, - activitiesRef: - null == activitiesRef - ? _value.activitiesRef - : activitiesRef // ignore: cast_nullable_to_non_nullable - as List, + id: freezed == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int?, + startDate: null == startDate + ? _value.startDate + : startDate // ignore: cast_nullable_to_non_nullable + as DateTime, + endDate: null == endDate + ? _value.endDate + : endDate // ignore: cast_nullable_to_non_nullable + as DateTime, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + destinationRef: null == destinationRef + ? _value.destinationRef + : destinationRef // ignore: cast_nullable_to_non_nullable + as String, + activitiesRef: null == activitiesRef + ? _value.activitiesRef + : activitiesRef // ignore: cast_nullable_to_non_nullable + as List, ) as $Val, ); @@ -169,36 +163,30 @@ class __$$BookingApiModelImplCopyWithImpl<$Res> }) { return _then( _$BookingApiModelImpl( - id: - freezed == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int?, - startDate: - null == startDate - ? _value.startDate - : startDate // ignore: cast_nullable_to_non_nullable - as DateTime, - endDate: - null == endDate - ? _value.endDate - : endDate // ignore: cast_nullable_to_non_nullable - as DateTime, - name: - null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - destinationRef: - null == destinationRef - ? _value.destinationRef - : destinationRef // ignore: cast_nullable_to_non_nullable - as String, - activitiesRef: - null == activitiesRef - ? _value._activitiesRef - : activitiesRef // ignore: cast_nullable_to_non_nullable - as List, + id: freezed == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int?, + startDate: null == startDate + ? _value.startDate + : startDate // ignore: cast_nullable_to_non_nullable + as DateTime, + endDate: null == endDate + ? _value.endDate + : endDate // ignore: cast_nullable_to_non_nullable + as DateTime, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + destinationRef: null == destinationRef + ? _value.destinationRef + : destinationRef // ignore: cast_nullable_to_non_nullable + as String, + activitiesRef: null == activitiesRef + ? _value._activitiesRef + : activitiesRef // ignore: cast_nullable_to_non_nullable + as List, ), ); } diff --git a/compass_app/app/lib/data/services/api/model/booking/booking_api_model.g.dart b/compass_app/app/lib/data/services/api/model/booking/booking_api_model.g.dart index d5df306a3..c75b5349a 100644 --- a/compass_app/app/lib/data/services/api/model/booking/booking_api_model.g.dart +++ b/compass_app/app/lib/data/services/api/model/booking/booking_api_model.g.dart @@ -14,8 +14,9 @@ _$BookingApiModelImpl _$$BookingApiModelImplFromJson( endDate: DateTime.parse(json['endDate'] as String), name: json['name'] as String, destinationRef: json['destinationRef'] as String, - activitiesRef: - (json['activitiesRef'] as List).map((e) => e as String).toList(), + activitiesRef: (json['activitiesRef'] as List) + .map((e) => e as String) + .toList(), ); Map _$$BookingApiModelImplToJson( diff --git a/compass_app/app/lib/data/services/api/model/login_request/login_request.freezed.dart b/compass_app/app/lib/data/services/api/model/login_request/login_request.freezed.dart index a45082a15..db4394ebb 100644 --- a/compass_app/app/lib/data/services/api/model/login_request/login_request.freezed.dart +++ b/compass_app/app/lib/data/services/api/model/login_request/login_request.freezed.dart @@ -64,16 +64,14 @@ class _$LoginRequestCopyWithImpl<$Res, $Val extends LoginRequest> $Res call({Object? email = null, Object? password = null}) { return _then( _value.copyWith( - email: - null == email - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as String, - password: - null == password - ? _value.password - : password // ignore: cast_nullable_to_non_nullable - as String, + email: null == email + ? _value.email + : email // ignore: cast_nullable_to_non_nullable + as String, + password: null == password + ? _value.password + : password // ignore: cast_nullable_to_non_nullable + as String, ) as $Val, ); @@ -108,16 +106,14 @@ class __$$LoginRequestImplCopyWithImpl<$Res> $Res call({Object? email = null, Object? password = null}) { return _then( _$LoginRequestImpl( - email: - null == email - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as String, - password: - null == password - ? _value.password - : password // ignore: cast_nullable_to_non_nullable - as String, + email: null == email + ? _value.email + : email // ignore: cast_nullable_to_non_nullable + as String, + password: null == password + ? _value.password + : password // ignore: cast_nullable_to_non_nullable + as String, ), ); } diff --git a/compass_app/app/lib/data/services/api/model/login_response/login_response.freezed.dart b/compass_app/app/lib/data/services/api/model/login_response/login_response.freezed.dart index 49be034eb..dfaf762b2 100644 --- a/compass_app/app/lib/data/services/api/model/login_response/login_response.freezed.dart +++ b/compass_app/app/lib/data/services/api/model/login_response/login_response.freezed.dart @@ -64,16 +64,14 @@ class _$LoginResponseCopyWithImpl<$Res, $Val extends LoginResponse> $Res call({Object? token = null, Object? userId = null}) { return _then( _value.copyWith( - token: - null == token - ? _value.token - : token // ignore: cast_nullable_to_non_nullable - as String, - userId: - null == userId - ? _value.userId - : userId // ignore: cast_nullable_to_non_nullable - as String, + token: null == token + ? _value.token + : token // ignore: cast_nullable_to_non_nullable + as String, + userId: null == userId + ? _value.userId + : userId // ignore: cast_nullable_to_non_nullable + as String, ) as $Val, ); @@ -108,16 +106,14 @@ class __$$LoginResponseImplCopyWithImpl<$Res> $Res call({Object? token = null, Object? userId = null}) { return _then( _$LoginResponseImpl( - token: - null == token - ? _value.token - : token // ignore: cast_nullable_to_non_nullable - as String, - userId: - null == userId - ? _value.userId - : userId // ignore: cast_nullable_to_non_nullable - as String, + token: null == token + ? _value.token + : token // ignore: cast_nullable_to_non_nullable + as String, + userId: null == userId + ? _value.userId + : userId // ignore: cast_nullable_to_non_nullable + as String, ), ); } diff --git a/compass_app/app/lib/data/services/api/model/user/user_api_model.freezed.dart b/compass_app/app/lib/data/services/api/model/user/user_api_model.freezed.dart index 1ba6de18f..2d8ad1027 100644 --- a/compass_app/app/lib/data/services/api/model/user/user_api_model.freezed.dart +++ b/compass_app/app/lib/data/services/api/model/user/user_api_model.freezed.dart @@ -75,26 +75,22 @@ class _$UserApiModelCopyWithImpl<$Res, $Val extends UserApiModel> }) { return _then( _value.copyWith( - id: - null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - name: - null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - email: - null == email - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as String, - picture: - null == picture - ? _value.picture - : picture // ignore: cast_nullable_to_non_nullable - as String, + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + email: null == email + ? _value.email + : email // ignore: cast_nullable_to_non_nullable + as String, + picture: null == picture + ? _value.picture + : picture // ignore: cast_nullable_to_non_nullable + as String, ) as $Val, ); @@ -134,26 +130,22 @@ class __$$UserApiModelImplCopyWithImpl<$Res> }) { return _then( _$UserApiModelImpl( - id: - null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - name: - null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - email: - null == email - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as String, - picture: - null == picture - ? _value.picture - : picture // ignore: cast_nullable_to_non_nullable - as String, + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + email: null == email + ? _value.email + : email // ignore: cast_nullable_to_non_nullable + as String, + picture: null == picture + ? _value.picture + : picture // ignore: cast_nullable_to_non_nullable + as String, ), ); } diff --git a/compass_app/app/lib/domain/models/activity/activity.freezed.dart b/compass_app/app/lib/domain/models/activity/activity.freezed.dart index b900e74da..0c89f888a 100644 --- a/compass_app/app/lib/domain/models/activity/activity.freezed.dart +++ b/compass_app/app/lib/domain/models/activity/activity.freezed.dart @@ -109,56 +109,46 @@ class _$ActivityCopyWithImpl<$Res, $Val extends Activity> }) { return _then( _value.copyWith( - name: - null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - description: - null == description - ? _value.description - : description // ignore: cast_nullable_to_non_nullable - as String, - locationName: - null == locationName - ? _value.locationName - : locationName // ignore: cast_nullable_to_non_nullable - as String, - duration: - null == duration - ? _value.duration - : duration // ignore: cast_nullable_to_non_nullable - as int, - timeOfDay: - null == timeOfDay - ? _value.timeOfDay - : timeOfDay // ignore: cast_nullable_to_non_nullable - as TimeOfDay, - familyFriendly: - null == familyFriendly - ? _value.familyFriendly - : familyFriendly // ignore: cast_nullable_to_non_nullable - as bool, - price: - null == price - ? _value.price - : price // ignore: cast_nullable_to_non_nullable - as int, - destinationRef: - null == destinationRef - ? _value.destinationRef - : destinationRef // ignore: cast_nullable_to_non_nullable - as String, - ref: - null == ref - ? _value.ref - : ref // ignore: cast_nullable_to_non_nullable - as String, - imageUrl: - null == imageUrl - ? _value.imageUrl - : imageUrl // ignore: cast_nullable_to_non_nullable - as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + description: null == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String, + locationName: null == locationName + ? _value.locationName + : locationName // ignore: cast_nullable_to_non_nullable + as String, + duration: null == duration + ? _value.duration + : duration // ignore: cast_nullable_to_non_nullable + as int, + timeOfDay: null == timeOfDay + ? _value.timeOfDay + : timeOfDay // ignore: cast_nullable_to_non_nullable + as TimeOfDay, + familyFriendly: null == familyFriendly + ? _value.familyFriendly + : familyFriendly // ignore: cast_nullable_to_non_nullable + as bool, + price: null == price + ? _value.price + : price // ignore: cast_nullable_to_non_nullable + as int, + destinationRef: null == destinationRef + ? _value.destinationRef + : destinationRef // ignore: cast_nullable_to_non_nullable + as String, + ref: null == ref + ? _value.ref + : ref // ignore: cast_nullable_to_non_nullable + as String, + imageUrl: null == imageUrl + ? _value.imageUrl + : imageUrl // ignore: cast_nullable_to_non_nullable + as String, ) as $Val, ); @@ -215,56 +205,46 @@ class __$$ActivityImplCopyWithImpl<$Res> }) { return _then( _$ActivityImpl( - name: - null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - description: - null == description - ? _value.description - : description // ignore: cast_nullable_to_non_nullable - as String, - locationName: - null == locationName - ? _value.locationName - : locationName // ignore: cast_nullable_to_non_nullable - as String, - duration: - null == duration - ? _value.duration - : duration // ignore: cast_nullable_to_non_nullable - as int, - timeOfDay: - null == timeOfDay - ? _value.timeOfDay - : timeOfDay // ignore: cast_nullable_to_non_nullable - as TimeOfDay, - familyFriendly: - null == familyFriendly - ? _value.familyFriendly - : familyFriendly // ignore: cast_nullable_to_non_nullable - as bool, - price: - null == price - ? _value.price - : price // ignore: cast_nullable_to_non_nullable - as int, - destinationRef: - null == destinationRef - ? _value.destinationRef - : destinationRef // ignore: cast_nullable_to_non_nullable - as String, - ref: - null == ref - ? _value.ref - : ref // ignore: cast_nullable_to_non_nullable - as String, - imageUrl: - null == imageUrl - ? _value.imageUrl - : imageUrl // ignore: cast_nullable_to_non_nullable - as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + description: null == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String, + locationName: null == locationName + ? _value.locationName + : locationName // ignore: cast_nullable_to_non_nullable + as String, + duration: null == duration + ? _value.duration + : duration // ignore: cast_nullable_to_non_nullable + as int, + timeOfDay: null == timeOfDay + ? _value.timeOfDay + : timeOfDay // ignore: cast_nullable_to_non_nullable + as TimeOfDay, + familyFriendly: null == familyFriendly + ? _value.familyFriendly + : familyFriendly // ignore: cast_nullable_to_non_nullable + as bool, + price: null == price + ? _value.price + : price // ignore: cast_nullable_to_non_nullable + as int, + destinationRef: null == destinationRef + ? _value.destinationRef + : destinationRef // ignore: cast_nullable_to_non_nullable + as String, + ref: null == ref + ? _value.ref + : ref // ignore: cast_nullable_to_non_nullable + as String, + imageUrl: null == imageUrl + ? _value.imageUrl + : imageUrl // ignore: cast_nullable_to_non_nullable + as String, ), ); } diff --git a/compass_app/app/lib/domain/models/booking/booking.freezed.dart b/compass_app/app/lib/domain/models/booking/booking.freezed.dart index 991449de1..03a1ebc9d 100644 --- a/compass_app/app/lib/domain/models/booking/booking.freezed.dart +++ b/compass_app/app/lib/domain/models/booking/booking.freezed.dart @@ -85,31 +85,26 @@ class _$BookingCopyWithImpl<$Res, $Val extends Booking> }) { return _then( _value.copyWith( - id: - freezed == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int?, - startDate: - null == startDate - ? _value.startDate - : startDate // ignore: cast_nullable_to_non_nullable - as DateTime, - endDate: - null == endDate - ? _value.endDate - : endDate // ignore: cast_nullable_to_non_nullable - as DateTime, - destination: - null == destination - ? _value.destination - : destination // ignore: cast_nullable_to_non_nullable - as Destination, - activity: - null == activity - ? _value.activity - : activity // ignore: cast_nullable_to_non_nullable - as List, + id: freezed == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int?, + startDate: null == startDate + ? _value.startDate + : startDate // ignore: cast_nullable_to_non_nullable + as DateTime, + endDate: null == endDate + ? _value.endDate + : endDate // ignore: cast_nullable_to_non_nullable + as DateTime, + destination: null == destination + ? _value.destination + : destination // ignore: cast_nullable_to_non_nullable + as Destination, + activity: null == activity + ? _value.activity + : activity // ignore: cast_nullable_to_non_nullable + as List, ) as $Val, ); @@ -168,31 +163,26 @@ class __$$BookingImplCopyWithImpl<$Res> }) { return _then( _$BookingImpl( - id: - freezed == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int?, - startDate: - null == startDate - ? _value.startDate - : startDate // ignore: cast_nullable_to_non_nullable - as DateTime, - endDate: - null == endDate - ? _value.endDate - : endDate // ignore: cast_nullable_to_non_nullable - as DateTime, - destination: - null == destination - ? _value.destination - : destination // ignore: cast_nullable_to_non_nullable - as Destination, - activity: - null == activity - ? _value._activity - : activity // ignore: cast_nullable_to_non_nullable - as List, + id: freezed == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int?, + startDate: null == startDate + ? _value.startDate + : startDate // ignore: cast_nullable_to_non_nullable + as DateTime, + endDate: null == endDate + ? _value.endDate + : endDate // ignore: cast_nullable_to_non_nullable + as DateTime, + destination: null == destination + ? _value.destination + : destination // ignore: cast_nullable_to_non_nullable + as Destination, + activity: null == activity + ? _value._activity + : activity // ignore: cast_nullable_to_non_nullable + as List, ), ); } diff --git a/compass_app/app/lib/domain/models/booking/booking.g.dart b/compass_app/app/lib/domain/models/booking/booking.g.dart index 7d800c47a..6c851aba4 100644 --- a/compass_app/app/lib/domain/models/booking/booking.g.dart +++ b/compass_app/app/lib/domain/models/booking/booking.g.dart @@ -14,10 +14,9 @@ _$BookingImpl _$$BookingImplFromJson(Map json) => destination: Destination.fromJson( json['destination'] as Map, ), - activity: - (json['activity'] as List) - .map((e) => Activity.fromJson(e as Map)) - .toList(), + activity: (json['activity'] as List) + .map((e) => Activity.fromJson(e as Map)) + .toList(), ); Map _$$BookingImplToJson(_$BookingImpl instance) => diff --git a/compass_app/app/lib/domain/models/booking/booking_summary.freezed.dart b/compass_app/app/lib/domain/models/booking/booking_summary.freezed.dart index e31b7faef..a06a75da3 100644 --- a/compass_app/app/lib/domain/models/booking/booking_summary.freezed.dart +++ b/compass_app/app/lib/domain/models/booking/booking_summary.freezed.dart @@ -75,26 +75,22 @@ class _$BookingSummaryCopyWithImpl<$Res, $Val extends BookingSummary> }) { return _then( _value.copyWith( - id: - null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - name: - null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - startDate: - null == startDate - ? _value.startDate - : startDate // ignore: cast_nullable_to_non_nullable - as DateTime, - endDate: - null == endDate - ? _value.endDate - : endDate // ignore: cast_nullable_to_non_nullable - as DateTime, + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + startDate: null == startDate + ? _value.startDate + : startDate // ignore: cast_nullable_to_non_nullable + as DateTime, + endDate: null == endDate + ? _value.endDate + : endDate // ignore: cast_nullable_to_non_nullable + as DateTime, ) as $Val, ); @@ -134,26 +130,22 @@ class __$$BookingSummaryImplCopyWithImpl<$Res> }) { return _then( _$BookingSummaryImpl( - id: - null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - name: - null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - startDate: - null == startDate - ? _value.startDate - : startDate // ignore: cast_nullable_to_non_nullable - as DateTime, - endDate: - null == endDate - ? _value.endDate - : endDate // ignore: cast_nullable_to_non_nullable - as DateTime, + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + startDate: null == startDate + ? _value.startDate + : startDate // ignore: cast_nullable_to_non_nullable + as DateTime, + endDate: null == endDate + ? _value.endDate + : endDate // ignore: cast_nullable_to_non_nullable + as DateTime, ), ); } diff --git a/compass_app/app/lib/domain/models/continent/continent.freezed.dart b/compass_app/app/lib/domain/models/continent/continent.freezed.dart index cb6688a65..6f13817d1 100644 --- a/compass_app/app/lib/domain/models/continent/continent.freezed.dart +++ b/compass_app/app/lib/domain/models/continent/continent.freezed.dart @@ -62,16 +62,14 @@ class _$ContinentCopyWithImpl<$Res, $Val extends Continent> $Res call({Object? name = null, Object? imageUrl = null}) { return _then( _value.copyWith( - name: - null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - imageUrl: - null == imageUrl - ? _value.imageUrl - : imageUrl // ignore: cast_nullable_to_non_nullable - as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + imageUrl: null == imageUrl + ? _value.imageUrl + : imageUrl // ignore: cast_nullable_to_non_nullable + as String, ) as $Val, ); @@ -106,16 +104,14 @@ class __$$ContinentImplCopyWithImpl<$Res> $Res call({Object? name = null, Object? imageUrl = null}) { return _then( _$ContinentImpl( - name: - null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - imageUrl: - null == imageUrl - ? _value.imageUrl - : imageUrl // ignore: cast_nullable_to_non_nullable - as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + imageUrl: null == imageUrl + ? _value.imageUrl + : imageUrl // ignore: cast_nullable_to_non_nullable + as String, ), ); } diff --git a/compass_app/app/lib/domain/models/destination/destination.freezed.dart b/compass_app/app/lib/domain/models/destination/destination.freezed.dart index 30789a969..1babb9353 100644 --- a/compass_app/app/lib/domain/models/destination/destination.freezed.dart +++ b/compass_app/app/lib/domain/models/destination/destination.freezed.dart @@ -95,41 +95,34 @@ class _$DestinationCopyWithImpl<$Res, $Val extends Destination> }) { return _then( _value.copyWith( - ref: - null == ref - ? _value.ref - : ref // ignore: cast_nullable_to_non_nullable - as String, - name: - null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - country: - null == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String, - continent: - null == continent - ? _value.continent - : continent // ignore: cast_nullable_to_non_nullable - as String, - knownFor: - null == knownFor - ? _value.knownFor - : knownFor // ignore: cast_nullable_to_non_nullable - as String, - tags: - null == tags - ? _value.tags - : tags // ignore: cast_nullable_to_non_nullable - as List, - imageUrl: - null == imageUrl - ? _value.imageUrl - : imageUrl // ignore: cast_nullable_to_non_nullable - as String, + ref: null == ref + ? _value.ref + : ref // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + country: null == country + ? _value.country + : country // ignore: cast_nullable_to_non_nullable + as String, + continent: null == continent + ? _value.continent + : continent // ignore: cast_nullable_to_non_nullable + as String, + knownFor: null == knownFor + ? _value.knownFor + : knownFor // ignore: cast_nullable_to_non_nullable + as String, + tags: null == tags + ? _value.tags + : tags // ignore: cast_nullable_to_non_nullable + as List, + imageUrl: null == imageUrl + ? _value.imageUrl + : imageUrl // ignore: cast_nullable_to_non_nullable + as String, ) as $Val, ); @@ -180,41 +173,34 @@ class __$$DestinationImplCopyWithImpl<$Res> }) { return _then( _$DestinationImpl( - ref: - null == ref - ? _value.ref - : ref // ignore: cast_nullable_to_non_nullable - as String, - name: - null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - country: - null == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String, - continent: - null == continent - ? _value.continent - : continent // ignore: cast_nullable_to_non_nullable - as String, - knownFor: - null == knownFor - ? _value.knownFor - : knownFor // ignore: cast_nullable_to_non_nullable - as String, - tags: - null == tags - ? _value._tags - : tags // ignore: cast_nullable_to_non_nullable - as List, - imageUrl: - null == imageUrl - ? _value.imageUrl - : imageUrl // ignore: cast_nullable_to_non_nullable - as String, + ref: null == ref + ? _value.ref + : ref // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + country: null == country + ? _value.country + : country // ignore: cast_nullable_to_non_nullable + as String, + continent: null == continent + ? _value.continent + : continent // ignore: cast_nullable_to_non_nullable + as String, + knownFor: null == knownFor + ? _value.knownFor + : knownFor // ignore: cast_nullable_to_non_nullable + as String, + tags: null == tags + ? _value._tags + : tags // ignore: cast_nullable_to_non_nullable + as List, + imageUrl: null == imageUrl + ? _value.imageUrl + : imageUrl // ignore: cast_nullable_to_non_nullable + as String, ), ); } diff --git a/compass_app/app/lib/domain/models/itinerary_config/itinerary_config.freezed.dart b/compass_app/app/lib/domain/models/itinerary_config/itinerary_config.freezed.dart index b4febdbc5..e933300d8 100644 --- a/compass_app/app/lib/domain/models/itinerary_config/itinerary_config.freezed.dart +++ b/compass_app/app/lib/domain/models/itinerary_config/itinerary_config.freezed.dart @@ -90,36 +90,30 @@ class _$ItineraryConfigCopyWithImpl<$Res, $Val extends ItineraryConfig> }) { return _then( _value.copyWith( - continent: - freezed == continent - ? _value.continent - : continent // ignore: cast_nullable_to_non_nullable - as String?, - startDate: - freezed == startDate - ? _value.startDate - : startDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - endDate: - freezed == endDate - ? _value.endDate - : endDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - guests: - freezed == guests - ? _value.guests - : guests // ignore: cast_nullable_to_non_nullable - as int?, - destination: - freezed == destination - ? _value.destination - : destination // ignore: cast_nullable_to_non_nullable - as String?, - activities: - null == activities - ? _value.activities - : activities // ignore: cast_nullable_to_non_nullable - as List, + continent: freezed == continent + ? _value.continent + : continent // ignore: cast_nullable_to_non_nullable + as String?, + startDate: freezed == startDate + ? _value.startDate + : startDate // ignore: cast_nullable_to_non_nullable + as DateTime?, + endDate: freezed == endDate + ? _value.endDate + : endDate // ignore: cast_nullable_to_non_nullable + as DateTime?, + guests: freezed == guests + ? _value.guests + : guests // ignore: cast_nullable_to_non_nullable + as int?, + destination: freezed == destination + ? _value.destination + : destination // ignore: cast_nullable_to_non_nullable + as String?, + activities: null == activities + ? _value.activities + : activities // ignore: cast_nullable_to_non_nullable + as List, ) as $Val, ); @@ -168,36 +162,30 @@ class __$$ItineraryConfigImplCopyWithImpl<$Res> }) { return _then( _$ItineraryConfigImpl( - continent: - freezed == continent - ? _value.continent - : continent // ignore: cast_nullable_to_non_nullable - as String?, - startDate: - freezed == startDate - ? _value.startDate - : startDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - endDate: - freezed == endDate - ? _value.endDate - : endDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - guests: - freezed == guests - ? _value.guests - : guests // ignore: cast_nullable_to_non_nullable - as int?, - destination: - freezed == destination - ? _value.destination - : destination // ignore: cast_nullable_to_non_nullable - as String?, - activities: - null == activities - ? _value._activities - : activities // ignore: cast_nullable_to_non_nullable - as List, + continent: freezed == continent + ? _value.continent + : continent // ignore: cast_nullable_to_non_nullable + as String?, + startDate: freezed == startDate + ? _value.startDate + : startDate // ignore: cast_nullable_to_non_nullable + as DateTime?, + endDate: freezed == endDate + ? _value.endDate + : endDate // ignore: cast_nullable_to_non_nullable + as DateTime?, + guests: freezed == guests + ? _value.guests + : guests // ignore: cast_nullable_to_non_nullable + as int?, + destination: freezed == destination + ? _value.destination + : destination // ignore: cast_nullable_to_non_nullable + as String?, + activities: null == activities + ? _value._activities + : activities // ignore: cast_nullable_to_non_nullable + as List, ), ); } diff --git a/compass_app/app/lib/domain/models/itinerary_config/itinerary_config.g.dart b/compass_app/app/lib/domain/models/itinerary_config/itinerary_config.g.dart index 6bd037844..c012d7ad0 100644 --- a/compass_app/app/lib/domain/models/itinerary_config/itinerary_config.g.dart +++ b/compass_app/app/lib/domain/models/itinerary_config/itinerary_config.g.dart @@ -10,14 +10,12 @@ _$ItineraryConfigImpl _$$ItineraryConfigImplFromJson( Map json, ) => _$ItineraryConfigImpl( continent: json['continent'] as String?, - startDate: - json['startDate'] == null - ? null - : DateTime.parse(json['startDate'] as String), - endDate: - json['endDate'] == null - ? null - : DateTime.parse(json['endDate'] as String), + startDate: json['startDate'] == null + ? null + : DateTime.parse(json['startDate'] as String), + endDate: json['endDate'] == null + ? null + : DateTime.parse(json['endDate'] as String), guests: (json['guests'] as num?)?.toInt(), destination: json['destination'] as String?, activities: diff --git a/compass_app/app/lib/domain/models/user/user.freezed.dart b/compass_app/app/lib/domain/models/user/user.freezed.dart index 019912a02..b510aac73 100644 --- a/compass_app/app/lib/domain/models/user/user.freezed.dart +++ b/compass_app/app/lib/domain/models/user/user.freezed.dart @@ -61,16 +61,14 @@ class _$UserCopyWithImpl<$Res, $Val extends User> $Res call({Object? name = null, Object? picture = null}) { return _then( _value.copyWith( - name: - null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - picture: - null == picture - ? _value.picture - : picture // ignore: cast_nullable_to_non_nullable - as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + picture: null == picture + ? _value.picture + : picture // ignore: cast_nullable_to_non_nullable + as String, ) as $Val, ); @@ -102,16 +100,14 @@ class __$$UserImplCopyWithImpl<$Res> $Res call({Object? name = null, Object? picture = null}) { return _then( _$UserImpl( - name: - null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - picture: - null == picture - ? _value.picture - : picture // ignore: cast_nullable_to_non_nullable - as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + picture: null == picture + ? _value.picture + : picture // ignore: cast_nullable_to_non_nullable + as String, ), ); } diff --git a/compass_app/app/lib/domain/use_cases/booking/booking_create_use_case.dart b/compass_app/app/lib/domain/use_cases/booking/booking_create_use_case.dart index 50f0eff76..3fcff3e30 100644 --- a/compass_app/app/lib/domain/use_cases/booking/booking_create_use_case.dart +++ b/compass_app/app/lib/domain/use_cases/booking/booking_create_use_case.dart @@ -63,12 +63,9 @@ class BookingCreateUseCase { return Result.error(activitiesResult.error); case Ok>(): } - final activities = - activitiesResult.value - .where( - (activity) => itineraryConfig.activities.contains(activity.ref), - ) - .toList(); + final activities = activitiesResult.value + .where((activity) => itineraryConfig.activities.contains(activity.ref)) + .toList(); _log.fine('Activities loaded (${activities.length})'); // Check if dates are set diff --git a/compass_app/app/lib/ui/activities/view_models/activities_viewmodel.dart b/compass_app/app/lib/ui/activities/view_models/activities_viewmodel.dart index cda783531..61ecd66bb 100644 --- a/compass_app/app/lib/ui/activities/view_models/activities_viewmodel.dart +++ b/compass_app/app/lib/ui/activities/view_models/activities_viewmodel.dart @@ -67,26 +67,24 @@ class ActivitiesViewModel extends ChangeNotifier { switch (resultActivities) { case Ok(): { - _daytimeActivities = - resultActivities.value - .where( - (activity) => [ - TimeOfDay.any, - TimeOfDay.morning, - TimeOfDay.afternoon, - ].contains(activity.timeOfDay), - ) - .toList(); - - _eveningActivities = - resultActivities.value - .where( - (activity) => [ - TimeOfDay.evening, - TimeOfDay.night, - ].contains(activity.timeOfDay), - ) - .toList(); + _daytimeActivities = resultActivities.value + .where( + (activity) => [ + TimeOfDay.any, + TimeOfDay.morning, + TimeOfDay.afternoon, + ].contains(activity.timeOfDay), + ) + .toList(); + + _eveningActivities = resultActivities.value + .where( + (activity) => [ + TimeOfDay.evening, + TimeOfDay.night, + ].contains(activity.timeOfDay), + ) + .toList(); _log.fine( 'Activities (daytime: ${_daytimeActivities.length}, ' diff --git a/compass_app/app/lib/ui/activities/widgets/activities_screen.dart b/compass_app/app/lib/ui/activities/widgets/activities_screen.dart index 7b784ac58..f2ba884f4 100644 --- a/compass_app/app/lib/ui/activities/widgets/activities_screen.dart +++ b/compass_app/app/lib/ui/activities/widgets/activities_screen.dart @@ -71,10 +71,9 @@ class _ActivitiesScreenState extends State { Expanded( child: Center( child: ErrorIndicator( - title: - AppLocalization.of( - context, - ).errorWhileLoadingActivities, + title: AppLocalization.of( + context, + ).errorWhileLoadingActivities, label: AppLocalization.of(context).tryAgain, onPressed: widget.viewModel.loadActivities.execute, ), @@ -171,10 +170,9 @@ class _BottomArea extends StatelessWidget { ), FilledButton( key: const Key(confirmButtonKey), - onPressed: - viewModel.selectedActivities.isNotEmpty - ? viewModel.saveActivities.execute - : null, + onPressed: viewModel.selectedActivities.isNotEmpty + ? viewModel.saveActivities.execute + : null, child: Text(AppLocalization.of(context).confirm), ), ], diff --git a/compass_app/app/lib/ui/auth/login/widgets/login_screen.dart b/compass_app/app/lib/ui/auth/login/widgets/login_screen.dart index fb8ed14eb..60be3f4ac 100644 --- a/compass_app/app/lib/ui/auth/login/widgets/login_screen.dart +++ b/compass_app/app/lib/ui/auth/login/widgets/login_screen.dart @@ -99,11 +99,10 @@ class _LoginScreenState extends State { content: Text(AppLocalization.of(context).errorWhileLogin), action: SnackBarAction( label: AppLocalization.of(context).tryAgain, - onPressed: - () => widget.viewModel.login.execute(( - _email.value.text, - _password.value.text, - )), + onPressed: () => widget.viewModel.login.execute(( + _email.value.text, + _password.value.text, + )), ), ), ); diff --git a/compass_app/app/lib/ui/booking/view_models/booking_viewmodel.dart b/compass_app/app/lib/ui/booking/view_models/booking_viewmodel.dart index 2ab853b52..21d2e39fa 100644 --- a/compass_app/app/lib/ui/booking/view_models/booking_viewmodel.dart +++ b/compass_app/app/lib/ui/booking/view_models/booking_viewmodel.dart @@ -50,8 +50,8 @@ class BookingViewModel extends ChangeNotifier { Future> _createBooking() async { _log.fine('Loading booking'); - final itineraryConfig = - await _itineraryConfigRepository.getItineraryConfig(); + final itineraryConfig = await _itineraryConfigRepository + .getItineraryConfig(); switch (itineraryConfig) { case Ok(): _log.fine('Loaded stored ItineraryConfig'); diff --git a/compass_app/app/lib/ui/booking/widgets/booking_header.dart b/compass_app/app/lib/ui/booking/widgets/booking_header.dart index 474417d8e..0c889aede 100644 --- a/compass_app/app/lib/ui/booking/widgets/booking_header.dart +++ b/compass_app/app/lib/ui/booking/widgets/booking_header.dart @@ -90,18 +90,17 @@ class _Tags extends StatelessWidget { child: Wrap( spacing: 6, runSpacing: 6, - children: - booking.destination.tags - .map( - (tag) => TagChip( - tag: tag, - fontSize: 16, - height: 32, - chipColor: chipColor, - onChipColor: Theme.of(context).colorScheme.onSurface, - ), - ) - .toList(), + children: booking.destination.tags + .map( + (tag) => TagChip( + tag: tag, + fontSize: 16, + height: 32, + chipColor: chipColor, + onChipColor: Theme.of(context).colorScheme.onSurface, + ), + ) + .toList(), ), ); } diff --git a/compass_app/app/lib/ui/booking/widgets/booking_screen.dart b/compass_app/app/lib/ui/booking/widgets/booking_screen.dart index 379a628cd..0180231a5 100644 --- a/compass_app/app/lib/ui/booking/widgets/booking_screen.dart +++ b/compass_app/app/lib/ui/booking/widgets/booking_screen.dart @@ -44,18 +44,16 @@ class _BookingScreenState extends State { child: Scaffold( floatingActionButton: ListenableBuilder( listenable: widget.viewModel, - builder: - (context, _) => FloatingActionButton.extended( - // Workaround for https://github.com/flutter/flutter/issues/115358#issuecomment-2117157419 - heroTag: null, - key: const ValueKey('share-button'), - onPressed: - widget.viewModel.booking != null - ? widget.viewModel.shareBooking.execute - : null, - label: Text(AppLocalization.of(context).shareTrip), - icon: const Icon(Icons.share_outlined), - ), + builder: (context, _) => FloatingActionButton.extended( + // Workaround for https://github.com/flutter/flutter/issues/115358#issuecomment-2117157419 + heroTag: null, + key: const ValueKey('share-button'), + onPressed: widget.viewModel.booking != null + ? widget.viewModel.shareBooking.execute + : null, + label: Text(AppLocalization.of(context).shareTrip), + icon: const Icon(Icons.share_outlined), + ), ), body: ListenableBuilder( // Listen to changes in both commands diff --git a/compass_app/app/lib/ui/core/themes/dimens.dart b/compass_app/app/lib/ui/core/themes/dimens.dart index e77492223..ea5d101b1 100644 --- a/compass_app/app/lib/ui/core/themes/dimens.dart +++ b/compass_app/app/lib/ui/core/themes/dimens.dart @@ -35,12 +35,11 @@ abstract final class Dimens { static const Dimens mobile = _DimensMobile(); /// Get dimensions definition based on screen size - factory Dimens.of(BuildContext context) => switch (MediaQuery.sizeOf( - context, - ).width) { - > 600 && < 840 => desktop, - _ => mobile, - }; + factory Dimens.of(BuildContext context) => + switch (MediaQuery.sizeOf(context).width) { + > 600 && < 840 => desktop, + _ => mobile, + }; } /// Mobile dimensions diff --git a/compass_app/app/lib/ui/core/ui/custom_checkbox.dart b/compass_app/app/lib/ui/core/ui/custom_checkbox.dart index d08ea6339..515e91a3d 100644 --- a/compass_app/app/lib/ui/core/ui/custom_checkbox.dart +++ b/compass_app/app/lib/ui/core/ui/custom_checkbox.dart @@ -28,10 +28,9 @@ class CustomCheckbox extends StatelessWidget { ), child: Material( borderRadius: BorderRadius.circular(24), - color: - value - ? Theme.of(context).colorScheme.primary - : Colors.transparent, + color: value + ? Theme.of(context).colorScheme.primary + : Colors.transparent, child: SizedBox( width: 24, height: 24, diff --git a/compass_app/app/lib/ui/home/widgets/home_screen.dart b/compass_app/app/lib/ui/home/widgets/home_screen.dart index 39f4dcdaf..fefe78003 100644 --- a/compass_app/app/lib/ui/home/widgets/home_screen.dart +++ b/compass_app/app/lib/ui/home/widgets/home_screen.dart @@ -93,31 +93,29 @@ class _HomeScreenState extends State { ), SliverList.builder( itemCount: widget.viewModel.bookings.length, - itemBuilder: - (_, index) => _Booking( - key: ValueKey(widget.viewModel.bookings[index].id), - booking: widget.viewModel.bookings[index], - onTap: - () => context.push( - Routes.bookingWithId( - widget.viewModel.bookings[index].id, - ), - ), - confirmDismiss: (_) async { - // wait for command to complete - await widget.viewModel.deleteBooking.execute( - widget.viewModel.bookings[index].id, - ); - // if command completed successfully, return true - if (widget.viewModel.deleteBooking.completed) { - // removes the dismissable from the list - return true; - } else { - // the dismissable stays in the list - return false; - } - }, + itemBuilder: (_, index) => _Booking( + key: ValueKey(widget.viewModel.bookings[index].id), + booking: widget.viewModel.bookings[index], + onTap: () => context.push( + Routes.bookingWithId( + widget.viewModel.bookings[index].id, ), + ), + confirmDismiss: (_) async { + // wait for command to complete + await widget.viewModel.deleteBooking.execute( + widget.viewModel.bookings[index].id, + ); + // if command completed successfully, return true + if (widget.viewModel.deleteBooking.completed) { + // removes the dismissable from the list + return true; + } else { + // the dismissable stays in the list + return false; + } + }, + ), ), ], ); diff --git a/compass_app/app/lib/ui/home/widgets/home_title.dart b/compass_app/app/lib/ui/home/widgets/home_title.dart index 7086ccdf0..165e7ffe5 100644 --- a/compass_app/app/lib/ui/home/widgets/home_title.dart +++ b/compass_app/app/lib/ui/home/widgets/home_title.dart @@ -61,12 +61,11 @@ class _Title extends StatelessWidget { Widget build(BuildContext context) { return ShaderMask( blendMode: BlendMode.srcIn, - shaderCallback: - (bounds) => RadialGradient( - center: Alignment.bottomLeft, - radius: 2, - colors: [Colors.purple.shade700, Colors.purple.shade400], - ).createShader(Rect.fromLTWH(0, 0, bounds.width, bounds.height)), + shaderCallback: (bounds) => RadialGradient( + center: Alignment.bottomLeft, + radius: 2, + colors: [Colors.purple.shade700, Colors.purple.shade400], + ).createShader(Rect.fromLTWH(0, 0, bounds.width, bounds.height)), child: Text( text, style: GoogleFonts.rubik( diff --git a/compass_app/app/lib/ui/results/view_models/results_viewmodel.dart b/compass_app/app/lib/ui/results/view_models/results_viewmodel.dart index 33ba262b3..b5af3dea6 100644 --- a/compass_app/app/lib/ui/results/view_models/results_viewmodel.dart +++ b/compass_app/app/lib/ui/results/view_models/results_viewmodel.dart @@ -67,13 +67,12 @@ class ResultsViewModel extends ChangeNotifier { case Ok(): { // If the result is Ok, update the list of destinations - _destinations = - result.value - .where( - (destination) => - destination.continent == _itineraryConfig!.continent, - ) - .toList(); + _destinations = result.value + .where( + (destination) => + destination.continent == _itineraryConfig!.continent, + ) + .toList(); _log.fine('Destinations (${_destinations.length}) loaded'); } case Error(): diff --git a/compass_app/app/lib/ui/results/widgets/result_card.dart b/compass_app/app/lib/ui/results/widgets/result_card.dart index adcdad91a..463358d82 100644 --- a/compass_app/app/lib/ui/results/widgets/result_card.dart +++ b/compass_app/app/lib/ui/results/widgets/result_card.dart @@ -42,8 +42,9 @@ class ResultCard extends StatelessWidget { spacing: 4.0, runSpacing: 4.0, direction: Axis.horizontal, - children: - destination.tags.map((e) => TagChip(tag: e)).toList(), + children: destination.tags + .map((e) => TagChip(tag: e)) + .toList(), ), ], ), diff --git a/compass_app/app/lib/ui/results/widgets/results_screen.dart b/compass_app/app/lib/ui/results/widgets/results_screen.dart index 2bfc3d377..a2b675cb9 100644 --- a/compass_app/app/lib/ui/results/widgets/results_screen.dart +++ b/compass_app/app/lib/ui/results/widgets/results_screen.dart @@ -67,10 +67,9 @@ class _ResultsScreenState extends State { Expanded( child: Center( child: ErrorIndicator( - title: - AppLocalization.of( - context, - ).errorWhileLoadingDestinations, + title: AppLocalization.of( + context, + ).errorWhileLoadingDestinations, label: AppLocalization.of(context).tryAgain, onPressed: widget.viewModel.search.execute, ), diff --git a/compass_app/app/lib/ui/search_form/widgets/search_form_guests.dart b/compass_app/app/lib/ui/search_form/widgets/search_form_guests.dart index 3772c0f85..5c4abfaca 100644 --- a/compass_app/app/lib/ui/search_form/widgets/search_form_guests.dart +++ b/compass_app/app/lib/ui/search_form/widgets/search_form_guests.dart @@ -75,14 +75,12 @@ class _QuantitySelector extends StatelessWidget { ), ListenableBuilder( listenable: viewModel, - builder: - (context, _) => Text( - viewModel.guests.toString(), - style: - viewModel.guests == 0 - ? Theme.of(context).inputDecorationTheme.hintStyle - : Theme.of(context).textTheme.bodyMedium, - ), + builder: (context, _) => Text( + viewModel.guests.toString(), + style: viewModel.guests == 0 + ? Theme.of(context).inputDecorationTheme.hintStyle + : Theme.of(context).textTheme.bodyMedium, + ), ), InkWell( key: const ValueKey(addGuestsKey), diff --git a/compass_app/app/lib/ui/search_form/widgets/search_form_submit.dart b/compass_app/app/lib/ui/search_form/widgets/search_form_submit.dart index a4c6113a1..e6ce6a104 100644 --- a/compass_app/app/lib/ui/search_form/widgets/search_form_submit.dart +++ b/compass_app/app/lib/ui/search_form/widgets/search_form_submit.dart @@ -65,10 +65,9 @@ class _SearchFormSubmitState extends State { builder: (context, child) { return FilledButton( key: const ValueKey(searchFormSubmitButtonKey), - onPressed: - widget.viewModel.valid - ? widget.viewModel.updateItineraryConfig.execute - : null, + onPressed: widget.viewModel.valid + ? widget.viewModel.updateItineraryConfig.execute + : null, child: child, ); }, diff --git a/compass_app/app/pubspec.yaml b/compass_app/app/pubspec.yaml index 7b9881146..d93c56be2 100644 --- a/compass_app/app/pubspec.yaml +++ b/compass_app/app/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none version: 0.1.0 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: cached_network_image: ^3.4.1 diff --git a/compass_app/server/bin/compass_server.dart b/compass_app/server/bin/compass_server.dart index 05bdfc011..7f2011552 100644 --- a/compass_app/server/bin/compass_server.dart +++ b/compass_app/server/bin/compass_server.dart @@ -15,13 +15,12 @@ import 'package:shelf/shelf_io.dart'; import 'package:shelf_router/shelf_router.dart'; // Configure routes. -final _router = - Router() - ..get('/continent', continentHandler) - ..mount('/destination', DestinationApi().router.call) - ..mount('/booking', BookingApi().router.call) - ..mount('/user', UserApi().router.call) - ..mount('/login', LoginApi().router.call); +final _router = Router() + ..get('/continent', continentHandler) + ..mount('/destination', DestinationApi().router.call) + ..mount('/booking', BookingApi().router.call) + ..mount('/user', UserApi().router.call) + ..mount('/login', LoginApi().router.call); void main(List args) async { // Use any available host or container IP (usually `0.0.0.0`). diff --git a/compass_app/server/lib/model/activity/activity.freezed.dart b/compass_app/server/lib/model/activity/activity.freezed.dart index b900e74da..0c89f888a 100644 --- a/compass_app/server/lib/model/activity/activity.freezed.dart +++ b/compass_app/server/lib/model/activity/activity.freezed.dart @@ -109,56 +109,46 @@ class _$ActivityCopyWithImpl<$Res, $Val extends Activity> }) { return _then( _value.copyWith( - name: - null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - description: - null == description - ? _value.description - : description // ignore: cast_nullable_to_non_nullable - as String, - locationName: - null == locationName - ? _value.locationName - : locationName // ignore: cast_nullable_to_non_nullable - as String, - duration: - null == duration - ? _value.duration - : duration // ignore: cast_nullable_to_non_nullable - as int, - timeOfDay: - null == timeOfDay - ? _value.timeOfDay - : timeOfDay // ignore: cast_nullable_to_non_nullable - as TimeOfDay, - familyFriendly: - null == familyFriendly - ? _value.familyFriendly - : familyFriendly // ignore: cast_nullable_to_non_nullable - as bool, - price: - null == price - ? _value.price - : price // ignore: cast_nullable_to_non_nullable - as int, - destinationRef: - null == destinationRef - ? _value.destinationRef - : destinationRef // ignore: cast_nullable_to_non_nullable - as String, - ref: - null == ref - ? _value.ref - : ref // ignore: cast_nullable_to_non_nullable - as String, - imageUrl: - null == imageUrl - ? _value.imageUrl - : imageUrl // ignore: cast_nullable_to_non_nullable - as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + description: null == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String, + locationName: null == locationName + ? _value.locationName + : locationName // ignore: cast_nullable_to_non_nullable + as String, + duration: null == duration + ? _value.duration + : duration // ignore: cast_nullable_to_non_nullable + as int, + timeOfDay: null == timeOfDay + ? _value.timeOfDay + : timeOfDay // ignore: cast_nullable_to_non_nullable + as TimeOfDay, + familyFriendly: null == familyFriendly + ? _value.familyFriendly + : familyFriendly // ignore: cast_nullable_to_non_nullable + as bool, + price: null == price + ? _value.price + : price // ignore: cast_nullable_to_non_nullable + as int, + destinationRef: null == destinationRef + ? _value.destinationRef + : destinationRef // ignore: cast_nullable_to_non_nullable + as String, + ref: null == ref + ? _value.ref + : ref // ignore: cast_nullable_to_non_nullable + as String, + imageUrl: null == imageUrl + ? _value.imageUrl + : imageUrl // ignore: cast_nullable_to_non_nullable + as String, ) as $Val, ); @@ -215,56 +205,46 @@ class __$$ActivityImplCopyWithImpl<$Res> }) { return _then( _$ActivityImpl( - name: - null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - description: - null == description - ? _value.description - : description // ignore: cast_nullable_to_non_nullable - as String, - locationName: - null == locationName - ? _value.locationName - : locationName // ignore: cast_nullable_to_non_nullable - as String, - duration: - null == duration - ? _value.duration - : duration // ignore: cast_nullable_to_non_nullable - as int, - timeOfDay: - null == timeOfDay - ? _value.timeOfDay - : timeOfDay // ignore: cast_nullable_to_non_nullable - as TimeOfDay, - familyFriendly: - null == familyFriendly - ? _value.familyFriendly - : familyFriendly // ignore: cast_nullable_to_non_nullable - as bool, - price: - null == price - ? _value.price - : price // ignore: cast_nullable_to_non_nullable - as int, - destinationRef: - null == destinationRef - ? _value.destinationRef - : destinationRef // ignore: cast_nullable_to_non_nullable - as String, - ref: - null == ref - ? _value.ref - : ref // ignore: cast_nullable_to_non_nullable - as String, - imageUrl: - null == imageUrl - ? _value.imageUrl - : imageUrl // ignore: cast_nullable_to_non_nullable - as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + description: null == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String, + locationName: null == locationName + ? _value.locationName + : locationName // ignore: cast_nullable_to_non_nullable + as String, + duration: null == duration + ? _value.duration + : duration // ignore: cast_nullable_to_non_nullable + as int, + timeOfDay: null == timeOfDay + ? _value.timeOfDay + : timeOfDay // ignore: cast_nullable_to_non_nullable + as TimeOfDay, + familyFriendly: null == familyFriendly + ? _value.familyFriendly + : familyFriendly // ignore: cast_nullable_to_non_nullable + as bool, + price: null == price + ? _value.price + : price // ignore: cast_nullable_to_non_nullable + as int, + destinationRef: null == destinationRef + ? _value.destinationRef + : destinationRef // ignore: cast_nullable_to_non_nullable + as String, + ref: null == ref + ? _value.ref + : ref // ignore: cast_nullable_to_non_nullable + as String, + imageUrl: null == imageUrl + ? _value.imageUrl + : imageUrl // ignore: cast_nullable_to_non_nullable + as String, ), ); } diff --git a/compass_app/server/lib/model/booking/booking.freezed.dart b/compass_app/server/lib/model/booking/booking.freezed.dart index 24c38badb..5ce4f6c99 100644 --- a/compass_app/server/lib/model/booking/booking.freezed.dart +++ b/compass_app/server/lib/model/booking/booking.freezed.dart @@ -88,36 +88,30 @@ class _$BookingCopyWithImpl<$Res, $Val extends Booking> }) { return _then( _value.copyWith( - id: - freezed == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int?, - startDate: - null == startDate - ? _value.startDate - : startDate // ignore: cast_nullable_to_non_nullable - as DateTime, - endDate: - null == endDate - ? _value.endDate - : endDate // ignore: cast_nullable_to_non_nullable - as DateTime, - name: - null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - destinationRef: - null == destinationRef - ? _value.destinationRef - : destinationRef // ignore: cast_nullable_to_non_nullable - as String, - activitiesRef: - null == activitiesRef - ? _value.activitiesRef - : activitiesRef // ignore: cast_nullable_to_non_nullable - as List, + id: freezed == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int?, + startDate: null == startDate + ? _value.startDate + : startDate // ignore: cast_nullable_to_non_nullable + as DateTime, + endDate: null == endDate + ? _value.endDate + : endDate // ignore: cast_nullable_to_non_nullable + as DateTime, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + destinationRef: null == destinationRef + ? _value.destinationRef + : destinationRef // ignore: cast_nullable_to_non_nullable + as String, + activitiesRef: null == activitiesRef + ? _value.activitiesRef + : activitiesRef // ignore: cast_nullable_to_non_nullable + as List, ) as $Val, ); @@ -165,36 +159,30 @@ class __$$BookingImplCopyWithImpl<$Res> }) { return _then( _$BookingImpl( - id: - freezed == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int?, - startDate: - null == startDate - ? _value.startDate - : startDate // ignore: cast_nullable_to_non_nullable - as DateTime, - endDate: - null == endDate - ? _value.endDate - : endDate // ignore: cast_nullable_to_non_nullable - as DateTime, - name: - null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - destinationRef: - null == destinationRef - ? _value.destinationRef - : destinationRef // ignore: cast_nullable_to_non_nullable - as String, - activitiesRef: - null == activitiesRef - ? _value._activitiesRef - : activitiesRef // ignore: cast_nullable_to_non_nullable - as List, + id: freezed == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int?, + startDate: null == startDate + ? _value.startDate + : startDate // ignore: cast_nullable_to_non_nullable + as DateTime, + endDate: null == endDate + ? _value.endDate + : endDate // ignore: cast_nullable_to_non_nullable + as DateTime, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + destinationRef: null == destinationRef + ? _value.destinationRef + : destinationRef // ignore: cast_nullable_to_non_nullable + as String, + activitiesRef: null == activitiesRef + ? _value._activitiesRef + : activitiesRef // ignore: cast_nullable_to_non_nullable + as List, ), ); } diff --git a/compass_app/server/lib/model/booking/booking.g.dart b/compass_app/server/lib/model/booking/booking.g.dart index 676d95d96..829d766bf 100644 --- a/compass_app/server/lib/model/booking/booking.g.dart +++ b/compass_app/server/lib/model/booking/booking.g.dart @@ -13,10 +13,9 @@ _$BookingImpl _$$BookingImplFromJson(Map json) => endDate: DateTime.parse(json['endDate'] as String), name: json['name'] as String, destinationRef: json['destinationRef'] as String, - activitiesRef: - (json['activitiesRef'] as List) - .map((e) => e as String) - .toList(), + activitiesRef: (json['activitiesRef'] as List) + .map((e) => e as String) + .toList(), ); Map _$$BookingImplToJson(_$BookingImpl instance) => diff --git a/compass_app/server/lib/model/continent/continent.freezed.dart b/compass_app/server/lib/model/continent/continent.freezed.dart index cb6688a65..6f13817d1 100644 --- a/compass_app/server/lib/model/continent/continent.freezed.dart +++ b/compass_app/server/lib/model/continent/continent.freezed.dart @@ -62,16 +62,14 @@ class _$ContinentCopyWithImpl<$Res, $Val extends Continent> $Res call({Object? name = null, Object? imageUrl = null}) { return _then( _value.copyWith( - name: - null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - imageUrl: - null == imageUrl - ? _value.imageUrl - : imageUrl // ignore: cast_nullable_to_non_nullable - as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + imageUrl: null == imageUrl + ? _value.imageUrl + : imageUrl // ignore: cast_nullable_to_non_nullable + as String, ) as $Val, ); @@ -106,16 +104,14 @@ class __$$ContinentImplCopyWithImpl<$Res> $Res call({Object? name = null, Object? imageUrl = null}) { return _then( _$ContinentImpl( - name: - null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - imageUrl: - null == imageUrl - ? _value.imageUrl - : imageUrl // ignore: cast_nullable_to_non_nullable - as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + imageUrl: null == imageUrl + ? _value.imageUrl + : imageUrl // ignore: cast_nullable_to_non_nullable + as String, ), ); } diff --git a/compass_app/server/lib/model/destination/destination.freezed.dart b/compass_app/server/lib/model/destination/destination.freezed.dart index 30789a969..1babb9353 100644 --- a/compass_app/server/lib/model/destination/destination.freezed.dart +++ b/compass_app/server/lib/model/destination/destination.freezed.dart @@ -95,41 +95,34 @@ class _$DestinationCopyWithImpl<$Res, $Val extends Destination> }) { return _then( _value.copyWith( - ref: - null == ref - ? _value.ref - : ref // ignore: cast_nullable_to_non_nullable - as String, - name: - null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - country: - null == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String, - continent: - null == continent - ? _value.continent - : continent // ignore: cast_nullable_to_non_nullable - as String, - knownFor: - null == knownFor - ? _value.knownFor - : knownFor // ignore: cast_nullable_to_non_nullable - as String, - tags: - null == tags - ? _value.tags - : tags // ignore: cast_nullable_to_non_nullable - as List, - imageUrl: - null == imageUrl - ? _value.imageUrl - : imageUrl // ignore: cast_nullable_to_non_nullable - as String, + ref: null == ref + ? _value.ref + : ref // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + country: null == country + ? _value.country + : country // ignore: cast_nullable_to_non_nullable + as String, + continent: null == continent + ? _value.continent + : continent // ignore: cast_nullable_to_non_nullable + as String, + knownFor: null == knownFor + ? _value.knownFor + : knownFor // ignore: cast_nullable_to_non_nullable + as String, + tags: null == tags + ? _value.tags + : tags // ignore: cast_nullable_to_non_nullable + as List, + imageUrl: null == imageUrl + ? _value.imageUrl + : imageUrl // ignore: cast_nullable_to_non_nullable + as String, ) as $Val, ); @@ -180,41 +173,34 @@ class __$$DestinationImplCopyWithImpl<$Res> }) { return _then( _$DestinationImpl( - ref: - null == ref - ? _value.ref - : ref // ignore: cast_nullable_to_non_nullable - as String, - name: - null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - country: - null == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String, - continent: - null == continent - ? _value.continent - : continent // ignore: cast_nullable_to_non_nullable - as String, - knownFor: - null == knownFor - ? _value.knownFor - : knownFor // ignore: cast_nullable_to_non_nullable - as String, - tags: - null == tags - ? _value._tags - : tags // ignore: cast_nullable_to_non_nullable - as List, - imageUrl: - null == imageUrl - ? _value.imageUrl - : imageUrl // ignore: cast_nullable_to_non_nullable - as String, + ref: null == ref + ? _value.ref + : ref // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + country: null == country + ? _value.country + : country // ignore: cast_nullable_to_non_nullable + as String, + continent: null == continent + ? _value.continent + : continent // ignore: cast_nullable_to_non_nullable + as String, + knownFor: null == knownFor + ? _value.knownFor + : knownFor // ignore: cast_nullable_to_non_nullable + as String, + tags: null == tags + ? _value._tags + : tags // ignore: cast_nullable_to_non_nullable + as List, + imageUrl: null == imageUrl + ? _value.imageUrl + : imageUrl // ignore: cast_nullable_to_non_nullable + as String, ), ); } diff --git a/compass_app/server/lib/model/login_request/login_request.freezed.dart b/compass_app/server/lib/model/login_request/login_request.freezed.dart index a45082a15..db4394ebb 100644 --- a/compass_app/server/lib/model/login_request/login_request.freezed.dart +++ b/compass_app/server/lib/model/login_request/login_request.freezed.dart @@ -64,16 +64,14 @@ class _$LoginRequestCopyWithImpl<$Res, $Val extends LoginRequest> $Res call({Object? email = null, Object? password = null}) { return _then( _value.copyWith( - email: - null == email - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as String, - password: - null == password - ? _value.password - : password // ignore: cast_nullable_to_non_nullable - as String, + email: null == email + ? _value.email + : email // ignore: cast_nullable_to_non_nullable + as String, + password: null == password + ? _value.password + : password // ignore: cast_nullable_to_non_nullable + as String, ) as $Val, ); @@ -108,16 +106,14 @@ class __$$LoginRequestImplCopyWithImpl<$Res> $Res call({Object? email = null, Object? password = null}) { return _then( _$LoginRequestImpl( - email: - null == email - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as String, - password: - null == password - ? _value.password - : password // ignore: cast_nullable_to_non_nullable - as String, + email: null == email + ? _value.email + : email // ignore: cast_nullable_to_non_nullable + as String, + password: null == password + ? _value.password + : password // ignore: cast_nullable_to_non_nullable + as String, ), ); } diff --git a/compass_app/server/lib/model/login_response/login_response.freezed.dart b/compass_app/server/lib/model/login_response/login_response.freezed.dart index 49be034eb..dfaf762b2 100644 --- a/compass_app/server/lib/model/login_response/login_response.freezed.dart +++ b/compass_app/server/lib/model/login_response/login_response.freezed.dart @@ -64,16 +64,14 @@ class _$LoginResponseCopyWithImpl<$Res, $Val extends LoginResponse> $Res call({Object? token = null, Object? userId = null}) { return _then( _value.copyWith( - token: - null == token - ? _value.token - : token // ignore: cast_nullable_to_non_nullable - as String, - userId: - null == userId - ? _value.userId - : userId // ignore: cast_nullable_to_non_nullable - as String, + token: null == token + ? _value.token + : token // ignore: cast_nullable_to_non_nullable + as String, + userId: null == userId + ? _value.userId + : userId // ignore: cast_nullable_to_non_nullable + as String, ) as $Val, ); @@ -108,16 +106,14 @@ class __$$LoginResponseImplCopyWithImpl<$Res> $Res call({Object? token = null, Object? userId = null}) { return _then( _$LoginResponseImpl( - token: - null == token - ? _value.token - : token // ignore: cast_nullable_to_non_nullable - as String, - userId: - null == userId - ? _value.userId - : userId // ignore: cast_nullable_to_non_nullable - as String, + token: null == token + ? _value.token + : token // ignore: cast_nullable_to_non_nullable + as String, + userId: null == userId + ? _value.userId + : userId // ignore: cast_nullable_to_non_nullable + as String, ), ); } diff --git a/compass_app/server/lib/model/user/user.freezed.dart b/compass_app/server/lib/model/user/user.freezed.dart index ca8a4b81e..74e26c7b3 100644 --- a/compass_app/server/lib/model/user/user.freezed.dart +++ b/compass_app/server/lib/model/user/user.freezed.dart @@ -72,26 +72,22 @@ class _$UserCopyWithImpl<$Res, $Val extends User> }) { return _then( _value.copyWith( - id: - null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - name: - null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - email: - null == email - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as String, - picture: - null == picture - ? _value.picture - : picture // ignore: cast_nullable_to_non_nullable - as String, + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + email: null == email + ? _value.email + : email // ignore: cast_nullable_to_non_nullable + as String, + picture: null == picture + ? _value.picture + : picture // ignore: cast_nullable_to_non_nullable + as String, ) as $Val, ); @@ -128,26 +124,22 @@ class __$$UserImplCopyWithImpl<$Res> }) { return _then( _$UserImpl( - id: - null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - name: - null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - email: - null == email - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as String, - picture: - null == picture - ? _value.picture - : picture // ignore: cast_nullable_to_non_nullable - as String, + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + email: null == email + ? _value.email + : email // ignore: cast_nullable_to_non_nullable + as String, + picture: null == picture + ? _value.picture + : picture // ignore: cast_nullable_to_non_nullable + as String, ), ); } diff --git a/compass_app/server/lib/routes/booking.dart b/compass_app/server/lib/routes/booking.dart index 850797bce..adffc89fc 100644 --- a/compass_app/server/lib/routes/booking.dart +++ b/compass_app/server/lib/routes/booking.dart @@ -22,11 +22,10 @@ class BookingApi { BookingApi() { // Create a default booking final destination = Assets.destinations.first; - final activitiesRef = - Assets.activities - .where((activity) => activity.destinationRef == destination.ref) - .map((activity) => activity.ref) - .toList(); + final activitiesRef = Assets.activities + .where((activity) => activity.destinationRef == destination.ref) + .map((activity) => activity.ref) + .toList(); _bookings.add( Booking( id: _sequentialId++, @@ -60,8 +59,9 @@ class BookingApi { // Get a booking by id router.get('/', (Request request, String id) { final bookingId = int.parse(id); - final booking = - _bookings.where((booking) => booking.id == bookingId).firstOrNull; + final booking = _bookings + .where((booking) => booking.id == bookingId) + .firstOrNull; if (booking == null) { return Response.notFound('Invalid id'); @@ -102,8 +102,9 @@ class BookingApi { // Delete booking router.delete('/', (Request request, String id) async { final bookingId = int.parse(id); - final booking = - _bookings.where((booking) => booking.id == bookingId).firstOrNull; + final booking = _bookings + .where((booking) => booking.id == bookingId) + .firstOrNull; if (booking == null) { return Response.notFound('Invalid id'); } diff --git a/compass_app/server/lib/routes/destination.dart b/compass_app/server/lib/routes/destination.dart index c10ea18af..7d63ca577 100644 --- a/compass_app/server/lib/routes/destination.dart +++ b/compass_app/server/lib/routes/destination.dart @@ -21,10 +21,9 @@ class DestinationApi { }); router.get('//activity', (Request request, String id) { - final list = - Assets.activities - .where((activity) => activity.destinationRef == id) - .toList(); + final list = Assets.activities + .where((activity) => activity.destinationRef == id) + .toList(); return Response.ok( json.encode(list), headers: {'Content-Type': 'application/json'}, diff --git a/compass_app/server/pubspec.yaml b/compass_app/server/pubspec.yaml index 734269df4..cadb9be52 100644 --- a/compass_app/server/pubspec.yaml +++ b/compass_app/server/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 1.0.0 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: args: ^2.4.0 diff --git a/context_menus/lib/cascading_menu_page.dart b/context_menus/lib/cascading_menu_page.dart index f8d018981..7fc0c4ad0 100644 --- a/context_menus/lib/cascading_menu_page.dart +++ b/context_menus/lib/cascading_menu_page.dart @@ -234,14 +234,13 @@ class _MyCascadingContextMenuState extends State<_MyCascadingContextMenu> { // already hidden. MenuEntry( label: 'Reset', - onPressed: - widget.showingMessage - ? () { - ContextMenuController.removeAny(); - widget.onChangeSelection('Reset'); - widget.onToggleMessageVisibility(); - } - : null, + onPressed: widget.showingMessage + ? () { + ContextMenuController.removeAny(); + widget.onChangeSelection('Reset'); + widget.onToggleMessageVisibility(); + } + : null, shortcut: const SingleActivator(LogicalKeyboardKey.escape), ), MenuEntry( diff --git a/context_menus/lib/custom_buttons_page.dart b/context_menus/lib/custom_buttons_page.dart index 1f8b87ac8..573978435 100644 --- a/context_menus/lib/custom_buttons_page.dart +++ b/context_menus/lib/custom_buttons_page.dart @@ -52,26 +52,27 @@ class CustomButtonsPage extends StatelessWidget { // Build the default buttons, but make them look custom. // Note that in a real project you may want to build // different buttons depending on the platform. - children: - editableTextState.contextMenuButtonItems.map((buttonItem) { - return CupertinoButton( - borderRadius: null, - color: const Color(0xffaaaa00), - disabledColor: const Color(0xffaaaaff), - onPressed: buttonItem.onPressed, - padding: const EdgeInsets.all(10.0), - pressedOpacity: 0.7, - child: SizedBox( - width: 200.0, - child: Text( - CupertinoTextSelectionToolbarButton.getButtonLabel( - context, - buttonItem, - ), - ), + children: editableTextState.contextMenuButtonItems.map(( + buttonItem, + ) { + return CupertinoButton( + borderRadius: null, + color: const Color(0xffaaaa00), + disabledColor: const Color(0xffaaaaff), + onPressed: buttonItem.onPressed, + padding: const EdgeInsets.all(10.0), + pressedOpacity: 0.7, + child: SizedBox( + width: 200.0, + child: Text( + CupertinoTextSelectionToolbarButton.getButtonLabel( + context, + buttonItem, ), - ); - }).toList(), + ), + ), + ); + }).toList(), ); }, ), diff --git a/context_menus/lib/custom_menu_page.dart b/context_menus/lib/custom_menu_page.dart index 9645391ac..53deaceac 100644 --- a/context_menus/lib/custom_menu_page.dart +++ b/context_menus/lib/custom_menu_page.dart @@ -47,11 +47,10 @@ class CustomMenuPage extends StatelessWidget { contextMenuBuilder: (context, editableTextState) { return _MyContextMenu( anchor: editableTextState.contextMenuAnchors.primaryAnchor, - children: - AdaptiveTextSelectionToolbar.getAdaptiveButtons( - context, - editableTextState.contextMenuButtonItems, - ).toList(), + children: AdaptiveTextSelectionToolbar.getAdaptiveButtons( + context, + editableTextState.contextMenuButtonItems, + ).toList(), ); }, ), diff --git a/context_menus/lib/email_button_page.dart b/context_menus/lib/email_button_page.dart index a5c7f35d1..d1f72baf2 100644 --- a/context_menus/lib/email_button_page.dart +++ b/context_menus/lib/email_button_page.dart @@ -22,9 +22,8 @@ class EmailButtonPage extends StatelessWidget { DialogRoute _showDialog(BuildContext context) { return DialogRoute( context: context, - builder: - (context) => - const AlertDialog(title: Text('You clicked send email!')), + builder: (context) => + const AlertDialog(title: Text('You clicked send email!')), ); } diff --git a/context_menus/lib/field_types_page.dart b/context_menus/lib/field_types_page.dart index 2fde4bbee..d8d5c2fbc 100644 --- a/context_menus/lib/field_types_page.dart +++ b/context_menus/lib/field_types_page.dart @@ -85,11 +85,10 @@ class FieldTypesPage extends StatelessWidget { contextMenuBuilder: (context, editableTextState) { return DesktopTextSelectionToolbar( anchor: editableTextState.contextMenuAnchors.primaryAnchor, - children: - AdaptiveTextSelectionToolbar.getAdaptiveButtons( - context, - editableTextState.contextMenuButtonItems, - ).toList(), + children: AdaptiveTextSelectionToolbar.getAdaptiveButtons( + context, + editableTextState.contextMenuButtonItems, + ).toList(), ); }, ), diff --git a/context_menus/lib/full_page.dart b/context_menus/lib/full_page.dart index 9ce311c23..9a2ebb9ee 100644 --- a/context_menus/lib/full_page.dart +++ b/context_menus/lib/full_page.dart @@ -126,26 +126,25 @@ class FullPage extends StatelessWidget { // Build the default buttons, but make them look crazy. // Note that in a real project you may want to build // different buttons depending on the platform. - children: - buttonItems.map((buttonItem) { - return CupertinoButton( - borderRadius: null, - color: const Color(0xffaaaa00), - disabledColor: const Color(0xffaaaaff), - onPressed: buttonItem.onPressed, - padding: const EdgeInsets.all(10.0), - pressedOpacity: 0.7, - child: SizedBox( - width: 200.0, - child: Text( - CupertinoTextSelectionToolbarButton.getButtonLabel( - context, - buttonItem, - ), - ), + children: buttonItems.map((buttonItem) { + return CupertinoButton( + borderRadius: null, + color: const Color(0xffaaaa00), + disabledColor: const Color(0xffaaaaff), + onPressed: buttonItem.onPressed, + padding: const EdgeInsets.all(10.0), + pressedOpacity: 0.7, + child: SizedBox( + width: 200.0, + child: Text( + CupertinoTextSelectionToolbarButton.getButtonLabel( + context, + buttonItem, ), - ); - }).toList(), + ), + ), + ); + }).toList(), ); }, ), diff --git a/context_menus/lib/image_page.dart b/context_menus/lib/image_page.dart index c3ebf1cf7..a7fc3d04c 100644 --- a/context_menus/lib/image_page.dart +++ b/context_menus/lib/image_page.dart @@ -19,10 +19,8 @@ class ImagePage extends StatelessWidget { DialogRoute _showDialog(BuildContext context) { return DialogRoute( context: context, - builder: - (context) => const AlertDialog( - title: Text('Image saved! (not really though)'), - ), + builder: (context) => + const AlertDialog(title: Text('Image saved! (not really though)')), ); } diff --git a/context_menus/lib/main.dart b/context_menus/lib/main.dart index 566534f5b..e67fa3411 100644 --- a/context_menus/lib/main.dart +++ b/context_menus/lib/main.dart @@ -64,36 +64,30 @@ class _MyAppState extends State { initialRoute: '/', routes: { '/': (context) => MyHomePage(onChangedPlatform: onChangedPlatform), - AnywherePage.route: - (context) => AnywherePage(onChangedPlatform: onChangedPlatform), - CustomButtonsPage.route: - (context) => - CustomButtonsPage(onChangedPlatform: onChangedPlatform), - CustomMenuPage.route: - (context) => CustomMenuPage(onChangedPlatform: onChangedPlatform), - ReorderedButtonsPage.route: - (context) => - ReorderedButtonsPage(onChangedPlatform: onChangedPlatform), - EmailButtonPage.route: - (context) => EmailButtonPage(onChangedPlatform: onChangedPlatform), - ImagePage.route: - (context) => ImagePage(onChangedPlatform: onChangedPlatform), - FieldTypesPage.route: - (context) => FieldTypesPage(onChangedPlatform: onChangedPlatform), - FullPage.route: - (context) => FullPage(onChangedPlatform: onChangedPlatform), - ModifiedActionPage.route: - (context) => - ModifiedActionPage(onChangedPlatform: onChangedPlatform), - GlobalSelectionPage.route: - (context) => - GlobalSelectionPage(onChangedPlatform: onChangedPlatform), - DefaultValuesPage.route: - (context) => - DefaultValuesPage(onChangedPlatform: onChangedPlatform), - CascadingMenuPage.route: - (context) => - CascadingMenuPage(onChangedPlatform: onChangedPlatform), + AnywherePage.route: (context) => + AnywherePage(onChangedPlatform: onChangedPlatform), + CustomButtonsPage.route: (context) => + CustomButtonsPage(onChangedPlatform: onChangedPlatform), + CustomMenuPage.route: (context) => + CustomMenuPage(onChangedPlatform: onChangedPlatform), + ReorderedButtonsPage.route: (context) => + ReorderedButtonsPage(onChangedPlatform: onChangedPlatform), + EmailButtonPage.route: (context) => + EmailButtonPage(onChangedPlatform: onChangedPlatform), + ImagePage.route: (context) => + ImagePage(onChangedPlatform: onChangedPlatform), + FieldTypesPage.route: (context) => + FieldTypesPage(onChangedPlatform: onChangedPlatform), + FullPage.route: (context) => + FullPage(onChangedPlatform: onChangedPlatform), + ModifiedActionPage.route: (context) => + ModifiedActionPage(onChangedPlatform: onChangedPlatform), + GlobalSelectionPage.route: (context) => + GlobalSelectionPage(onChangedPlatform: onChangedPlatform), + DefaultValuesPage.route: (context) => + DefaultValuesPage(onChangedPlatform: onChangedPlatform), + CascadingMenuPage.route: (context) => + CascadingMenuPage(onChangedPlatform: onChangedPlatform), }, ); } diff --git a/context_menus/lib/modified_action_page.dart b/context_menus/lib/modified_action_page.dart index b14568615..68587f0cb 100644 --- a/context_menus/lib/modified_action_page.dart +++ b/context_menus/lib/modified_action_page.dart @@ -22,10 +22,9 @@ class ModifiedActionPage extends StatelessWidget { DialogRoute _showDialog(BuildContext context) { return DialogRoute( context: context, - builder: - (context) => const AlertDialog( - title: Text('Copied, but also showed this dialog.'), - ), + builder: (context) => const AlertDialog( + title: Text('Copied, but also showed this dialog.'), + ), ); } diff --git a/context_menus/lib/platform_selector.dart b/context_menus/lib/platform_selector.dart index 5ce1eeafe..9df3e99d2 100644 --- a/context_menus/lib/platform_selector.dart +++ b/context_menus/lib/platform_selector.dart @@ -37,19 +37,18 @@ class _PlatformSelectorState extends State { widget.onChangedPlatform(value); setState(() {}); }, - items: - TargetPlatform.values.map((platform) { - return DropdownMenuItem( - value: platform, - child: Row( - children: [ - if (platform == originaPlatform) - const Icon(Icons.home, color: Color(0xff616161)), - Text(_platformToString(platform)), - ], - ), - ); - }).toList(), + items: TargetPlatform.values.map((platform) { + return DropdownMenuItem( + value: platform, + child: Row( + children: [ + if (platform == originaPlatform) + const Icon(Icons.home, color: Color(0xff616161)), + Text(_platformToString(platform)), + ], + ), + ); + }).toList(), ), ); } diff --git a/context_menus/pubspec.yaml b/context_menus/pubspec.yaml index 2b66fb6df..b8d44d88d 100644 --- a/context_menus/pubspec.yaml +++ b/context_menus/pubspec.yaml @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions diff --git a/date_planner/pubspec.yaml b/date_planner/pubspec.yaml index e8a484bce..41bce1a16 100644 --- a/date_planner/pubspec.yaml +++ b/date_planner/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 0.1.0 environment: - sdk: ^3.7.0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/deeplink_store_example/lib/product_category_list.dart b/deeplink_store_example/lib/product_category_list.dart index 210156d4a..e794aeef0 100644 --- a/deeplink_store_example/lib/product_category_list.dart +++ b/deeplink_store_example/lib/product_category_list.dart @@ -30,10 +30,9 @@ class ProductCategoryList extends StatelessWidget { value.toString().contains(state.pathParameters['category']!), orElse: () => Category.all, ); - final List children = - ProductsRepository.loadProducts( - category: category, - ).map((Product p) => RowItem(product: p)).toList(); + final List children = ProductsRepository.loadProducts( + category: category, + ).map((Product p) => RowItem(product: p)).toList(); return Scaffold( backgroundColor: Styles.scaffoldBackground, body: CustomScrollView( diff --git a/deeplink_store_example/lib/product_list.dart b/deeplink_store_example/lib/product_list.dart index 50ef37848..569c81d3f 100644 --- a/deeplink_store_example/lib/product_list.dart +++ b/deeplink_store_example/lib/product_list.dart @@ -23,10 +23,9 @@ class ProductList extends StatelessWidget { @override Widget build(BuildContext context) { - final List children = - ProductsRepository.loadProducts() - .map((Product p) => RowItem(product: p)) - .toList(); + final List children = ProductsRepository.loadProducts() + .map((Product p) => RowItem(product: p)) + .toList(); return Scaffold( backgroundColor: Styles.scaffoldBackground, body: CustomScrollView( diff --git a/deeplink_store_example/pubspec.yaml b/deeplink_store_example/pubspec.yaml index 9f295df77..83d625e1b 100644 --- a/deeplink_store_example/pubspec.yaml +++ b/deeplink_store_example/pubspec.yaml @@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions diff --git a/desktop_photo_search/fluent_ui/lib/main.dart b/desktop_photo_search/fluent_ui/lib/main.dart index 7c57e7f13..d11985cfb 100644 --- a/desktop_photo_search/fluent_ui/lib/main.dart +++ b/desktop_photo_search/fluent_ui/lib/main.dart @@ -39,8 +39,8 @@ void main() { runApp( ChangeNotifierProvider( - create: - (context) => PhotoSearchModel(Unsplash(accessKey: unsplashAccessKey)), + create: (context) => + PhotoSearchModel(Unsplash(accessKey: unsplashAccessKey)), child: const UnsplashSearchApp(), ), ); @@ -84,9 +84,8 @@ class UnsplashHomePage extends StatelessWidget { onSelected: () { showDialog( context: context, - builder: - (context) => - PhotoSearchDialog(callback: photoSearchModel.addSearch), + builder: (context) => + PhotoSearchDialog(callback: photoSearchModel.addSearch), ); }, ), @@ -118,12 +117,11 @@ class UnsplashHomePage extends StatelessWidget { return UnsplashNotice( child: Container( color: Colors.white, - child: - photoSearchModel.entries.isNotEmpty - ? const UnsplashSearchContent() - : const Center( - child: Text('Search for Photos using the Search menu'), - ), + child: photoSearchModel.entries.isNotEmpty + ? const UnsplashSearchContent() + : const Center( + child: Text('Search for Photos using the Search menu'), + ), ), ); } diff --git a/desktop_photo_search/fluent_ui/lib/src/unsplash/api_error.g.dart b/desktop_photo_search/fluent_ui/lib/src/unsplash/api_error.g.dart index 191309a7b..acc2aab46 100644 --- a/desktop_photo_search/fluent_ui/lib/src/unsplash/api_error.g.dart +++ b/desktop_photo_search/fluent_ui/lib/src/unsplash/api_error.g.dart @@ -106,8 +106,9 @@ class _$ApiError extends ApiError { @override String toString() { - return (newBuiltValueToStringHelper(r'ApiError') - ..add('errors', errors)).toString(); + return (newBuiltValueToStringHelper( + r'ApiError', + )..add('errors', errors)).toString(); } } diff --git a/desktop_photo_search/fluent_ui/lib/src/unsplash/tags.g.dart b/desktop_photo_search/fluent_ui/lib/src/unsplash/tags.g.dart index c01972084..6140fee4d 100644 --- a/desktop_photo_search/fluent_ui/lib/src/unsplash/tags.g.dart +++ b/desktop_photo_search/fluent_ui/lib/src/unsplash/tags.g.dart @@ -98,8 +98,9 @@ class _$Tags extends Tags { @override String toString() { - return (newBuiltValueToStringHelper(r'Tags') - ..add('title', title)).toString(); + return (newBuiltValueToStringHelper( + r'Tags', + )..add('title', title)).toString(); } } diff --git a/desktop_photo_search/fluent_ui/lib/src/widgets/photo_details.dart b/desktop_photo_search/fluent_ui/lib/src/widgets/photo_details.dart index 743abdaf3..fc55e98f0 100644 --- a/desktop_photo_search/fluent_ui/lib/src/widgets/photo_details.dart +++ b/desktop_photo_search/fluent_ui/lib/src/widgets/photo_details.dart @@ -39,20 +39,18 @@ class _PhotoDetailsState extends State { uri: Uri.parse( 'https://unsplash.com/@${widget.photo.user!.username}?utm_source=$unsplashAppName&utm_medium=referral', ), - builder: - (context, followLink) => HyperlinkButton( - onPressed: followLink, - child: Text(widget.photo.user!.name), - ), + builder: (context, followLink) => HyperlinkButton( + onPressed: followLink, + child: Text(widget.photo.user!.name), + ), ), const Text('on'), Link( uri: _unsplashHomepage, - builder: - (context, followLink) => HyperlinkButton( - onPressed: followLink, - child: const Text('Unsplash'), - ), + builder: (context, followLink) => HyperlinkButton( + onPressed: followLink, + child: const Text('Unsplash'), + ), ), ], ); diff --git a/desktop_photo_search/fluent_ui/lib/src/widgets/photo_search_dialog.dart b/desktop_photo_search/fluent_ui/lib/src/widgets/photo_search_dialog.dart index 37de11f9e..fa83f813b 100644 --- a/desktop_photo_search/fluent_ui/lib/src/widgets/photo_search_dialog.dart +++ b/desktop_photo_search/fluent_ui/lib/src/widgets/photo_search_dialog.dart @@ -48,13 +48,12 @@ class _PhotoSearchDialogState extends State { ), actions: [ FilledButton( - onPressed: - _searchEnabled - ? () { - widget.callback(_controller.text); - Navigator.of(context).pop(); - } - : null, + onPressed: _searchEnabled + ? () { + widget.callback(_controller.text); + Navigator.of(context).pop(); + } + : null, child: const Text('Search'), ), Button( diff --git a/desktop_photo_search/fluent_ui/lib/src/widgets/policy_dialog.dart b/desktop_photo_search/fluent_ui/lib/src/widgets/policy_dialog.dart index a0c91ab89..add7f3d92 100644 --- a/desktop_photo_search/fluent_ui/lib/src/widgets/policy_dialog.dart +++ b/desktop_photo_search/fluent_ui/lib/src/widgets/policy_dialog.dart @@ -29,16 +29,15 @@ class PolicyDialog extends StatelessWidget { fontWeight: FontWeight.bold, color: Colors.blue.normal, ), - recognizer: - TapGestureRecognizer() - ..onTap = () async { - final url = Uri.parse( - 'https://policies.google.com/terms', - ); - if (await url_launcher.canLaunchUrl(url)) { - await url_launcher.launchUrl(url); - } - }, + recognizer: TapGestureRecognizer() + ..onTap = () async { + final url = Uri.parse( + 'https://policies.google.com/terms', + ); + if (await url_launcher.canLaunchUrl(url)) { + await url_launcher.launchUrl(url); + } + }, ), ], ), @@ -55,14 +54,13 @@ class PolicyDialog extends StatelessWidget { fontWeight: FontWeight.bold, color: Colors.blue.normal, ), - recognizer: - TapGestureRecognizer() - ..onTap = () async { - final url = Uri.parse('https://unsplash.com/terms'); - if (await url_launcher.canLaunchUrl(url)) { - await url_launcher.launchUrl(url); - } - }, + recognizer: TapGestureRecognizer() + ..onTap = () async { + final url = Uri.parse('https://unsplash.com/terms'); + if (await url_launcher.canLaunchUrl(url)) { + await url_launcher.launchUrl(url); + } + }, ), ], ), diff --git a/desktop_photo_search/fluent_ui/lib/src/widgets/unsplash_notice.dart b/desktop_photo_search/fluent_ui/lib/src/widgets/unsplash_notice.dart index ed86de980..074eebbdb 100644 --- a/desktop_photo_search/fluent_ui/lib/src/widgets/unsplash_notice.dart +++ b/desktop_photo_search/fluent_ui/lib/src/widgets/unsplash_notice.dart @@ -68,13 +68,12 @@ class _UnsplashDialog extends StatelessWidget { children: [ TextSpan( text: 'Unsplash', - recognizer: - TapGestureRecognizer() - ..onTap = () async { - if (!await launchUrl(_unsplashHomepage)) { - throw 'Could not launch $_unsplashHomepage'; - } - }, + recognizer: TapGestureRecognizer() + ..onTap = () async { + if (!await launchUrl(_unsplashHomepage)) { + throw 'Could not launch $_unsplashHomepage'; + } + }, style: TextStyle(color: Colors.blue), ), const TextSpan( @@ -87,16 +86,18 @@ class _UnsplashDialog extends StatelessWidget { ), TextSpan( text: 'how Unsplash collects and uses data', - recognizer: - TapGestureRecognizer() - ..onTap = () async { - if (!await launchUrl(_unsplashPrivacyPolicy)) { - throw 'Could not launch $_unsplashPrivacyPolicy'; - } - }, + recognizer: TapGestureRecognizer() + ..onTap = () async { + if (!await launchUrl(_unsplashPrivacyPolicy)) { + throw 'Could not launch $_unsplashPrivacyPolicy'; + } + }, style: TextStyle(color: Colors.blue), ), - const TextSpan(text: '.', style: TextStyle(color: Colors.grey)), + const TextSpan( + text: '.', + style: TextStyle(color: Colors.grey), + ), ], ), ), 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 85738d3b2..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 @@ -44,34 +44,33 @@ class _UnsplashSearchContentState extends State { ), ), secondChild: Center( - child: - photoSearchModel.selectedPhoto != null - ? PhotoDetails( - photo: photoSearchModel.selectedPhoto!, - onPhotoSave: (photo) async { - final saveLocation = await getSaveLocation( - suggestedName: '${photo.id}.jpg', - acceptedTypeGroups: [ - const XTypeGroup( - label: 'JPG', - extensions: ['jpg'], - mimeTypes: ['image/jpeg'], - ), - ], + child: photoSearchModel.selectedPhoto != null + ? PhotoDetails( + photo: photoSearchModel.selectedPhoto!, + onPhotoSave: (photo) async { + final saveLocation = await getSaveLocation( + suggestedName: '${photo.id}.jpg', + acceptedTypeGroups: [ + const XTypeGroup( + label: 'JPG', + extensions: ['jpg'], + mimeTypes: ['image/jpeg'], + ), + ], + ); + if (saveLocation != null) { + final fileData = await photoSearchModel.download( + photo: photo, + ); + final photoFile = XFile.fromData( + fileData, + mimeType: 'image/jpeg', ); - if (saveLocation != null) { - final fileData = await photoSearchModel.download( - photo: photo, - ); - final photoFile = XFile.fromData( - fileData, - mimeType: 'image/jpeg', - ); - await photoFile.saveTo(saveLocation.path); - } - }, - ) - : Container(), + await photoFile.saveTo(saveLocation.path); + } + }, + ) + : Container(), ), ); } @@ -85,26 +84,25 @@ class _UnsplashSearchContentState extends State { return TreeViewItem( content: Text(searchEntry.query), - children: - searchEntry.photos - .map( - (photo) => TreeViewItem( - content: Semantics( - button: true, - onTap: () => selectPhoto(photo), - label: labelForPhoto(photo), - excludeSemantics: true, - child: GestureDetector( - onTap: () => selectPhoto(photo), - child: Text( - labelForPhoto(photo), - style: const TextStyle(color: Colors.black), - ), - ), + children: searchEntry.photos + .map( + (photo) => TreeViewItem( + content: Semantics( + button: true, + onTap: () => selectPhoto(photo), + label: labelForPhoto(photo), + excludeSemantics: true, + child: GestureDetector( + onTap: () => selectPhoto(photo), + child: Text( + labelForPhoto(photo), + style: const TextStyle(color: Colors.black), ), ), - ) - .toList(), + ), + ), + ) + .toList(), ); } } diff --git a/desktop_photo_search/fluent_ui/pubspec.yaml b/desktop_photo_search/fluent_ui/pubspec.yaml index 1e0ccfe90..9244e626f 100644 --- a/desktop_photo_search/fluent_ui/pubspec.yaml +++ b/desktop_photo_search/fluent_ui/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: built_collection: ^5.1.1 diff --git a/desktop_photo_search/material/lib/main.dart b/desktop_photo_search/material/lib/main.dart index 27b42135b..ee70ba799 100644 --- a/desktop_photo_search/material/lib/main.dart +++ b/desktop_photo_search/material/lib/main.dart @@ -39,8 +39,8 @@ void main() { runApp( ChangeNotifierProvider( - create: - (context) => PhotoSearchModel(Unsplash(accessKey: unsplashAccessKey)), + create: (context) => + PhotoSearchModel(Unsplash(accessKey: unsplashAccessKey)), child: const UnsplashSearchApp(), ), ); @@ -85,9 +85,8 @@ class UnsplashHomePage extends StatelessWidget { onSelected: () { showDialog( context: context, - builder: - (context) => - PhotoSearchDialog(callback: photoSearchModel.addSearch), + builder: (context) => + PhotoSearchDialog(callback: photoSearchModel.addSearch), ); }, ), @@ -119,20 +118,17 @@ class UnsplashHomePage extends StatelessWidget { return UnsplashNotice( child: Scaffold( appBar: AppBar(title: Text(title)), - body: - photoSearchModel.entries.isNotEmpty - ? const UnsplashSearchContent() - : const Center( - child: Text('Search for Photos using the Fab button'), - ), - floatingActionButton: FloatingActionButton( - onPressed: - () => showDialog( - context: context, - builder: - (context) => - PhotoSearchDialog(callback: photoSearchModel.addSearch), + body: photoSearchModel.entries.isNotEmpty + ? const UnsplashSearchContent() + : const Center( + child: Text('Search for Photos using the Fab button'), ), + floatingActionButton: FloatingActionButton( + onPressed: () => showDialog( + context: context, + builder: (context) => + PhotoSearchDialog(callback: photoSearchModel.addSearch), + ), tooltip: 'Search for a photo', child: const Icon(Icons.search), ), diff --git a/desktop_photo_search/material/lib/src/unsplash/api_error.g.dart b/desktop_photo_search/material/lib/src/unsplash/api_error.g.dart index 191309a7b..acc2aab46 100644 --- a/desktop_photo_search/material/lib/src/unsplash/api_error.g.dart +++ b/desktop_photo_search/material/lib/src/unsplash/api_error.g.dart @@ -106,8 +106,9 @@ class _$ApiError extends ApiError { @override String toString() { - return (newBuiltValueToStringHelper(r'ApiError') - ..add('errors', errors)).toString(); + return (newBuiltValueToStringHelper( + r'ApiError', + )..add('errors', errors)).toString(); } } diff --git a/desktop_photo_search/material/lib/src/unsplash/tags.g.dart b/desktop_photo_search/material/lib/src/unsplash/tags.g.dart index c01972084..6140fee4d 100644 --- a/desktop_photo_search/material/lib/src/unsplash/tags.g.dart +++ b/desktop_photo_search/material/lib/src/unsplash/tags.g.dart @@ -98,8 +98,9 @@ class _$Tags extends Tags { @override String toString() { - return (newBuiltValueToStringHelper(r'Tags') - ..add('title', title)).toString(); + return (newBuiltValueToStringHelper( + r'Tags', + )..add('title', title)).toString(); } } diff --git a/desktop_photo_search/material/lib/src/widgets/photo_details.dart b/desktop_photo_search/material/lib/src/widgets/photo_details.dart index 2da4eb311..069306963 100644 --- a/desktop_photo_search/material/lib/src/widgets/photo_details.dart +++ b/desktop_photo_search/material/lib/src/widgets/photo_details.dart @@ -37,20 +37,16 @@ class _PhotoDetailsState extends State { uri: Uri.parse( 'https://unsplash.com/@${widget.photo.user!.username}?utm_source=$unsplashAppName&utm_medium=referral', ), - builder: - (context, followLink) => TextButton( - onPressed: followLink, - child: Text(widget.photo.user!.name), - ), + builder: (context, followLink) => TextButton( + onPressed: followLink, + child: Text(widget.photo.user!.name), + ), ), const Text(' on '), Link( uri: _unsplashHomepage, - builder: - (context, followLink) => TextButton( - onPressed: followLink, - child: const Text('Unsplash'), - ), + builder: (context, followLink) => + TextButton(onPressed: followLink, child: const Text('Unsplash')), ), ], ); diff --git a/desktop_photo_search/material/lib/src/widgets/photo_search_dialog.dart b/desktop_photo_search/material/lib/src/widgets/photo_search_dialog.dart index 28aee440a..28cd62e64 100644 --- a/desktop_photo_search/material/lib/src/widgets/photo_search_dialog.dart +++ b/desktop_photo_search/material/lib/src/widgets/photo_search_dialog.dart @@ -55,13 +55,12 @@ class _PhotoSearchDialogState extends State { child: const Text('CANCEL'), ), TextButton( - onPressed: - _searchEnabled - ? () { - widget.callback(_controller.text); - Navigator.of(context).pop(); - } - : null, + onPressed: _searchEnabled + ? () { + widget.callback(_controller.text); + Navigator.of(context).pop(); + } + : null, child: const Text('SEARCH'), ), ], diff --git a/desktop_photo_search/material/lib/src/widgets/policy_dialog.dart b/desktop_photo_search/material/lib/src/widgets/policy_dialog.dart index dfc1ca738..792b7526d 100644 --- a/desktop_photo_search/material/lib/src/widgets/policy_dialog.dart +++ b/desktop_photo_search/material/lib/src/widgets/policy_dialog.dart @@ -29,16 +29,15 @@ class PolicyDialog extends StatelessWidget { fontWeight: FontWeight.bold, color: Colors.lightBlue, ), - recognizer: - TapGestureRecognizer() - ..onTap = () async { - final url = Uri.parse( - 'https://policies.google.com/terms', - ); - if (await url_launcher.canLaunchUrl(url)) { - await url_launcher.launchUrl(url); - } - }, + recognizer: TapGestureRecognizer() + ..onTap = () async { + final url = Uri.parse( + 'https://policies.google.com/terms', + ); + if (await url_launcher.canLaunchUrl(url)) { + await url_launcher.launchUrl(url); + } + }, ), ], ), @@ -55,14 +54,13 @@ class PolicyDialog extends StatelessWidget { fontWeight: FontWeight.bold, color: Colors.lightBlue, ), - recognizer: - TapGestureRecognizer() - ..onTap = () async { - final url = Uri.parse('https://unsplash.com/terms'); - if (await url_launcher.canLaunchUrl(url)) { - await url_launcher.launchUrl(url); - } - }, + recognizer: TapGestureRecognizer() + ..onTap = () async { + final url = Uri.parse('https://unsplash.com/terms'); + if (await url_launcher.canLaunchUrl(url)) { + await url_launcher.launchUrl(url); + } + }, ), ], ), diff --git a/desktop_photo_search/material/lib/src/widgets/unsplash_notice.dart b/desktop_photo_search/material/lib/src/widgets/unsplash_notice.dart index 3845ba0e9..22e2c46aa 100644 --- a/desktop_photo_search/material/lib/src/widgets/unsplash_notice.dart +++ b/desktop_photo_search/material/lib/src/widgets/unsplash_notice.dart @@ -69,13 +69,12 @@ class _UnsplashDialog extends StatelessWidget { children: [ TextSpan( text: 'Unsplash', - recognizer: - TapGestureRecognizer() - ..onTap = () async { - if (!await launchUrl(_unsplashHomepage)) { - throw 'Could not launch $_unsplashHomepage'; - } - }, + recognizer: TapGestureRecognizer() + ..onTap = () async { + if (!await launchUrl(_unsplashHomepage)) { + throw 'Could not launch $_unsplashHomepage'; + } + }, style: const TextStyle(color: Colors.blue), ), const TextSpan( @@ -88,16 +87,18 @@ class _UnsplashDialog extends StatelessWidget { ), TextSpan( text: 'how Unsplash collects and uses data', - recognizer: - TapGestureRecognizer() - ..onTap = () async { - if (!await launchUrl(_unsplashPrivacyPolicy)) { - throw 'Could not launch $_unsplashPrivacyPolicy'; - } - }, + recognizer: TapGestureRecognizer() + ..onTap = () async { + if (!await launchUrl(_unsplashPrivacyPolicy)) { + throw 'Could not launch $_unsplashPrivacyPolicy'; + } + }, style: const TextStyle(color: Colors.blue), ), - const TextSpan(text: '.', style: TextStyle(color: Colors.grey)), + const TextSpan( + text: '.', + style: TextStyle(color: Colors.grey), + ), ], ), ), 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 ac74dd538..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 @@ -46,34 +46,33 @@ class _UnsplashSearchContentState extends State { ), ), secondChild: Center( - child: - photoSearchModel.selectedPhoto != null - ? PhotoDetails( - photo: photoSearchModel.selectedPhoto!, - onPhotoSave: (photo) async { - final saveLocation = await getSaveLocation( - suggestedName: '${photo.id}.jpg', - acceptedTypeGroups: [ - const XTypeGroup( - label: 'JPG', - extensions: ['jpg'], - mimeTypes: ['image/jpeg'], - ), - ], + child: photoSearchModel.selectedPhoto != null + ? PhotoDetails( + photo: photoSearchModel.selectedPhoto!, + onPhotoSave: (photo) async { + final saveLocation = await getSaveLocation( + suggestedName: '${photo.id}.jpg', + acceptedTypeGroups: [ + const XTypeGroup( + label: 'JPG', + extensions: ['jpg'], + mimeTypes: ['image/jpeg'], + ), + ], + ); + if (saveLocation != null) { + final fileData = await photoSearchModel.download( + photo: photo, + ); + final photoFile = XFile.fromData( + fileData, + mimeType: 'image/jpeg', ); - if (saveLocation != null) { - final fileData = await photoSearchModel.download( - photo: photo, - ); - final photoFile = XFile.fromData( - fileData, - mimeType: 'image/jpeg', - ); - await photoFile.saveTo(saveLocation.path); - } - }, - ) - : Container(), + await photoFile.saveTo(saveLocation.path); + } + }, + ) + : Container(), ), ); } @@ -87,28 +86,27 @@ class _UnsplashSearchContentState extends State { return TreeNode( content: Expanded(child: Text(searchEntry.query)), - children: - searchEntry.photos - .map( - (photo) => TreeNode( - content: Expanded( - child: Semantics( - button: true, - onTap: () => selectPhoto(photo), - label: labelForPhoto(photo), - excludeSemantics: true, - child: InkWell( - onTap: () => selectPhoto(photo), - child: Padding( - padding: const EdgeInsets.all(12), - child: Text(labelForPhoto(photo)), - ), - ), + children: searchEntry.photos + .map( + (photo) => TreeNode( + content: Expanded( + child: Semantics( + button: true, + onTap: () => selectPhoto(photo), + label: labelForPhoto(photo), + excludeSemantics: true, + child: InkWell( + onTap: () => selectPhoto(photo), + child: Padding( + padding: const EdgeInsets.all(12), + child: Text(labelForPhoto(photo)), ), ), ), - ) - .toList(), + ), + ), + ) + .toList(), ); } } diff --git a/desktop_photo_search/material/pubspec.yaml b/desktop_photo_search/material/pubspec.yaml index 00ab300d5..46a42b347 100644 --- a/desktop_photo_search/material/pubspec.yaml +++ b/desktop_photo_search/material/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: built_collection: ^5.1.1 diff --git a/dynamic_theme/lib/main.dart b/dynamic_theme/lib/main.dart index 37c4292e1..b61f2855b 100644 --- a/dynamic_theme/lib/main.dart +++ b/dynamic_theme/lib/main.dart @@ -266,30 +266,29 @@ class _ExampleState extends State { final reversed = messages.value.reversed; return Scaffold( appBar: AppBar(title: Text(widget.title)), - body: - messages.value.isEmpty - ? const Center( - child: Padding( - padding: EdgeInsets.all(32.0), - child: Text( - 'Start changing the theme! Try typing ' - 'in requests like "Make the colors darker" or "Make the ' - 'font larger" and see what happens.', - ), + body: messages.value.isEmpty + ? const Center( + child: Padding( + padding: EdgeInsets.all(32.0), + child: Text( + 'Start changing the theme! Try typing ' + 'in requests like "Make the colors darker" or "Make the ' + 'font larger" and see what happens.', ), - ) - : ListView.builder( - padding: const EdgeInsets.all(8), - reverse: true, - itemCount: reversed.length, - itemBuilder: (context, index) { - final (sender, message) = reversed.elementAt(index); - return MessageWidget( - isFromUser: sender == Sender.user, - text: message, - ); - }, ), + ) + : ListView.builder( + padding: const EdgeInsets.all(8), + reverse: true, + itemCount: reversed.length, + itemBuilder: (context, index) { + final (sender, message) = reversed.elementAt(index); + return MessageWidget( + isFromUser: sender == Sender.user, + text: message, + ); + }, + ), bottomNavigationBar: BottomAppBar( padding: const EdgeInsets.all(8), child: Row( diff --git a/dynamic_theme/lib/widgets/api_key_widget.dart b/dynamic_theme/lib/widgets/api_key_widget.dart index 002d35f72..341d07998 100644 --- a/dynamic_theme/lib/widgets/api_key_widget.dart +++ b/dynamic_theme/lib/widgets/api_key_widget.dart @@ -44,11 +44,10 @@ class ApiKeyWidget extends StatelessWidget { Link( uri: Uri.https('aistudio.google.com', '/app/apikey'), target: LinkTarget.blank, - builder: - (context, followLink) => TextButton( - onPressed: followLink, - child: const Text('Get an API Key'), - ), + builder: (context, followLink) => TextButton( + onPressed: followLink, + child: const Text('Get an API Key'), + ), ), ], ), diff --git a/dynamic_theme/lib/widgets/message_widget.dart b/dynamic_theme/lib/widgets/message_widget.dart index 95dae9102..74b45df1a 100644 --- a/dynamic_theme/lib/widgets/message_widget.dart +++ b/dynamic_theme/lib/widgets/message_widget.dart @@ -30,17 +30,17 @@ class MessageWidget extends StatelessWidget { @override Widget build(BuildContext context) { return Row( - mainAxisAlignment: - isFromUser ? MainAxisAlignment.end : MainAxisAlignment.start, + mainAxisAlignment: isFromUser + ? MainAxisAlignment.end + : MainAxisAlignment.start, children: [ Flexible( child: Container( constraints: const BoxConstraints(maxWidth: 520), decoration: BoxDecoration( - color: - isFromUser - ? Theme.of(context).colorScheme.primaryContainer - : Theme.of(context).colorScheme.surfaceContainerHighest, + color: isFromUser + ? Theme.of(context).colorScheme.primaryContainer + : Theme.of(context).colorScheme.surfaceContainerHighest, borderRadius: BorderRadius.circular(18), ), padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 20), diff --git a/dynamic_theme/pubspec.yaml b/dynamic_theme/pubspec.yaml index d3e29bfdf..33d1781c1 100644 --- a/dynamic_theme/pubspec.yaml +++ b/dynamic_theme/pubspec.yaml @@ -3,7 +3,7 @@ description: "Sample app for the google_generative_ai package" publish_to: 'none' version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/flutter_maps_firestore/lib/main.dart b/flutter_maps_firestore/lib/main.dart index 13668c621..bdc5913f1 100644 --- a/flutter_maps_firestore/lib/main.dart +++ b/flutter_maps_firestore/lib/main.dart @@ -58,11 +58,10 @@ class _HomePageState extends State { @override void initState() { super.initState(); - _iceCreamStores = - FirebaseFirestore.instance - .collection('ice_cream_stores') - .orderBy('name') - .snapshots(); + _iceCreamStores = FirebaseFirestore.instance + .collection('ice_cream_stores') + .orderBy('name') + .snapshots(); } @override @@ -216,13 +215,12 @@ class _StoreListTileState extends State { leading: SizedBox( width: 100, height: 100, - child: - _placePhotoUrl.isNotEmpty - ? ClipRRect( - borderRadius: const BorderRadius.all(Radius.circular(2)), - child: Image.network(_placePhotoUrl, fit: BoxFit.cover), - ) - : Container(), + child: _placePhotoUrl.isNotEmpty + ? ClipRRect( + borderRadius: const BorderRadius.all(Radius.circular(2)), + child: Image.network(_placePhotoUrl, fit: BoxFit.cover), + ) + : Container(), ), onTap: () async { final controller = await widget.mapController.future; @@ -258,23 +256,22 @@ class StoreMap extends StatelessWidget { Widget build(BuildContext context) { return GoogleMap( initialCameraPosition: CameraPosition(target: initialPosition, zoom: 12), - markers: - documents - .map( - (document) => Marker( - markerId: MarkerId(document['placeId'] as String), - icon: BitmapDescriptor.defaultMarkerWithHue(_pinkHue), - position: LatLng( - document['location'].latitude as double, - document['location'].longitude as double, - ), - infoWindow: InfoWindow( - title: document['name'] as String?, - snippet: document['address'] as String?, - ), - ), - ) - .toSet(), + markers: documents + .map( + (document) => Marker( + markerId: MarkerId(document['placeId'] as String), + icon: BitmapDescriptor.defaultMarkerWithHue(_pinkHue), + position: LatLng( + document['location'].latitude as double, + document['location'].longitude as double, + ), + infoWindow: InfoWindow( + title: document['name'] as String?, + snippet: document['address'] as String?, + ), + ), + ) + .toSet(), onMapCreated: (mapController) { this.mapController.complete(mapController); }, diff --git a/flutter_maps_firestore/pubspec.yaml b/flutter_maps_firestore/pubspec.yaml index a45675abf..952310ca0 100644 --- a/flutter_maps_firestore/pubspec.yaml +++ b/flutter_maps_firestore/pubspec.yaml @@ -3,7 +3,7 @@ description: A new Flutter project. version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/form_app/lib/main.dart b/form_app/lib/main.dart index 9be0081cc..2d9401cac 100644 --- a/form_app/lib/main.dart +++ b/form_app/lib/main.dart @@ -45,11 +45,10 @@ final demos = [ Demo( name: 'Sign in with HTTP', route: 'signin_http', - builder: - (context) => SignInHttpDemo( - // This sample uses a mock HTTP client. - httpClient: mockClient, - ), + builder: (context) => SignInHttpDemo( + // This sample uses a mock HTTP client. + httpClient: mockClient, + ), ), Demo( name: 'Autofill', diff --git a/form_app/lib/src/sign_in_http.dart b/form_app/lib/src/sign_in_http.dart index 4096e922b..d014a18a3 100644 --- a/form_app/lib/src/sign_in_http.dart +++ b/form_app/lib/src/sign_in_http.dart @@ -97,16 +97,15 @@ class _SignInHttpDemoState extends State { void _showDialog(String message) { showDialog( context: context, - builder: - (context) => AlertDialog( - title: Text(message), - actions: [ - TextButton( - child: const Text('OK'), - onPressed: () => Navigator.of(context).pop(), - ), - ], + builder: (context) => AlertDialog( + title: Text(message), + actions: [ + TextButton( + child: const Text('OK'), + onPressed: () => Navigator.of(context).pop(), ), + ], + ), ); } } diff --git a/form_app/lib/src/validation.dart b/form_app/lib/src/validation.dart index 65f2d2e38..693714592 100644 --- a/form_app/lib/src/validation.dart +++ b/form_app/lib/src/validation.dart @@ -38,19 +38,18 @@ class _FormValidationDemoState extends State { showDialog( context: context, - builder: - (context) => AlertDialog( - title: const Text('Your story'), - content: Text('The $adjective developer saw a $noun'), - actions: [ - TextButton( - child: const Text('Done'), - onPressed: () { - Navigator.of(context).pop(); - }, - ), - ], + builder: (context) => AlertDialog( + title: const Text('Your story'), + content: Text('The $adjective developer saw a $noun'), + actions: [ + TextButton( + child: const Text('Done'), + onPressed: () { + Navigator.of(context).pop(); + }, ), + ], + ), ); }, ), @@ -145,11 +144,10 @@ class _FormValidationDemoState extends State { if (!formFieldState.isValid) Text( formFieldState.errorText ?? "", - style: Theme.of( - context, - ).textTheme.bodySmall!.copyWith( - color: Theme.of(context).colorScheme.error, - ), + style: Theme.of(context).textTheme.bodySmall! + .copyWith( + color: Theme.of(context).colorScheme.error, + ), ), ], ); diff --git a/form_app/pubspec.yaml b/form_app/pubspec.yaml index 66ad2b1c2..a36fd5131 100644 --- a/form_app/pubspec.yaml +++ b/form_app/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: "none" version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/game_template/lib/main.dart b/game_template/lib/main.dart index de11af8d0..b2e30e9c8 100644 --- a/game_template/lib/main.dart +++ b/game_template/lib/main.dart @@ -129,19 +129,16 @@ class MyApp extends StatelessWidget { routes: [ GoRoute( path: '/', - builder: - (context, state) => const MainMenuScreen(key: Key('main menu')), + builder: (context, state) => + const MainMenuScreen(key: Key('main menu')), routes: [ GoRoute( path: 'play', - pageBuilder: - (context, state) => buildMyTransition( - key: ValueKey('play'), - child: const LevelSelectionScreen( - key: Key('level selection'), - ), - color: context.watch().backgroundLevelSelection, - ), + pageBuilder: (context, state) => buildMyTransition( + key: ValueKey('play'), + child: const LevelSelectionScreen(key: Key('level selection')), + color: context.watch().backgroundLevelSelection, + ), routes: [ GoRoute( path: 'session/:level', @@ -190,8 +187,8 @@ class MyApp extends StatelessWidget { ), GoRoute( path: 'settings', - builder: - (context, state) => const SettingsScreen(key: Key('settings')), + builder: (context, state) => + const SettingsScreen(key: Key('settings')), ), ], ), @@ -238,10 +235,9 @@ class MyApp extends StatelessWidget { ), Provider( lazy: false, - create: - (context) => - SettingsController(persistence: settingsPersistence) - ..loadStateFromPersistence(), + create: (context) => + SettingsController(persistence: settingsPersistence) + ..loadStateFromPersistence(), ), ProxyProvider2< SettingsController, diff --git a/game_template/lib/src/ads/ads_controller.dart b/game_template/lib/src/ads/ads_controller.dart index 6c1e4da46..8afc80a83 100644 --- a/game_template/lib/src/ads/ads_controller.dart +++ b/game_template/lib/src/ads/ads_controller.dart @@ -36,11 +36,10 @@ class AdsController { void preloadAd() { // TODO: When ready, change this to the Ad Unit IDs provided by AdMob. // The current values are AdMob's sample IDs. - final adUnitId = - defaultTargetPlatform == TargetPlatform.android - ? 'ca-app-pub-3940256099942544/6300978111' - // iOS - : 'ca-app-pub-3940256099942544/2934735716'; + final adUnitId = defaultTargetPlatform == TargetPlatform.android + ? 'ca-app-pub-3940256099942544/6300978111' + // iOS + : 'ca-app-pub-3940256099942544/2934735716'; _preloadedAd = PreloadedBannerAd( size: AdSize.mediumRectangle, adUnitId: adUnitId, diff --git a/game_template/lib/src/ads/banner_ad_widget.dart b/game_template/lib/src/ads/banner_ad_widget.dart index cfbe6e609..bd486cf4a 100644 --- a/game_template/lib/src/ads/banner_ad_widget.dart +++ b/game_template/lib/src/ads/banner_ad_widget.dart @@ -150,10 +150,9 @@ class _BannerAdWidgetState extends State { // https://developers.google.com/admob/android/test-ads. When ready, // you replace this with your own, production ad unit ID, // created in https://apps.admob.com/. - adUnitId: - Theme.of(context).platform == TargetPlatform.android - ? 'ca-app-pub-3940256099942544/6300978111' - : 'ca-app-pub-3940256099942544/2934735716', + adUnitId: Theme.of(context).platform == TargetPlatform.android + ? 'ca-app-pub-3940256099942544/6300978111' + : 'ca-app-pub-3940256099942544/2934735716', size: size, request: const AdRequest(), listener: BannerAdListener( diff --git a/game_template/lib/src/play_session/play_session_screen.dart b/game_template/lib/src/play_session/play_session_screen.dart index 3c038129d..4f06cca29 100644 --- a/game_template/lib/src/play_session/play_session_screen.dart +++ b/game_template/lib/src/play_session/play_session_screen.dart @@ -48,9 +48,8 @@ class _PlaySessionScreenState extends State { return MultiProvider( providers: [ ChangeNotifierProvider( - create: - (context) => - LevelState(goal: widget.level.difficulty, onWin: _playerWon), + create: (context) => + LevelState(goal: widget.level.difficulty, onWin: _playerWon), ), ], child: IgnorePointer( @@ -80,17 +79,14 @@ class _PlaySessionScreenState extends State { ' or above!', ), Consumer( - builder: - (context, levelState, child) => Slider( - label: 'Level Progress', - autofocus: true, - value: levelState.progress / 100, - onChanged: - (value) => levelState.setProgress( - (value * 100).round(), - ), - onChangeEnd: (value) => levelState.evaluate(), - ), + builder: (context, levelState, child) => Slider( + label: 'Level Progress', + autofocus: true, + value: levelState.progress / 100, + onChanged: (value) => + levelState.setProgress((value * 100).round()), + onChangeEnd: (value) => levelState.evaluate(), + ), ), const Spacer(), Padding( diff --git a/game_template/lib/src/settings/custom_name_dialog.dart b/game_template/lib/src/settings/custom_name_dialog.dart index 3d1298543..786902a42 100644 --- a/game_template/lib/src/settings/custom_name_dialog.dart +++ b/game_template/lib/src/settings/custom_name_dialog.dart @@ -10,9 +10,8 @@ import 'settings.dart'; void showCustomNameDialog(BuildContext context) { showGeneralDialog( context: context, - pageBuilder: - (context, animation, secondaryAnimation) => - CustomNameDialog(animation: animation), + pageBuilder: (context, animation, secondaryAnimation) => + CustomNameDialog(animation: animation), ); } diff --git a/game_template/lib/src/settings/settings_screen.dart b/game_template/lib/src/settings/settings_screen.dart index 791fec6e0..2f48b08de 100644 --- a/game_template/lib/src/settings/settings_screen.dart +++ b/game_template/lib/src/settings/settings_screen.dart @@ -42,21 +42,19 @@ class SettingsScreen extends StatelessWidget { const _NameChangeLine('Name'), ValueListenableBuilder( valueListenable: settings.soundsOn, - builder: - (context, soundsOn, child) => _SettingsLine( - 'Sound FX', - Icon(soundsOn ? Icons.graphic_eq : Icons.volume_off), - onSelected: () => settings.toggleSoundsOn(), - ), + builder: (context, soundsOn, child) => _SettingsLine( + 'Sound FX', + Icon(soundsOn ? Icons.graphic_eq : Icons.volume_off), + onSelected: () => settings.toggleSoundsOn(), + ), ), ValueListenableBuilder( valueListenable: settings.musicOn, - builder: - (context, musicOn, child) => _SettingsLine( - 'Music', - Icon(musicOn ? Icons.music_note : Icons.music_off), - onSelected: () => settings.toggleMusicOn(), - ), + builder: (context, musicOn, child) => _SettingsLine( + 'Music', + Icon(musicOn ? Icons.music_note : Icons.music_off), + onSelected: () => settings.toggleMusicOn(), + ), ), Consumer( builder: (context, inAppPurchase, child) { @@ -137,14 +135,13 @@ class _NameChangeLine extends StatelessWidget { const Spacer(), ValueListenableBuilder( valueListenable: settings.playerName, - builder: - (context, name, child) => Text( - '‘$name’', - style: const TextStyle( - fontFamily: 'Permanent Marker', - fontSize: 30, - ), - ), + builder: (context, name, child) => Text( + '‘$name’', + style: const TextStyle( + fontFamily: 'Permanent Marker', + fontSize: 30, + ), + ), ), ], ), diff --git a/game_template/lib/src/style/confetti.dart b/game_template/lib/src/style/confetti.dart index 5036f5fc6..60a6dad74 100644 --- a/game_template/lib/src/style/confetti.dart +++ b/game_template/lib/src/style/confetti.dart @@ -188,17 +188,17 @@ class _PaperSnipping { paint.color = backColor; } - final path = - Path()..addPolygon( - List.generate( - 4, - (index) => Offset( - position.x + corners[index].x * size, - position.y + corners[index].y * size * cosA, - ), + final path = Path() + ..addPolygon( + List.generate( + 4, + (index) => Offset( + position.x + corners[index].x * size, + position.y + corners[index].y * size * cosA, ), - true, - ); + ), + true, + ); canvas.drawPath(path, paint); } diff --git a/game_template/pubspec.yaml b/game_template/pubspec.yaml index 3c0af46ff..7db82af9e 100644 --- a/game_template/pubspec.yaml +++ b/game_template/pubspec.yaml @@ -7,7 +7,7 @@ publish_to: 'none' version: 0.0.1+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/gemini_tasks/lib/main.dart b/gemini_tasks/lib/main.dart index 33a43a0df..bde51881d 100644 --- a/gemini_tasks/lib/main.dart +++ b/gemini_tasks/lib/main.dart @@ -244,18 +244,19 @@ class _ExampleState extends State { actions.add(FunctionResponse(fn.name, task.toJson())); break; case 'get_completed_tasks': - var filter = - current.toList().where((e) => e.completed == true).toList(); + var filter = current + .toList() + .where((e) => e.completed == true) + .toList(); final name = args['name'] as String?; final description = args['description'] as String?; if (name != null) { filter = filter.where((e) => e.name.contains(name)).toList(); } if (description != null) { - filter = - filter - .where((e) => e.description?.contains(description) ?? false) - .toList(); + filter = filter + .where((e) => e.description?.contains(description) ?? false) + .toList(); } actions.add( FunctionResponse(fn.name, { @@ -264,18 +265,19 @@ class _ExampleState extends State { ); break; case 'get_active_tasks': - var filter = - current.toList().where((e) => e.completed == false).toList(); + var filter = current + .toList() + .where((e) => e.completed == false) + .toList(); final name = args['name'] as String?; final description = args['description'] as String?; if (name != null) { filter = filter.where((e) => e.name.contains(name)).toList(); } if (description != null) { - filter = - filter - .where((e) => e.description?.contains(description) ?? false) - .toList(); + filter = filter + .where((e) => e.description?.contains(description) ?? false) + .toList(); } actions.add( FunctionResponse(fn.name, { @@ -336,21 +338,20 @@ class _ExampleState extends State { final reversed = messages.value.reversed; return Scaffold( appBar: AppBar(title: Text(widget.title)), - body: - messages.value.isEmpty - ? const Center(child: Text('No tasks found')) - : ListView.builder( - padding: const EdgeInsets.all(8), - reverse: true, - itemCount: reversed.length, - itemBuilder: (context, index) { - final (sender, message) = reversed.elementAt(index); - return MessageWidget( - isFromUser: sender == Sender.user, - text: message, - ); - }, - ), + body: messages.value.isEmpty + ? const Center(child: Text('No tasks found')) + : ListView.builder( + padding: const EdgeInsets.all(8), + reverse: true, + itemCount: reversed.length, + itemBuilder: (context, index) { + final (sender, message) = reversed.elementAt(index); + return MessageWidget( + isFromUser: sender == Sender.user, + text: message, + ); + }, + ), bottomNavigationBar: BottomAppBar( padding: const EdgeInsets.all(8), child: Row( diff --git a/gemini_tasks/lib/widgets/api_key_widget.dart b/gemini_tasks/lib/widgets/api_key_widget.dart index 002d35f72..341d07998 100644 --- a/gemini_tasks/lib/widgets/api_key_widget.dart +++ b/gemini_tasks/lib/widgets/api_key_widget.dart @@ -44,11 +44,10 @@ class ApiKeyWidget extends StatelessWidget { Link( uri: Uri.https('aistudio.google.com', '/app/apikey'), target: LinkTarget.blank, - builder: - (context, followLink) => TextButton( - onPressed: followLink, - child: const Text('Get an API Key'), - ), + builder: (context, followLink) => TextButton( + onPressed: followLink, + child: const Text('Get an API Key'), + ), ), ], ), diff --git a/gemini_tasks/lib/widgets/message_widget.dart b/gemini_tasks/lib/widgets/message_widget.dart index 95dae9102..74b45df1a 100644 --- a/gemini_tasks/lib/widgets/message_widget.dart +++ b/gemini_tasks/lib/widgets/message_widget.dart @@ -30,17 +30,17 @@ class MessageWidget extends StatelessWidget { @override Widget build(BuildContext context) { return Row( - mainAxisAlignment: - isFromUser ? MainAxisAlignment.end : MainAxisAlignment.start, + mainAxisAlignment: isFromUser + ? MainAxisAlignment.end + : MainAxisAlignment.start, children: [ Flexible( child: Container( constraints: const BoxConstraints(maxWidth: 520), decoration: BoxDecoration( - color: - isFromUser - ? Theme.of(context).colorScheme.primaryContainer - : Theme.of(context).colorScheme.surfaceContainerHighest, + color: isFromUser + ? Theme.of(context).colorScheme.primaryContainer + : Theme.of(context).colorScheme.surfaceContainerHighest, borderRadius: BorderRadius.circular(18), ), padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 20), diff --git a/gemini_tasks/pubspec.yaml b/gemini_tasks/pubspec.yaml index c25e88971..717950e4d 100644 --- a/gemini_tasks/pubspec.yaml +++ b/gemini_tasks/pubspec.yaml @@ -3,7 +3,7 @@ description: "Sample app for the google_generative_ai package" publish_to: 'none' version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/google_maps/lib/src/locations.g.dart b/google_maps/lib/src/locations.g.dart index 685fbd1d1..33f36c8c6 100644 --- a/google_maps/lib/src/locations.g.dart +++ b/google_maps/lib/src/locations.g.dart @@ -69,14 +69,12 @@ Map _$OfficeToJson(Office instance) => { }; Locations _$LocationsFromJson(Map json) => Locations( - offices: - (json['offices'] as List) - .map((e) => Office.fromJson(e as Map)) - .toList(), - regions: - (json['regions'] as List) - .map((e) => Region.fromJson(e as Map)) - .toList(), + offices: (json['offices'] as List) + .map((e) => Office.fromJson(e as Map)) + .toList(), + regions: (json['regions'] as List) + .map((e) => Region.fromJson(e as Map)) + .toList(), ); Map _$LocationsToJson(Locations instance) => { diff --git a/google_maps/pubspec.yaml b/google_maps/pubspec.yaml index 268697a4d..0cb9c3f1a 100644 --- a/google_maps/pubspec.yaml +++ b/google_maps/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/infinite_list/lib/main.dart b/infinite_list/lib/main.dart index 3f9f795d8..943ca89aa 100644 --- a/infinite_list/lib/main.dart +++ b/infinite_list/lib/main.dart @@ -68,26 +68,25 @@ class MyHomePage extends StatelessWidget { // listening to the catalog's `itemCount`, because that's all we need // at this level. selector: (context, catalog) => catalog.itemCount, - builder: - (context, itemCount, child) => ListView.builder( - // When `itemCount` is null, `ListView` assumes an infinite list. - // Once we provide a value, it will stop the scrolling beyond - // the last element. - itemCount: itemCount, - padding: const EdgeInsets.symmetric(vertical: 18), - itemBuilder: (context, index) { - // Every item of the `ListView` is individually listening - // to the catalog. - var catalog = Provider.of(context); + builder: (context, itemCount, child) => ListView.builder( + // When `itemCount` is null, `ListView` assumes an infinite list. + // Once we provide a value, it will stop the scrolling beyond + // the last element. + itemCount: itemCount, + padding: const EdgeInsets.symmetric(vertical: 18), + itemBuilder: (context, index) { + // Every item of the `ListView` is individually listening + // to the catalog. + var catalog = Provider.of(context); - // Catalog provides a single synchronous method for getting the - // current data. - return switch (catalog.getByIndex(index)) { - Item(isLoading: true) => const LoadingItemTile(), - var item => ItemTile(item: item), - }; - }, - ), + // Catalog provides a single synchronous method for getting the + // current data. + return switch (catalog.getByIndex(index)) { + Item(isLoading: true) => const LoadingItemTile(), + var item => ItemTile(item: item), + }; + }, + ), ), ); } diff --git a/infinite_list/pubspec.yaml b/infinite_list/pubspec.yaml index 5c4397817..cf5a79565 100644 --- a/infinite_list/pubspec.yaml +++ b/infinite_list/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/ios_app_clip/pubspec.yaml b/ios_app_clip/pubspec.yaml index b67d9febd..0903f77b3 100644 --- a/ios_app_clip/pubspec.yaml +++ b/ios_app_clip/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/isolate_example/pubspec.yaml b/isolate_example/pubspec.yaml index b515eec88..6e25d9140 100644 --- a/isolate_example/pubspec.yaml +++ b/isolate_example/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/llm_prompt.md b/llm_prompt.md new file mode 100644 index 000000000..89c10bc18 --- /dev/null +++ b/llm_prompt.md @@ -0,0 +1,54 @@ +# Instructions for Updating Dart SDK to Beta in Flutter Projects + +You are an AI assistant tasked with keeping a repository of Flutter projects up-to-date. Your goal is to update the Dart SDK constraint in all `pubspec.yaml` files to the latest **beta** version. + +## Your Task + +1. **Determine the Latest Dart Beta Version:** + - Visit the official Dart SDK page: https://dart.dev/get-dart + - Identify the current beta version number. It will look something like `3.x.x-x.x.beta`. + +2. **Locate all `pubspec.yaml` files:** + - Scan the entire repository to find every `pubspec.yaml` file. + +3. **Update the SDK Constraint:** + - For each `pubspec.yaml` file, locate the `environment` section. + - It will look like this: + ```yaml + environment: + sdk: '>=2.17.0 <3.0.0' + flutter: '>=1.17.0' + ``` + - You need to update the `sdk` constraint. You should change it to allow the new beta version. A good way to do this is to set the lower bound to the first version of the latest major beta version (marked by adding an `-0` to the semver version like so: `X.X.X-0`) and the upper bound to the next major version. For example, if the new beta version is `3.4.0-257.0.beta`, you should update the constraint to: + ```yaml + environment: + sdk: '>=3.4.0-0 <4.0.0' + ``` + - **Important:** + - Do not change the `flutter` constraint. + - Preserve the formatting and indentation of the `pubspec.yaml` file. + - The exact version you find on the Dart website should be used. The example above is just for illustration. + +## Example Workflow + +1. **LLM:** *Fetches [https://dart.dev/get-dart#beta-channel](https://dart.dev/get-dart#beta-channel) and finds the latest beta version is `3.5.0-123.0.beta`.* +2. **LLM:** *Finds `/path/to/project1/pubspec.yaml`.* +3. **LLM:** *Reads the file and finds:* + ```yaml + environment: + sdk: '>=3.3.0 <4.0.0' + ``` +4. **LLM:** *Updates it to:* + ```yaml + environment: + sdk: '>=3.5.0-123.0.beta <4.0.0' + ``` +5. **LLM:** *Repeats for all other `pubspec.yaml` files.* + +Please proceed with this task. + + +Next: + +- Run the CLI command `flutter channel beta` to ensure the Flutter SDK on my machine is using the latest beta +- Run the CI running the bash file at /tool/flutter_ci_script_stable.sh \ No newline at end of file diff --git a/material_3_demo/pubspec.yaml b/material_3_demo/pubspec.yaml index c42109ea3..a2cf1b444 100644 --- a/material_3_demo/pubspec.yaml +++ b/material_3_demo/pubspec.yaml @@ -8,7 +8,7 @@ publish_to: "none" version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/navigation_and_routing/lib/src/auth.dart b/navigation_and_routing/lib/src/auth.dart index 4abe973f1..9804207f4 100644 --- a/navigation_and_routing/lib/src/auth.dart +++ b/navigation_and_routing/lib/src/auth.dart @@ -33,10 +33,9 @@ class BookstoreAuth extends ChangeNotifier { @override int get hashCode => _signedIn.hashCode; - static BookstoreAuth of(BuildContext context) => - context - .dependOnInheritedWidgetOfExactType()! - .notifier!; + static BookstoreAuth of(BuildContext context) => context + .dependOnInheritedWidgetOfExactType()! + .notifier!; } class BookstoreAuthScope extends InheritedNotifier { diff --git a/navigation_and_routing/lib/src/data/library.dart b/navigation_and_routing/lib/src/data/library.dart index 8daf24dc3..60794efaa 100644 --- a/navigation_and_routing/lib/src/data/library.dart +++ b/navigation_and_routing/lib/src/data/library.dart @@ -5,32 +5,31 @@ import 'author.dart'; import 'book.dart'; -final libraryInstance = - Library() - ..addBook( - title: 'Left Hand of Darkness', - authorName: 'Ursula K. Le Guin', - isPopular: true, - isNew: true, - ) - ..addBook( - title: 'Too Like the Lightning', - authorName: 'Ada Palmer', - isPopular: false, - isNew: true, - ) - ..addBook( - title: 'Kindred', - authorName: 'Octavia E. Butler', - isPopular: true, - isNew: false, - ) - ..addBook( - title: 'The Lathe of Heaven', - authorName: 'Ursula K. Le Guin', - isPopular: false, - isNew: false, - ); +final libraryInstance = Library() + ..addBook( + title: 'Left Hand of Darkness', + authorName: 'Ursula K. Le Guin', + isPopular: true, + isNew: true, + ) + ..addBook( + title: 'Too Like the Lightning', + authorName: 'Ada Palmer', + isPopular: false, + isNew: true, + ) + ..addBook( + title: 'Kindred', + authorName: 'Octavia E. Butler', + isPopular: true, + isNew: false, + ) + ..addBook( + title: 'The Lathe of Heaven', + authorName: 'Ursula K. Le Guin', + isPopular: false, + isNew: false, + ); class Library { final List allBooks = []; diff --git a/navigation_and_routing/lib/src/screens/book_details.dart b/navigation_and_routing/lib/src/screens/book_details.dart index 481e4826d..edc6c4747 100644 --- a/navigation_and_routing/lib/src/screens/book_details.dart +++ b/navigation_and_routing/lib/src/screens/book_details.dart @@ -37,26 +37,22 @@ class BookDetailsScreen extends StatelessWidget { onPressed: () { Navigator.of(context).push( MaterialPageRoute( - builder: - (context) => AuthorDetailsScreen( - author: book!.author, - onBookTapped: (book) { - GoRouter.of( - context, - ).go('/books/all/book/${book.id}'); - }, - ), + builder: (context) => AuthorDetailsScreen( + author: book!.author, + onBookTapped: (book) { + GoRouter.of(context).go('/books/all/book/${book.id}'); + }, + ), ), ); }, ), Link( uri: Uri.parse('/authors/author/${book!.author.id}'), - builder: - (context, followLink) => TextButton( - onPressed: followLink, - child: const Text('View author (Link)'), - ), + builder: (context, followLink) => TextButton( + onPressed: followLink, + child: const Text('View author (Link)'), + ), ), ], ), diff --git a/navigation_and_routing/lib/src/screens/settings.dart b/navigation_and_routing/lib/src/screens/settings.dart index 54015b7a3..7feed8e10 100644 --- a/navigation_and_routing/lib/src/screens/settings.dart +++ b/navigation_and_routing/lib/src/screens/settings.dart @@ -54,11 +54,10 @@ class SettingsContent extends StatelessWidget { const Text('Example using the Link widget:'), Link( uri: Uri.parse('/books/all/book/0'), - builder: - (context, followLink) => TextButton( - onPressed: followLink, - child: const Text('/books/all/book/0'), - ), + builder: (context, followLink) => TextButton( + onPressed: followLink, + child: const Text('/books/all/book/0'), + ), ), const Text('Example using GoRouter.of(context).go():'), TextButton( @@ -70,25 +69,23 @@ class SettingsContent extends StatelessWidget { ].map((w) => Padding(padding: const EdgeInsets.all(8), child: w)), const Text('Displays a dialog on the root Navigator:'), TextButton( - onPressed: - () => showDialog( - context: context, - builder: - (context) => AlertDialog( - title: const Text('Alert!'), - content: const Text('The alert description goes here.'), - actions: [ - TextButton( - onPressed: () => Navigator.pop(context, 'Cancel'), - child: const Text('Cancel'), - ), - TextButton( - onPressed: () => Navigator.pop(context, 'OK'), - child: const Text('OK'), - ), - ], - ), - ), + onPressed: () => showDialog( + context: context, + builder: (context) => AlertDialog( + title: const Text('Alert!'), + content: const Text('The alert description goes here.'), + actions: [ + TextButton( + onPressed: () => Navigator.pop(context, 'Cancel'), + child: const Text('Cancel'), + ), + TextButton( + onPressed: () => Navigator.pop(context, 'OK'), + child: const Text('OK'), + ), + ], + ), + ), child: const Text('Show Dialog'), ), ], diff --git a/navigation_and_routing/lib/src/widgets/author_list.dart b/navigation_and_routing/lib/src/widgets/author_list.dart index 445350926..e9c3a99a1 100644 --- a/navigation_and_routing/lib/src/widgets/author_list.dart +++ b/navigation_and_routing/lib/src/widgets/author_list.dart @@ -15,11 +15,10 @@ class AuthorList extends StatelessWidget { @override Widget build(BuildContext context) => ListView.builder( itemCount: authors.length, - itemBuilder: - (context, index) => ListTile( - title: Text(authors[index].name), - subtitle: Text('${authors[index].books.length} books'), - onTap: onTap != null ? () => onTap!(authors[index]) : null, - ), + itemBuilder: (context, index) => ListTile( + title: Text(authors[index].name), + subtitle: Text('${authors[index].books.length} books'), + onTap: onTap != null ? () => onTap!(authors[index]) : null, + ), ); } diff --git a/navigation_and_routing/lib/src/widgets/book_list.dart b/navigation_and_routing/lib/src/widgets/book_list.dart index 630f1e43b..9c5da89e7 100644 --- a/navigation_and_routing/lib/src/widgets/book_list.dart +++ b/navigation_and_routing/lib/src/widgets/book_list.dart @@ -15,11 +15,10 @@ class BookList extends StatelessWidget { @override Widget build(BuildContext context) => ListView.builder( itemCount: books.length, - itemBuilder: - (context, index) => ListTile( - title: Text(books[index].title), - subtitle: Text(books[index].author.name), - onTap: onTap != null ? () => onTap!(books[index]) : null, - ), + itemBuilder: (context, index) => ListTile( + title: Text(books[index].title), + subtitle: Text(books[index].author.name), + onTap: onTap != null ? () => onTap!(books[index]) : null, + ), ); } diff --git a/navigation_and_routing/pubspec.yaml b/navigation_and_routing/pubspec.yaml index 73a4a194f..f711f64c0 100644 --- a/navigation_and_routing/pubspec.yaml +++ b/navigation_and_routing/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: adaptive_navigation: ^0.0.3 diff --git a/pedometer/example/lib/main.dart b/pedometer/example/lib/main.dart index ac402fc27..00ea267ee 100644 --- a/pedometer/example/lib/main.dart +++ b/pedometer/example/lib/main.dart @@ -65,20 +65,19 @@ class _HomeState extends State { Widget build(BuildContext context) { final textTheme = Theme.of(context).textTheme; - final barGroups = - hourlySteps - .map( - (e) => BarChartGroupData( - x: int.parse(e.startHour), - barRods: [ - BarChartRodData( - color: Colors.blue[900], - toY: e.steps.toDouble() / 100, - ), - ], + final barGroups = hourlySteps + .map( + (e) => BarChartGroupData( + x: int.parse(e.startHour), + barRods: [ + BarChartRodData( + color: Colors.blue[900], + toY: e.steps.toDouble() / 100, ), - ) - .toList(); + ], + ), + ) + .toList(); return Scaffold( body: Stack( @@ -99,14 +98,14 @@ class _HomeState extends State { children: [ lastUpdated != null ? Padding( - padding: const EdgeInsets.symmetric(vertical: 50.0), - child: Text( - DateFormat.yMMMMd('en_US').format(lastUpdated!), - style: textTheme.titleLarge!.copyWith( - color: Colors.blue[900], + padding: const EdgeInsets.symmetric(vertical: 50.0), + child: Text( + DateFormat.yMMMMd('en_US').format(lastUpdated!), + style: textTheme.titleLarge!.copyWith( + color: Colors.blue[900], + ), ), - ), - ) + ) : const SizedBox(height: 0), Text( hourlySteps.fold(0, (t, e) => t + e.steps).toString(), diff --git a/pedometer/example/lib/steps_repo.dart b/pedometer/example/lib/steps_repo.dart index d44e5f1ae..bd8db966a 100644 --- a/pedometer/example/lib/steps_repo.dart +++ b/pedometer/example/lib/steps_repo.dart @@ -45,10 +45,11 @@ class _IOSStepsRepo implements StepsRepo { final dylib = ffi.DynamicLibrary.open("pedometer.framework/pedometer"); // Initialize the Dart API - final initializeApi = dylib.lookupFunction< - ffi.IntPtr Function(ffi.Pointer), - int Function(ffi.Pointer) - >('Dart_InitializeApiDL'); + final initializeApi = dylib + .lookupFunction< + ffi.IntPtr Function(ffi.Pointer), + int Function(ffi.Pointer) + >('Dart_InitializeApiDL'); final initializeResult = initializeApi(ffi.NativeApi.initializeApiDLData); if (initializeResult != 0) { @@ -106,8 +107,9 @@ class _IOSStepsRepo implements StepsRepo { ) { if (result != null) { final stepCount = result.numberOfSteps.intValue; - final startHour = - hourFormatter.stringFromDate_(result.startDate).toString(); + final startHour = hourFormatter + .stringFromDate_(result.startDate) + .toString(); completer.complete(Steps(startHour, stepCount)); } else { debugPrint("Query error: ${error?.localizedDescription}"); @@ -136,8 +138,8 @@ class _AndroidStepsRepo implements StepsRepo { // ignore: invalid_use_of_internal_member activity = hc.Activity.fromReference(jni.Jni.getCurrentActivity()); applicationContext = - // ignore: invalid_use_of_internal_member - hc.Context.fromReference(jni.Jni.getCachedApplicationContext()); + // ignore: invalid_use_of_internal_member + hc.Context.fromReference(jni.Jni.getCachedApplicationContext()); client = hc.HealthConnectClient.getOrCreate$1(applicationContext); } @@ -147,10 +149,18 @@ class _AndroidStepsRepo implements StepsRepo { final now = DateTime.now(); for (var h = 0; h <= now.hour; h++) { - final start = - DateTime(now.year, now.month, now.day, h).millisecondsSinceEpoch; - final end = - DateTime(now.year, now.month, now.day, h + 1).millisecondsSinceEpoch; + final start = DateTime( + now.year, + now.month, + now.day, + h, + ).millisecondsSinceEpoch; + final end = DateTime( + now.year, + now.month, + now.day, + h + 1, + ).millisecondsSinceEpoch; final request = hc.AggregateRequest( { hc.StepsRecord.COUNT_TOTAL, diff --git a/pedometer/example/pubspec.yaml b/pedometer/example/pubspec.yaml index e454e4275..2791c3957 100644 --- a/pedometer/example/pubspec.yaml +++ b/pedometer/example/pubspec.yaml @@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions diff --git a/pedometer/pubspec.yaml b/pedometer/pubspec.yaml index b52c13419..61063894d 100644 --- a/pedometer/pubspec.yaml +++ b/pedometer/pubspec.yaml @@ -4,7 +4,7 @@ version: 0.0.1 publish_to: none environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: @@ -14,7 +14,7 @@ dependencies: ffi: ^2.1.2 dev_dependencies: - ffigen: ^16.0.0 + ffigen: ^19.1.0 jnigen: ^0.13.1 flutter_test: sdk: flutter diff --git a/place_tracker/lib/place_details.dart b/place_tracker/lib/place_details.dart index 05ff1fbdf..56e5524f2 100644 --- a/place_tracker/lib/place_details.dart +++ b/place_tracker/lib/place_details.dart @@ -240,10 +240,9 @@ class _Reviews extends StatelessWidget { ), ), Column( - children: - StubData.reviewStrings - .map((reviewText) => _buildSingleReview(reviewText)) - .toList(), + children: StubData.reviewStrings + .map((reviewText) => _buildSingleReview(reviewText)) + .toList(), ), ], ); @@ -308,17 +307,16 @@ class _StarBar extends StatelessWidget { Widget build(BuildContext context) { return Row( mainAxisAlignment: MainAxisAlignment.center, - children: - List.generate(maxStars, (index) { - return IconButton( - icon: const Icon(Icons.star), - iconSize: 40, - color: rating > index ? Colors.amber : Colors.grey[400], - onPressed: () { - onChanged(index + 1); - }, - ); - }).toList(), + children: List.generate(maxStars, (index) { + return IconButton( + icon: const Icon(Icons.star), + iconSize: 40, + color: rating > index ? Colors.amber : Colors.grey[400], + onPressed: () { + onChanged(index + 1); + }, + ); + }).toList(), ); } } diff --git a/place_tracker/lib/place_list.dart b/place_tracker/lib/place_list.dart index 46a9e29c9..d6e10d579 100644 --- a/place_tracker/lib/place_list.dart +++ b/place_tracker/lib/place_list.dart @@ -33,11 +33,10 @@ class _PlaceListState extends State { padding: const EdgeInsets.fromLTRB(16.0, 0.0, 16.0, 8.0), controller: _scrollController, shrinkWrap: true, - children: - state.places - .where((place) => place.category == state.selectedCategory) - .map((place) => _PlaceListTile(place: place)) - .toList(), + children: state.places + .where((place) => place.category == state.selectedCategory) + .map((place) => _PlaceListTile(place: place)) + .toList(), ), ), ], @@ -158,17 +157,15 @@ class _PlaceListTile extends StatelessWidget { maxLines: 3, ), Row( - children: - List.generate(5, (index) { - return Icon( - Icons.star, - size: 28.0, - color: - place.starRating > index - ? Colors.amber - : Colors.grey[400], - ); - }).toList(), + children: List.generate(5, (index) { + return Icon( + Icons.star, + size: 28.0, + color: place.starRating > index + ? Colors.amber + : Colors.grey[400], + ); + }).toList(), ), Text( place.description ?? '', diff --git a/place_tracker/lib/place_map.dart b/place_tracker/lib/place_map.dart index ffebe88fa..10dac39e4 100644 --- a/place_tracker/lib/place_map.dart +++ b/place_tracker/lib/place_map.dart @@ -278,8 +278,9 @@ class _PlaceMapState extends State { // At this point, we know the places have been updated from the list // view. We need to reconfigure the map to respect the updates. for (final place in newConfiguration.places) { - final oldPlace = - _configuration!.places.where((p) => p.id == place.id).firstOrNull; + final oldPlace = _configuration!.places + .where((p) => p.id == place.id) + .firstOrNull; if (oldPlace == null || oldPlace != place) { // New place or updated place. _updateExistingPlaceMarker(place: place); @@ -355,8 +356,9 @@ class _PlaceMapState extends State { final updatedMarker = marker.copyWith( infoWindowParam: InfoWindow( title: place.name, - snippet: - place.starRating != 0 ? '${place.starRating} Star Rating' : null, + snippet: place.starRating != 0 + ? '${place.starRating} Star Rating' + : null, ), ); _updateMarker(marker: marker, updatedMarker: updatedMarker, place: place); @@ -502,8 +504,8 @@ class _CategoryButtonBar extends StatelessWidget { style: FilledButton.styleFrom( backgroundColor: selectedPlaceCategory == PlaceCategory.favorite - ? Colors.green[700] - : Colors.lightGreen, + ? Colors.green[700] + : Colors.lightGreen, ), onPressed: () => onChanged(PlaceCategory.favorite), child: const Text( @@ -515,8 +517,8 @@ class _CategoryButtonBar extends StatelessWidget { style: FilledButton.styleFrom( backgroundColor: selectedPlaceCategory == PlaceCategory.visited - ? Colors.green[700] - : Colors.lightGreen, + ? Colors.green[700] + : Colors.lightGreen, ), onPressed: () => onChanged(PlaceCategory.visited), child: const Text( @@ -528,8 +530,8 @@ class _CategoryButtonBar extends StatelessWidget { style: FilledButton.styleFrom( backgroundColor: selectedPlaceCategory == PlaceCategory.wantToGo - ? Colors.green[700] - : Colors.lightGreen, + ? Colors.green[700] + : Colors.lightGreen, ), onPressed: () => onChanged(PlaceCategory.wantToGo), child: const Text( diff --git a/place_tracker/pubspec.yaml b/place_tracker/pubspec.yaml index 230489114..1a9d41996 100644 --- a/place_tracker/pubspec.yaml +++ b/place_tracker/pubspec.yaml @@ -4,7 +4,7 @@ description: A new Flutter project. version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/platform_channels/pubspec.yaml b/platform_channels/pubspec.yaml index 5c58e4d23..906d06151 100644 --- a/platform_channels/pubspec.yaml +++ b/platform_channels/pubspec.yaml @@ -4,7 +4,7 @@ description: A new Flutter project. version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/platform_design/pubspec.yaml b/platform_design/pubspec.yaml index d91118cf6..879bd0237 100644 --- a/platform_design/pubspec.yaml +++ b/platform_design/pubspec.yaml @@ -3,7 +3,7 @@ description: A project showcasing a Flutter app following different platform IA version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: english_words: ^4.0.0 diff --git a/platform_view_swift/pubspec.yaml b/platform_view_swift/pubspec.yaml index 159ee9984..5d46f6724 100644 --- a/platform_view_swift/pubspec.yaml +++ b/platform_view_swift/pubspec.yaml @@ -4,7 +4,7 @@ description: A new Flutter project. version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/provider_counter/lib/main.dart b/provider_counter/lib/main.dart index 1a6bdd035..160875892 100644 --- a/provider_counter/lib/main.dart +++ b/provider_counter/lib/main.dart @@ -92,11 +92,10 @@ class MyHomePage extends StatelessWidget { // Then it uses that model to build widgets, and will trigger // rebuilds if the model is updated. Consumer( - builder: - (context, counter, child) => Text( - '${counter.value}', - style: Theme.of(context).textTheme.headlineMedium, - ), + builder: (context, counter, child) => Text( + '${counter.value}', + style: Theme.of(context).textTheme.headlineMedium, + ), ), ], ), diff --git a/provider_counter/pubspec.yaml b/provider_counter/pubspec.yaml index 1aa8464ce..d4e3e78a5 100644 --- a/provider_counter/pubspec.yaml +++ b/provider_counter/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none version: 1.0.0 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/provider_shopper/lib/screens/cart.dart b/provider_shopper/lib/screens/cart.dart index 9e063600b..79922bd18 100644 --- a/provider_shopper/lib/screens/cart.dart +++ b/provider_shopper/lib/screens/cart.dart @@ -46,17 +46,16 @@ class _CartList extends StatelessWidget { return ListView.builder( itemCount: cart.items.length, - itemBuilder: - (context, index) => ListTile( - leading: const Icon(Icons.done), - trailing: IconButton( - icon: const Icon(Icons.remove_circle_outline), - onPressed: () { - cart.remove(cart.items[index]); - }, - ), - title: Text(cart.items[index].name, style: itemNameStyle), - ), + itemBuilder: (context, index) => ListTile( + leading: const Icon(Icons.done), + trailing: IconButton( + icon: const Icon(Icons.remove_circle_outline), + onPressed: () { + cart.remove(cart.items[index]); + }, + ), + title: Text(cart.items[index].name, style: itemNameStyle), + ), ); } } @@ -81,9 +80,8 @@ class _CartTotal extends StatelessWidget { // The important thing is that it will not rebuild // the rest of the widgets in this build method. Consumer( - builder: - (context, cart, child) => - Text('\$${cart.totalPrice}', style: hugeStyle), + builder: (context, cart, child) => + Text('\$${cart.totalPrice}', style: hugeStyle), ), const SizedBox(width: 24), FilledButton( diff --git a/provider_shopper/lib/screens/catalog.dart b/provider_shopper/lib/screens/catalog.dart index 555251a74..905114475 100644 --- a/provider_shopper/lib/screens/catalog.dart +++ b/provider_shopper/lib/screens/catalog.dart @@ -48,17 +48,16 @@ class _AddButton extends StatelessWidget { ); return TextButton( - onPressed: - isInCart - ? null - : () { - // If the item is not in cart, we let the user add it. - // We are using context.read() here because the callback - // is executed whenever the user taps the button. In other - // words, it is executed outside the build method. - var cart = context.read(); - cart.add(item); - }, + onPressed: isInCart + ? null + : () { + // If the item is not in cart, we let the user add it. + // We are using context.read() here because the callback + // is executed whenever the user taps the button. In other + // words, it is executed outside the build method. + var cart = context.read(); + cart.add(item); + }, style: ButtonStyle( overlayColor: WidgetStateProperty.resolveWith((states) { if (states.contains(WidgetState.pressed)) { @@ -67,10 +66,9 @@ class _AddButton extends StatelessWidget { return null; // Defer to the widget's default. }), ), - child: - isInCart - ? const Icon(Icons.check, semanticLabel: 'ADDED') - : const Text('ADD'), + child: isInCart + ? const Icon(Icons.check, semanticLabel: 'ADDED') + : const Text('ADD'), ); } } diff --git a/provider_shopper/pubspec.yaml b/provider_shopper/pubspec.yaml index 99c6d2586..8f8cdfcae 100644 --- a/provider_shopper/pubspec.yaml +++ b/provider_shopper/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/simple_shader/pubspec.yaml b/simple_shader/pubspec.yaml index f71b19ea2..8ec029010 100644 --- a/simple_shader/pubspec.yaml +++ b/simple_shader/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/simplistic_calculator/lib/main.dart b/simplistic_calculator/lib/main.dart index 0129f5d1d..cc7ed4b6d 100644 --- a/simplistic_calculator/lib/main.dart +++ b/simplistic_calculator/lib/main.dart @@ -107,10 +107,9 @@ class CalculatorEngine extends StateNotifier { mode: CalculatorEngineMode.result, ); default: - final resultStr = - result.ceil() == result - ? result.toInt().toString() - : result.toString(); + final resultStr = result.ceil() == result + ? result.toInt().toString() + : result.toString(); state = state.copyWith( buffer: resultStr, mode: CalculatorEngineMode.result, @@ -379,26 +378,25 @@ class CalculatorApp extends ConsumerWidget { horizontal: 8, vertical: 8, ), - child: - state.error.isEmpty - ? AutoSizeText( - state.buffer, - textAlign: TextAlign.end, - style: const TextStyle( - fontSize: 80, - color: Colors.black, - ), - maxLines: 2, - ) - : AutoSizeText( - state.error, - textAlign: TextAlign.start, - style: const TextStyle( - fontSize: 80, - color: Colors.red, - ), - maxLines: 2, + child: state.error.isEmpty + ? AutoSizeText( + state.buffer, + textAlign: TextAlign.end, + style: const TextStyle( + fontSize: 80, + color: Colors.black, ), + maxLines: 2, + ) + : AutoSizeText( + state.error, + textAlign: TextAlign.start, + style: const TextStyle( + fontSize: 80, + color: Colors.red, + ), + maxLines: 2, + ), ), ), ), diff --git a/simplistic_calculator/pubspec.yaml b/simplistic_calculator/pubspec.yaml index 41a86b172..988f7be44 100644 --- a/simplistic_calculator/pubspec.yaml +++ b/simplistic_calculator/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: auto_size_text: ^3.0.0 diff --git a/simplistic_editor/pubspec.yaml b/simplistic_editor/pubspec.yaml index 016eb3e4c..ba8d24efc 100644 --- a/simplistic_editor/pubspec.yaml +++ b/simplistic_editor/pubspec.yaml @@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions diff --git a/testing_app/integration_test/state_mgmt_test.dart b/testing_app/integration_test/state_mgmt_test.dart index dc272638f..6dabad443 100644 --- a/testing_app/integration_test/state_mgmt_test.dart +++ b/testing_app/integration_test/state_mgmt_test.dart @@ -12,12 +12,12 @@ import 'package:testing_app/screens/favorites.dart'; late Favorites favoritesList; Widget createFavoritesScreen() => ChangeNotifierProvider( - create: (context) { - favoritesList = Favorites(); - return favoritesList; - }, - child: const MaterialApp(home: FavoritesPage()), - ); + create: (context) { + favoritesList = Favorites(); + return favoritesList; + }, + child: const MaterialApp(home: FavoritesPage()), +); void main() { group('Testing App State Management Tests', () { diff --git a/testing_app/pubspec.yaml b/testing_app/pubspec.yaml index e89841add..d32e7a814 100644 --- a/testing_app/pubspec.yaml +++ b/testing_app/pubspec.yaml @@ -4,7 +4,7 @@ description: A sample that shows testing in Flutter. version: 1.0.0+1 environment: - sdk: ^3.6.0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/testing_app/test/favorites_test.dart b/testing_app/test/favorites_test.dart index be9f21650..c1344cb82 100644 --- a/testing_app/test/favorites_test.dart +++ b/testing_app/test/favorites_test.dart @@ -11,12 +11,12 @@ import 'package:testing_app/screens/favorites.dart'; late Favorites favoritesList; Widget createFavoritesScreen() => ChangeNotifierProvider( - create: (context) { - favoritesList = Favorites(); - return favoritesList; - }, - child: const MaterialApp(home: FavoritesPage()), - ); + create: (context) { + favoritesList = Favorites(); + return favoritesList; + }, + child: const MaterialApp(home: FavoritesPage()), +); void addItems() { for (var i = 0; i < 5; i++) { diff --git a/testing_app/test/home_test.dart b/testing_app/test/home_test.dart index b81deb1d4..6adcefbfc 100644 --- a/testing_app/test/home_test.dart +++ b/testing_app/test/home_test.dart @@ -9,9 +9,9 @@ import 'package:testing_app/main.dart'; import 'package:testing_app/models/favorites.dart'; Widget createHomeScreen() => ChangeNotifierProvider( - create: (context) => Favorites(), - child: MaterialApp.router(routerConfig: router()), - ); + create: (context) => Favorites(), + child: MaterialApp.router(routerConfig: router()), +); void main() { group('Home Page Widget Tests', () { diff --git a/tool/flutter_ci_script_stable.sh b/tool/flutter_ci_script_stable.sh index ba5eb35a2..9d6fecc0c 100755 --- a/tool/flutter_ci_script_stable.sh +++ b/tool/flutter_ci_script_stable.sh @@ -8,51 +8,6 @@ source "$DIR/flutter_ci_script_shared.sh" flutter doctor -v declare -ar PROJECT_NAMES=( - "add_to_app/android_view/flutter_module_using_plugin" - "add_to_app/books/flutter_module_books" - "add_to_app/fullscreen/flutter_module" - "add_to_app/multiple_flutters/multiple_flutters_module" - "add_to_app/plugin/flutter_module_using_plugin" - "add_to_app/prebuilt_module/flutter_module" - "analysis_defaults" - "android_splash_screen" - "animations" - "asset_transformation" - "background_isolate_channels" - "code_sharing/client" - "code_sharing/server" - "code_sharing/shared" - "compass_app/app" - "compass_app/server" - "context_menus" - "deeplink_store_example" - "desktop_photo_search/fluent_ui" - "desktop_photo_search/material" - "dynamic_theme" - "flutter_maps_firestore" - "form_app" - "game_template" - "gemini_tasks" - "google_maps" - "infinite_list" - "ios_app_clip" - # TODO(ewindmill) For all the following 4 -- Uncomment when 3.34 goes stable. I updated too soon. - # "isolate_example" - # "material_3_demo" - # "platform_channels" - # "platform_design" - "navigation_and_routing" - "pedometer" - "pedometer/example" - "place_tracker" - "platform_view_swift" - "provider_counter" - "provider_shopper" - "simple_shader" - "simplistic_calculator" - # "simplistic_editor" - "testing_app" - "veggieseasons" "web_embedding/element_embedding_demo" ) diff --git a/veggieseasons/lib/data/app_state.dart b/veggieseasons/lib/data/app_state.dart index e1f14cfb9..9c802c001 100644 --- a/veggieseasons/lib/data/app_state.dart +++ b/veggieseasons/lib/data/app_state.dart @@ -28,10 +28,9 @@ class AppState extends ChangeNotifier { Veggie getVeggie(int? id) => _veggies.singleWhere((v) => v.id == id); - List searchVeggies(String? terms) => - _veggies - .where((v) => v.name.toLowerCase().contains(terms!.toLowerCase())) - .toList(); + List searchVeggies(String? terms) => _veggies + .where((v) => v.name.toLowerCase().contains(terms!.toLowerCase())) + .toList(); void setFavorite(int? id, bool isFavorite) { var veggie = getVeggie(id); diff --git a/veggieseasons/lib/screens/details.dart b/veggieseasons/lib/screens/details.dart index 1b1fc0fab..63f8b680c 100644 --- a/veggieseasons/lib/screens/details.dart +++ b/veggieseasons/lib/screens/details.dart @@ -143,10 +143,9 @@ class InfoView extends StatelessWidget { children: [ Icon( Styles.seasonIconData[season], - color: - veggie.seasons.contains(season) - ? Styles.seasonColors[season] - : const Color.fromRGBO(128, 128, 128, 1), + color: veggie.seasons.contains(season) + ? Styles.seasonColors[season] + : const Color.fromRGBO(128, 128, 128, 1), size: 24, ), const SizedBox(height: 4), diff --git a/veggieseasons/lib/screens/favorites.dart b/veggieseasons/lib/screens/favorites.dart index e10e62bd1..3f4bcf914 100644 --- a/veggieseasons/lib/screens/favorites.dart +++ b/veggieseasons/lib/screens/favorites.dart @@ -25,26 +25,25 @@ class FavoritesScreen extends StatelessWidget { middle: Text('My Garden'), ), child: Center( - child: - model.favoriteVeggies.isEmpty - ? Padding( - padding: const EdgeInsets.symmetric(horizontal: 24), - child: Text( - 'You haven\'t added any favorite veggies to your garden yet.', - style: CupertinoTheme.of(context).textTheme.textStyle, - ), - ) - : ListView( - restorationId: 'list', - children: [ - const SizedBox(height: 24), - for (Veggie veggie in model.favoriteVeggies) - Padding( - padding: const EdgeInsets.fromLTRB(16, 0, 16, 24), - child: VeggieHeadline(veggie), - ), - ], + child: model.favoriteVeggies.isEmpty + ? Padding( + padding: const EdgeInsets.symmetric(horizontal: 24), + child: Text( + 'You haven\'t added any favorite veggies to your garden yet.', + style: CupertinoTheme.of(context).textTheme.textStyle, ), + ) + : ListView( + restorationId: 'list', + children: [ + const SizedBox(height: 24), + for (Veggie veggie in model.favoriteVeggies) + Padding( + padding: const EdgeInsets.fromLTRB(16, 0, 16, 24), + child: VeggieHeadline(veggie), + ), + ], + ), ), ); }, diff --git a/veggieseasons/lib/screens/settings.dart b/veggieseasons/lib/screens/settings.dart index 8e1e91f5e..4d147cb8d 100644 --- a/veggieseasons/lib/screens/settings.dart +++ b/veggieseasons/lib/screens/settings.dart @@ -129,14 +129,13 @@ class CalorieSettingsScreen extends StatelessWidget { icon: CupertinoIcons.check_mark, foregroundColor: snapshot.hasData && snapshot.data == cals - ? CupertinoColors.activeBlue - : Styles.transparentColor, + ? CupertinoColors.activeBlue + : Styles.transparentColor, backgroundColor: Styles.transparentColor, ), - onTap: - snapshot.hasData - ? () => model.setDesiredCalories(cals) - : null, + onTap: snapshot.hasData + ? () => model.setDesiredCalories(cals) + : null, ), ); } @@ -227,29 +226,28 @@ class _SettingsScreenState extends State { onTap: () { showCupertinoDialog( context: context, - builder: - (context) => CupertinoAlertDialog( - title: const Text('Are you sure?'), - content: const Text( - 'Are you sure you want to reset the current settings?', - ), - actions: [ - CupertinoDialogAction( - isDestructiveAction: true, - child: const Text('Yes'), - onPressed: () async { - await prefs.restoreDefaults(); - if (!context.mounted) return; - context.pop(); - }, - ), - CupertinoDialogAction( - isDefaultAction: true, - child: const Text('No'), - onPressed: () => context.pop(), - ), - ], + builder: (context) => CupertinoAlertDialog( + title: const Text('Are you sure?'), + content: const Text( + 'Are you sure you want to reset the current settings?', + ), + actions: [ + CupertinoDialogAction( + isDestructiveAction: true, + child: const Text('Yes'), + onPressed: () async { + await prefs.restoreDefaults(); + if (!context.mounted) return; + context.pop(); + }, + ), + CupertinoDialogAction( + isDefaultAction: true, + child: const Text('No'), + onPressed: () => context.pop(), ), + ], + ), ); }, ); diff --git a/veggieseasons/lib/styles.dart b/veggieseasons/lib/styles.dart index da9c3ab4c..0460a27f1 100644 --- a/veggieseasons/lib/styles.dart +++ b/veggieseasons/lib/styles.dart @@ -103,8 +103,8 @@ abstract class Styles { static Color? scaffoldBackground(Brightness brightness) => brightness == Brightness.light - ? CupertinoColors.extraLightBackgroundGray - : null; + ? CupertinoColors.extraLightBackgroundGray + : null; static const frostedBackground = Color(0xccf8f8f8); @@ -177,13 +177,13 @@ abstract class Styles { static Color settingsItemColor(Brightness brightness) => brightness == Brightness.light - ? CupertinoColors.tertiarySystemBackground - : CupertinoColors.darkBackgroundGray; + ? CupertinoColors.tertiarySystemBackground + : CupertinoColors.darkBackgroundGray; static Color settingsLineation(Brightness brightness) => brightness == Brightness.light - ? const Color(0xffbcbbc1) - : const Color(0xff4c4b4b); + ? const Color(0xffbcbbc1) + : const Color(0xff4c4b4b); static const Color settingsBackground = Color(0xffefeff4); @@ -208,6 +208,6 @@ abstract class Styles { static const servingInfoBorderColor = Color(0xffb0b0b0); static const ColorFilter desaturatedColorFilter = - // 222222 is a random color that has low color saturation. - ColorFilter.mode(Color(0xff222222), BlendMode.saturation); + // 222222 is a random color that has low color saturation. + ColorFilter.mode(Color(0xff222222), BlendMode.saturation); } diff --git a/veggieseasons/lib/widgets/detail_buttons.dart b/veggieseasons/lib/widgets/detail_buttons.dart index c10727bf9..f46f30a74 100644 --- a/veggieseasons/lib/widgets/detail_buttons.dart +++ b/veggieseasons/lib/widgets/detail_buttons.dart @@ -129,10 +129,9 @@ class _DetailPageButtonState extends State<_DetailPageButton> { child: ColorChangingIcon( widget.icon, duration: const Duration(milliseconds: 300), - color: - tapInProgress - ? Styles.closeButtonPressed - : Styles.closeButtonUnpressed, + color: tapInProgress + ? Styles.closeButtonPressed + : Styles.closeButtonUnpressed, size: 20, ), ), diff --git a/veggieseasons/lib/widgets/veggie_card.dart b/veggieseasons/lib/widgets/veggie_card.dart index 474fb6a9c..ce7e537c2 100644 --- a/veggieseasons/lib/widgets/veggie_card.dart +++ b/veggieseasons/lib/widgets/veggie_card.dart @@ -93,8 +93,9 @@ class VeggieCard extends StatelessWidget { decoration: BoxDecoration( image: DecorationImage( fit: BoxFit.cover, - colorFilter: - isInSeason ? null : Styles.desaturatedColorFilter, + colorFilter: isInSeason + ? null + : Styles.desaturatedColorFilter, image: AssetImage(veggie.imageAssetPath), ), ), diff --git a/veggieseasons/pubspec.yaml b/veggieseasons/pubspec.yaml index b65293a71..039069742 100644 --- a/veggieseasons/pubspec.yaml +++ b/veggieseasons/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none version: 1.2.0 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/web_embedding/element_embedding_demo/pubspec.yaml b/web_embedding/element_embedding_demo/pubspec.yaml index afa31c129..632dbf101 100644 --- a/web_embedding/element_embedding_demo/pubspec.yaml +++ b/web_embedding/element_embedding_demo/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' dependencies: flutter: diff --git a/web_embedding/ng-flutter/flutter/pubspec.yaml b/web_embedding/ng-flutter/flutter/pubspec.yaml index 5d3292570..715cd41c1 100644 --- a/web_embedding/ng-flutter/flutter/pubspec.yaml +++ b/web_embedding/ng-flutter/flutter/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: none version: 1.0.0 environment: - sdk: ^3.7.0-0 + sdk: '>=3.9.0-0 <4.0.0' flutter: ">=3.22.0" dependencies: