diff --git a/add_to_app/android_view/flutter_module_using_plugin_android_view/analysis_options.yaml b/add_to_app/android_view/flutter_module_using_plugin_android_view/analysis_options.yaml index 5940214f4..0d5eaab35 100644 --- a/add_to_app/android_view/flutter_module_using_plugin_android_view/analysis_options.yaml +++ b/add_to_app/android_view/flutter_module_using_plugin_android_view/analysis_options.yaml @@ -7,4 +7,4 @@ analyzer: - windows/** - macos/** - linux/** -include: package:analysis_defaults/flutter.yaml +include: ../../../analysis_options.yaml diff --git a/add_to_app/android_view/flutter_module_using_plugin_content_sizing_android_view/analysis_options.yaml b/add_to_app/android_view/flutter_module_using_plugin_content_sizing_android_view/analysis_options.yaml index 5940214f4..0d5eaab35 100644 --- a/add_to_app/android_view/flutter_module_using_plugin_content_sizing_android_view/analysis_options.yaml +++ b/add_to_app/android_view/flutter_module_using_plugin_content_sizing_android_view/analysis_options.yaml @@ -7,4 +7,4 @@ analyzer: - windows/** - macos/** - linux/** -include: package:analysis_defaults/flutter.yaml +include: ../../../analysis_options.yaml diff --git a/add_to_app/books/flutter_module_books/analysis_options.yaml b/add_to_app/books/flutter_module_books/analysis_options.yaml index 5940214f4..0d5eaab35 100644 --- a/add_to_app/books/flutter_module_books/analysis_options.yaml +++ b/add_to_app/books/flutter_module_books/analysis_options.yaml @@ -7,4 +7,4 @@ analyzer: - windows/** - macos/** - linux/** -include: package:analysis_defaults/flutter.yaml +include: ../../../analysis_options.yaml diff --git a/add_to_app/fullscreen/flutter_module_fullscreen/analysis_options.yaml b/add_to_app/fullscreen/flutter_module_fullscreen/analysis_options.yaml index 5940214f4..0d5eaab35 100644 --- a/add_to_app/fullscreen/flutter_module_fullscreen/analysis_options.yaml +++ b/add_to_app/fullscreen/flutter_module_fullscreen/analysis_options.yaml @@ -7,4 +7,4 @@ analyzer: - windows/** - macos/** - linux/** -include: package:analysis_defaults/flutter.yaml +include: ../../../analysis_options.yaml diff --git a/add_to_app/ios_content_resizing/flutter_module/analysis_options.yaml b/add_to_app/ios_content_resizing/flutter_module/analysis_options.yaml index a5744c1cf..e69de29bb 100644 --- a/add_to_app/ios_content_resizing/flutter_module/analysis_options.yaml +++ b/add_to_app/ios_content_resizing/flutter_module/analysis_options.yaml @@ -1,4 +0,0 @@ -include: package:flutter_lints/flutter.yaml - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options diff --git a/add_to_app/ios_content_resizing/ios_content_resizing/flutter_module/analysis_options.yaml b/add_to_app/ios_content_resizing/ios_content_resizing/flutter_module/analysis_options.yaml index 13d6fe105..e69de29bb 100644 --- a/add_to_app/ios_content_resizing/ios_content_resizing/flutter_module/analysis_options.yaml +++ b/add_to_app/ios_content_resizing/ios_content_resizing/flutter_module/analysis_options.yaml @@ -1 +0,0 @@ -include: package:analysis_defaults/flutter.yaml diff --git a/add_to_app/multiple_flutters/multiple_flutters_module/analysis_options.yaml b/add_to_app/multiple_flutters/multiple_flutters_module/analysis_options.yaml index 322db234a..0d5eaab35 100644 --- a/add_to_app/multiple_flutters/multiple_flutters_module/analysis_options.yaml +++ b/add_to_app/multiple_flutters/multiple_flutters_module/analysis_options.yaml @@ -7,4 +7,4 @@ analyzer: - windows/** - macos/** - linux/** -include: package:analysis_defaults/flutter.yaml \ No newline at end of file +include: ../../../analysis_options.yaml diff --git a/add_to_app/plugin/flutter_module_using_plugin/analysis_options.yaml b/add_to_app/plugin/flutter_module_using_plugin/analysis_options.yaml index 5940214f4..0d5eaab35 100644 --- a/add_to_app/plugin/flutter_module_using_plugin/analysis_options.yaml +++ b/add_to_app/plugin/flutter_module_using_plugin/analysis_options.yaml @@ -7,4 +7,4 @@ analyzer: - windows/** - macos/** - linux/** -include: package:analysis_defaults/flutter.yaml +include: ../../../analysis_options.yaml diff --git a/add_to_app/prebuilt_module/flutter_module/analysis_options.yaml b/add_to_app/prebuilt_module/flutter_module/analysis_options.yaml index 5940214f4..0d5eaab35 100644 --- a/add_to_app/prebuilt_module/flutter_module/analysis_options.yaml +++ b/add_to_app/prebuilt_module/flutter_module/analysis_options.yaml @@ -7,4 +7,4 @@ analyzer: - windows/** - macos/** - linux/** -include: package:analysis_defaults/flutter.yaml +include: ../../../analysis_options.yaml diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 000000000..2273994a1 --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1,11 @@ +include: package:analysis_defaults/flutter.yaml + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** diff --git a/android_splash_screen/analysis_options.yaml b/android_splash_screen/analysis_options.yaml index 5940214f4..d770e9ca6 100644 --- a/android_splash_screen/analysis_options.yaml +++ b/android_splash_screen/analysis_options.yaml @@ -7,4 +7,4 @@ analyzer: - windows/** - macos/** - linux/** -include: package:analysis_defaults/flutter.yaml +include: ../analysis_options.yaml diff --git a/animations/analysis_options.yaml b/animations/analysis_options.yaml index 5940214f4..d770e9ca6 100644 --- a/animations/analysis_options.yaml +++ b/animations/analysis_options.yaml @@ -7,4 +7,4 @@ analyzer: - windows/** - macos/** - linux/** -include: package:analysis_defaults/flutter.yaml +include: ../analysis_options.yaml diff --git a/asset_transformation/grayscale_transformer/analysis_options.yaml b/asset_transformation/grayscale_transformer/analysis_options.yaml index 6c4f4c8dd..a96029588 100644 --- a/asset_transformation/grayscale_transformer/analysis_options.yaml +++ b/asset_transformation/grayscale_transformer/analysis_options.yaml @@ -1,16 +1,3 @@ -# This file configures the static analysis results for your project (errors, -# warnings, and lints). -# -# This enables the 'recommended' set of lints from `package:lints`. -# This set helps identify many issues that may lead to problems when running -# or consuming Dart code, and enforces writing Dart using a single, idiomatic -# style and format. -# -# If you want a smaller set of lints you can change this to specify -# 'package:lints/core.yaml'. These are just the most critical lints -# (the recommended set includes the core lints). -# The core lints are also what is used by pub.dev for scoring packages. - analyzer: exclude: - build/** @@ -20,20 +7,4 @@ analyzer: - windows/** - macos/** - linux/** -include: package:lints/recommended.yaml - -# Uncomment the following section to specify additional rules. - -# linter: -# rules: -# - camel_case_types - -# analyzer: -# exclude: -# - path/to/excluded/files/** - -# For more information about the core and recommended set of lints, see -# https://dart.dev/go/core-lints - -# For additional information about configuring this file, see -# https://dart.dev/guides/language/analysis-options +include: ../../analysis_options.yaml diff --git a/asset_transformation/grayscale_transformer/bin/grayscale_transformer.dart b/asset_transformation/grayscale_transformer/bin/grayscale_transformer.dart index ac1e61795..b80fe7184 100644 --- a/asset_transformation/grayscale_transformer/bin/grayscale_transformer.dart +++ b/asset_transformation/grayscale_transformer/bin/grayscale_transformer.dart @@ -16,8 +16,8 @@ int main(List arguments) { ..addOption(outputOptionName, mandatory: true, abbr: 'o'); ArgResults argResults = parser.parse(arguments); - final String inputFilePath = argResults[inputOptionName]; - final String outputFilePath = argResults[outputOptionName]; + final String inputFilePath = argResults[inputOptionName] as String; + final String outputFilePath = argResults[outputOptionName] as String; try { final Image image = decodeImage(File(inputFilePath).readAsBytesSync())!; diff --git a/asset_transformation/test/main_test.dart b/asset_transformation/test/main_test.dart index e3bae36ee..2c84aa5f2 100644 --- a/asset_transformation/test/main_test.dart +++ b/asset_transformation/test/main_test.dart @@ -1,8 +1,8 @@ -import 'package:flutter_test/flutter_test.dart'; import 'package:asset_transformation/main.dart'; +import 'package:flutter_test/flutter_test.dart'; void main() { - testWidgets('app can render without exceptions', (WidgetTester tester) async { + testWidgets('app can render without exceptions', (tester) async { await tester.pumpWidget(const MainApp()); }); } diff --git a/background_isolate_channels/analysis_options.yaml b/background_isolate_channels/analysis_options.yaml index 5940214f4..d770e9ca6 100644 --- a/background_isolate_channels/analysis_options.yaml +++ b/background_isolate_channels/analysis_options.yaml @@ -7,4 +7,4 @@ analyzer: - windows/** - macos/** - linux/** -include: package:analysis_defaults/flutter.yaml +include: ../analysis_options.yaml diff --git a/compass_app/app/analysis_options.yaml b/compass_app/app/analysis_options.yaml index 90f16991a..fbaa40610 100644 --- a/compass_app/app/analysis_options.yaml +++ b/compass_app/app/analysis_options.yaml @@ -1,14 +1,3 @@ -analyzer: - exclude: - - build/** - - android/** - - ios/** - - web/** - - windows/** - - macos/** - - linux/** -include: package:flutter_lints/flutter.yaml - linter: rules: - combinators_ordering @@ -18,3 +7,13 @@ linter: - prefer_final_in_for_each - prefer_final_locals - prefer_relative_imports + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** \ No newline at end of file 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 3fcff3e30..cec85afa5 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 @@ -85,7 +85,6 @@ class BookingCreateUseCase { switch (saveBookingResult) { case Ok(): _log.fine('Booking saved successfully'); - break; case Error(): _log.warning('Failed to save booking', saveBookingResult.error); return Result.error(saveBookingResult.error); diff --git a/compass_app/app/lib/ui/core/localization/applocalization.dart b/compass_app/app/lib/ui/core/localization/applocalization.dart index b4aa2823c..1c142090a 100644 --- a/compass_app/app/lib/ui/core/localization/applocalization.dart +++ b/compass_app/app/lib/ui/core/localization/applocalization.dart @@ -7,7 +7,7 @@ import 'package:flutter/material.dart'; class AppLocalization { static AppLocalization of(BuildContext context) { - return Localizations.of(context, AppLocalization); + return Localizations.of(context, AppLocalization)!; } static const _strings = { @@ -53,11 +53,13 @@ class AppLocalization { String get daytime => _get('daytime'); - String get errorWhileLoadingActivities => _get('errorWhileLoadingActivities'); + String get errorWhileLoadingActivities => + _get('errorWhileLoadingActivities'); String get errorWhileLoadingBooking => _get('errorWhileLoadingBooking'); - String get errorWhileLoadingContinents => _get('errorWhileLoadingContinents'); + String get errorWhileLoadingContinents => + _get('errorWhileLoadingContinents'); String get errorWhileLoadingDestinations => _get('errorWhileLoadingDestinations'); @@ -98,7 +100,8 @@ class AppLocalization { String get errorWhileDeletingBooking => _get('errorWhileDeletingBooking'); - String nameTrips(String name) => _get('nameTrips').replaceAll('{name}', name); + String nameTrips(String name) => + _get('nameTrips').replaceAll('{name}', name); String selected(int value) => _get('selected').replaceAll('{1}', value.toString()); diff --git a/compass_app/app/lib/ui/search_form/widgets/search_form_continent.dart b/compass_app/app/lib/ui/search_form/widgets/search_form_continent.dart index a12991886..d59b5eb4b 100644 --- a/compass_app/app/lib/ui/search_form/widgets/search_form_continent.dart +++ b/compass_app/app/lib/ui/search_form/widgets/search_form_continent.dart @@ -52,7 +52,7 @@ class SearchFormContinent extends StatelessWidget { scrollDirection: Axis.horizontal, itemCount: viewModel.continents.length, padding: Dimens.of(context).edgeInsetsScreenHorizontal, - itemBuilder: (BuildContext context, int index) { + itemBuilder: (context, index) { final Continent(:imageUrl, :name) = viewModel.continents[index]; return _CarouselItem( key: ValueKey(name), @@ -61,7 +61,7 @@ class SearchFormContinent extends StatelessWidget { viewModel: viewModel, ); }, - separatorBuilder: (BuildContext context, int index) { + separatorBuilder: (context, index) { return const SizedBox(width: 8); }, ); diff --git a/compass_app/app/test/ui/activities/activities_screen_test.dart b/compass_app/app/test/ui/activities/activities_screen_test.dart index fb76286e6..83b8a16ed 100644 --- a/compass_app/app/test/ui/activities/activities_screen_test.dart +++ b/compass_app/app/test/ui/activities/activities_screen_test.dart @@ -45,14 +45,14 @@ void main() { ); } - testWidgets('should load screen', (WidgetTester tester) async { + testWidgets('should load screen', (tester) async { await mockNetworkImages(() async { await loadScreen(tester); expect(find.byType(ActivitiesScreen), findsOneWidget); }); }); - testWidgets('should list activity', (WidgetTester tester) async { + testWidgets('should list activity', (tester) async { await mockNetworkImages(() async { await loadScreen(tester); expect(find.byType(ActivityEntry), findsOneWidget); @@ -61,7 +61,7 @@ void main() { }); testWidgets('should select activity and confirm', ( - WidgetTester tester, + tester, ) async { await mockNetworkImages(() async { await loadScreen(tester); diff --git a/compass_app/app/test/ui/auth/login_screen_test.dart b/compass_app/app/test/ui/auth/login_screen_test.dart index a893e8eaa..80eb45edf 100644 --- a/compass_app/app/test/ui/auth/login_screen_test.dart +++ b/compass_app/app/test/ui/auth/login_screen_test.dart @@ -32,14 +32,14 @@ void main() { ); } - testWidgets('should load screen', (WidgetTester tester) async { + testWidgets('should load screen', (tester) async { await mockNetworkImages(() async { await loadScreen(tester); expect(find.byType(LoginScreen), findsOneWidget); }); }); - testWidgets('should perform login', (WidgetTester tester) async { + testWidgets('should perform login', (tester) async { await mockNetworkImages(() async { await loadScreen(tester); diff --git a/compass_app/app/test/ui/auth/logout_button_test.dart b/compass_app/app/test/ui/auth/logout_button_test.dart index 07891ce89..52397dbf1 100644 --- a/compass_app/app/test/ui/auth/logout_button_test.dart +++ b/compass_app/app/test/ui/auth/logout_button_test.dart @@ -43,14 +43,14 @@ void main() { ); } - testWidgets('should load widget', (WidgetTester tester) async { + testWidgets('should load widget', (tester) async { await mockNetworkImages(() async { await loadScreen(tester); expect(find.byType(LogoutButton), findsOneWidget); }); }); - testWidgets('should perform logout', (WidgetTester tester) async { + testWidgets('should perform logout', (tester) async { await mockNetworkImages(() async { await loadScreen(tester); diff --git a/compass_app/app/test/ui/booking/booking_screen_test.dart b/compass_app/app/test/ui/booking/booking_screen_test.dart index 0036e1703..d4105835c 100644 --- a/compass_app/app/test/ui/booking/booking_screen_test.dart +++ b/compass_app/app/test/ui/booking/booking_screen_test.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'dart:async'; + import 'package:compass_app/domain/models/itinerary_config/itinerary_config.dart'; import 'package:compass_app/domain/use_cases/booking/booking_create_use_case.dart'; import 'package:compass_app/domain/use_cases/booking/booking_share_use_case.dart'; @@ -62,20 +64,20 @@ void main() { ); } - testWidgets('should load screen', (WidgetTester tester) async { + testWidgets('should load screen', (tester) async { await loadScreen(tester); expect(find.byType(BookingScreen), findsOneWidget); }); - testWidgets('should display booking from ID', (WidgetTester tester) async { + testWidgets('should display booking from ID', (tester) async { // Add a booking to repository - bookingRepository.createBooking(kBooking); + unawaited(bookingRepository.createBooking(kBooking)); // Load screen await loadScreen(tester); // Load booking with ID 0 - viewModel.loadBooking.execute(0); + unawaited(viewModel.loadBooking.execute(0)); // Wait for booking to load await tester.pumpAndSettle(); @@ -85,12 +87,12 @@ void main() { }); testWidgets('should create booking from itinerary config', ( - WidgetTester tester, + tester, ) async { await loadScreen(tester); // Create a new booking from stored itinerary config - viewModel.createBooking.execute(); + unawaited(viewModel.createBooking.execute()); // Wait for booking to load await tester.pumpAndSettle(); @@ -102,10 +104,10 @@ void main() { expect(bookingRepository.bookings.length, 1); }); - testWidgets('should share booking', (WidgetTester tester) async { - bookingRepository.createBooking(kBooking); + testWidgets('should share booking', (tester) async { + unawaited(bookingRepository.createBooking(kBooking)); await loadScreen(tester); - viewModel.loadBooking.execute(0); + unawaited(viewModel.loadBooking.execute(0)); await tester.pumpAndSettle(); await tester.tap(find.byKey(const Key('share-button'))); expect(shared, true); diff --git a/compass_app/app/test/ui/results/results_screen_test.dart b/compass_app/app/test/ui/results/results_screen_test.dart index cfb1ce3a3..23ea886f1 100644 --- a/compass_app/app/test/ui/results/results_screen_test.dart +++ b/compass_app/app/test/ui/results/results_screen_test.dart @@ -42,14 +42,14 @@ void main() { ); } - testWidgets('should load screen', (WidgetTester tester) async { + testWidgets('should load screen', (tester) async { await mockNetworkImages(() async { await loadScreen(tester); expect(find.byType(ResultsScreen), findsOneWidget); }); }); - testWidgets('should display destination', (WidgetTester tester) async { + testWidgets('should display destination', (tester) async { await mockNetworkImages(() async { await loadScreen(tester); @@ -63,7 +63,7 @@ void main() { }); testWidgets('should tap and navigate to activities', ( - WidgetTester tester, + tester, ) async { await mockNetworkImages(() async { await loadScreen(tester); diff --git a/compass_app/app/test/ui/search_form/widgets/search_form_continent_test.dart b/compass_app/app/test/ui/search_form/widgets/search_form_continent_test.dart index 6015cecec..63c2d5a0f 100644 --- a/compass_app/app/test/ui/search_form/widgets/search_form_continent_test.dart +++ b/compass_app/app/test/ui/search_form/widgets/search_form_continent_test.dart @@ -26,7 +26,7 @@ void main() { } testWidgets('Should load and select continent', ( - WidgetTester tester, + tester, ) async { await loadWidget(tester); expect(find.byType(SearchFormContinent), findsOneWidget); diff --git a/compass_app/app/test/ui/search_form/widgets/search_form_date_test.dart b/compass_app/app/test/ui/search_form/widgets/search_form_date_test.dart index f099dc2ab..b419f9507 100644 --- a/compass_app/app/test/ui/search_form/widgets/search_form_date_test.dart +++ b/compass_app/app/test/ui/search_form/widgets/search_form_date_test.dart @@ -27,7 +27,7 @@ void main() { } testWidgets('should display date in different month', ( - WidgetTester tester, + tester, ) async { await loadWidget(tester); expect(find.byType(SearchFormDate), findsOneWidget); @@ -46,7 +46,7 @@ void main() { }); testWidgets('should display date in same month', ( - WidgetTester tester, + tester, ) async { await loadWidget(tester); expect(find.byType(SearchFormDate), findsOneWidget); diff --git a/compass_app/app/test/ui/search_form/widgets/search_form_guests_test.dart b/compass_app/app/test/ui/search_form/widgets/search_form_guests_test.dart index 858f3e002..5aff3a983 100644 --- a/compass_app/app/test/ui/search_form/widgets/search_form_guests_test.dart +++ b/compass_app/app/test/ui/search_form/widgets/search_form_guests_test.dart @@ -26,7 +26,7 @@ void main() { await testApp(tester, SearchFormGuests(viewModel: viewModel)); } - testWidgets('Increase number of guests', (WidgetTester tester) async { + testWidgets('Increase number of guests', (tester) async { await loadWidget(tester); expect(find.byType(SearchFormGuests), findsOneWidget); @@ -39,7 +39,7 @@ void main() { expect(find.text('1'), findsOneWidget); }); - testWidgets('Decrease number of guests', (WidgetTester tester) async { + testWidgets('Decrease number of guests', (tester) async { await loadWidget(tester); expect(find.byType(SearchFormGuests), findsOneWidget); diff --git a/compass_app/app/test/ui/search_form/widgets/search_form_screen_test.dart b/compass_app/app/test/ui/search_form/widgets/search_form_screen_test.dart index 355cc80f8..d6fb0d796 100644 --- a/compass_app/app/test/ui/search_form/widgets/search_form_screen_test.dart +++ b/compass_app/app/test/ui/search_form/widgets/search_form_screen_test.dart @@ -47,7 +47,7 @@ void main() { } testWidgets('Should fill form and perform search', ( - WidgetTester tester, + tester, ) async { await loadWidget(tester); expect(find.byType(SearchFormScreen), findsOneWidget); diff --git a/compass_app/app/test/ui/search_form/widgets/search_form_submit_test.dart b/compass_app/app/test/ui/search_form/widgets/search_form_submit_test.dart index 949d40436..4fa99b52d 100644 --- a/compass_app/app/test/ui/search_form/widgets/search_form_submit_test.dart +++ b/compass_app/app/test/ui/search_form/widgets/search_form_submit_test.dart @@ -34,7 +34,7 @@ void main() { ); } - testWidgets('Should be enabled and allow tap', (WidgetTester tester) async { + testWidgets('Should be enabled and allow tap', (tester) async { await loadWidget(tester); expect(find.byType(SearchFormSubmit), findsOneWidget); diff --git a/compass_app/app/test/utils/command_test.dart b/compass_app/app/test/utils/command_test.dart index 4633fb41f..733f383f3 100644 --- a/compass_app/app/test/utils/command_test.dart +++ b/compass_app/app/test/utils/command_test.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'dart:async'; + import 'package:compass_app/utils/command.dart'; import 'package:compass_app/utils/result.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -53,10 +55,10 @@ void main() { final future = command.execute(); // Run multiple times - command.execute(); - command.execute(); - command.execute(); - command.execute(); + unawaited(command.execute()); + unawaited(command.execute()); + unawaited(command.execute()); + unawaited(command.execute()); // Await execution await future; diff --git a/compass_app/server/analysis_options.yaml b/compass_app/server/analysis_options.yaml new file mode 100644 index 000000000..fbaa40610 --- /dev/null +++ b/compass_app/server/analysis_options.yaml @@ -0,0 +1,19 @@ +linter: + rules: + - combinators_ordering + - directives_ordering + - omit_local_variable_types + - prefer_final_fields + - prefer_final_in_for_each + - prefer_final_locals + - prefer_relative_imports + +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** \ No newline at end of file diff --git a/compass_app/server/bin/compass_server.dart b/compass_app/server/bin/compass_server.dart index 7f2011552..5dc7c6251 100644 --- a/compass_app/server/bin/compass_server.dart +++ b/compass_app/server/bin/compass_server.dart @@ -35,5 +35,6 @@ void main(List args) async { // For running in containers, we respect the PORT environment variable. final port = int.parse(Platform.environment['PORT'] ?? '8080'); final server = await serve(handler, ip, port); + // ignore: avoid_print print('Server listening on port ${server.port}'); } diff --git a/cupertino_gallery/analysis_options.yaml b/cupertino_gallery/analysis_options.yaml index bf8d42185..d770e9ca6 100644 --- a/cupertino_gallery/analysis_options.yaml +++ b/cupertino_gallery/analysis_options.yaml @@ -1,12 +1,3 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. - -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. analyzer: exclude: - build/** @@ -16,22 +7,4 @@ analyzer: - windows/** - macos/** - linux/** -include: package:flutter_lints/flutter.yaml - -linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at https://dart.dev/lints. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. - rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options +include: ../analysis_options.yaml diff --git a/cupertino_gallery/lib/gallery_home.dart b/cupertino_gallery/lib/gallery_home.dart index fc1b25f26..cd206ed80 100644 --- a/cupertino_gallery/lib/gallery_home.dart +++ b/cupertino_gallery/lib/gallery_home.dart @@ -31,9 +31,9 @@ class GalleryHome extends StatelessWidget { ), ], ), - tabBuilder: (BuildContext context, int index) { + tabBuilder: (context, index) { return CupertinoTabView( - builder: (BuildContext context) { + builder: (context) { return switch (index) { 0 => const WidgetsPage(), 1 => SettingsPage( diff --git a/cupertino_gallery/lib/settings_page.dart b/cupertino_gallery/lib/settings_page.dart index ae35c4461..6022afb96 100644 --- a/cupertino_gallery/lib/settings_page.dart +++ b/cupertino_gallery/lib/settings_page.dart @@ -54,7 +54,7 @@ class _SettingsPageState extends State { title: const Text('Dark Mode'), trailing: CupertinoSwitch( value: isDarkMode, - onChanged: (bool isActive) { + onChanged: (isActive) { setState(() { isDarkMode = isActive; widget.onThemeChange(isActive); @@ -70,7 +70,7 @@ class _SettingsPageState extends State { value: _textSize, min: 0.5, max: 1.5, - onChanged: (double value) { + onChanged: (value) { setState(() { _textSize = value; }); @@ -103,7 +103,7 @@ class _SettingsPageState extends State { onTap: () { showCupertinoDialog( context: context, - builder: (BuildContext context) => CupertinoAlertDialog( + builder: (context) => CupertinoAlertDialog( title: const Text('Reset Settings'), content: const Text( 'Are you sure you want to reset all settings?', diff --git a/cupertino_gallery/lib/widgets/action_sheet_page.dart b/cupertino_gallery/lib/widgets/action_sheet_page.dart index b5a8c5b0e..0a26a4f70 100644 --- a/cupertino_gallery/lib/widgets/action_sheet_page.dart +++ b/cupertino_gallery/lib/widgets/action_sheet_page.dart @@ -13,7 +13,7 @@ class ActionSheetPage extends StatelessWidget { onPressed: () { showCupertinoModalPopup( context: context, - builder: (BuildContext context) => CupertinoActionSheet( + builder: (context) => CupertinoActionSheet( title: const Text('Title'), message: const Text('Message'), actions: [ diff --git a/cupertino_gallery/lib/widgets/alert_dialog_page.dart b/cupertino_gallery/lib/widgets/alert_dialog_page.dart index 416ba5160..bd8aa7842 100644 --- a/cupertino_gallery/lib/widgets/alert_dialog_page.dart +++ b/cupertino_gallery/lib/widgets/alert_dialog_page.dart @@ -13,7 +13,7 @@ class AlertDialogPage extends StatelessWidget { onPressed: () { showCupertinoDialog( context: context, - builder: (BuildContext context) => CupertinoAlertDialog( + builder: (context) => CupertinoAlertDialog( title: const Text('Alert'), content: const Text('This is a sample alert dialog.'), actions: [ diff --git a/cupertino_gallery/lib/widgets/checkbox_page.dart b/cupertino_gallery/lib/widgets/checkbox_page.dart index 6244e6b87..b482054d0 100644 --- a/cupertino_gallery/lib/widgets/checkbox_page.dart +++ b/cupertino_gallery/lib/widgets/checkbox_page.dart @@ -17,7 +17,7 @@ class _CheckboxPageState extends State { child: Center( child: CupertinoCheckbox( value: _value, - onChanged: (bool? value) { + onChanged: (value) { setState(() { _value = value!; }); diff --git a/cupertino_gallery/lib/widgets/date_picker_page.dart b/cupertino_gallery/lib/widgets/date_picker_page.dart index 126bd967c..aee62b46a 100644 --- a/cupertino_gallery/lib/widgets/date_picker_page.dart +++ b/cupertino_gallery/lib/widgets/date_picker_page.dart @@ -10,7 +10,7 @@ class DatePickerPage extends StatelessWidget { child: Center( child: SizedBox( height: 200, - child: CupertinoDatePicker(onDateTimeChanged: (DateTime newDate) {}), + child: CupertinoDatePicker(onDateTimeChanged: (newDate) {}), ), ), ); diff --git a/cupertino_gallery/lib/widgets/picker_page.dart b/cupertino_gallery/lib/widgets/picker_page.dart index 63223061d..60ef8e6c2 100644 --- a/cupertino_gallery/lib/widgets/picker_page.dart +++ b/cupertino_gallery/lib/widgets/picker_page.dart @@ -12,7 +12,7 @@ class PickerPage extends StatelessWidget { height: 200, child: CupertinoPicker( itemExtent: 32, - onSelectedItemChanged: (int index) {}, + onSelectedItemChanged: (index) {}, children: const [Text('One'), Text('Two'), Text('Three')], ), ), diff --git a/cupertino_gallery/lib/widgets/popup_surface_page.dart b/cupertino_gallery/lib/widgets/popup_surface_page.dart index c817ab474..d871e6c7f 100644 --- a/cupertino_gallery/lib/widgets/popup_surface_page.dart +++ b/cupertino_gallery/lib/widgets/popup_surface_page.dart @@ -15,7 +15,7 @@ class PopupSurfacePage extends StatelessWidget { onPressed: () { showCupertinoModalPopup( context: context, - builder: (BuildContext context) { + builder: (context) { return CupertinoPopupSurface( child: Container( color: CupertinoColors.white, diff --git a/cupertino_gallery/lib/widgets/radio_page.dart b/cupertino_gallery/lib/widgets/radio_page.dart index f5e768472..c6003c17d 100644 --- a/cupertino_gallery/lib/widgets/radio_page.dart +++ b/cupertino_gallery/lib/widgets/radio_page.dart @@ -17,7 +17,7 @@ class _RadioPageState extends State { child: Center( child: RadioGroup( groupValue: _selectedValue, - onChanged: (int? value) { + onChanged: (value) { setState(() { _selectedValue = value!; }); diff --git a/cupertino_gallery/lib/widgets/scrollbar_page.dart b/cupertino_gallery/lib/widgets/scrollbar_page.dart index fdecb34cb..cf9e67582 100644 --- a/cupertino_gallery/lib/widgets/scrollbar_page.dart +++ b/cupertino_gallery/lib/widgets/scrollbar_page.dart @@ -13,10 +13,10 @@ class ScrollbarPage extends StatelessWidget { child: ListView.separated( controller: controller, itemCount: 100, - itemBuilder: (BuildContext context, int index) { + itemBuilder: (context, index) { return CupertinoListTile(title: Text('Item $index')); }, - separatorBuilder: (BuildContext context, int index) { + separatorBuilder: (context, index) { return Container(height: 1, color: CupertinoColors.opaqueSeparator); }, ), diff --git a/cupertino_gallery/lib/widgets/segmented_control_page.dart b/cupertino_gallery/lib/widgets/segmented_control_page.dart index 614ca44b2..4e344d608 100644 --- a/cupertino_gallery/lib/widgets/segmented_control_page.dart +++ b/cupertino_gallery/lib/widgets/segmented_control_page.dart @@ -23,7 +23,7 @@ class _SegmentedControlPageState extends State { 1: Text('Two'), 2: Text('Three'), }, - onValueChanged: (int val) { + onValueChanged: (val) { setState(() { _selectedIndex = val; }); diff --git a/cupertino_gallery/lib/widgets/sheet_page.dart b/cupertino_gallery/lib/widgets/sheet_page.dart index e2f7a1609..1e977a82c 100644 --- a/cupertino_gallery/lib/widgets/sheet_page.dart +++ b/cupertino_gallery/lib/widgets/sheet_page.dart @@ -14,7 +14,7 @@ class SheetPage extends StatelessWidget { Navigator.of(context).push( CupertinoSheetRoute( scrollableBuilder: - (BuildContext context, ScrollController controller) { + (context, controller) { return CupertinoPageScaffold( navigationBar: CupertinoNavigationBar( middle: const Text('Sheet'), diff --git a/cupertino_gallery/lib/widgets/slider_page.dart b/cupertino_gallery/lib/widgets/slider_page.dart index 38536b159..0ed332e73 100644 --- a/cupertino_gallery/lib/widgets/slider_page.dart +++ b/cupertino_gallery/lib/widgets/slider_page.dart @@ -17,7 +17,7 @@ class _SliderPageState extends State { child: Center( child: CupertinoSlider( value: _value, - onChanged: (double value) { + onChanged: (value) { setState(() { _value = value; }); diff --git a/cupertino_gallery/lib/widgets/sliding_segmented_control_page.dart b/cupertino_gallery/lib/widgets/sliding_segmented_control_page.dart index 528c1512c..11f97fd34 100644 --- a/cupertino_gallery/lib/widgets/sliding_segmented_control_page.dart +++ b/cupertino_gallery/lib/widgets/sliding_segmented_control_page.dart @@ -25,7 +25,7 @@ class _SlidingSegmentedControlPageState 1: Text('Two'), 2: Text('Three'), }, - onValueChanged: (int? value) { + onValueChanged: (value) { setState(() { _groupValue = value; }); diff --git a/cupertino_gallery/lib/widgets/switch_page.dart b/cupertino_gallery/lib/widgets/switch_page.dart index d0ffb8c8b..6ebb66a5c 100644 --- a/cupertino_gallery/lib/widgets/switch_page.dart +++ b/cupertino_gallery/lib/widgets/switch_page.dart @@ -17,7 +17,7 @@ class _SwitchPageState extends State { child: Center( child: CupertinoSwitch( value: _value, - onChanged: (bool value) { + onChanged: (value) { setState(() { _value = value; }); diff --git a/cupertino_gallery/lib/widgets/time_picker_page.dart b/cupertino_gallery/lib/widgets/time_picker_page.dart index 0b69ee276..f50ca1472 100644 --- a/cupertino_gallery/lib/widgets/time_picker_page.dart +++ b/cupertino_gallery/lib/widgets/time_picker_page.dart @@ -11,7 +11,7 @@ class TimePickerPage extends StatelessWidget { child: SizedBox( height: 200, child: CupertinoTimerPicker( - onTimerDurationChanged: (Duration newDuration) {}, + onTimerDurationChanged: (newDuration) {}, ), ), ), diff --git a/cupertino_gallery/lib/widgets_page.dart b/cupertino_gallery/lib/widgets_page.dart index 3c338299b..af5d5ad12 100644 --- a/cupertino_gallery/lib/widgets_page.dart +++ b/cupertino_gallery/lib/widgets_page.dart @@ -54,7 +54,7 @@ class CustomCupertinoListTile extends StatelessWidget { onTap: () { Navigator.of(context).push( CupertinoPageRoute( - builder: (BuildContext context) { + builder: (context) { return WidgetDetailPage(title: title); }, ), diff --git a/date_planner/analysis_options.yaml b/date_planner/analysis_options.yaml index bf8d42185..ee406c27d 100644 --- a/date_planner/analysis_options.yaml +++ b/date_planner/analysis_options.yaml @@ -1,12 +1,3 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. - -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. analyzer: exclude: - build/** @@ -16,22 +7,8 @@ analyzer: - windows/** - macos/** - linux/** -include: package:flutter_lints/flutter.yaml +include: ../analysis_options.yaml linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at https://dart.dev/lints. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options + sort_pub_dependencies: true diff --git a/date_planner/lib/event_list.dart b/date_planner/lib/event_list.dart index 1ecdeb1bc..026350538 100644 --- a/date_planner/lib/event_list.dart +++ b/date_planner/lib/event_list.dart @@ -16,7 +16,7 @@ class EventList extends StatelessWidget { @override Widget build(BuildContext context) { return Consumer( - builder: (BuildContext context, EventData events, Widget? child) { + builder: (context, events, child) { return CupertinoPageScaffold( // TODO(mit-mit): Avoid having to pass nav bar manually. // diff --git a/date_planner/pubspec.yaml b/date_planner/pubspec.yaml index 4b9309fa0..b06a2044d 100644 --- a/date_planner/pubspec.yaml +++ b/date_planner/pubspec.yaml @@ -8,9 +8,9 @@ environment: sdk: ^3.9.0-0 dependencies: + cupertino_icons: ^1.0.8 flutter: sdk: flutter - cupertino_icons: ^1.0.8 intl: provider: uuid: diff --git a/desktop_photo_search/fluent_ui/analysis_options.yaml b/desktop_photo_search/fluent_ui/analysis_options.yaml index f9c399b5d..2deed08e0 100644 --- a/desktop_photo_search/fluent_ui/analysis_options.yaml +++ b/desktop_photo_search/fluent_ui/analysis_options.yaml @@ -7,7 +7,7 @@ analyzer: - windows/** - macos/** - linux/** -include: package:analysis_defaults/flutter.yaml +include: ../../analysis_options.yaml linter: rules: diff --git a/desktop_photo_search/material/analysis_options.yaml b/desktop_photo_search/material/analysis_options.yaml index f9c399b5d..2deed08e0 100644 --- a/desktop_photo_search/material/analysis_options.yaml +++ b/desktop_photo_search/material/analysis_options.yaml @@ -7,7 +7,7 @@ analyzer: - windows/** - macos/** - linux/** -include: package:analysis_defaults/flutter.yaml +include: ../../analysis_options.yaml linter: rules: diff --git a/dynamic_theme/analysis_options.yaml b/dynamic_theme/analysis_options.yaml index bf8d42185..d770e9ca6 100644 --- a/dynamic_theme/analysis_options.yaml +++ b/dynamic_theme/analysis_options.yaml @@ -1,12 +1,3 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. - -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. analyzer: exclude: - build/** @@ -16,22 +7,4 @@ analyzer: - windows/** - macos/** - linux/** -include: package:flutter_lints/flutter.yaml - -linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at https://dart.dev/lints. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. - rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options +include: ../analysis_options.yaml diff --git a/dynamic_theme/lib/main.dart b/dynamic_theme/lib/main.dart index b61f2855b..39dfd0fcf 100644 --- a/dynamic_theme/lib/main.dart +++ b/dynamic_theme/lib/main.dart @@ -79,7 +79,7 @@ class _GenerativeAISampleState extends State { _ => ApiKeyWidget( title: widget.title, onSubmitted: (key) { - setState(() => apiKey = key); + setState(() => apiKey = key as String); }, ), }, @@ -166,7 +166,9 @@ class _ExampleState extends State { try { final prompt = StringBuffer(); prompt.writeln(message); - final response = await callWithActions([Content.text(prompt.toString())]); + final response = await callWithActions([ + Content.text(prompt.toString()), + ]); if (response.text != null) { addMessage(Sender.system, response.text!); } else { @@ -209,7 +211,6 @@ class _ExampleState extends State { }), ); } - break; case 'change_theme_mode': final mode = args['mode'] as String; themeMode.value = switch (mode) { @@ -224,7 +225,6 @@ class _ExampleState extends State { 'message': 'theme mode updated', }), ); - break; case 'change_text_scale_factor': final value = args['scale'] as num; textScaleFactor.value = value.toDouble(); @@ -234,7 +234,6 @@ class _ExampleState extends State { 'message': 'font scale updated', }), ); - break; default: } } diff --git a/form_app/analysis_options.yaml b/form_app/analysis_options.yaml index 5940214f4..d770e9ca6 100644 --- a/form_app/analysis_options.yaml +++ b/form_app/analysis_options.yaml @@ -7,4 +7,4 @@ analyzer: - windows/** - macos/** - linux/** -include: package:analysis_defaults/flutter.yaml +include: ../analysis_options.yaml diff --git a/google_maps/analysis_options.yaml b/google_maps/analysis_options.yaml index d48569270..1347e6dd8 100644 --- a/google_maps/analysis_options.yaml +++ b/google_maps/analysis_options.yaml @@ -1,7 +1,7 @@ -include: package:analysis_defaults/flutter.yaml +include: ../analysis_options.yaml analyzer: - exclude: + exclude: - lib/src/*.g.dart - build/** - android/** diff --git a/ios_app_clip/analysis_options.yaml b/ios_app_clip/analysis_options.yaml index 5940214f4..d770e9ca6 100644 --- a/ios_app_clip/analysis_options.yaml +++ b/ios_app_clip/analysis_options.yaml @@ -7,4 +7,4 @@ analyzer: - windows/** - macos/** - linux/** -include: package:analysis_defaults/flutter.yaml +include: ../analysis_options.yaml diff --git a/material_3_demo/analysis_options.yaml b/material_3_demo/analysis_options.yaml index 5940214f4..d770e9ca6 100644 --- a/material_3_demo/analysis_options.yaml +++ b/material_3_demo/analysis_options.yaml @@ -7,4 +7,4 @@ analyzer: - windows/** - macos/** - linux/** -include: package:analysis_defaults/flutter.yaml +include: ../analysis_options.yaml diff --git a/navigation_and_routing/analysis_options.yaml b/navigation_and_routing/analysis_options.yaml index 5940214f4..d770e9ca6 100644 --- a/navigation_and_routing/analysis_options.yaml +++ b/navigation_and_routing/analysis_options.yaml @@ -7,4 +7,4 @@ analyzer: - windows/** - macos/** - linux/** -include: package:analysis_defaults/flutter.yaml +include: ../analysis_options.yaml diff --git a/pedometer/analysis_options.yaml b/pedometer/analysis_options.yaml index 534f26d23..7887423db 100644 --- a/pedometer/analysis_options.yaml +++ b/pedometer/analysis_options.yaml @@ -1,3 +1,5 @@ +include: ../analysis_options.yaml + analyzer: exclude: - build/** @@ -7,7 +9,3 @@ analyzer: - windows/** - macos/** - linux/** -include: package:flutter_lints/flutter.yaml - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options diff --git a/pedometer/example/analysis_options.yaml b/pedometer/example/analysis_options.yaml index 5bee4ffba..a96029588 100644 --- a/pedometer/example/analysis_options.yaml +++ b/pedometer/example/analysis_options.yaml @@ -1,12 +1,3 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. - -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. analyzer: exclude: - build/** @@ -16,23 +7,4 @@ analyzer: - windows/** - macos/** - linux/** -include: package:flutter_lints/flutter.yaml - -linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at - # https://dart-lang.github.io/linter/lints/index.html. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. - rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options +include: ../../analysis_options.yaml diff --git a/pedometer/example/lib/main.dart b/pedometer/example/lib/main.dart index 00ea267ee..6e184338c 100644 --- a/pedometer/example/lib/main.dart +++ b/pedometer/example/lib/main.dart @@ -54,7 +54,7 @@ class _HomeState extends State { super.initState(); } - void runPedometer() async { + Future runPedometer() async { final now = DateTime.now(); hourlySteps = await StepsRepo.instance.getSteps(); lastUpdated = now; diff --git a/pedometer/example/lib/steps_repo.dart b/pedometer/example/lib/steps_repo.dart index bd8db966a..0ad24d12a 100644 --- a/pedometer/example/lib/steps_repo.dart +++ b/pedometer/example/lib/steps_repo.dart @@ -90,6 +90,7 @@ class _IOSStepsRepo implements StepsRepo { return []; } + // ignore: inference_failure_on_collection_literal final handlers = []; final futures = >[]; final now = DateTime.now(); @@ -102,8 +103,8 @@ class _IOSStepsRepo implements StepsRepo { final handler = helpLib.wrapCallback( pd.ObjCBlock_ffiVoid_CMPedometerData_NSError.listener(lib, ( - pd.CMPedometerData? result, - pd.NSError? error, + result, + error, ) { if (result != null) { final stepCount = result.numberOfSteps.intValue; diff --git a/platform_channels/analysis_options.yaml b/platform_channels/analysis_options.yaml index 5940214f4..d770e9ca6 100644 --- a/platform_channels/analysis_options.yaml +++ b/platform_channels/analysis_options.yaml @@ -7,4 +7,4 @@ analyzer: - windows/** - macos/** - linux/** -include: package:analysis_defaults/flutter.yaml +include: ../analysis_options.yaml diff --git a/platform_design/analysis_options.yaml b/platform_design/analysis_options.yaml index 5940214f4..d770e9ca6 100644 --- a/platform_design/analysis_options.yaml +++ b/platform_design/analysis_options.yaml @@ -7,4 +7,4 @@ analyzer: - windows/** - macos/** - linux/** -include: package:analysis_defaults/flutter.yaml +include: ../analysis_options.yaml diff --git a/platform_view_swift/analysis_options.yaml b/platform_view_swift/analysis_options.yaml index 5940214f4..d770e9ca6 100644 --- a/platform_view_swift/analysis_options.yaml +++ b/platform_view_swift/analysis_options.yaml @@ -7,4 +7,4 @@ analyzer: - windows/** - macos/** - linux/** -include: package:analysis_defaults/flutter.yaml +include: ../analysis_options.yaml diff --git a/simple_sdf/analysis_options.yaml b/simple_sdf/analysis_options.yaml index 5940214f4..d770e9ca6 100644 --- a/simple_sdf/analysis_options.yaml +++ b/simple_sdf/analysis_options.yaml @@ -7,4 +7,4 @@ analyzer: - windows/** - macos/** - linux/** -include: package:analysis_defaults/flutter.yaml +include: ../analysis_options.yaml diff --git a/simple_shader/analysis_options.yaml b/simple_shader/analysis_options.yaml index 5940214f4..d770e9ca6 100644 --- a/simple_shader/analysis_options.yaml +++ b/simple_shader/analysis_options.yaml @@ -7,4 +7,4 @@ analyzer: - windows/** - macos/** - linux/** -include: package:analysis_defaults/flutter.yaml +include: ../analysis_options.yaml diff --git a/testing_app/analysis_options.yaml b/testing_app/analysis_options.yaml index 5940214f4..d770e9ca6 100644 --- a/testing_app/analysis_options.yaml +++ b/testing_app/analysis_options.yaml @@ -7,4 +7,4 @@ analyzer: - windows/** - macos/** - linux/** -include: package:analysis_defaults/flutter.yaml +include: ../analysis_options.yaml diff --git a/tool/ci_script.dart b/tool/ci_script.dart index c53033920..f1ad8127e 100644 --- a/tool/ci_script.dart +++ b/tool/ci_script.dart @@ -1,5 +1,8 @@ +// ignore_for_file: avoid_print, + import 'dart:convert'; import 'dart:io'; + import 'package:path/path.dart' as path; import 'package:yaml/yaml.dart'; @@ -38,8 +41,9 @@ Future main() async { final packages = workspace .where((e) { if (skipCiList != null && skipCiList.contains(e)) return false; - if (channelSkipList != null && channelSkipList.contains(e)) + if (channelSkipList != null && channelSkipList.contains(e)) { return false; + } return true; }) .map((e) => e.toString()) @@ -99,7 +103,9 @@ Future _getFlutterChannel() async { '--machine', ], runInShell: true); if (result.exitCode != 0) { - print('Flutter version command failed with exit code ${result.exitCode}'); + print( + 'Flutter version command failed with exit code ${result.exitCode}', + ); print('Stdout: ${result.stdout}'); print('Stderr: ${result.stderr}'); return 'unknown'; diff --git a/tool/ci_with_channel.dart b/tool/ci_with_channel.dart index 47a39f16d..897fbaff9 100644 --- a/tool/ci_with_channel.dart +++ b/tool/ci_with_channel.dart @@ -1,4 +1,7 @@ +// ignore_for_file: avoid_print, + import 'dart:io'; + import 'package:args/args.dart'; import 'package:path/path.dart' as path; import 'package:yaml/yaml.dart'; diff --git a/tool/clean_all.dart b/tool/clean_all.dart index d13b3d9cc..6c7a18eb7 100644 --- a/tool/clean_all.dart +++ b/tool/clean_all.dart @@ -1,4 +1,7 @@ +// ignore_for_file: avoid_print, + import 'dart:io'; + import 'package:path/path.dart' as path; import 'package:yaml/yaml.dart'; diff --git a/tool/release.dart b/tool/release.dart index c8886cc8a..068ea3ac7 100644 --- a/tool/release.dart +++ b/tool/release.dart @@ -163,7 +163,7 @@ class ReleaseScriptRunner { Future _processProject(String projectPath, String dartVersion) async { final projectName = p.basename(projectPath); final projectDir = Directory(projectPath); - final issues = []; + final issues = []; if (!projectDir.existsSync()) { log(red.wrap('Project directory not found: $projectPath'), stderr); @@ -174,7 +174,10 @@ class ReleaseScriptRunner { log(styleBold.wrap('Processing project: $projectName'), stdout); log(styleBold.wrap('=========================================')!, stdout); - log(blue.wrap('Updating SDK constraints to use Dart $dartVersion'), stdout); + log( + blue.wrap('Updating SDK constraints to use Dart $dartVersion'), + stdout, + ); if (!_isDryRun) { if (!await _updateSdkConstraints(projectPath, dartVersion)) { log( @@ -191,7 +194,10 @@ class ReleaseScriptRunner { '--fatal-infos', '--fatal-warnings', ]), - Command('dart format', 'Running dart format...', 'dart', ['format', '.']), + Command('dart format', 'Running dart format...', 'dart', [ + 'format', + '.', + ]), ]; final testDir = Directory(p.join(projectPath, 'test')); @@ -211,7 +217,10 @@ class ReleaseScriptRunner { ); if (!didPass) { - log(red.wrap('${command.displayName} failed for $projectName'), stderr); + log( + red.wrap('${command.displayName} failed for $projectName'), + stderr, + ); if (command.displayName == 'pub upgrade' || command.displayName == 'pub get' && @@ -234,7 +243,7 @@ class ReleaseScriptRunner { if (issues.isNotEmpty) { logToFile('- Issues found in $projectName'); - for (final issue in issues) { + for (final String issue in issues) { if (_isOnlyWhitespace(issue)) continue; logToFile('-- $issue'); } @@ -255,7 +264,7 @@ class ReleaseScriptRunner { } try { - final newConstraint = '^${versionString}-0'; + final newConstraint = '^$versionString-0'; final content = await pubspecFile.readAsString(); final editor = YamlEditor(content); @@ -307,16 +316,18 @@ class ReleaseScriptRunner { .transform(SystemEncoding().decoder) .forEach((line) { log(line, stdout); - if (!_isOnlyWhitespace(line)) - output.writeln('${line.trim().padLeft(2)}'); + if (!_isOnlyWhitespace(line)) { + output.writeln(line.trim().padLeft(2)); + } }); final stderrFuture = process.stderr .transform(SystemEncoding().decoder) .forEach((line) { log(red.wrap(line), stderr); - if (!_isOnlyWhitespace(line)) - output.writeln('${line.trim().padLeft(2)}'); + if (!_isOnlyWhitespace(line)) { + output.writeln(line.trim().padLeft(2)); + } }); await Future.wait([stdoutFuture, stderrFuture]); @@ -325,7 +336,10 @@ class ReleaseScriptRunner { } void _printSummary(int total, List failed) { - log(styleBold.wrap('\n=========================================')!, stdout); + log( + styleBold.wrap('\n=========================================')!, + stdout, + ); log(styleBold.wrap('Update Summary')!, stdout); log(styleBold.wrap('=========================================')!, stdout); log(blue.wrap('Total projects processed: $total'), stdout); diff --git a/web_embedding/element_embedding_demo/lib/main.dart b/web_embedding/element_embedding_demo/lib/main.dart index 76aeca841..3b57be293 100644 --- a/web_embedding/element_embedding_demo/lib/main.dart +++ b/web_embedding/element_embedding_demo/lib/main.dart @@ -90,16 +90,12 @@ class _MyAppState extends State { switch (screenString) { case 'counter': _currentDemoScreen = DemoScreen.counter; - break; case 'textField': _currentDemoScreen = DemoScreen.textField; - break; case 'custom': _currentDemoScreen = DemoScreen.custom; - break; default: _currentDemoScreen = DemoScreen.counter; - break; } }); } diff --git a/web_embedding/ng-flutter/flutter/analysis_options.yaml b/web_embedding/ng-flutter/flutter/analysis_options.yaml index e1fcb4321..ad6e362b3 100644 --- a/web_embedding/ng-flutter/flutter/analysis_options.yaml +++ b/web_embedding/ng-flutter/flutter/analysis_options.yaml @@ -1,4 +1,4 @@ -include: package:flutter_lints/flutter.yaml +include: ../../../analysis_options.yaml analyzer: exclude: