From bb97da8ec627466fdb45cdd36e2c0e35dee40e9e Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Wed, 3 Jan 2024 15:16:49 -0800 Subject: [PATCH] [various] Sync lints with flutter/flutter (#5717) Applying the latest analysis_options.yaml from flutter/flutter to this repo. Most fixes were auto-generated by `dart fix`. --- analysis_options.yaml | 48 ++++--- packages/animations/CHANGELOG.md | 4 + .../example/lib/container_transition.dart | 2 +- .../example/lib/fade_through_transition.dart | 2 +- .../lib/src/fade_through_transition.dart | 2 +- .../animations/lib/src/open_container.dart | 9 -- .../lib/src/shared_axis_transition.dart | 6 +- packages/animations/pubspec.yaml | 2 +- .../test/shared_axis_transition_test.dart | 54 ++++---- packages/camera/camera/CHANGELOG.md | 4 + packages/camera/camera/example/lib/main.dart | 10 +- packages/camera/camera/lib/camera.dart | 6 +- .../camera/lib/src/camera_controller.dart | 4 +- packages/camera/camera/pubspec.yaml | 2 +- .../camera/test/camera_image_stream_test.dart | 12 +- packages/camera/camera_android/CHANGELOG.md | 4 + .../example/lib/camera_controller.dart | 4 +- .../camera_android/example/lib/main.dart | 11 +- .../lib/src/android_camera.dart | 8 +- packages/camera/camera_android/pubspec.yaml | 2 +- .../camera_android_camerax/CHANGELOG.md | 4 + .../example/lib/camera_controller.dart | 4 +- .../example/lib/main.dart | 10 +- .../lib/src/android_camera_camerax.dart | 14 -- .../lib/src/camera_state_error.dart | 7 - .../lib/src/live_data.dart | 6 +- .../camera_android_camerax/pubspec.yaml | 2 +- .../test/android_camera_camerax_test.dart | 17 --- .../camera/camera_avfoundation/CHANGELOG.md | 4 + .../example/lib/camera_controller.dart | 4 +- .../camera_avfoundation/example/lib/main.dart | 11 +- .../lib/src/avfoundation_camera.dart | 8 +- .../camera/camera_avfoundation/pubspec.yaml | 2 +- .../camera_platform_interface/CHANGELOG.md | 4 + .../lib/camera_platform_interface.dart | 2 +- .../method_channel/method_channel_camera.dart | 8 +- .../lib/src/types/video_capture_options.dart | 2 +- .../camera_platform_interface/pubspec.yaml | 2 +- packages/camera/camera_web/CHANGELOG.md | 3 +- .../integration_test/camera_service_test.dart | 2 - .../camera/camera_web/lib/camera_web.dart | 2 - .../lib/src/types/camera_options.dart | 18 +-- packages/camera/camera_web/pubspec.yaml | 2 +- packages/camera/camera_windows/CHANGELOG.md | 3 +- .../camera_windows/lib/camera_windows.dart | 3 - packages/camera/camera_windows/pubspec.yaml | 2 +- .../cross_file/test/x_file_html_test.dart | 1 + packages/cross_file/test/x_file_io_test.dart | 1 + .../dynamic_layouts/lib/src/wrap_layout.dart | 6 - .../file_selector_android/CHANGELOG.md | 3 +- .../file_selector_android_test.dart | 1 + .../example/lib/main.dart | 1 + .../file_selector_android/pubspec.yaml | 2 +- .../file_selector_web/test/utils_test.dart | 1 + .../flutter_adaptive_scaffold/CHANGELOG.md | 4 + packages/flutter_adaptive_scaffold/README.md | 6 +- .../example/lib/adaptive_layout_demo.dart | 6 +- .../example/lib/main.dart | 5 +- .../lib/src/adaptive_scaffold.dart | 13 +- .../flutter_adaptive_scaffold/pubspec.yaml | 2 +- .../test/adaptive_scaffold_test.dart | 3 +- packages/flutter_markdown/CHANGELOG.md | 2 +- .../flutter_markdown/example/lib/main.dart | 1 + .../example/lib/screens/home_screen.dart | 2 +- .../lib/src/_functions_io.dart | 2 - .../lib/src/_functions_web.dart | 2 - .../flutter_markdown/lib/src/builder.dart | 3 - packages/flutter_markdown/pubspec.yaml | 2 +- packages/flutter_markdown/test/all.dart | 2 - .../test/image_test_mocks.dart | 8 +- packages/flutter_migrate/lib/src/base/io.dart | 46 +++---- .../test/base/file_system_test.dart | 24 ---- .../test/base/logger_test.dart | 13 -- packages/flutter_migrate/test/src/common.dart | 2 - .../test/test_data/migrate_project.dart | 1 + packages/go_router/CHANGELOG.md | 4 + .../example/lib/books/src/screens/books.dart | 5 - .../lib/books/src/screens/scaffold.dart | 3 - .../go_router/example/lib/extra_codec.dart | 10 +- .../others/custom_stateful_shell_route.dart | 2 +- .../example/lib/others/extra_param.dart | 13 +- .../example/lib/others/transitions.dart | 2 +- .../lib/path_and_query_parameters.dart | 13 +- .../go_router/example/lib/shell_route.dart | 3 - .../example/lib/stateful_shell_route.dart | 2 +- .../lib/src/information_provider.dart | 3 - .../go_router/lib/src/misc/extensions.dart | 4 +- packages/go_router/pubspec.yaml | 2 +- packages/go_router/test/delegate_test.dart | 12 +- packages/go_router/test/error_page_test.dart | 12 -- packages/go_router/test/go_router_test.dart | 6 +- .../go_router/test/imperative_api_test.dart | 2 +- packages/go_router_builder/CHANGELOG.md | 4 + .../example/lib/all_types.dart | 2 +- .../example/lib/extra_example.dart | 2 +- .../go_router_builder/example/lib/main.dart | 4 +- .../example/lib/shell_route_example.dart | 4 +- .../lib/shell_route_with_keys_example.dart | 4 +- .../shell_route_with_observers_example.dart | 4 +- .../example/lib/simple_example.dart | 2 +- .../lib/stateful_shell_route_example.dart | 3 +- ..._shell_route_initial_location_example.dart | 2 +- .../lib/src/route_config.dart | 4 - packages/go_router_builder/pubspec.yaml | 2 +- .../test/js_loader_test.dart | 1 + .../test/js_loader_tt_custom_test.dart | 1 + .../test/js_loader_tt_forbidden_test.dart | 1 + .../test/only_chrome_tests_here_test.dart | 1 + .../google_maps_flutter/CHANGELOG.md | 4 + .../lib/google_maps_flutter.dart | 4 +- .../lib/src/controller.dart | 2 +- .../lib/src/google_map.dart | 2 +- .../google_maps_flutter/pubspec.yaml | 2 +- .../google_maps_flutter_android/CHANGELOG.md | 4 + .../lib/src/google_maps_flutter_android.dart | 15 -- .../google_maps_flutter_android/pubspec.yaml | 2 +- .../google_maps_flutter_ios/CHANGELOG.md | 4 + .../lib/src/google_maps_flutter_ios.dart | 13 -- .../google_maps_flutter_ios/pubspec.yaml | 2 +- .../CHANGELOG.md | 3 +- .../method_channel_google_maps_flutter.dart | 13 -- .../lib/src/types/bitmap.dart | 6 +- .../lib/src/types/joint_type.dart | 21 ++- .../lib/src/types/marker.dart | 2 +- .../lib/src/types/polygon.dart | 2 +- .../lib/src/types/polyline.dart | 2 +- .../pubspec.yaml | 2 +- .../google_maps_flutter_web/CHANGELOG.md | 3 +- .../lib/src/circle.dart | 2 +- .../lib/src/circles.dart | 2 +- .../lib/src/convert.dart | 11 +- .../lib/src/google_maps_controller.dart | 2 +- .../lib/src/google_maps_flutter_web.dart | 2 +- .../lib/src/marker.dart | 2 +- .../lib/src/markers.dart | 2 +- .../lib/src/overlay.dart | 2 +- .../lib/src/overlays.dart | 2 +- .../lib/src/polygon.dart | 2 +- .../lib/src/polygons.dart | 2 +- .../lib/src/polyline.dart | 2 +- .../lib/src/polylines.dart | 2 +- .../google_maps_flutter_web/pubspec.yaml | 2 +- .../test/google_sign_in_test.dart | 2 +- .../google_sign_in_web/CHANGELOG.md | 4 + .../lib/src/button_configuration_column.dart | 2 +- .../lib/google_sign_in_web.dart | 2 +- .../google_sign_in_web/pubspec.yaml | 2 +- .../image_picker/image_picker/CHANGELOG.md | 4 + .../image_picker/lib/image_picker.dart | 8 +- .../image_picker/image_picker/pubspec.yaml | 2 +- .../image_picker_android/CHANGELOG.md | 4 + .../example/lib/main.dart | 1 + .../image_picker_android/pubspec.yaml | 2 +- .../CHANGELOG.md | 3 +- .../method_channel_image_picker.dart | 3 - .../lib/src/types/media_selection_type.dart | 2 - .../pubspec.yaml | 2 +- .../test/picked_file_html_test.dart | 1 + .../test/picked_file_io_test.dart | 1 + .../in_app_purchase/CHANGELOG.md | 3 +- .../in_app_purchase/lib/in_app_purchase.dart | 4 +- .../in_app_purchase/pubspec.yaml | 2 +- .../in_app_purchase_android/CHANGELOG.md | 3 +- .../billing_client_wrapper.dart | 2 - .../in_app_purchase_android/pubspec.yaml | 2 +- .../billing_client_wrapper_test.dart | 14 ++ .../purchase_wrapper_test.dart | 14 -- ...in_app_purchase_android_platform_test.dart | 24 ++-- .../in_app_purchase_storekit/CHANGELOG.md | 3 +- .../in_app_purchase_storekit_platform.dart | 2 +- .../sk_payment_queue_wrapper.dart | 3 +- .../in_app_purchase_storekit/pubspec.yaml | 2 +- .../test/fakes/fake_storekit_platform.dart | 4 - .../CHANGELOG.md | 3 +- .../lib/default_method_channel_platform.dart | 3 - .../pubspec.yaml | 2 +- .../metrics_center/test/skiaperf_test.dart | 1 + .../test/path_provider_android_test.dart | 2 - .../test/path_provider_windows_test.dart | 4 +- packages/pigeon/CHANGELOG.md | 4 + packages/pigeon/lib/cpp_generator.dart | 3 - packages/pigeon/lib/generator_tools.dart | 2 +- packages/pigeon/pubspec.yaml | 2 +- packages/pigeon/tool/run_tests.dart | 2 + packages/pigeon/tool/shared/test_suites.dart | 2 +- packages/pigeon/tool/test.dart | 2 + packages/platform/CHANGELOG.md | 3 +- packages/platform/lib/platform.dart | 2 +- packages/platform/pubspec.yaml | 2 +- .../plugin_platform_interface/CHANGELOG.md | 4 + .../lib/plugin_platform_interface.dart | 2 - .../plugin_platform_interface/pubspec.yaml | 2 +- .../test/plugin_platform_interface_test.dart | 3 + .../pointer_interceptor/CHANGELOG.md | 4 + .../lib/pointer_interceptor.dart | 2 - .../pointer_interceptor/pubspec.yaml | 2 +- packages/process/CHANGELOG.md | 3 +- .../src/interface/local_process_manager.dart | 2 +- packages/process/pubspec.yaml | 2 +- .../test/quick_actions_test.dart | 2 - .../test/quick_actions_ios_test.dart | 2 - packages/rfw/CHANGELOG.md | 2 +- packages/rfw/README.md | 6 +- packages/rfw/example/local/lib/main.dart | 2 +- packages/rfw/lib/src/dart/binary.dart | 2 - packages/rfw/lib/src/dart/text.dart | 128 +----------------- packages/rfw/pubspec.yaml | 2 +- packages/rfw/test/readme_test.dart | 6 +- .../shared_preferences_web_test.dart | 8 -- .../two_dimensional_scrollables/CHANGELOG.md | 4 + .../lib/src/table_view/table.dart | 4 - .../lib/src/table_view/table_span.dart | 2 - .../two_dimensional_scrollables/pubspec.yaml | 2 +- .../url_launcher_android/CHANGELOG.md | 3 +- .../lib/url_launcher_android.dart | 2 - .../url_launcher_android/pubspec.yaml | 2 +- .../url_launcher_ios/CHANGELOG.md | 3 +- .../lib/url_launcher_ios.dart | 2 - .../url_launcher_ios/pubspec.yaml | 2 +- .../CHANGELOG.md | 3 +- .../lib/link.dart | 1 + .../pubspec.yaml | 2 +- .../url_launcher_web/CHANGELOG.md | 4 + .../url_launcher_web_test.dart | 2 +- .../url_launcher_web/pubspec.yaml | 2 +- .../video_player/video_player/CHANGELOG.md | 3 +- .../video_player/example/lib/main.dart | 5 +- .../video_player/lib/video_player.dart | 12 +- .../video_player/video_player/pubspec.yaml | 2 +- .../video_player_android/CHANGELOG.md | 3 +- .../example/lib/main.dart | 4 +- .../example/lib/mini_controller.dart | 10 -- .../lib/src/android_video_player.dart | 4 - .../video_player_android/pubspec.yaml | 2 +- .../video_player_avfoundation/CHANGELOG.md | 4 + .../example/lib/main.dart | 4 +- .../example/lib/mini_controller.dart | 10 -- .../lib/src/avfoundation_video_player.dart | 4 - .../video_player_avfoundation/pubspec.yaml | 2 +- .../video_player_web/CHANGELOG.md | 3 +- .../lib/video_player_web.dart | 2 - .../video_player_web/pubspec.yaml | 2 +- packages/web_benchmarks/CHANGELOG.md | 4 + packages/web_benchmarks/pubspec.yaml | 2 +- .../test_app/lib/benchmarks/runner.dart | 2 +- .../webview_flutter/CHANGELOG.md | 3 +- .../webview_flutter/example/lib/main.dart | 14 -- .../lib/src/legacy/platform_interface.dart | 14 +- .../lib/src/legacy/webview.dart | 2 - .../webview_flutter/lib/webview_flutter.dart | 2 - .../webview_flutter/pubspec.yaml | 2 +- .../test/legacy/webview_flutter_test.dart | 7 +- .../webview_flutter_android/CHANGELOG.md | 4 + .../example/lib/main.dart | 16 --- .../lib/src/android_webview_controller.dart | 7 - .../lib/webview_flutter_android.dart | 2 - .../webview_flutter_android/pubspec.yaml | 2 +- .../test/android_webview_controller_test.dart | 4 +- .../legacy/webview_android_widget_test.dart | 12 +- .../webview_flutter_web/CHANGELOG.md | 3 +- .../webview_flutter_web/example/lib/main.dart | 1 - .../lib/src/content_type.dart | 2 - .../lib/webview_flutter_web.dart | 2 - .../webview_flutter_web/pubspec.yaml | 2 +- .../webview_flutter_wkwebview/CHANGELOG.md | 4 + .../example/lib/main.dart | 15 -- .../lib/src/foundation/foundation.dart | 2 +- .../src/foundation/foundation_api_impls.dart | 6 +- .../src/legacy/web_kit_webview_widget.dart | 7 - .../lib/src/web_kit/web_kit.dart | 2 +- .../lib/src/web_kit/web_kit_api_impls.dart | 30 +--- .../lib/src/webkit_webview_controller.dart | 9 -- .../lib/webview_flutter_wkwebview.dart | 2 - .../webview_flutter_wkwebview/pubspec.yaml | 2 +- packages/xdg_directories/CHANGELOG.md | 3 +- .../xdg_directories_test.dart | 4 +- .../xdg_directories/lib/xdg_directories.dart | 2 - packages/xdg_directories/pubspec.yaml | 2 +- .../common/package_looping_command_test.dart | 5 - .../test/common/pub_version_finder_test.dart | 4 - script/tool/test/util.dart | 4 +- .../tool/test/version_check_command_test.dart | 3 - 282 files changed, 527 insertions(+), 947 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index f53b40ad1044..a4f3df44d3df 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,13 +1,14 @@ # Specify analysis options. # # This file is a copy of analysis_options.yaml from flutter repo -# as of 2022-07-27, but with some modifications marked with +# as of 2023-12-18, but with some modifications marked with # "DIFFERENT FROM FLUTTER/FLUTTER" below. The file is expected to # be kept in sync with the master file from the flutter repo. analyzer: language: strict-casts: true + strict-inference: true strict-raw-types: true errors: # allow self-reference to deprecated members (we do this because otherwise we have @@ -21,11 +22,10 @@ analyzer: linter: rules: # This list is derived from the list of all available lints located at - # https://github.com/dart-lang/linter/blob/master/example/all.yaml + # https://github.com/dart-lang/linter/blob/main/example/all.yaml - always_declare_return_types - always_put_control_body_on_new_line # - always_put_required_named_parameters_first # we prefer having parameters in the same order as fields https://github.com/flutter/flutter/issues/10219 - - always_require_non_null_named_parameters - always_specify_types # - always_use_package_imports # we do this commonly - annotate_overrides @@ -33,7 +33,7 @@ linter: - avoid_bool_literals_in_conditional_expressions # - avoid_catches_without_on_clauses # blocked on https://github.com/dart-lang/linter/issues/3023 # - avoid_catching_errors # blocked on https://github.com/dart-lang/linter/issues/3023 - - avoid_classes_with_only_static_members + # - avoid_classes_with_only_static_members # we do this commonly for `abstract final class`es - avoid_double_and_int_checks - avoid_dynamic_calls - avoid_empty_else @@ -42,7 +42,7 @@ linter: - avoid_field_initializers_in_const_classes # - avoid_final_parameters # incompatible with prefer_final_parameters - avoid_function_literals_in_foreach_calls - - avoid_implementing_value_types + # - avoid_implementing_value_types # see https://github.com/dart-lang/linter/issues/4558 - avoid_init_to_null - avoid_js_rounded_ints # - avoid_multiple_declarations_per_line # seems to be a stylistic choice we don't subscribe to @@ -54,8 +54,6 @@ linter: - avoid_relative_lib_imports - avoid_renaming_method_parameters - avoid_return_types_on_setters - - avoid_returning_null - - avoid_returning_null_for_future - avoid_returning_null_for_void # - avoid_returning_this # there are enough valid reasons to return `this` that this lint ends up with too many false positives - avoid_setters_without_getters @@ -77,17 +75,19 @@ linter: - cast_nullable_to_non_nullable # - close_sinks # not reliable enough - collection_methods_unrelated_type - # - combinators_ordering # DIFFERENT FROM FLUTTER/FLUTTER: This isn't available on stable yet. + - combinators_ordering # - comment_references # blocked on https://github.com/dart-lang/linter/issues/1142 - conditional_uri_does_not_exist # - constant_identifier_names # needs an opt-out https://github.com/dart-lang/linter/issues/204 - control_flow_in_finally - curly_braces_in_flow_control_structures + - dangling_library_doc_comments - depend_on_referenced_packages - deprecated_consistency + # - deprecated_member_use_from_same_package # we allow self-references to deprecated members # - diagnostic_describe_all_properties # enabled only at the framework level (packages/flutter/lib) - directives_ordering - # - discarded_futures # not yet tested + # - discarded_futures # too many false positives, similar to unawaited_futures # - do_not_use_environment # there are appropriate times to use the environment, especially in our tests and build logic - empty_catches - empty_constructor_bodies @@ -98,21 +98,29 @@ linter: - flutter_style_todos - hash_and_equals - implementation_imports + - implicit_call_tearoffs + - implicit_reopen + - invalid_case_patterns # - join_return_with_assignment # not required by flutter style - leading_newlines_in_multiline_strings + - library_annotations - library_names - library_prefixes - library_private_types_in_public_api # - lines_longer_than_80_chars # not required by flutter style - # - literal_only_boolean_expressions # too many false positives: https://github.com/dart-lang/linter/issues/453 + - literal_only_boolean_expressions + # - matching_super_parameters # blocked on https://github.com/dart-lang/language/issues/2509 - missing_whitespace_between_adjacent_strings - no_adjacent_strings_in_list - no_default_cases - no_duplicate_case_values - no_leading_underscores_for_library_prefixes - no_leading_underscores_for_local_identifiers + - no_literal_bool_comparisons - no_logic_in_create_state - no_runtimeType_toString # DIFFERENT FROM FLUTTER/FLUTTER + - no_self_assignments + - no_wildcard_variable_uses - non_constant_identifier_names - noop_primitive_operations - null_check_on_nullable_type_parameter @@ -137,12 +145,11 @@ linter: # - prefer_constructors_over_static_methods # far too many false positives - prefer_contains # - prefer_double_quotes # opposite of prefer_single_quotes - - prefer_equal_for_default_values # - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods - prefer_final_fields - prefer_final_in_for_each - prefer_final_locals - # - prefer_final_parameters # we should enable this one day when it can be auto-fixed (https://github.com/dart-lang/linter/issues/3104), see also parameter_assignments + # - prefer_final_parameters # adds too much verbosity - prefer_for_elements_to_map_fromIterable - prefer_foreach - prefer_function_declarations_over_variables @@ -157,7 +164,7 @@ linter: - prefer_is_not_empty - prefer_is_not_operator - prefer_iterable_whereType - # - prefer_mixin # Has false positives, see https://github.com/dart-lang/linter/issues/3018 + # - prefer_mixin # DIFFERENT FROM FLUTTER/FLUTTER: enable when v2.1.7 of plugin_platform_interface is the oldest supported version (which makes MockPlatformInterfaceMixin a mixin class) # - prefer_null_aware_method_calls # "call()" is confusing to people new to the language since it's not documented anywhere - prefer_null_aware_operators - prefer_relative_imports @@ -168,10 +175,10 @@ linter: - provide_deprecation_message - public_member_api_docs # DIFFERENT FROM FLUTTER/FLUTTER - recursive_getters - # - require_trailing_commas # blocked on https://github.com/dart-lang/sdk/issues/47441 + # - require_trailing_commas # would be nice, but requires a lot of manual work: 10,000+ code locations would need to be reformatted by hand after bulk fix is applied - secure_pubspec_urls - sized_box_for_whitespace - # - sized_box_shrink_expand # not yet tested + - sized_box_shrink_expand - slash_for_doc_comments - sort_child_properties_last - sort_constructors_first @@ -182,15 +189,18 @@ linter: - tighten_type_of_initializing_formals # - type_annotate_public_apis # subset of always_specify_types - type_init_formals + - type_literal_in_constant_pattern - unawaited_futures # DIFFERENT FROM FLUTTER/FLUTTER: It's disabled there for "too many false positives"; that's not an issue here, and missing awaits have caused production issues in plugins. - unnecessary_await_in_return - unnecessary_brace_in_string_interps + - unnecessary_breaks - unnecessary_const - unnecessary_constructor_name # - unnecessary_final # conflicts with prefer_final_locals - unnecessary_getters_setters # - unnecessary_lambdas # has false positives: https://github.com/dart-lang/linter/issues/498 - unnecessary_late + - unnecessary_library_directive - unnecessary_new - unnecessary_null_aware_assignments - unnecessary_null_aware_operator_on_extension_on_nullable @@ -205,12 +215,13 @@ linter: - unnecessary_string_interpolations - unnecessary_this - unnecessary_to_list_in_spreads + - unreachable_from_main - unrelated_type_equality_checks - unsafe_html - use_build_context_synchronously - # - use_colored_box # not yet tested - # - use_decorated_box # not yet tested - # - use_enums # not yet tested + - use_colored_box + # - use_decorated_box # leads to bugs: DecoratedBox and Container are not equivalent (Container inserts extra padding) + - use_enums - use_full_hex_values_for_flutter_colors - use_function_type_syntax_for_parameters - use_if_null_to_convert_nulls_to_bools @@ -222,6 +233,7 @@ linter: - use_rethrow_when_possible - use_setters_to_change_properties # - use_string_buffers # has false positives: https://github.com/dart-lang/sdk/issues/34182 + - use_string_in_part_of_directives - use_super_parameters - use_test_throws_matchers # - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review diff --git a/packages/animations/CHANGELOG.md b/packages/animations/CHANGELOG.md index 9b6c068a75bc..d467c5d00982 100644 --- a/packages/animations/CHANGELOG.md +++ b/packages/animations/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.11 + +* Fixes new lint warnings. + ## 2.0.10 * Updates minimum supported SDK version to Flutter 3.16/Dart 3.2. diff --git a/packages/animations/example/lib/container_transition.dart b/packages/animations/example/lib/container_transition.dart index 4e522d8a0d45..e35ddf74a684 100644 --- a/packages/animations/example/lib/container_transition.dart +++ b/packages/animations/example/lib/container_transition.dart @@ -312,7 +312,7 @@ class _ExampleCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Expanded( - child: Container( + child: ColoredBox( color: Colors.black38, child: Center( child: Image.asset( diff --git a/packages/animations/example/lib/fade_through_transition.dart b/packages/animations/example/lib/fade_through_transition.dart index 6fc368f2b12f..7b8e30e7a765 100644 --- a/packages/animations/example/lib/fade_through_transition.dart +++ b/packages/animations/example/lib/fade_through_transition.dart @@ -79,7 +79,7 @@ class _ExampleCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Expanded( - child: Container( + child: ColoredBox( color: Colors.black26, child: Padding( padding: const EdgeInsets.all(30.0), diff --git a/packages/animations/lib/src/fade_through_transition.dart b/packages/animations/lib/src/fade_through_transition.dart index fbca19d65437..7be2e883c163 100644 --- a/packages/animations/lib/src/fade_through_transition.dart +++ b/packages/animations/lib/src/fade_through_transition.dart @@ -201,7 +201,7 @@ class FadeThroughTransition extends StatelessWidget { Widget build(BuildContext context) { return _ZoomedFadeInFadeOut( animation: animation, - child: Container( + child: ColoredBox( color: fillColor ?? Theme.of(context).canvasColor, child: _ZoomedFadeInFadeOut( animation: ReverseAnimation(secondaryAnimation), diff --git a/packages/animations/lib/src/open_container.dart b/packages/animations/lib/src/open_container.dart index fb7bd46e3576..438251eb8be8 100644 --- a/packages/animations/lib/src/open_container.dart +++ b/packages/animations/lib/src/open_container.dart @@ -604,10 +604,8 @@ class _OpenContainerRoute extends ModalRoute { switch (status) { case AnimationStatus.dismissed: _toggleHideable(hide: false); - break; case AnimationStatus.completed: _toggleHideable(hide: true); - break; case AnimationStatus.forward: case AnimationStatus.reverse: break; @@ -699,11 +697,9 @@ class _OpenContainerRoute extends ModalRoute { case AnimationStatus.completed: case AnimationStatus.dismissed: isInProgress = false; - break; case AnimationStatus.forward: case AnimationStatus.reverse: isInProgress = true; - break; case null: break; } @@ -711,11 +707,9 @@ class _OpenContainerRoute extends ModalRoute { case AnimationStatus.completed: case AnimationStatus.dismissed: wasInProgress = false; - break; case AnimationStatus.forward: case AnimationStatus.reverse: wasInProgress = true; - break; case null: break; } @@ -769,7 +763,6 @@ class _OpenContainerRoute extends ModalRoute { openOpacityTween = _openOpacityTween; colorTween = _colorTween; scrimTween = _scrimFadeInTween; - break; case AnimationStatus.reverse: if (_transitionWasInterrupted) { closedOpacityTween = _closedOpacityTween; @@ -782,10 +775,8 @@ class _OpenContainerRoute extends ModalRoute { openOpacityTween = _openOpacityTween.flipped; colorTween = _colorTween.flipped; scrimTween = _scrimFadeOutTween; - break; case AnimationStatus.completed: assert(false); // Unreachable. - break; } assert(colorTween != null); assert(closedOpacityTween != null); diff --git a/packages/animations/lib/src/shared_axis_transition.dart b/packages/animations/lib/src/shared_axis_transition.dart index 3b3340c9871e..cbb3f7195078 100644 --- a/packages/animations/lib/src/shared_axis_transition.dart +++ b/packages/animations/lib/src/shared_axis_transition.dart @@ -410,7 +410,7 @@ class _ExitTransition extends StatelessWidget { return FadeTransition( opacity: _fadeOutTransition.animate(animation), - child: Container( + child: ColoredBox( color: fillColor, child: AnimatedBuilder( animation: animation, @@ -432,7 +432,7 @@ class _ExitTransition extends StatelessWidget { return FadeTransition( opacity: _fadeOutTransition.animate(animation), - child: Container( + child: ColoredBox( color: fillColor, child: AnimatedBuilder( animation: animation, @@ -449,7 +449,7 @@ class _ExitTransition extends StatelessWidget { case SharedAxisTransitionType.scaled: return FadeTransition( opacity: _fadeOutTransition.animate(animation), - child: Container( + child: ColoredBox( color: fillColor, child: ScaleTransition( scale: (!reverse ? _scaleUpTransition : _scaleDownTransition) diff --git a/packages/animations/pubspec.yaml b/packages/animations/pubspec.yaml index 2a18abddc48f..2c06adf64cd7 100644 --- a/packages/animations/pubspec.yaml +++ b/packages/animations/pubspec.yaml @@ -2,7 +2,7 @@ name: animations description: Fancy pre-built animations that can easily be integrated into any Flutter application. repository: https://github.com/flutter/packages/tree/main/packages/animations issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+animations%22 -version: 2.0.10 +version: 2.0.11 environment: sdk: ">=3.2.0 <4.0.0" diff --git a/packages/animations/test/shared_axis_transition_test.dart b/packages/animations/test/shared_axis_transition_test.dart index 67bdf4ea30ef..bd4c41918c9f 100644 --- a/packages/animations/test/shared_axis_transition_test.dart +++ b/packages/animations/test/shared_axis_transition_test.dart @@ -522,12 +522,12 @@ void main() { expect(find.text(bottomRoute), findsOneWidget); Finder fillContainerFinder = find .ancestor( - matching: find.byType(Container), + matching: find.byType(ColoredBox), of: find.byKey(const ValueKey('/')), ) .last; expect(fillContainerFinder, findsOneWidget); - expect(tester.widget(fillContainerFinder).color, + expect(tester.widget(fillContainerFinder).color, defaultFillColor); navigator.currentState!.pushNamed(topRoute); @@ -536,12 +536,12 @@ void main() { fillContainerFinder = find .ancestor( - matching: find.byType(Container), + matching: find.byType(ColoredBox), of: find.byKey(const ValueKey('/a')), ) .last; expect(fillContainerFinder, findsOneWidget); - expect(tester.widget(fillContainerFinder).color, + expect(tester.widget(fillContainerFinder).color, defaultFillColor); }); @@ -561,12 +561,13 @@ void main() { expect(find.text(bottomRoute), findsOneWidget); Finder fillContainerFinder = find .ancestor( - matching: find.byType(Container), + matching: find.byType(ColoredBox), of: find.byKey(const ValueKey('/')), ) .last; expect(fillContainerFinder, findsOneWidget); - expect(tester.widget(fillContainerFinder).color, Colors.green); + expect( + tester.widget(fillContainerFinder).color, Colors.green); navigator.currentState!.pushNamed(topRoute); await tester.pump(); @@ -574,12 +575,13 @@ void main() { fillContainerFinder = find .ancestor( - matching: find.byType(Container), + matching: find.byType(ColoredBox), of: find.byKey(const ValueKey('/a')), ) .last; expect(fillContainerFinder, findsOneWidget); - expect(tester.widget(fillContainerFinder).color, Colors.green); + expect( + tester.widget(fillContainerFinder).color, Colors.green); }); testWidgets('should keep state', (WidgetTester tester) async { @@ -1165,12 +1167,12 @@ void main() { expect(find.text(bottomRoute), findsOneWidget); Finder fillContainerFinder = find .ancestor( - matching: find.byType(Container), + matching: find.byType(ColoredBox), of: find.byKey(const ValueKey('/')), ) .last; expect(fillContainerFinder, findsOneWidget); - expect(tester.widget(fillContainerFinder).color, + expect(tester.widget(fillContainerFinder).color, defaultFillColor); navigator.currentState!.pushNamed(topRoute); @@ -1179,12 +1181,12 @@ void main() { fillContainerFinder = find .ancestor( - matching: find.byType(Container), + matching: find.byType(ColoredBox), of: find.byKey(const ValueKey('/a')), ) .last; expect(fillContainerFinder, findsOneWidget); - expect(tester.widget(fillContainerFinder).color, + expect(tester.widget(fillContainerFinder).color, defaultFillColor); }); @@ -1204,12 +1206,13 @@ void main() { expect(find.text(bottomRoute), findsOneWidget); Finder fillContainerFinder = find .ancestor( - matching: find.byType(Container), + matching: find.byType(ColoredBox), of: find.byKey(const ValueKey('/')), ) .last; expect(fillContainerFinder, findsOneWidget); - expect(tester.widget(fillContainerFinder).color, Colors.green); + expect( + tester.widget(fillContainerFinder).color, Colors.green); navigator.currentState!.pushNamed(topRoute); await tester.pump(); @@ -1217,12 +1220,13 @@ void main() { fillContainerFinder = find .ancestor( - matching: find.byType(Container), + matching: find.byType(ColoredBox), of: find.byKey(const ValueKey('/a')), ) .last; expect(fillContainerFinder, findsOneWidget); - expect(tester.widget(fillContainerFinder).color, Colors.green); + expect( + tester.widget(fillContainerFinder).color, Colors.green); }); testWidgets('should keep state', (WidgetTester tester) async { @@ -1701,12 +1705,12 @@ void main() { expect(find.text(bottomRoute), findsOneWidget); Finder fillContainerFinder = find .ancestor( - matching: find.byType(Container), + matching: find.byType(ColoredBox), of: find.byKey(const ValueKey('/')), ) .last; expect(fillContainerFinder, findsOneWidget); - expect(tester.widget(fillContainerFinder).color, + expect(tester.widget(fillContainerFinder).color, defaultFillColor); navigator.currentState!.pushNamed(topRoute); @@ -1715,12 +1719,12 @@ void main() { fillContainerFinder = find .ancestor( - matching: find.byType(Container), + matching: find.byType(ColoredBox), of: find.byKey(const ValueKey('/a')), ) .last; expect(fillContainerFinder, findsOneWidget); - expect(tester.widget(fillContainerFinder).color, + expect(tester.widget(fillContainerFinder).color, defaultFillColor); }); @@ -1740,12 +1744,13 @@ void main() { expect(find.text(bottomRoute), findsOneWidget); Finder fillContainerFinder = find .ancestor( - matching: find.byType(Container), + matching: find.byType(ColoredBox), of: find.byKey(const ValueKey('/')), ) .last; expect(fillContainerFinder, findsOneWidget); - expect(tester.widget(fillContainerFinder).color, Colors.green); + expect( + tester.widget(fillContainerFinder).color, Colors.green); navigator.currentState!.pushNamed(topRoute); await tester.pump(); @@ -1753,12 +1758,13 @@ void main() { fillContainerFinder = find .ancestor( - matching: find.byType(Container), + matching: find.byType(ColoredBox), of: find.byKey(const ValueKey('/a')), ) .last; expect(fillContainerFinder, findsOneWidget); - expect(tester.widget(fillContainerFinder).color, Colors.green); + expect( + tester.widget(fillContainerFinder).color, Colors.green); }); testWidgets('should keep state', (WidgetTester tester) async { diff --git a/packages/camera/camera/CHANGELOG.md b/packages/camera/camera/CHANGELOG.md index 4c53fe61f071..295e78643439 100644 --- a/packages/camera/camera/CHANGELOG.md +++ b/packages/camera/camera/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.10.5+8 + +* Fixes new lint warnings. + ## 0.10.5+7 * Updates example app to use non-deprecated video_player method. diff --git a/packages/camera/camera/example/lib/main.dart b/packages/camera/camera/example/lib/main.dart index 481774cae277..f7b209a768b3 100644 --- a/packages/camera/camera/example/lib/main.dart +++ b/packages/camera/camera/example/lib/main.dart @@ -378,7 +378,7 @@ class _CameraExampleHomeState extends State return SizeTransition( sizeFactor: _exposureModeControlRowAnimation, child: ClipRect( - child: Container( + child: ColoredBox( color: Colors.grey.shade50, child: Column( children: [ @@ -461,7 +461,7 @@ class _CameraExampleHomeState extends State return SizeTransition( sizeFactor: _focusModeControlRowAnimation, child: ClipRect( - child: Container( + child: ColoredBox( color: Colors.grey.shade50, child: Column( children: [ @@ -673,26 +673,20 @@ class _CameraExampleHomeState extends State switch (e.code) { case 'CameraAccessDenied': showInSnackBar('You have denied camera access.'); - break; case 'CameraAccessDeniedWithoutPrompt': // iOS only showInSnackBar('Please go to Settings app to enable camera access.'); - break; case 'CameraAccessRestricted': // iOS only showInSnackBar('Camera access is restricted.'); - break; case 'AudioAccessDenied': showInSnackBar('You have denied audio access.'); - break; case 'AudioAccessDeniedWithoutPrompt': // iOS only showInSnackBar('Please go to Settings app to enable audio access.'); - break; case 'AudioAccessRestricted': // iOS only showInSnackBar('Audio access is restricted.'); - break; default: _showCameraException(e); break; diff --git a/packages/camera/camera/lib/camera.dart b/packages/camera/camera/lib/camera.dart index 900c2633a5d7..507d6c7cded3 100644 --- a/packages/camera/camera/lib/camera.dart +++ b/packages/camera/camera/lib/camera.dart @@ -7,12 +7,12 @@ export 'package:camera_platform_interface/camera_platform_interface.dart' CameraDescription, CameraException, CameraLensDirection, - FlashMode, ExposureMode, + FlashMode, FocusMode, + ImageFormatGroup, ResolutionPreset, - XFile, - ImageFormatGroup; + XFile; export 'src/camera_controller.dart'; export 'src/camera_image.dart'; diff --git a/packages/camera/camera/lib/src/camera_controller.dart b/packages/camera/camera/lib/src/camera_controller.dart index 2e8d0df8d748..1d402afcc2ed 100644 --- a/packages/camera/camera/lib/src/camera_controller.dart +++ b/packages/camera/camera/lib/src/camera_controller.dart @@ -19,7 +19,7 @@ import '../camera.dart'; // TODO(stuartmorgan): Fix this naming the next time there's a breaking change // to this package. // ignore: camel_case_types -typedef onLatestImageAvailable = Function(CameraImage image); +typedef onLatestImageAvailable = void Function(CameraImage image); /// Completes with a list of available cameras. /// @@ -530,7 +530,7 @@ class CameraController extends ValueNotifier { ); } - Function(CameraImageData image)? streamCallback; + void Function(CameraImageData image)? streamCallback; if (onAvailable != null) { streamCallback = (CameraImageData imageData) { onAvailable(CameraImage.fromPlatformInterface(imageData)); diff --git a/packages/camera/camera/pubspec.yaml b/packages/camera/camera/pubspec.yaml index 14e3aa48a0e5..f05afb1357cb 100644 --- a/packages/camera/camera/pubspec.yaml +++ b/packages/camera/camera/pubspec.yaml @@ -4,7 +4,7 @@ description: A Flutter plugin for controlling the camera. Supports previewing Dart. repository: https://github.com/flutter/packages/tree/main/packages/camera/camera issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 -version: 0.10.5+7 +version: 0.10.5+8 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/camera/camera/test/camera_image_stream_test.dart b/packages/camera/camera/test/camera_image_stream_test.dart index 4fe465030518..6ac27e513fca 100644 --- a/packages/camera/camera/test/camera_image_stream_test.dart +++ b/packages/camera/camera/test/camera_image_stream_test.dart @@ -28,7 +28,7 @@ void main() { ResolutionPreset.max); expect( - () => cameraController.startImageStream((CameraImage image) => null), + () => cameraController.startImageStream((CameraImage image) {}), throwsA( isA() .having( @@ -60,7 +60,7 @@ void main() { cameraController.value.copyWith(isRecordingVideo: true); expect( - () => cameraController.startImageStream((CameraImage image) => null), + () => cameraController.startImageStream((CameraImage image) {}), throwsA(isA().having( (CameraException error) => error.description, 'A video recording is already started.', @@ -81,7 +81,7 @@ void main() { cameraController.value = cameraController.value.copyWith(isStreamingImages: true); expect( - () => cameraController.startImageStream((CameraImage image) => null), + () => cameraController.startImageStream((CameraImage image) {}), throwsA(isA().having( (CameraException error) => error.description, 'A camera has started streaming images.', @@ -98,7 +98,7 @@ void main() { ResolutionPreset.max); await cameraController.initialize(); - await cameraController.startImageStream((CameraImage image) => null); + await cameraController.startImageStream((CameraImage image) {}); expect(mockPlatform.streamCallLog, ['onStreamedFrameAvailable', 'listen']); @@ -157,7 +157,7 @@ void main() { sensorOrientation: 90), ResolutionPreset.max); await cameraController.initialize(); - await cameraController.startImageStream((CameraImage image) => null); + await cameraController.startImageStream((CameraImage image) {}); await cameraController.stopImageStream(); expect(mockPlatform.streamCallLog, @@ -175,7 +175,7 @@ void main() { await cameraController.initialize(); await cameraController.startVideoRecording( - onAvailable: (CameraImage image) => null); + onAvailable: (CameraImage image) {}); expect( mockPlatform.streamCallLog.contains('startVideoCapturing with stream'), diff --git a/packages/camera/camera_android/CHANGELOG.md b/packages/camera/camera_android/CHANGELOG.md index 0bf174e781db..d3b85feaf9f4 100644 --- a/packages/camera/camera_android/CHANGELOG.md +++ b/packages/camera/camera_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.10.8+16 + +* Fixes new lint warnings. + ## 0.10.8+15 * Updates example app to use non-deprecated video_player method. diff --git a/packages/camera/camera_android/example/lib/camera_controller.dart b/packages/camera/camera_android/example/lib/camera_controller.dart index 9ab06140170a..3c4ce1871345 100644 --- a/packages/camera/camera_android/example/lib/camera_controller.dart +++ b/packages/camera/camera_android/example/lib/camera_controller.dart @@ -306,7 +306,7 @@ class CameraController extends ValueNotifier { /// Start streaming images from platform camera. Future startImageStream( - Function(CameraImageData image) onAvailable) async { + void Function(CameraImageData image) onAvailable) async { _imageStreamSubscription = CameraPlatform.instance .onStreamedFrameAvailable(_cameraId) .listen((CameraImageData imageData) { @@ -327,7 +327,7 @@ class CameraController extends ValueNotifier { /// The video is returned as a [XFile] after calling [stopVideoRecording]. /// Throws a [CameraException] if the capture fails. Future startVideoRecording( - {Function(CameraImageData image)? streamCallback}) async { + {void Function(CameraImageData image)? streamCallback}) async { await CameraPlatform.instance.startVideoCapturing( VideoCaptureOptions(_cameraId, streamCallback: streamCallback)); value = value.copyWith( diff --git a/packages/camera/camera_android/example/lib/main.dart b/packages/camera/camera_android/example/lib/main.dart index be43ba998ed4..26d2527eeddb 100644 --- a/packages/camera/camera_android/example/lib/main.dart +++ b/packages/camera/camera_android/example/lib/main.dart @@ -381,7 +381,7 @@ class _CameraExampleHomeState extends State return SizeTransition( sizeFactor: _exposureModeControlRowAnimation, child: ClipRect( - child: Container( + child: ColoredBox( color: Colors.grey.shade50, child: Column( children: [ @@ -465,7 +465,7 @@ class _CameraExampleHomeState extends State return SizeTransition( sizeFactor: _focusModeControlRowAnimation, child: ClipRect( - child: Container( + child: ColoredBox( color: Colors.grey.shade50, child: Column( children: [ @@ -677,30 +677,23 @@ class _CameraExampleHomeState extends State switch (e.code) { case 'CameraAccessDenied': showInSnackBar('You have denied camera access.'); - break; case 'CameraAccessDeniedWithoutPrompt': // iOS only showInSnackBar('Please go to Settings app to enable camera access.'); - break; case 'CameraAccessRestricted': // iOS only showInSnackBar('Camera access is restricted.'); - break; case 'AudioAccessDenied': showInSnackBar('You have denied audio access.'); - break; case 'AudioAccessDeniedWithoutPrompt': // iOS only showInSnackBar('Please go to Settings app to enable audio access.'); - break; case 'AudioAccessRestricted': // iOS only showInSnackBar('Audio access is restricted.'); - break; case 'cameraPermission': // Android & web only showInSnackBar('Unknown permission error.'); - break; default: _showCameraException(e); break; diff --git a/packages/camera/camera_android/lib/src/android_camera.dart b/packages/camera/camera_android/lib/src/android_camera.dart index eca1003247c6..98e1edd1280a 100644 --- a/packages/camera/camera_android/lib/src/android_camera.dart +++ b/packages/camera/camera_android/lib/src/android_camera.dart @@ -308,7 +308,7 @@ class AndroidCamera extends CameraPlatform { } StreamController _installStreamController( - {Function()? onListen}) { + {void Function()? onListen}) { _frameStreamController = StreamController( onListen: onListen ?? () {}, onPause: _onFrameStreamPauseResume, @@ -574,7 +574,6 @@ class AndroidCamera extends CameraPlatform { final Map arguments = _getArgumentDictionary(call); _deviceEventStreamController.add(DeviceOrientationChangedEvent( deserializeDeviceOrientation(arguments['orientation']! as String))); - break; default: throw MissingPluginException(); } @@ -598,7 +597,6 @@ class AndroidCamera extends CameraPlatform { deserializeFocusMode(arguments['focusMode']! as String), arguments['focusPointSupported']! as bool, )); - break; case 'resolution_changed': final Map arguments = _getArgumentDictionary(call); cameraEventStreamController.add(CameraResolutionChangedEvent( @@ -606,12 +604,10 @@ class AndroidCamera extends CameraPlatform { arguments['captureWidth']! as double, arguments['captureHeight']! as double, )); - break; case 'camera_closing': cameraEventStreamController.add(CameraClosingEvent( cameraId, )); - break; case 'video_recorded': final Map arguments = _getArgumentDictionary(call); cameraEventStreamController.add(VideoRecordedEvent( @@ -621,14 +617,12 @@ class AndroidCamera extends CameraPlatform { ? Duration(milliseconds: arguments['maxVideoDuration']! as int) : null, )); - break; case 'error': final Map arguments = _getArgumentDictionary(call); cameraEventStreamController.add(CameraErrorEvent( cameraId, arguments['description']! as String, )); - break; default: throw MissingPluginException(); } diff --git a/packages/camera/camera_android/pubspec.yaml b/packages/camera/camera_android/pubspec.yaml index 570d7597fe91..2fc248806bc6 100644 --- a/packages/camera/camera_android/pubspec.yaml +++ b/packages/camera/camera_android/pubspec.yaml @@ -3,7 +3,7 @@ description: Android implementation of the camera plugin. repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 -version: 0.10.8+15 +version: 0.10.8+16 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/camera/camera_android_camerax/CHANGELOG.md b/packages/camera/camera_android_camerax/CHANGELOG.md index af2488eb6695..b34eb68980a0 100644 --- a/packages/camera/camera_android_camerax/CHANGELOG.md +++ b/packages/camera/camera_android_camerax/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.5.0+26 + +* Fixes new lint warnings. + ## 0.5.0+25 * Implements `lockCaptureOrientation` and `unlockCaptureOrientation`. diff --git a/packages/camera/camera_android_camerax/example/lib/camera_controller.dart b/packages/camera/camera_android_camerax/example/lib/camera_controller.dart index d43eb13aaa31..e3b4ee9b496c 100644 --- a/packages/camera/camera_android_camerax/example/lib/camera_controller.dart +++ b/packages/camera/camera_android_camerax/example/lib/camera_controller.dart @@ -19,7 +19,7 @@ import 'camera_image.dart'; // TODO(stuartmorgan): Fix this naming the next time there's a breaking change // to this package. // ignore: camel_case_types -typedef onLatestImageAvailable = Function(CameraImage image); +typedef onLatestImageAvailable = void Function(CameraImage image); /// Completes with a list of available cameras. /// @@ -492,7 +492,7 @@ class CameraController extends ValueNotifier { ); } - Function(CameraImageData image)? streamCallback; + void Function(CameraImageData image)? streamCallback; if (onAvailable != null) { streamCallback = (CameraImageData imageData) { onAvailable(CameraImage.fromPlatformInterface(imageData)); diff --git a/packages/camera/camera_android_camerax/example/lib/main.dart b/packages/camera/camera_android_camerax/example/lib/main.dart index 960d50723461..4484c5dac982 100644 --- a/packages/camera/camera_android_camerax/example/lib/main.dart +++ b/packages/camera/camera_android_camerax/example/lib/main.dart @@ -380,7 +380,7 @@ class _CameraExampleHomeState extends State return SizeTransition( sizeFactor: _exposureModeControlRowAnimation, child: ClipRect( - child: Container( + child: ColoredBox( color: Colors.grey.shade50, child: Column( children: [ @@ -454,7 +454,7 @@ class _CameraExampleHomeState extends State return SizeTransition( sizeFactor: _focusModeControlRowAnimation, child: ClipRect( - child: Container( + child: ColoredBox( color: Colors.grey.shade50, child: Column( children: [ @@ -660,26 +660,20 @@ class _CameraExampleHomeState extends State switch (e.code) { case 'CameraAccessDenied': showInSnackBar('You have denied camera access.'); - break; case 'CameraAccessDeniedWithoutPrompt': // iOS only showInSnackBar('Please go to Settings app to enable camera access.'); - break; case 'CameraAccessRestricted': // iOS only showInSnackBar('Camera access is restricted.'); - break; case 'AudioAccessDenied': showInSnackBar('You have denied audio access.'); - break; case 'AudioAccessDeniedWithoutPrompt': // iOS only showInSnackBar('Please go to Settings app to enable audio access.'); - break; case 'AudioAccessRestricted': // iOS only showInSnackBar('Audio access is restricted.'); - break; default: _showCameraException(e); break; diff --git a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index fbb42d3664ed..bb9956c0f67b 100644 --- a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart +++ b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart @@ -587,13 +587,10 @@ class AndroidCameraCameraX extends CameraPlatform { switch (mode) { case FlashMode.off: _currentFlashMode = ImageCapture.flashModeOff; - break; case FlashMode.auto: _currentFlashMode = ImageCapture.flashModeAuto; - break; case FlashMode.always: _currentFlashMode = ImageCapture.flashModeOn; - break; case FlashMode.torch: _currentFlashMode = null; if (torchEnabled) { @@ -603,7 +600,6 @@ class AndroidCameraCameraX extends CameraPlatform { cameraControl = await camera!.getCameraControl(); await cameraControl.enableTorch(true); torchEnabled = true; - break; } } @@ -913,19 +909,14 @@ class AndroidCameraCameraX extends CameraPlatform { switch (preset) { case ResolutionPreset.low: boundSize = const Size(320, 240); - break; case ResolutionPreset.medium: boundSize = const Size(720, 480); - break; case ResolutionPreset.high: boundSize = const Size(1280, 720); - break; case ResolutionPreset.veryHigh: boundSize = const Size(1920, 1080); - break; case ResolutionPreset.ultraHigh: boundSize = const Size(3840, 2160); - break; case ResolutionPreset.max: // Automatically set strategy to choose highest available. resolutionStrategy = @@ -954,19 +945,14 @@ class AndroidCameraCameraX extends CameraPlatform { // 240p is not supported by CameraX. case ResolutionPreset.medium: videoQuality = VideoQuality.SD; - break; case ResolutionPreset.high: videoQuality = VideoQuality.HD; - break; case ResolutionPreset.veryHigh: videoQuality = VideoQuality.FHD; - break; case ResolutionPreset.ultraHigh: videoQuality = VideoQuality.UHD; - break; case ResolutionPreset.max: videoQuality = VideoQuality.highest; - break; case null: // If no preset is specified, default to CameraX's default behavior // for each UseCase. diff --git a/packages/camera/camera_android_camerax/lib/src/camera_state_error.dart b/packages/camera/camera_android_camerax/lib/src/camera_state_error.dart index c0f0cad43eb2..2f33d513aa02 100644 --- a/packages/camera/camera_android_camerax/lib/src/camera_state_error.dart +++ b/packages/camera/camera_android_camerax/lib/src/camera_state_error.dart @@ -39,30 +39,23 @@ class CameraStateError extends JavaObject { case CameraState.errorCameraInUse: description = 'The camera was already in use, possibly by a higher-priority camera client.'; - break; case CameraState.errorMaxCamerasInUse: description = 'The limit number of open cameras has been reached, and more cameras cannot be opened until other instances are closed.'; - break; case CameraState.errorOtherRecoverableError: description = 'The camera device has encountered a recoverable error. CameraX will attempt to recover from the error.'; - break; case CameraState.errorStreamConfig: description = 'Configuring the camera has failed.'; - break; case CameraState.errorCameraDisabled: description = 'The camera device could not be opened due to a device policy. Thia may be caused by a client from a background process attempting to open the camera.'; - break; case CameraState.errorCameraFatalError: description = 'The camera was closed due to a fatal error. This may require the Android device be shut down and restarted to restore camera function or may indicate a persistent camera hardware problem.'; - break; case CameraState.errorDoNotDisturbModeEnabled: description = 'The camera could not be opened because "Do Not Disturb" mode is enabled. Please disable this mode, and try opening the camera again.'; - break; default: description = 'There was an unspecified issue with the current camera state.'; diff --git a/packages/camera/camera_android_camerax/lib/src/live_data.dart b/packages/camera/camera_android_camerax/lib/src/live_data.dart index 40dc5fed693b..9659a2068eee 100644 --- a/packages/camera/camera_android_camerax/lib/src/live_data.dart +++ b/packages/camera/camera_android_camerax/lib/src/live_data.dart @@ -104,14 +104,12 @@ class _LiveDataHostApiImpl extends LiveDataHostApi { LiveData instance) async { LiveDataSupportedTypeData? typeData; switch (T) { - case CameraState: + case const (CameraState): typeData = LiveDataSupportedTypeData(value: LiveDataSupportedType.cameraState); - break; - case ZoomState: + case const (ZoomState): typeData = LiveDataSupportedTypeData(value: LiveDataSupportedType.zoomState); - break; default: throw ArgumentError(LiveData.unsupportedLiveDataTypeErrorMessage); } diff --git a/packages/camera/camera_android_camerax/pubspec.yaml b/packages/camera/camera_android_camerax/pubspec.yaml index e4332e9e54e2..8ec9f0369a41 100644 --- a/packages/camera/camera_android_camerax/pubspec.yaml +++ b/packages/camera/camera_android_camerax/pubspec.yaml @@ -2,7 +2,7 @@ name: camera_android_camerax description: Android implementation of the camera plugin using the CameraX library. repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android_camerax issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 -version: 0.5.0+25 +version: 0.5.0+26 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart b/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart index 2dbda1bba546..6fd99e3cbca4 100644 --- a/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart +++ b/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart @@ -487,23 +487,17 @@ void main() { switch (resolutionPreset) { case ResolutionPreset.low: expectedBoundSize = const Size(320, 240); - break; case ResolutionPreset.medium: expectedBoundSize = const Size(720, 480); - break; case ResolutionPreset.high: expectedBoundSize = const Size(1280, 720); - break; case ResolutionPreset.veryHigh: expectedBoundSize = const Size(1920, 1080); - break; case ResolutionPreset.ultraHigh: expectedBoundSize = const Size(3840, 2160); - break; case ResolutionPreset.max: expectedResolutionStrategy = ResolutionStrategy.detachedHighestAvailableStrategy(); - break; } // We expect the strategy to be the highest available or correspond to the @@ -629,19 +623,14 @@ void main() { // 240p is not supported by CameraX. case ResolutionPreset.medium: expectedVideoQuality = VideoQuality.SD; - break; case ResolutionPreset.high: expectedVideoQuality = VideoQuality.HD; - break; case ResolutionPreset.veryHigh: expectedVideoQuality = VideoQuality.FHD; - break; case ResolutionPreset.ultraHigh: expectedVideoQuality = VideoQuality.UHD; - break; case ResolutionPreset.max: expectedVideoQuality = VideoQuality.highest; - break; } const VideoResolutionFallbackRule expectedFallbackRule = @@ -1494,16 +1483,12 @@ void main() { switch (flashMode) { case FlashMode.off: expectedFlashMode = ImageCapture.flashModeOff; - break; case FlashMode.auto: expectedFlashMode = ImageCapture.flashModeAuto; - break; case FlashMode.always: expectedFlashMode = ImageCapture.flashModeOn; - break; case FlashMode.torch: expectedFlashMode = null; - break; } if (expectedFlashMode == null) { @@ -1557,11 +1542,9 @@ void main() { case FlashMode.always: verify(mockCameraControl.enableTorch(false)); expect(camera.torchEnabled, isFalse); - break; case FlashMode.torch: verifyNever(mockCameraControl.enableTorch(true)); expect(camera.torchEnabled, true); - break; } } }); diff --git a/packages/camera/camera_avfoundation/CHANGELOG.md b/packages/camera/camera_avfoundation/CHANGELOG.md index ccc3b46c238e..dab80145dbb7 100644 --- a/packages/camera/camera_avfoundation/CHANGELOG.md +++ b/packages/camera/camera_avfoundation/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.9.13+9 + +* Fixes new lint warnings. + ## 0.9.13+8 * Updates example app to use non-deprecated video_player method. diff --git a/packages/camera/camera_avfoundation/example/lib/camera_controller.dart b/packages/camera/camera_avfoundation/example/lib/camera_controller.dart index 36b9ac68cfdd..bb702c51b8a0 100644 --- a/packages/camera/camera_avfoundation/example/lib/camera_controller.dart +++ b/packages/camera/camera_avfoundation/example/lib/camera_controller.dart @@ -306,7 +306,7 @@ class CameraController extends ValueNotifier { /// Start streaming images from platform camera. Future startImageStream( - Function(CameraImageData image) onAvailable) async { + void Function(CameraImageData image) onAvailable) async { _imageStreamSubscription = CameraPlatform.instance .onStreamedFrameAvailable(_cameraId) .listen((CameraImageData imageData) { @@ -327,7 +327,7 @@ class CameraController extends ValueNotifier { /// The video is returned as a [XFile] after calling [stopVideoRecording]. /// Throws a [CameraException] if the capture fails. Future startVideoRecording( - {Function(CameraImageData image)? streamCallback}) async { + {void Function(CameraImageData image)? streamCallback}) async { await CameraPlatform.instance.startVideoCapturing( VideoCaptureOptions(_cameraId, streamCallback: streamCallback)); value = value.copyWith( diff --git a/packages/camera/camera_avfoundation/example/lib/main.dart b/packages/camera/camera_avfoundation/example/lib/main.dart index 304cd0279eb0..2ada5351eef0 100644 --- a/packages/camera/camera_avfoundation/example/lib/main.dart +++ b/packages/camera/camera_avfoundation/example/lib/main.dart @@ -381,7 +381,7 @@ class _CameraExampleHomeState extends State return SizeTransition( sizeFactor: _exposureModeControlRowAnimation, child: ClipRect( - child: Container( + child: ColoredBox( color: Colors.grey.shade50, child: Column( children: [ @@ -465,7 +465,7 @@ class _CameraExampleHomeState extends State return SizeTransition( sizeFactor: _focusModeControlRowAnimation, child: ClipRect( - child: Container( + child: ColoredBox( color: Colors.grey.shade50, child: Column( children: [ @@ -677,30 +677,23 @@ class _CameraExampleHomeState extends State switch (e.code) { case 'CameraAccessDenied': showInSnackBar('You have denied camera access.'); - break; case 'CameraAccessDeniedWithoutPrompt': // iOS only showInSnackBar('Please go to Settings app to enable camera access.'); - break; case 'CameraAccessRestricted': // iOS only showInSnackBar('Camera access is restricted.'); - break; case 'AudioAccessDenied': showInSnackBar('You have denied audio access.'); - break; case 'AudioAccessDeniedWithoutPrompt': // iOS only showInSnackBar('Please go to Settings app to enable audio access.'); - break; case 'AudioAccessRestricted': // iOS only showInSnackBar('Audio access is restricted.'); - break; case 'cameraPermission': // Android & web only showInSnackBar('Unknown permission error.'); - break; default: _showCameraException(e); break; diff --git a/packages/camera/camera_avfoundation/lib/src/avfoundation_camera.dart b/packages/camera/camera_avfoundation/lib/src/avfoundation_camera.dart index 33f550b3211b..2f1151fc5dc0 100644 --- a/packages/camera/camera_avfoundation/lib/src/avfoundation_camera.dart +++ b/packages/camera/camera_avfoundation/lib/src/avfoundation_camera.dart @@ -310,7 +310,7 @@ class AVFoundationCamera extends CameraPlatform { } StreamController _createStreamController( - {Function()? onListen}) { + {void Function()? onListen}) { return StreamController( onListen: onListen ?? () {}, onPause: _onFrameStreamPauseResume, @@ -580,7 +580,6 @@ class AVFoundationCamera extends CameraPlatform { final Map arguments = _getArgumentDictionary(call); _deviceEventStreamController.add(DeviceOrientationChangedEvent( deserializeDeviceOrientation(arguments['orientation']! as String))); - break; default: throw MissingPluginException(); } @@ -604,7 +603,6 @@ class AVFoundationCamera extends CameraPlatform { deserializeFocusMode(arguments['focusMode']! as String), arguments['focusPointSupported']! as bool, )); - break; case 'resolution_changed': final Map arguments = _getArgumentDictionary(call); cameraEventStreamController.add(CameraResolutionChangedEvent( @@ -612,12 +610,10 @@ class AVFoundationCamera extends CameraPlatform { arguments['captureWidth']! as double, arguments['captureHeight']! as double, )); - break; case 'camera_closing': cameraEventStreamController.add(CameraClosingEvent( cameraId, )); - break; case 'video_recorded': final Map arguments = _getArgumentDictionary(call); cameraEventStreamController.add(VideoRecordedEvent( @@ -627,14 +623,12 @@ class AVFoundationCamera extends CameraPlatform { ? Duration(milliseconds: arguments['maxVideoDuration']! as int) : null, )); - break; case 'error': final Map arguments = _getArgumentDictionary(call); cameraEventStreamController.add(CameraErrorEvent( cameraId, arguments['description']! as String, )); - break; default: throw MissingPluginException(); } diff --git a/packages/camera/camera_avfoundation/pubspec.yaml b/packages/camera/camera_avfoundation/pubspec.yaml index 103859ffb39c..10f4f03018a9 100644 --- a/packages/camera/camera_avfoundation/pubspec.yaml +++ b/packages/camera/camera_avfoundation/pubspec.yaml @@ -2,7 +2,7 @@ name: camera_avfoundation description: iOS implementation of the camera plugin. repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_avfoundation issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 -version: 0.9.13+8 +version: 0.9.13+9 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/camera/camera_platform_interface/CHANGELOG.md b/packages/camera/camera_platform_interface/CHANGELOG.md index f31511df65a5..04483d089116 100644 --- a/packages/camera/camera_platform_interface/CHANGELOG.md +++ b/packages/camera/camera_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.7.1 + +* Fixes new lint warnings. + ## 2.7.0 * Adds support for setting the image file format. See `CameraPlatform.setImageFileFormat`. diff --git a/packages/camera/camera_platform_interface/lib/camera_platform_interface.dart b/packages/camera/camera_platform_interface/lib/camera_platform_interface.dart index 25fc417a9cc4..039c3d9cf798 100644 --- a/packages/camera/camera_platform_interface/lib/camera_platform_interface.dart +++ b/packages/camera/camera_platform_interface/lib/camera_platform_interface.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/// Expose XFile +// Expose XFile export 'package:cross_file/cross_file.dart'; export 'src/events/camera_event.dart'; diff --git a/packages/camera/camera_platform_interface/lib/src/method_channel/method_channel_camera.dart b/packages/camera/camera_platform_interface/lib/src/method_channel/method_channel_camera.dart index 7ee0ed4e7b97..e38df4865331 100644 --- a/packages/camera/camera_platform_interface/lib/src/method_channel/method_channel_camera.dart +++ b/packages/camera/camera_platform_interface/lib/src/method_channel/method_channel_camera.dart @@ -314,7 +314,7 @@ class MethodChannelCamera extends CameraPlatform { } StreamController _installStreamController( - {Function()? onListen}) { + {void Function()? onListen}) { _frameStreamController = StreamController( onListen: onListen ?? () {}, onPause: _onFrameStreamPauseResume, @@ -587,7 +587,6 @@ class MethodChannelCamera extends CameraPlatform { final Map arguments = _getArgumentDictionary(call); deviceEventStreamController.add(DeviceOrientationChangedEvent( deserializeDeviceOrientation(arguments['orientation']! as String))); - break; default: throw MissingPluginException(); } @@ -611,7 +610,6 @@ class MethodChannelCamera extends CameraPlatform { deserializeFocusMode(arguments['focusMode']! as String), arguments['focusPointSupported']! as bool, )); - break; case 'resolution_changed': final Map arguments = _getArgumentDictionary(call); cameraEventStreamController.add(CameraResolutionChangedEvent( @@ -619,12 +617,10 @@ class MethodChannelCamera extends CameraPlatform { arguments['captureWidth']! as double, arguments['captureHeight']! as double, )); - break; case 'camera_closing': cameraEventStreamController.add(CameraClosingEvent( cameraId, )); - break; case 'video_recorded': final Map arguments = _getArgumentDictionary(call); cameraEventStreamController.add(VideoRecordedEvent( @@ -634,14 +630,12 @@ class MethodChannelCamera extends CameraPlatform { ? Duration(milliseconds: arguments['maxVideoDuration']! as int) : null, )); - break; case 'error': final Map arguments = _getArgumentDictionary(call); cameraEventStreamController.add(CameraErrorEvent( cameraId, arguments['description']! as String, )); - break; default: throw MissingPluginException(); } diff --git a/packages/camera/camera_platform_interface/lib/src/types/video_capture_options.dart b/packages/camera/camera_platform_interface/lib/src/types/video_capture_options.dart index 9fcb7fa95379..7a10b3b87c35 100644 --- a/packages/camera/camera_platform_interface/lib/src/types/video_capture_options.dart +++ b/packages/camera/camera_platform_interface/lib/src/types/video_capture_options.dart @@ -32,7 +32,7 @@ class VideoCaptureOptions { /// /// If set, then each image captured by the camera will be /// passed to this callback. - final Function(CameraImageData image)? streamCallback; + final void Function(CameraImageData image)? streamCallback; /// Configuration options for streaming. /// diff --git a/packages/camera/camera_platform_interface/pubspec.yaml b/packages/camera/camera_platform_interface/pubspec.yaml index 3bf2055f91c9..a2985bbc5773 100644 --- a/packages/camera/camera_platform_interface/pubspec.yaml +++ b/packages/camera/camera_platform_interface/pubspec.yaml @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/camera/camera issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 2.7.0 +version: 2.7.1 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/camera/camera_web/CHANGELOG.md b/packages/camera/camera_web/CHANGELOG.md index 729b2aa9368f..9cff62b8a35e 100644 --- a/packages/camera/camera_web/CHANGELOG.md +++ b/packages/camera/camera_web/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 0.3.2+4 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Fixes new lint warnings. ## 0.3.2+3 diff --git a/packages/camera/camera_web/example/integration_test/camera_service_test.dart b/packages/camera/camera_web/example/integration_test/camera_service_test.dart index 908d52195dc3..09a18c011582 100644 --- a/packages/camera/camera_web/example/integration_test/camera_service_test.dart +++ b/packages/camera/camera_web/example/integration_test/camera_service_test.dart @@ -913,5 +913,3 @@ void main() { }); }); } - -class JSNoSuchMethodError implements Exception {} diff --git a/packages/camera/camera_web/lib/camera_web.dart b/packages/camera/camera_web/lib/camera_web.dart index dcefc9293b88..a2a0a5be4f44 100644 --- a/packages/camera/camera_web/lib/camera_web.dart +++ b/packages/camera/camera_web/lib/camera_web.dart @@ -2,6 +2,4 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -library camera_web; - export 'src/camera_web.dart'; diff --git a/packages/camera/camera_web/lib/src/types/camera_options.dart b/packages/camera/camera_web/lib/src/types/camera_options.dart index 08491b56081b..ecb729d74544 100644 --- a/packages/camera/camera_web/lib/src/types/camera_options.dart +++ b/packages/camera/camera_web/lib/src/types/camera_options.dart @@ -145,21 +145,21 @@ class VideoConstraints { /// /// Specifies whether the requested camera should be facing away /// or toward the user. -class CameraType { +enum CameraType { + /// The camera is facing away from the user, viewing their environment. + /// This includes the back camera on a smartphone. + environment._('environment'), + + /// The camera is facing toward the user. + /// This includes the front camera on a smartphone. + user._('user'); + const CameraType._(this._type); final String _type; @override String toString() => _type; - - /// The camera is facing away from the user, viewing their environment. - /// This includes the back camera on a smartphone. - static const CameraType environment = CameraType._('environment'); - - /// The camera is facing toward the user. - /// This includes the front camera on a smartphone. - static const CameraType user = CameraType._('user'); } /// Indicates the direction in which the desired camera should be pointing. diff --git a/packages/camera/camera_web/pubspec.yaml b/packages/camera/camera_web/pubspec.yaml index f2f8f7caec4d..fab01e5ecc59 100644 --- a/packages/camera/camera_web/pubspec.yaml +++ b/packages/camera/camera_web/pubspec.yaml @@ -2,7 +2,7 @@ name: camera_web description: A Flutter plugin for getting information about and controlling the camera on Web. repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 -version: 0.3.2+3 +version: 0.3.2+4 environment: sdk: ">=3.1.0 <4.0.0" diff --git a/packages/camera/camera_windows/CHANGELOG.md b/packages/camera/camera_windows/CHANGELOG.md index e927f8b9caf3..c96b193b8890 100644 --- a/packages/camera/camera_windows/CHANGELOG.md +++ b/packages/camera/camera_windows/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 0.2.1+9 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Fixes new lint warnings. ## 0.2.1+8 diff --git a/packages/camera/camera_windows/lib/camera_windows.dart b/packages/camera/camera_windows/lib/camera_windows.dart index 4b0c1586f433..920f53f77f3a 100644 --- a/packages/camera/camera_windows/lib/camera_windows.dart +++ b/packages/camera/camera_windows/lib/camera_windows.dart @@ -397,7 +397,6 @@ class CameraWindows extends CameraPlatform { cameraId, ), ); - break; case 'video_recorded': final Map arguments = (call.arguments as Map).cast(); @@ -410,7 +409,6 @@ class CameraWindows extends CameraPlatform { maxDuration != null ? Duration(milliseconds: maxDuration) : null, ), ); - break; case 'error': final Map arguments = (call.arguments as Map).cast(); @@ -420,7 +418,6 @@ class CameraWindows extends CameraPlatform { arguments['description']! as String, ), ); - break; default: throw UnimplementedError(); } diff --git a/packages/camera/camera_windows/pubspec.yaml b/packages/camera/camera_windows/pubspec.yaml index 32585013cc02..e819d39433d0 100644 --- a/packages/camera/camera_windows/pubspec.yaml +++ b/packages/camera/camera_windows/pubspec.yaml @@ -2,7 +2,7 @@ name: camera_windows description: A Flutter plugin for getting information about and controlling the camera on Windows. repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_windows issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 -version: 0.2.1+8 +version: 0.2.1+9 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/cross_file/test/x_file_html_test.dart b/packages/cross_file/test/x_file_html_test.dart index 4e1cac634aee..4b002cac158b 100644 --- a/packages/cross_file/test/x_file_html_test.dart +++ b/packages/cross_file/test/x_file_html_test.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. @TestOn('chrome') // Uses web-only Flutter SDK +library; import 'dart:convert'; import 'dart:js_interop'; diff --git a/packages/cross_file/test/x_file_io_test.dart b/packages/cross_file/test/x_file_io_test.dart index 7b730ca76553..92dfc885ef80 100644 --- a/packages/cross_file/test/x_file_io_test.dart +++ b/packages/cross_file/test/x_file_io_test.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. @TestOn('vm') // Uses dart:io +library; import 'dart:convert'; import 'dart:io'; diff --git a/packages/dynamic_layouts/lib/src/wrap_layout.dart b/packages/dynamic_layouts/lib/src/wrap_layout.dart index b39ab87fa05c..917680b2a745 100644 --- a/packages/dynamic_layouts/lib/src/wrap_layout.dart +++ b/packages/dynamic_layouts/lib/src/wrap_layout.dart @@ -113,10 +113,8 @@ class SliverGridWrappingTileLayout extends DynamicSliverGridLayout { switch (scrollDirection) { case Axis.vertical: addedSize = currentSizeUsed + childSize.width + crossAxisSpacing; - break; case Axis.horizontal: addedSize = currentSizeUsed + childSize.height + mainAxisSpacing; - break; } if (addedSize > crossAxisExtent && _model.last.currentSizeUsed > 0.0) { @@ -130,7 +128,6 @@ class SliverGridWrappingTileLayout extends DynamicSliverGridLayout { scrollOffset + _model.last.maxSliver + mainAxisSpacing, ), ); - break; case Axis.horizontal: _model.add( _RunMetrics( @@ -140,7 +137,6 @@ class SliverGridWrappingTileLayout extends DynamicSliverGridLayout { scrollOffset + _model.last.maxSliver + crossAxisSpacing, ), ); - break; } return DynamicSliverGridGeometry( @@ -158,12 +154,10 @@ class SliverGridWrappingTileLayout extends DynamicSliverGridLayout { if (childSize.height + mainAxisSpacing > _model.last.maxSliver) { _model.last.maxSliver = childSize.height + mainAxisSpacing; } - break; case Axis.horizontal: if (childSize.width + crossAxisSpacing > _model.last.maxSliver) { _model.last.maxSliver = childSize.width + crossAxisSpacing; } - break; } return DynamicSliverGridGeometry( diff --git a/packages/file_selector/file_selector_android/CHANGELOG.md b/packages/file_selector/file_selector_android/CHANGELOG.md index f81eadca59b1..a11177885cb4 100644 --- a/packages/file_selector/file_selector_android/CHANGELOG.md +++ b/packages/file_selector/file_selector_android/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 0.5.0+5 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Fixes new lint warnings. ## 0.5.0+4 diff --git a/packages/file_selector/file_selector_android/example/integration_test/file_selector_android_test.dart b/packages/file_selector/file_selector_android/example/integration_test/file_selector_android_test.dart index 1f9567621698..0af2ff9cc161 100644 --- a/packages/file_selector/file_selector_android/example/integration_test/file_selector_android_test.dart +++ b/packages/file_selector/file_selector_android/example/integration_test/file_selector_android_test.dart @@ -8,6 +8,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; /// Entry point for integration tests that require espresso. +@pragma('vm:entry-point') void integrationTestMain() { enableFlutterDriverExtension(); app.main(); diff --git a/packages/file_selector/file_selector_android/example/lib/main.dart b/packages/file_selector/file_selector_android/example/lib/main.dart index a63fc41c2398..bfa91e6cb5f6 100644 --- a/packages/file_selector/file_selector_android/example/lib/main.dart +++ b/packages/file_selector/file_selector_android/example/lib/main.dart @@ -13,6 +13,7 @@ import 'open_multiple_images_page.dart'; import 'open_text_page.dart'; /// Entry point for integration tests that require espresso. +@pragma('vm:entry-point') void integrationTestMain() { enableFlutterDriverExtension(); main(); diff --git a/packages/file_selector/file_selector_android/pubspec.yaml b/packages/file_selector/file_selector_android/pubspec.yaml index 4ec709cfa356..c1bb76c8e221 100644 --- a/packages/file_selector/file_selector_android/pubspec.yaml +++ b/packages/file_selector/file_selector_android/pubspec.yaml @@ -2,7 +2,7 @@ name: file_selector_android description: Android implementation of the file_selector package. repository: https://github.com/flutter/packages/tree/main/packages/file_selector/file_selector_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+file_selector%22 -version: 0.5.0+4 +version: 0.5.0+5 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/file_selector/file_selector_web/test/utils_test.dart b/packages/file_selector/file_selector_web/test/utils_test.dart index 497d3ae48849..c1717572713f 100644 --- a/packages/file_selector/file_selector_web/test/utils_test.dart +++ b/packages/file_selector/file_selector_web/test/utils_test.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. @TestOn('chrome') // web-only package. +library; import 'package:file_selector_platform_interface/file_selector_platform_interface.dart'; import 'package:file_selector_web/src/utils.dart'; diff --git a/packages/flutter_adaptive_scaffold/CHANGELOG.md b/packages/flutter_adaptive_scaffold/CHANGELOG.md index f358bbf35526..4d62cf7a6883 100644 --- a/packages/flutter_adaptive_scaffold/CHANGELOG.md +++ b/packages/flutter_adaptive_scaffold/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.7+2 + +* Fixes new lint warnings. + ## 0.1.7+1 * Adds pub topics to package metadata. diff --git a/packages/flutter_adaptive_scaffold/README.md b/packages/flutter_adaptive_scaffold/README.md index 133e19262846..0e54c055815f 100644 --- a/packages/flutter_adaptive_scaffold/README.md +++ b/packages/flutter_adaptive_scaffold/README.md @@ -156,7 +156,8 @@ return AdaptiveLayout( }, leading: const Icon(Icons.menu), destinations: destinations - .map((_) => AdaptiveScaffold.toRailDestination(_)) + .map((NavigationDestination destination) => + AdaptiveScaffold.toRailDestination(destination)) .toList(), backgroundColor: navRailTheme.backgroundColor, selectedIconTheme: navRailTheme.selectedIconTheme, @@ -187,7 +188,8 @@ return AdaptiveLayout( ], ), destinations: destinations - .map((_) => AdaptiveScaffold.toRailDestination(_)) + .map((NavigationDestination destination) => + AdaptiveScaffold.toRailDestination(destination)) .toList(), trailing: trailingNavRail, backgroundColor: navRailTheme.backgroundColor, diff --git a/packages/flutter_adaptive_scaffold/example/lib/adaptive_layout_demo.dart b/packages/flutter_adaptive_scaffold/example/lib/adaptive_layout_demo.dart index 77b5cd78d9fe..54a6a1aae2ec 100644 --- a/packages/flutter_adaptive_scaffold/example/lib/adaptive_layout_demo.dart +++ b/packages/flutter_adaptive_scaffold/example/lib/adaptive_layout_demo.dart @@ -175,7 +175,8 @@ class _MyHomePageState extends State { }, leading: const Icon(Icons.menu), destinations: destinations - .map((_) => AdaptiveScaffold.toRailDestination(_)) + .map((NavigationDestination destination) => + AdaptiveScaffold.toRailDestination(destination)) .toList(), backgroundColor: navRailTheme.backgroundColor, selectedIconTheme: navRailTheme.selectedIconTheme, @@ -206,7 +207,8 @@ class _MyHomePageState extends State { ], ), destinations: destinations - .map((_) => AdaptiveScaffold.toRailDestination(_)) + .map((NavigationDestination destination) => + AdaptiveScaffold.toRailDestination(destination)) .toList(), trailing: trailingNavRail, backgroundColor: navRailTheme.backgroundColor, diff --git a/packages/flutter_adaptive_scaffold/example/lib/main.dart b/packages/flutter_adaptive_scaffold/example/lib/main.dart index 4aac90d8bc93..735b25a668a1 100644 --- a/packages/flutter_adaptive_scaffold/example/lib/main.dart +++ b/packages/flutter_adaptive_scaffold/example/lib/main.dart @@ -313,8 +313,9 @@ class _MyHomePageState extends State selectedIndex: _navigationIndex, trailing: trailingNavRail, extended: true, - destinations: destinations.map((_) { - return AdaptiveScaffold.toRailDestination(_); + destinations: + destinations.map((NavigationDestination destination) { + return AdaptiveScaffold.toRailDestination(destination); }).toList(), ), ), diff --git a/packages/flutter_adaptive_scaffold/lib/src/adaptive_scaffold.dart b/packages/flutter_adaptive_scaffold/lib/src/adaptive_scaffold.dart index 3f2a030436b2..4a3ea05da451 100644 --- a/packages/flutter_adaptive_scaffold/lib/src/adaptive_scaffold.dart +++ b/packages/flutter_adaptive_scaffold/lib/src/adaptive_scaffold.dart @@ -228,7 +228,7 @@ class AdaptiveScaffold extends StatefulWidget { final PreferredSizeWidget? appBar; /// Callback function for when the index of a [NavigationRail] changes. - final Function(int)? onSelectedIndexChange; + final void Function(int)? onSelectedIndexChange; /// The width used for the internal [NavigationRail] at the medium [Breakpoint]. final double navigationRailWidth; @@ -267,7 +267,7 @@ class AdaptiveScaffold extends StatefulWidget { EdgeInsetsGeometry padding = const EdgeInsets.all(8.0), Widget? leading, Widget? trailing, - Function(int)? onDestinationSelected, + void Function(int)? onDestinationSelected, double? groupAlignment, IconThemeData? selectedIconTheme, IconThemeData? unselectedIconTheme, @@ -514,7 +514,8 @@ class _AdaptiveScaffoldState extends State { trailing: widget.trailingNavRail, selectedIndex: widget.selectedIndex, destinations: widget.destinations - .map((_) => AdaptiveScaffold.toRailDestination(_)) + .map((NavigationDestination destination) => + AdaptiveScaffold.toRailDestination(destination)) .toList(), onDestinationSelected: widget.onSelectedIndexChange, ), @@ -534,7 +535,8 @@ class _AdaptiveScaffoldState extends State { trailing: widget.trailingNavRail, selectedIndex: widget.selectedIndex, destinations: widget.destinations - .map((_) => AdaptiveScaffold.toRailDestination(_)) + .map((NavigationDestination destination) => + AdaptiveScaffold.toRailDestination(destination)) .toList(), onDestinationSelected: widget.onSelectedIndexChange, backgroundColor: navRailTheme.backgroundColor, @@ -553,7 +555,8 @@ class _AdaptiveScaffoldState extends State { trailing: widget.trailingNavRail, selectedIndex: widget.selectedIndex, destinations: widget.destinations - .map((_) => AdaptiveScaffold.toRailDestination(_)) + .map((NavigationDestination destination) => + AdaptiveScaffold.toRailDestination(destination)) .toList(), onDestinationSelected: widget.onSelectedIndexChange, backgroundColor: navRailTheme.backgroundColor, diff --git a/packages/flutter_adaptive_scaffold/pubspec.yaml b/packages/flutter_adaptive_scaffold/pubspec.yaml index 73f17959fe78..13cbca614f72 100644 --- a/packages/flutter_adaptive_scaffold/pubspec.yaml +++ b/packages/flutter_adaptive_scaffold/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_adaptive_scaffold description: Widgets to easily build adaptive layouts, including navigation elements. -version: 0.1.7+1 +version: 0.1.7+2 issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+flutter_adaptive_scaffold%22 repository: https://github.com/flutter/packages/tree/main/packages/flutter_adaptive_scaffold diff --git a/packages/flutter_adaptive_scaffold/test/adaptive_scaffold_test.dart b/packages/flutter_adaptive_scaffold/test/adaptive_scaffold_test.dart index 66fe11359ce5..3761fbfe29a0 100644 --- a/packages/flutter_adaptive_scaffold/test/adaptive_scaffold_test.dart +++ b/packages/flutter_adaptive_scaffold/test/adaptive_scaffold_test.dart @@ -374,7 +374,8 @@ void main() { home: MediaQuery( data: const MediaQueryData(size: Size(700, 900)), child: StatefulBuilder( - builder: (BuildContext context, Function(Function()) setState) { + builder: (BuildContext context, + void Function(void Function()) setState) { return AdaptiveScaffold( destinations: destinations, selectedIndex: selectedDestination, diff --git a/packages/flutter_markdown/CHANGELOG.md b/packages/flutter_markdown/CHANGELOG.md index f867f2d297d8..5cb6371421fd 100644 --- a/packages/flutter_markdown/CHANGELOG.md +++ b/packages/flutter_markdown/CHANGELOG.md @@ -1,4 +1,4 @@ -## NEXT +## 0.6.18+3 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. * Fixes lint warnings. diff --git a/packages/flutter_markdown/example/lib/main.dart b/packages/flutter_markdown/example/lib/main.dart index aa3842089474..d2602ce57fd3 100644 --- a/packages/flutter_markdown/example/lib/main.dart +++ b/packages/flutter_markdown/example/lib/main.dart @@ -54,6 +54,7 @@ /// parsing of Markdown syntax and building of the formatted output. The demos /// in this example app illustrate some of the potentials of the /// flutter_markdown package. +library; import 'package:flutter/material.dart'; import 'screens/demo_screen.dart'; diff --git a/packages/flutter_markdown/example/lib/screens/home_screen.dart b/packages/flutter_markdown/example/lib/screens/home_screen.dart index 8b2099a6e6fe..8933ee57ea4d 100644 --- a/packages/flutter_markdown/example/lib/screens/home_screen.dart +++ b/packages/flutter_markdown/example/lib/screens/home_screen.dart @@ -40,7 +40,7 @@ class HomeScreen extends StatelessWidget { title: const Text('Markdown Demos'), ), body: SafeArea( - child: Container( + child: ColoredBox( color: Colors.black12, child: ListView( children: [ diff --git a/packages/flutter_markdown/lib/src/_functions_io.dart b/packages/flutter_markdown/lib/src/_functions_io.dart index b3fa99ea63e6..cba2fd900b60 100644 --- a/packages/flutter_markdown/lib/src/_functions_io.dart +++ b/packages/flutter_markdown/lib/src/_functions_io.dart @@ -54,11 +54,9 @@ final MarkdownStyleSheet Function(BuildContext, MarkdownStyleSheetBaseTheme?) result = (Platform.isIOS || Platform.isMacOS) ? MarkdownStyleSheet.fromCupertinoTheme(CupertinoTheme.of(context)) : MarkdownStyleSheet.fromTheme(Theme.of(context)); - break; case MarkdownStyleSheetBaseTheme.cupertino: result = MarkdownStyleSheet.fromCupertinoTheme(CupertinoTheme.of(context)); - break; case MarkdownStyleSheetBaseTheme.material: // ignore: no_default_cases default: diff --git a/packages/flutter_markdown/lib/src/_functions_web.dart b/packages/flutter_markdown/lib/src/_functions_web.dart index 828388613a53..e4851ca7f6bf 100644 --- a/packages/flutter_markdown/lib/src/_functions_web.dart +++ b/packages/flutter_markdown/lib/src/_functions_web.dart @@ -57,11 +57,9 @@ final MarkdownStyleSheet Function(BuildContext, MarkdownStyleSheetBaseTheme?) result = userAgent.contains('Mac OS X') ? MarkdownStyleSheet.fromCupertinoTheme(CupertinoTheme.of(context)) : MarkdownStyleSheet.fromTheme(Theme.of(context)); - break; case MarkdownStyleSheetBaseTheme.cupertino: result = MarkdownStyleSheet.fromCupertinoTheme(CupertinoTheme.of(context)); - break; case MarkdownStyleSheetBaseTheme.material: default: // ignore: no_default_cases result = MarkdownStyleSheet.fromTheme(Theme.of(context)); diff --git a/packages/flutter_markdown/lib/src/builder.dart b/packages/flutter_markdown/lib/src/builder.dart index 8ffac7a33f44..e89a6620c060 100644 --- a/packages/flutter_markdown/lib/src/builder.dart +++ b/packages/flutter_markdown/lib/src/builder.dart @@ -501,13 +501,10 @@ class MarkdownBuilder implements md.NodeVisitor { switch (alignAttribute) { case 'left': align = TextAlign.left; - break; case 'center': align = TextAlign.center; - break; case 'right': align = TextAlign.right; - break; } } final Widget child = _buildTableCell( diff --git a/packages/flutter_markdown/pubspec.yaml b/packages/flutter_markdown/pubspec.yaml index 52e17f99e7e1..5656d43b7a86 100644 --- a/packages/flutter_markdown/pubspec.yaml +++ b/packages/flutter_markdown/pubspec.yaml @@ -4,7 +4,7 @@ description: A Markdown renderer for Flutter. Create rich text output, formatted with simple Markdown tags. repository: https://github.com/flutter/packages/tree/main/packages/flutter_markdown issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+flutter_markdown%22 -version: 0.6.18+2 +version: 0.6.18+3 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/flutter_markdown/test/all.dart b/packages/flutter_markdown/test/all.dart index c580ad7dfd5a..1258cca75562 100644 --- a/packages/flutter_markdown/test/all.dart +++ b/packages/flutter_markdown/test/all.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -library flutter_markdown.all_test; - import 'blockquote_test.dart' as blockquote_test; import 'custom_syntax_test.dart' as custome_syntax_test; import 'emphasis_test.dart' as emphasis_test; diff --git a/packages/flutter_markdown/test/image_test_mocks.dart b/packages/flutter_markdown/test/image_test_mocks.dart index 25c783edb766..1cd56219c1a7 100644 --- a/packages/flutter_markdown/test/image_test_mocks.dart +++ b/packages/flutter_markdown/test/image_test_mocks.dart @@ -44,11 +44,11 @@ MockHttpClient createMockImageHttpClient(SecurityContext? _) { // image tests that request an image. StreamSubscription> imageStream(Invocation invocation) { final void Function(List)? onData = - invocation.positionalArguments[0] as Function(List)?; + invocation.positionalArguments[0] as void Function(List)?; final void Function()? onDone = - invocation.namedArguments[#onDone] as Function()?; - final void Function(Object, [StackTrace?])? onError = - invocation.namedArguments[#onError] as Function(Object, [StackTrace?])?; + invocation.namedArguments[#onDone] as void Function()?; + final void Function(Object, [StackTrace?])? onError = invocation + .namedArguments[#onError] as void Function(Object, [StackTrace?])?; final bool? cancelOnError = invocation.namedArguments[#cancelOnError] as bool?; diff --git a/packages/flutter_migrate/lib/src/base/io.dart b/packages/flutter_migrate/lib/src/base/io.dart index 8ae28134f656..4d5834dd2122 100644 --- a/packages/flutter_migrate/lib/src/base/io.dart +++ b/packages/flutter_migrate/lib/src/base/io.dart @@ -2,29 +2,29 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/// This file serves as the single point of entry into the `dart:io` APIs -/// within Flutter tools. -/// -/// In order to make Flutter tools more testable, we use the `FileSystem` APIs -/// in `package:file` rather than using the `dart:io` file APIs directly (see -/// `file_system.dart`). Doing so allows us to swap out local file system -/// access with mockable (or in-memory) file systems, making our tests hermetic -/// vis-a-vis file system access. -/// -/// We also use `package:platform` to provide an abstraction away from the -/// static methods in the `dart:io` `Platform` class (see `platform.dart`). As -/// such, do not export Platform from this file! -/// -/// To ensure that all file system and platform API access within Flutter tools -/// goes through the proper APIs, we forbid direct imports of `dart:io` (via a -/// test), forcing all callers to instead import this file, which exports the -/// blessed subset of `dart:io` that is legal to use in Flutter tools. -/// -/// Because of the nature of this file, it is important that **platform and file -/// APIs not be exported from `dart:io` in this file**! Moreover, be careful -/// about any additional exports that you add to this file, as doing so will -/// increase the API surface that we have to test in Flutter tools, and the APIs -/// in `dart:io` can sometimes be hard to use in tests. +// This file serves as the single point of entry into the `dart:io` APIs +// within Flutter tools. +// +// In order to make Flutter tools more testable, we use the `FileSystem` APIs +// in `package:file` rather than using the `dart:io` file APIs directly (see +// `file_system.dart`). Doing so allows us to swap out local file system +// access with mockable (or in-memory) file systems, making our tests hermetic +// vis-a-vis file system access. +// +// We also use `package:platform` to provide an abstraction away from the +// static methods in the `dart:io` `Platform` class (see `platform.dart`). As +// such, do not export Platform from this file! +// +// To ensure that all file system and platform API access within Flutter tools +// goes through the proper APIs, we forbid direct imports of `dart:io` (via a +// test), forcing all callers to instead import this file, which exports the +// blessed subset of `dart:io` that is legal to use in Flutter tools. +// +// Because of the nature of this file, it is important that **platform and file +// APIs not be exported from `dart:io` in this file**! Moreover, be careful +// about any additional exports that you add to this file, as doing so will +// increase the API surface that we have to test in Flutter tools, and the APIs +// in `dart:io` can sometimes be hard to use in tests. // We allow `print()` in this file as a fallback for writing to the terminal via // regular stdout/stderr/stdio paths. Everything else in the flutter_tools diff --git a/packages/flutter_migrate/test/base/file_system_test.dart b/packages/flutter_migrate/test/base/file_system_test.dart index b7a6424f97be..191a13101b2c 100644 --- a/packages/flutter_migrate/test/base/file_system_test.dart +++ b/packages/flutter_migrate/test/base/file_system_test.dart @@ -278,30 +278,6 @@ class FileSystemUtils { i += 1; } } - - /// Escapes [path]. - /// - /// On Windows it replaces all '\' with '\\'. On other platforms, it returns the - /// path unchanged. - String escapePath(String path) => - isWindows ? path.replaceAll(r'\', r'\\') : path; - - /// Returns true if the file system [entity] has not been modified since the - /// latest modification to [referenceFile]. - /// - /// Returns true, if [entity] does not exist. - /// - /// Returns false, if [entity] exists, but [referenceFile] does not. - bool isOlderThanReference({ - required FileSystemEntity entity, - required File referenceFile, - }) { - if (!entity.existsSync()) { - return true; - } - return referenceFile.existsSync() && - referenceFile.statSync().modified.isAfter(entity.statSync().modified); - } } /// Creates `destDir` if needed, then recursively copies `srcDir` to diff --git a/packages/flutter_migrate/test/base/logger_test.dart b/packages/flutter_migrate/test/base/logger_test.dart index 2da9329481de..efc988b2c404 100644 --- a/packages/flutter_migrate/test/base/logger_test.dart +++ b/packages/flutter_migrate/test/base/logger_test.dart @@ -12,12 +12,6 @@ import 'package:test/fake.dart'; import '../src/common.dart'; import '../src/fakes.dart'; -// final Platform _kNoAnsiPlatform = FakePlatform(); -final String red = RegExp.escape(AnsiTerminal.red); -final String bold = RegExp.escape(AnsiTerminal.bold); -final String resetBold = RegExp.escape(AnsiTerminal.resetBold); -final String resetColor = RegExp.escape(AnsiTerminal.resetColor); - void main() { testWithoutContext('correct logger instance is created', () { final LoggerFactory loggerFactory = LoggerFactory( @@ -645,13 +639,6 @@ void main() { }); } -/// A fake [Logger] that throws the [Invocation] for any method call. -class FakeLogger implements Logger { - @override - dynamic noSuchMethod(Invocation invocation) => - throw invocation; // ignore: only_throw_errors -} - class FakeStdout extends Fake implements Stdout { FakeStdout({required this.syncError, this.completeWithError = false}); diff --git a/packages/flutter_migrate/test/src/common.dart b/packages/flutter_migrate/test/src/common.dart index c8da7d3174b8..2bc66ff6a61e 100644 --- a/packages/flutter_migrate/test/src/common.dart +++ b/packages/flutter_migrate/test/src/common.dart @@ -58,7 +58,6 @@ String getFlutterRoot() { switch (io.Platform.script.scheme) { case 'file': scriptUri = io.Platform.script; - break; case 'data': final RegExp flutterTools = RegExp( r'(file://[^"]*[/\\]flutter_tools[/\\][^"]+\.dart)', @@ -69,7 +68,6 @@ String getFlutterRoot() { throw invalidScript(); } scriptUri = Uri.parse(match.group(1)!); - break; default: throw invalidScript(); } diff --git a/packages/flutter_migrate/test/test_data/migrate_project.dart b/packages/flutter_migrate/test/test_data/migrate_project.dart index e62afdfc58ad..4f3b4023e2c9 100644 --- a/packages/flutter_migrate/test/test_data/migrate_project.dart +++ b/packages/flutter_migrate/test/test_data/migrate_project.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. @Timeout(Duration(seconds: 600)) +library; import 'dart:io'; import 'package:file/file.dart'; diff --git a/packages/go_router/CHANGELOG.md b/packages/go_router/CHANGELOG.md index 911de5304ffc..e551d260067c 100644 --- a/packages/go_router/CHANGELOG.md +++ b/packages/go_router/CHANGELOG.md @@ -1,3 +1,7 @@ +## 13.0.1 + +* Fixes new lint warnings. + ## 13.0.0 - Refactors `RouteMatchList` and imperative APIs. diff --git a/packages/go_router/example/lib/books/src/screens/books.dart b/packages/go_router/example/lib/books/src/screens/books.dart index b0e7ca2872e4..c3d8dc8083b3 100644 --- a/packages/go_router/example/lib/books/src/screens/books.dart +++ b/packages/go_router/example/lib/books/src/screens/books.dart @@ -37,15 +37,12 @@ class _BooksScreenState extends State switch (widget.kind) { case 'popular': _tabController.index = 0; - break; case 'new': _tabController.index = 1; - break; case 'all': _tabController.index = 2; - break; } } @@ -105,10 +102,8 @@ class _BooksScreenState extends State switch (index) { case 1: context.go('/books/new'); - break; case 2: context.go('/books/all'); - break; case 0: default: context.go('/books/popular'); diff --git a/packages/go_router/example/lib/books/src/screens/scaffold.dart b/packages/go_router/example/lib/books/src/screens/scaffold.dart index 2ffaf9a4584a..7e26fe28e4e1 100644 --- a/packages/go_router/example/lib/books/src/screens/scaffold.dart +++ b/packages/go_router/example/lib/books/src/screens/scaffold.dart @@ -43,13 +43,10 @@ class BookstoreScaffold extends StatelessWidget { switch (ScaffoldTab.values[idx]) { case ScaffoldTab.books: context.go('/books'); - break; case ScaffoldTab.authors: context.go('/authors'); - break; case ScaffoldTab.settings: context.go('/settings'); - break; } }, destinations: const [ diff --git a/packages/go_router/example/lib/extra_codec.dart b/packages/go_router/example/lib/extra_codec.dart index f7ae2a4f576c..389afe4063b5 100644 --- a/packages/go_router/example/lib/extra_codec.dart +++ b/packages/go_router/example/lib/extra_codec.dart @@ -127,11 +127,11 @@ class _MyExtraEncoder extends Converter { if (input == null) { return null; } - switch (input.runtimeType) { - case ComplexData1: - return ['ComplexData1', (input as ComplexData1).data]; - case ComplexData2: - return ['ComplexData2', (input as ComplexData2).data]; + switch (input) { + case ComplexData1 _: + return ['ComplexData1', input.data]; + case ComplexData2 _: + return ['ComplexData2', input.data]; default: throw FormatException('Cannot encode type ${input.runtimeType}'); } diff --git a/packages/go_router/example/lib/others/custom_stateful_shell_route.dart b/packages/go_router/example/lib/others/custom_stateful_shell_route.dart index 5fbe2b6d2868..5af1504234ac 100644 --- a/packages/go_router/example/lib/others/custom_stateful_shell_route.dart +++ b/packages/go_router/example/lib/others/custom_stateful_shell_route.dart @@ -329,7 +329,7 @@ class DetailsScreenState extends State { body: _build(context), ); } else { - return Container( + return ColoredBox( color: Theme.of(context).scaffoldBackgroundColor, child: _build(context), ); diff --git a/packages/go_router/example/lib/others/extra_param.dart b/packages/go_router/example/lib/others/extra_param.dart index eaef755cafcd..6cb1c39fcb55 100644 --- a/packages/go_router/example/lib/others/extra_param.dart +++ b/packages/go_router/example/lib/others/extra_param.dart @@ -20,28 +20,25 @@ class Family { /// Person data class. class Person { /// Creates a person. - const Person({required this.name, required this.age}); + const Person({required this.name}); /// The first name of the person. final String name; - - /// The age of the person. - final int age; } const Map _families = { 'f1': Family( name: 'Doe', people: { - 'p1': Person(name: 'Jane', age: 23), - 'p2': Person(name: 'John', age: 6), + 'p1': Person(name: 'Jane'), + 'p2': Person(name: 'John'), }, ), 'f2': Family( name: 'Wong', people: { - 'p1': Person(name: 'June', age: 51), - 'p2': Person(name: 'Xin', age: 44), + 'p1': Person(name: 'June'), + 'p2': Person(name: 'Xin'), }, ), }; diff --git a/packages/go_router/example/lib/others/transitions.dart b/packages/go_router/example/lib/others/transitions.dart index e4b9a3e67b33..f2559521a19f 100644 --- a/packages/go_router/example/lib/others/transitions.dart +++ b/packages/go_router/example/lib/others/transitions.dart @@ -141,7 +141,7 @@ class ExampleTransitionsScreen extends StatelessWidget { @override Widget build(BuildContext context) => Scaffold( appBar: AppBar(title: Text('${App.title}: $kind')), - body: Container( + body: ColoredBox( color: color, child: Center( child: Column( diff --git a/packages/go_router/example/lib/path_and_query_parameters.dart b/packages/go_router/example/lib/path_and_query_parameters.dart index 3a8f289b1f23..42d3b15d261b 100755 --- a/packages/go_router/example/lib/path_and_query_parameters.dart +++ b/packages/go_router/example/lib/path_and_query_parameters.dart @@ -28,28 +28,25 @@ class Family { /// Person data class. class Person { /// Creates a person. - const Person({required this.name, required this.age}); + const Person({required this.name}); /// The first name of the person. final String name; - - /// The age of the person. - final int age; } const Map _families = { 'f1': Family( name: 'Doe', people: { - 'p1': Person(name: 'Jane', age: 23), - 'p2': Person(name: 'John', age: 6), + 'p1': Person(name: 'Jane'), + 'p2': Person(name: 'John'), }, ), 'f2': Family( name: 'Wong', people: { - 'p1': Person(name: 'June', age: 51), - 'p2': Person(name: 'Xin', age: 44), + 'p1': Person(name: 'June'), + 'p2': Person(name: 'Xin'), }, ), }; diff --git a/packages/go_router/example/lib/shell_route.dart b/packages/go_router/example/lib/shell_route.dart index 70878b886ed3..2d5d87657094 100644 --- a/packages/go_router/example/lib/shell_route.dart +++ b/packages/go_router/example/lib/shell_route.dart @@ -169,13 +169,10 @@ class ScaffoldWithNavBar extends StatelessWidget { switch (index) { case 0: GoRouter.of(context).go('/a'); - break; case 1: GoRouter.of(context).go('/b'); - break; case 2: GoRouter.of(context).go('/c'); - break; } } } diff --git a/packages/go_router/example/lib/stateful_shell_route.dart b/packages/go_router/example/lib/stateful_shell_route.dart index eb0a67b679de..9901619d7ce9 100644 --- a/packages/go_router/example/lib/stateful_shell_route.dart +++ b/packages/go_router/example/lib/stateful_shell_route.dart @@ -276,7 +276,7 @@ class DetailsScreenState extends State { body: _build(context), ); } else { - return Container( + return ColoredBox( color: Theme.of(context).scaffoldBackgroundColor, child: _build(context), ); diff --git a/packages/go_router/lib/src/information_provider.dart b/packages/go_router/lib/src/information_provider.dart index 9346c2a20b03..74440051d686 100644 --- a/packages/go_router/lib/src/information_provider.dart +++ b/packages/go_router/lib/src/information_provider.dart @@ -115,13 +115,10 @@ class GoRouteInformationProvider extends RouteInformationProvider return; } replace = _valueInEngine == _kEmptyRouteInformation; - break; case RouteInformationReportingType.neglect: replace = true; - break; case RouteInformationReportingType.navigate: replace = false; - break; } SystemNavigator.selectMultiEntryHistory(); SystemNavigator.routeInformationUpdated( diff --git a/packages/go_router/lib/src/misc/extensions.dart b/packages/go_router/lib/src/misc/extensions.dart index 58e3c3fea7c0..c137022b8020 100644 --- a/packages/go_router/lib/src/misc/extensions.dart +++ b/packages/go_router/lib/src/misc/extensions.dart @@ -113,7 +113,7 @@ extension GoRouterHelper on BuildContext { /// * [pushReplacement] which replaces the top-most page of the page stack but /// always uses a new page key. void replace(String location, {Object? extra}) => - GoRouter.of(this).replace(location, extra: extra); + GoRouter.of(this).replace(location, extra: extra); /// Replaces the top-most page with the named route and optional parameters, /// preserving the page key. @@ -132,7 +132,7 @@ extension GoRouterHelper on BuildContext { Map queryParameters = const {}, Object? extra, }) => - GoRouter.of(this).replaceNamed(name, + GoRouter.of(this).replaceNamed(name, pathParameters: pathParameters, queryParameters: queryParameters, extra: extra); diff --git a/packages/go_router/pubspec.yaml b/packages/go_router/pubspec.yaml index 3e91cd898024..7ecbbbc2a0b0 100644 --- a/packages/go_router/pubspec.yaml +++ b/packages/go_router/pubspec.yaml @@ -1,7 +1,7 @@ name: go_router description: A declarative router for Flutter based on Navigation 2 supporting deep linking, data-driven routes and more -version: 13.0.0 +version: 13.0.1 repository: https://github.com/flutter/packages/tree/main/packages/go_router issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+go_router%22 diff --git a/packages/go_router/test/delegate_test.dart b/packages/go_router/test/delegate_test.dart index 0feca449fc98..9b7a99f13fd5 100644 --- a/packages/go_router/test/delegate_test.dart +++ b/packages/go_router/test/delegate_test.dart @@ -430,7 +430,7 @@ void main() { final RouteMatchBase first = goRouter.routerDelegate.currentConfiguration.matches.first; final RouteMatch last = goRouter.routerDelegate.currentConfiguration.last; - goRouter.replace('/page-1'); + goRouter.replace('/page-1'); expect(goRouter.routerDelegate.currentConfiguration.matches.length, 2); expect( goRouter.routerDelegate.currentConfiguration.matches.first, @@ -470,7 +470,7 @@ void main() { final ValueKey prev = goRouter.routerDelegate.currentConfiguration.matches.last.pageKey; - goRouter.replace('/a'); + goRouter.replace('/a'); await tester.pumpAndSettle(); expect(goRouter.routerDelegate.currentConfiguration.matches.length, 2); @@ -498,7 +498,7 @@ void main() { final ValueKey prev = goRouter.routerDelegate.currentConfiguration.matches.last.pageKey; - goRouter.replace('/'); + goRouter.replace('/'); await tester.pumpAndSettle(); expect(goRouter.routerDelegate.currentConfiguration.matches.length, 2); @@ -551,7 +551,7 @@ void main() { final RouteMatchBase first = goRouter.routerDelegate.currentConfiguration.matches.first; final RouteMatch last = goRouter.routerDelegate.currentConfiguration.last; - goRouter.replaceNamed('page1'); + goRouter.replaceNamed('page1'); expect(goRouter.routerDelegate.currentConfiguration.matches.length, 2); expect( goRouter.routerDelegate.currentConfiguration.matches.first, @@ -591,7 +591,7 @@ void main() { final ValueKey prev = goRouter.routerDelegate.currentConfiguration.matches.last.pageKey; - goRouter.replaceNamed('page0'); + goRouter.replaceNamed('page0'); await tester.pumpAndSettle(); expect(goRouter.routerDelegate.currentConfiguration.matches.length, 2); @@ -619,7 +619,7 @@ void main() { final ValueKey prev = goRouter.routerDelegate.currentConfiguration.matches.last.pageKey; - goRouter.replaceNamed('home'); + goRouter.replaceNamed('home'); await tester.pumpAndSettle(); expect(goRouter.routerDelegate.currentConfiguration.matches.length, 2); diff --git a/packages/go_router/test/error_page_test.dart b/packages/go_router/test/error_page_test.dart index 071cc962e73c..f2d1e5737256 100644 --- a/packages/go_router/test/error_page_test.dart +++ b/packages/go_router/test/error_page_test.dart @@ -51,15 +51,3 @@ Widget widgetsAppBuilder({required Widget home}) { color: Colors.white, ); } - -class DummyStatefulWidget extends StatefulWidget { - const DummyStatefulWidget({super.key}); - - @override - State createState() => _DummyStatefulWidgetState(); -} - -class _DummyStatefulWidgetState extends State { - @override - Widget build(BuildContext context) => Container(); -} diff --git a/packages/go_router/test/go_router_test.dart b/packages/go_router/test/go_router_test.dart index 9983caafa6c6..2a3381edb678 100644 --- a/packages/go_router/test/go_router_test.dart +++ b/packages/go_router/test/go_router_test.dart @@ -284,7 +284,7 @@ void main() { expect(find.byKey(home), findsNothing); expect(find.byKey(settings), findsOneWidget); - showDialog( + showDialog( context: navKey.currentContext!, builder: (_) => DummyScreen(key: dialog), ); @@ -296,7 +296,7 @@ void main() { expect(find.byKey(dialog), findsNothing); expect(find.byKey(settings), findsOneWidget); - showDialog( + showDialog( context: navKey.currentContext!, builder: (_) => DummyScreen(key: dialog), ); @@ -4427,7 +4427,7 @@ void main() { expect(router.canPop(), isFalse); expect(find.text('A Screen'), findsOneWidget); expect(find.text('Shell'), findsOneWidget); - showDialog( + showDialog( context: root.currentContext!, builder: (_) => const Text('A dialog')); await tester.pumpAndSettle(); diff --git a/packages/go_router/test/imperative_api_test.dart b/packages/go_router/test/imperative_api_test.dart index 7091a0383541..0598acf00bb7 100644 --- a/packages/go_router/test/imperative_api_test.dart +++ b/packages/go_router/test/imperative_api_test.dart @@ -39,7 +39,7 @@ void main() { expect(find.text('shell'), findsOneWidget); expect(find.byKey(a), findsOneWidget); - router.replace('/b'); + router.replace('/b'); await tester.pumpAndSettle(); expect(find.text('shell'), findsOneWidget); expect(find.byKey(a), findsNothing); diff --git a/packages/go_router_builder/CHANGELOG.md b/packages/go_router_builder/CHANGELOG.md index 153978168be4..96dbf5a3215a 100644 --- a/packages/go_router_builder/CHANGELOG.md +++ b/packages/go_router_builder/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.4.1 + +* Fixes new lint warnings. + ## 2.4.0 * Adds support for passing observers to the ShellRoute for the nested Navigator. diff --git a/packages/go_router_builder/example/lib/all_types.dart b/packages/go_router_builder/example/lib/all_types.dart index 762ab1cea9b9..aa49e45c83e4 100644 --- a/packages/go_router_builder/example/lib/all_types.dart +++ b/packages/go_router_builder/example/lib/all_types.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// ignore_for_file: public_member_api_docs +// ignore_for_file: public_member_api_docs, unreachable_from_main import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; diff --git a/packages/go_router_builder/example/lib/extra_example.dart b/packages/go_router_builder/example/lib/extra_example.dart index b16d6ff030c0..33547b1a6466 100644 --- a/packages/go_router_builder/example/lib/extra_example.dart +++ b/packages/go_router_builder/example/lib/extra_example.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// ignore_for_file: public_member_api_docs +// ignore_for_file: public_member_api_docs, unreachable_from_main import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; diff --git a/packages/go_router_builder/example/lib/main.dart b/packages/go_router_builder/example/lib/main.dart index 773b6687ed93..b67ca5f5aa85 100644 --- a/packages/go_router_builder/example/lib/main.dart +++ b/packages/go_router_builder/example/lib/main.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// ignore_for_file: public_member_api_docs +// ignore_for_file: public_member_api_docs, unreachable_from_main import 'dart:async'; @@ -179,7 +179,7 @@ class HomeScreen extends StatelessWidget { PopupMenuItem( value: '1', child: const Text('Push w/o return value'), - onTap: () => const PersonRoute('f1', 1).push(context), + onTap: () => const PersonRoute('f1', 1).push(context), ), PopupMenuItem( value: '2', diff --git a/packages/go_router_builder/example/lib/shell_route_example.dart b/packages/go_router_builder/example/lib/shell_route_example.dart index 77952c113363..6b5ec27947de 100644 --- a/packages/go_router_builder/example/lib/shell_route_example.dart +++ b/packages/go_router_builder/example/lib/shell_route_example.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// ignore_for_file: public_member_api_docs +// ignore_for_file: public_member_api_docs, unreachable_from_main import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; @@ -105,10 +105,8 @@ class MyShellRouteScreen extends StatelessWidget { switch (index) { case 0: const FooRouteData().go(context); - break; case 1: const BarRouteData().go(context); - break; } }, ), diff --git a/packages/go_router_builder/example/lib/shell_route_with_keys_example.dart b/packages/go_router_builder/example/lib/shell_route_with_keys_example.dart index d18c0aa482c7..af79f41fb989 100644 --- a/packages/go_router_builder/example/lib/shell_route_with_keys_example.dart +++ b/packages/go_router_builder/example/lib/shell_route_with_keys_example.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// ignore_for_file: public_member_api_docs +// ignore_for_file: public_member_api_docs, unreachable_from_main import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; @@ -87,10 +87,8 @@ class MyShellRouteScreen extends StatelessWidget { switch (index) { case 0: const HomeRouteData().go(context); - break; case 1: const UsersRouteData().go(context); - break; } }, ), diff --git a/packages/go_router_builder/example/lib/shell_route_with_observers_example.dart b/packages/go_router_builder/example/lib/shell_route_with_observers_example.dart index b644ee3bb02a..a762e12c1241 100644 --- a/packages/go_router_builder/example/lib/shell_route_with_observers_example.dart +++ b/packages/go_router_builder/example/lib/shell_route_with_observers_example.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// ignore_for_file: public_member_api_docs +// ignore_for_file: public_member_api_docs, unreachable_from_main import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; @@ -90,10 +90,8 @@ class MyShellRouteScreen extends StatelessWidget { switch (index) { case 0: const HomeRouteData().go(context); - break; case 1: const UsersRouteData().go(context); - break; } }, ), diff --git a/packages/go_router_builder/example/lib/simple_example.dart b/packages/go_router_builder/example/lib/simple_example.dart index dbb0a15a69c9..b977a296cb47 100644 --- a/packages/go_router_builder/example/lib/simple_example.dart +++ b/packages/go_router_builder/example/lib/simple_example.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// ignore_for_file: public_member_api_docs +// ignore_for_file: public_member_api_docs, unreachable_from_main import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; diff --git a/packages/go_router_builder/example/lib/stateful_shell_route_example.dart b/packages/go_router_builder/example/lib/stateful_shell_route_example.dart index 9e9748e870dc..ad5ba8c82fdd 100644 --- a/packages/go_router_builder/example/lib/stateful_shell_route_example.dart +++ b/packages/go_router_builder/example/lib/stateful_shell_route_example.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// ignore_for_file: public_member_api_docs +// ignore_for_file: public_member_api_docs, unreachable_from_main import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; @@ -12,6 +12,7 @@ part 'stateful_shell_route_example.g.dart'; final GlobalKey _sectionANavigatorKey = GlobalKey(debugLabel: 'sectionANav'); + void main() => runApp(App()); class App extends StatelessWidget { diff --git a/packages/go_router_builder/example/lib/stateful_shell_route_initial_location_example.dart b/packages/go_router_builder/example/lib/stateful_shell_route_initial_location_example.dart index 63c16638e7bc..a944e7d0997a 100644 --- a/packages/go_router_builder/example/lib/stateful_shell_route_initial_location_example.dart +++ b/packages/go_router_builder/example/lib/stateful_shell_route_initial_location_example.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// ignore_for_file: public_member_api_docs +// ignore_for_file: public_member_api_docs, unreachable_from_main import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; diff --git a/packages/go_router_builder/lib/src/route_config.dart b/packages/go_router_builder/lib/src/route_config.dart index b358d7809d10..1668f5e2740c 100644 --- a/packages/go_router_builder/lib/src/route_config.dart +++ b/packages/go_router_builder/lib/src/route_config.dart @@ -485,7 +485,6 @@ abstract class RouteBaseConfig { parameterName: r'$observers', ), ); - break; case 'TypedStatefulShellRoute': value = StatefulShellRouteConfig._( routeDataClass: classElement, @@ -503,7 +502,6 @@ abstract class RouteBaseConfig { parameterName: r'$navigatorContainerBuilder', ), ); - break; case 'TypedStatefulShellBranch': value = StatefulShellBranchConfig._( routeDataClass: classElement, @@ -521,7 +519,6 @@ abstract class RouteBaseConfig { parameterName: r'$initialLocation', ), ); - break; case 'TypedGoRoute': final ConstantReader pathValue = reader.read('path'); if (pathValue.isNull) { @@ -541,7 +538,6 @@ abstract class RouteBaseConfig { parameterName: r'$parentNavigatorKey', ), ); - break; default: throw UnsupportedError('Unrecognized type $typeName'); } diff --git a/packages/go_router_builder/pubspec.yaml b/packages/go_router_builder/pubspec.yaml index 0c4e2f158e39..83197ba3c691 100644 --- a/packages/go_router_builder/pubspec.yaml +++ b/packages/go_router_builder/pubspec.yaml @@ -2,7 +2,7 @@ name: go_router_builder description: >- A builder that supports generated strongly-typed route helpers for package:go_router -version: 2.4.0 +version: 2.4.1 repository: https://github.com/flutter/packages/tree/main/packages/go_router_builder issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+go_router_builder%22 diff --git a/packages/google_identity_services_web/test/js_loader_test.dart b/packages/google_identity_services_web/test/js_loader_test.dart index ec2c07428a55..cbb684acfe68 100644 --- a/packages/google_identity_services_web/test/js_loader_test.dart +++ b/packages/google_identity_services_web/test/js_loader_test.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. @TestOn('browser') // Uses package:web +library; import 'dart:async'; import 'dart:js_interop'; diff --git a/packages/google_identity_services_web/test/js_loader_tt_custom_test.dart b/packages/google_identity_services_web/test/js_loader_tt_custom_test.dart index 0ee856f68f06..7132fb4c76ea 100644 --- a/packages/google_identity_services_web/test/js_loader_tt_custom_test.dart +++ b/packages/google_identity_services_web/test/js_loader_tt_custom_test.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. @TestOn('browser') // Uses package:web +library; import 'package:google_identity_services_web/loader.dart'; import 'package:test/test.dart'; diff --git a/packages/google_identity_services_web/test/js_loader_tt_forbidden_test.dart b/packages/google_identity_services_web/test/js_loader_tt_forbidden_test.dart index 3806e9087dad..23401181a658 100644 --- a/packages/google_identity_services_web/test/js_loader_tt_forbidden_test.dart +++ b/packages/google_identity_services_web/test/js_loader_tt_forbidden_test.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. @TestOn('browser') // Uses package:web +library; import 'package:google_identity_services_web/loader.dart'; import 'package:test/test.dart'; diff --git a/packages/google_identity_services_web/test/only_chrome_tests_here_test.dart b/packages/google_identity_services_web/test/only_chrome_tests_here_test.dart index 6c33ea9b88f9..844adda7aacf 100644 --- a/packages/google_identity_services_web/test/only_chrome_tests_here_test.dart +++ b/packages/google_identity_services_web/test/only_chrome_tests_here_test.dart @@ -5,6 +5,7 @@ // ignore_for_file: avoid_print @TestOn('vm') +library; import 'package:test/test.dart'; diff --git a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md index 079355c7eb75..ade1c52ad03a 100644 --- a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.5.1 + +* Fixes new lint warnings. + ## 2.5.0 * Adds implementation for `cloudMapId` parameter to support cloud-based maps styling. diff --git a/packages/google_maps_flutter/google_maps_flutter/lib/google_maps_flutter.dart b/packages/google_maps_flutter/google_maps_flutter/lib/google_maps_flutter.dart index 8ad5b33bef95..7dbcee8e92cb 100644 --- a/packages/google_maps_flutter/google_maps_flutter/lib/google_maps_flutter.dart +++ b/packages/google_maps_flutter/google_maps_flutter/lib/google_maps_flutter.dart @@ -15,8 +15,8 @@ import 'package:google_maps_flutter_platform_interface/google_maps_flutter_platf export 'package:google_maps_flutter_platform_interface/google_maps_flutter_platform_interface.dart' show - ArgumentCallbacks, ArgumentCallback, + ArgumentCallbacks, BitmapDescriptor, CameraPosition, CameraPositionCallback, @@ -41,8 +41,8 @@ export 'package:google_maps_flutter_platform_interface/google_maps_flutter_platf PolylineId, ScreenCoordinate, Tile, - TileOverlayId, TileOverlay, + TileOverlayId, TileProvider, WebGestureHandling; diff --git a/packages/google_maps_flutter/google_maps_flutter/lib/src/controller.dart b/packages/google_maps_flutter/google_maps_flutter/lib/src/controller.dart index dedb8400a32e..095d15867acc 100644 --- a/packages/google_maps_flutter/google_maps_flutter/lib/src/controller.dart +++ b/packages/google_maps_flutter/google_maps_flutter/lib/src/controller.dart @@ -4,7 +4,7 @@ // ignore_for_file: library_private_types_in_public_api -part of google_maps_flutter; +part of '../google_maps_flutter.dart'; /// Controller for a single GoogleMap instance running on the host platform. class GoogleMapController { diff --git a/packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart b/packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart index 03adf3aa47c3..3b73e55664dd 100644 --- a/packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart +++ b/packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -part of google_maps_flutter; +part of '../google_maps_flutter.dart'; /// Callback method for when the map is ready to be used. /// diff --git a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml index c5dbbb3f9554..f453355dfd9e 100644 --- a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter description: A Flutter plugin for integrating Google Maps in iOS and Android applications. repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 -version: 2.5.0 +version: 2.5.1 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md index 3b4a2f4c4381..b1d1d4afe0f9 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.6.1 + +* Fixes new lint warnings. + ## 2.6.0 * Fixes missing updates in TLHC mode. diff --git a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart index 283b4abd38ce..4cb87722f375 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart @@ -185,24 +185,20 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { switch (call.method) { case 'camera#onMoveStarted': _mapEventStreamController.add(CameraMoveStartedEvent(mapId)); - break; case 'camera#onMove': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(CameraMoveEvent( mapId, CameraPosition.fromMap(arguments['position'])!, )); - break; case 'camera#onIdle': _mapEventStreamController.add(CameraIdleEvent(mapId)); - break; case 'marker#onTap': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(MarkerTapEvent( mapId, MarkerId(arguments['markerId']! as String), )); - break; case 'marker#onDragStart': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(MarkerDragStartEvent( @@ -210,7 +206,6 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { LatLng.fromJson(arguments['position'])!, MarkerId(arguments['markerId']! as String), )); - break; case 'marker#onDrag': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(MarkerDragEvent( @@ -218,7 +213,6 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { LatLng.fromJson(arguments['position'])!, MarkerId(arguments['markerId']! as String), )); - break; case 'marker#onDragEnd': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(MarkerDragEndEvent( @@ -226,49 +220,42 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { LatLng.fromJson(arguments['position'])!, MarkerId(arguments['markerId']! as String), )); - break; case 'infoWindow#onTap': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(InfoWindowTapEvent( mapId, MarkerId(arguments['markerId']! as String), )); - break; case 'polyline#onTap': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(PolylineTapEvent( mapId, PolylineId(arguments['polylineId']! as String), )); - break; case 'polygon#onTap': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(PolygonTapEvent( mapId, PolygonId(arguments['polygonId']! as String), )); - break; case 'circle#onTap': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(CircleTapEvent( mapId, CircleId(arguments['circleId']! as String), )); - break; case 'map#onTap': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(MapTapEvent( mapId, LatLng.fromJson(arguments['position'])!, )); - break; case 'map#onLongPress': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(MapLongPressEvent( mapId, LatLng.fromJson(arguments['position'])!, )); - break; case 'tileOverlay#getTile': final Map arguments = _getArgumentDictionary(call); final Map? tileOverlaysForThisMap = @@ -523,10 +510,8 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { switch (rendererType) { case AndroidMapRenderer.latest: preferredRenderer = 'latest'; - break; case AndroidMapRenderer.legacy: preferredRenderer = 'legacy'; - break; case AndroidMapRenderer.platformDefault: case null: preferredRenderer = 'default'; diff --git a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml index 1ffb8fbbf08b..16f50aa7761a 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter_android description: Android implementation of the google_maps_flutter plugin. repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 -version: 2.6.0 +version: 2.6.1 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md index 430d1a14d4d7..7c2b472bb87c 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.3.4 + +* Fixes new lint warnings. + ## 2.3.3 * Adds support for version 8 of the Google Maps SDK in apps targeting iOS 14+. diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/lib/src/google_maps_flutter_ios.dart b/packages/google_maps_flutter/google_maps_flutter_ios/lib/src/google_maps_flutter_ios.dart index 782e326f3703..642febcdd3b9 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/lib/src/google_maps_flutter_ios.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios/lib/src/google_maps_flutter_ios.dart @@ -167,24 +167,20 @@ class GoogleMapsFlutterIOS extends GoogleMapsFlutterPlatform { switch (call.method) { case 'camera#onMoveStarted': _mapEventStreamController.add(CameraMoveStartedEvent(mapId)); - break; case 'camera#onMove': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(CameraMoveEvent( mapId, CameraPosition.fromMap(arguments['position'])!, )); - break; case 'camera#onIdle': _mapEventStreamController.add(CameraIdleEvent(mapId)); - break; case 'marker#onTap': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(MarkerTapEvent( mapId, MarkerId(arguments['markerId']! as String), )); - break; case 'marker#onDragStart': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(MarkerDragStartEvent( @@ -192,7 +188,6 @@ class GoogleMapsFlutterIOS extends GoogleMapsFlutterPlatform { LatLng.fromJson(arguments['position'])!, MarkerId(arguments['markerId']! as String), )); - break; case 'marker#onDrag': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(MarkerDragEvent( @@ -200,7 +195,6 @@ class GoogleMapsFlutterIOS extends GoogleMapsFlutterPlatform { LatLng.fromJson(arguments['position'])!, MarkerId(arguments['markerId']! as String), )); - break; case 'marker#onDragEnd': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(MarkerDragEndEvent( @@ -208,49 +202,42 @@ class GoogleMapsFlutterIOS extends GoogleMapsFlutterPlatform { LatLng.fromJson(arguments['position'])!, MarkerId(arguments['markerId']! as String), )); - break; case 'infoWindow#onTap': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(InfoWindowTapEvent( mapId, MarkerId(arguments['markerId']! as String), )); - break; case 'polyline#onTap': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(PolylineTapEvent( mapId, PolylineId(arguments['polylineId']! as String), )); - break; case 'polygon#onTap': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(PolygonTapEvent( mapId, PolygonId(arguments['polygonId']! as String), )); - break; case 'circle#onTap': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(CircleTapEvent( mapId, CircleId(arguments['circleId']! as String), )); - break; case 'map#onTap': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(MapTapEvent( mapId, LatLng.fromJson(arguments['position'])!, )); - break; case 'map#onLongPress': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(MapLongPressEvent( mapId, LatLng.fromJson(arguments['position'])!, )); - break; case 'tileOverlay#getTile': final Map arguments = _getArgumentDictionary(call); final Map? tileOverlaysForThisMap = diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml index 9b2e69044fed..565ecb396f6e 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter_ios description: iOS implementation of the google_maps_flutter plugin. repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_ios issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 -version: 2.3.3 +version: 2.3.4 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md index cde822cee18b..ac8a8a82939f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 2.4.2 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Fixes new lint warnings. ## 2.4.1 diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/method_channel/method_channel_google_maps_flutter.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/method_channel/method_channel_google_maps_flutter.dart index b522bff7b84d..2c79c0cf995c 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/method_channel/method_channel_google_maps_flutter.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/method_channel/method_channel_google_maps_flutter.dart @@ -170,24 +170,20 @@ class MethodChannelGoogleMapsFlutter extends GoogleMapsFlutterPlatform { switch (call.method) { case 'camera#onMoveStarted': _mapEventStreamController.add(CameraMoveStartedEvent(mapId)); - break; case 'camera#onMove': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(CameraMoveEvent( mapId, CameraPosition.fromMap(arguments['position'])!, )); - break; case 'camera#onIdle': _mapEventStreamController.add(CameraIdleEvent(mapId)); - break; case 'marker#onTap': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(MarkerTapEvent( mapId, MarkerId(arguments['markerId']! as String), )); - break; case 'marker#onDragStart': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(MarkerDragStartEvent( @@ -195,7 +191,6 @@ class MethodChannelGoogleMapsFlutter extends GoogleMapsFlutterPlatform { LatLng.fromJson(arguments['position'])!, MarkerId(arguments['markerId']! as String), )); - break; case 'marker#onDrag': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(MarkerDragEvent( @@ -203,7 +198,6 @@ class MethodChannelGoogleMapsFlutter extends GoogleMapsFlutterPlatform { LatLng.fromJson(arguments['position'])!, MarkerId(arguments['markerId']! as String), )); - break; case 'marker#onDragEnd': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(MarkerDragEndEvent( @@ -211,49 +205,42 @@ class MethodChannelGoogleMapsFlutter extends GoogleMapsFlutterPlatform { LatLng.fromJson(arguments['position'])!, MarkerId(arguments['markerId']! as String), )); - break; case 'infoWindow#onTap': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(InfoWindowTapEvent( mapId, MarkerId(arguments['markerId']! as String), )); - break; case 'polyline#onTap': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(PolylineTapEvent( mapId, PolylineId(arguments['polylineId']! as String), )); - break; case 'polygon#onTap': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(PolygonTapEvent( mapId, PolygonId(arguments['polygonId']! as String), )); - break; case 'circle#onTap': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(CircleTapEvent( mapId, CircleId(arguments['circleId']! as String), )); - break; case 'map#onTap': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(MapTapEvent( mapId, LatLng.fromJson(arguments['position'])!, )); - break; case 'map#onLongPress': final Map arguments = _getArgumentDictionary(call); _mapEventStreamController.add(MapLongPressEvent( mapId, LatLng.fromJson(arguments['position'])!, )); - break; case 'tileOverlay#getTile': final Map arguments = _getArgumentDictionary(call); final Map? tileOverlaysForThisMap = diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/bitmap.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/bitmap.dart index 7dda43a7abf4..5a60a202cbbe 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/bitmap.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/bitmap.dart @@ -8,7 +8,7 @@ import 'dart:ui' show Size; import 'package:flutter/foundation.dart' show kIsWeb; import 'package:flutter/material.dart' - show ImageConfiguration, AssetImage, AssetBundleImageKey; + show AssetBundleImageKey, AssetImage, ImageConfiguration; import 'package:flutter/services.dart' show AssetBundle; /// Defines a bitmap image. For a marker, this class can be used to set the @@ -32,12 +32,10 @@ class BitmapDescriptor { final num secondElement = jsonList[1] as num; assert(0 <= secondElement && secondElement < 360); } - break; case _fromBytes: assert(jsonList.length == 2); assert(jsonList[1] != null && jsonList[1] is List); assert((jsonList[1] as List).isNotEmpty); - break; case _fromAsset: assert(jsonList.length <= 3); assert(jsonList[1] != null && jsonList[1] is String); @@ -46,7 +44,6 @@ class BitmapDescriptor { assert(jsonList[2] != null && jsonList[2] is String); assert((jsonList[2] as String).isNotEmpty); } - break; case _fromAssetImage: assert(jsonList.length <= 4); assert(jsonList[1] != null && jsonList[1] is String); @@ -56,7 +53,6 @@ class BitmapDescriptor { assert(jsonList[3] != null && jsonList[3] is List); assert((jsonList[3] as List).length == 2); } - break; default: break; } diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/joint_type.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/joint_type.dart index b986025b27a6..ab3b207e4dd1 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/joint_type.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/joint_type.dart @@ -2,28 +2,25 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:flutter/foundation.dart' show immutable; - /// Joint types for [Polyline]. -@immutable -class JointType { - const JointType._(this.value); - - /// The value representing the [JointType] on the sdk. - final int value; - +enum JointType { /// Mitered joint, with fixed pointed extrusion equal to half the stroke width on the outside of the joint. /// /// Constant Value: 0 - static const JointType mitered = JointType._(0); + mitered._(0), /// Flat bevel on the outside of the joint. /// /// Constant Value: 1 - static const JointType bevel = JointType._(1); + bevel._(1), /// Rounded on the outside of the joint by an arc of radius equal to half the stroke width, centered at the vertex. /// /// Constant Value: 2 - static const JointType round = JointType._(2); + round._(2); + + const JointType._(this.value); + + /// The value representing the [JointType] on the sdk. + final int value; } diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/marker.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/marker.dart index cd68b53b58ca..0b5b1a507d37 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/marker.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/marker.dart @@ -5,7 +5,7 @@ import 'dart:ui' show Offset; import 'package:flutter/foundation.dart' - show immutable, ValueChanged, VoidCallback; + show ValueChanged, VoidCallback, immutable; import 'types.dart'; diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/polygon.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/polygon.dart index 8298b90ae947..f106834eeb5b 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/polygon.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/polygon.dart @@ -4,7 +4,7 @@ import 'package:collection/collection.dart'; import 'package:flutter/foundation.dart' - show immutable, listEquals, VoidCallback; + show VoidCallback, immutable, listEquals; import 'package:flutter/material.dart' show Color, Colors; import 'types.dart'; diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/polyline.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/polyline.dart index b7d50cd3962d..d526375cfca3 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/polyline.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/polyline.dart @@ -3,7 +3,7 @@ // found in the LICENSE file. import 'package:flutter/foundation.dart' - show immutable, listEquals, VoidCallback; + show VoidCallback, immutable, listEquals; import 'package:flutter/material.dart' show Color, Colors; import 'types.dart'; diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml index 820f4d008639..71ceb725728d 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/google_maps_f issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 2.4.1 +version: 2.4.2 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md index 6825f3e4a902..e46b0702bf9f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 0.5.4+3 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Fixes new lint warnings. ## 0.5.4+2 diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/circle.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/circle.dart index 0e6df16af08d..8776bef9fd16 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/circle.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/circle.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -part of google_maps_flutter_web; +part of '../google_maps_flutter_web.dart'; /// The `CircleController` class wraps a [gmaps.Circle] and its `onTap` behavior. class CircleController { diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/circles.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/circles.dart index e307941887a4..4bc0fd385a26 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/circles.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/circles.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -part of google_maps_flutter_web; +part of '../google_maps_flutter_web.dart'; /// This class manages all the [CircleController]s associated to a [GoogleMapController]. class CirclesController extends GeometryController { diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart index 9402760ff64f..8ca6a75559f4 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -part of google_maps_flutter_web; +part of '../google_maps_flutter_web.dart'; // Default values for when the gmaps objects return null/undefined values. final gmaps.LatLng _nullGmapsLatLng = gmaps.LatLng(0, 0); @@ -442,16 +442,13 @@ void _applyCameraUpdate(gmaps.GMap map, CameraUpdate update) { gmaps.LatLng(latLng[0] as num?, latLng[1] as num?), ); map.tilt = position['tilt'] as num?; - break; case 'newLatLng': final List latLng = asJsonList(json[1]); map.panTo(gmaps.LatLng(latLng[0] as num?, latLng[1] as num?)); - break; case 'newLatLngZoom': final List latLng = asJsonList(json[1]); map.zoom = json[2] as num?; map.panTo(gmaps.LatLng(latLng[0] as num?, latLng[1] as num?)); - break; case 'newLatLngBounds': final List latLngPair = asJsonList(json[1]); final List latLng1 = asJsonList(latLngPair[0]); @@ -464,10 +461,8 @@ void _applyCameraUpdate(gmaps.GMap map, CameraUpdate update) { ), padding, ); - break; case 'scrollBy': map.panBy(json[1] as num?, json[2] as num?); - break; case 'zoomBy': gmaps.LatLng? focusLatLng; final double zoomDelta = json[1] as double? ?? 0; @@ -489,16 +484,12 @@ void _applyCameraUpdate(gmaps.GMap map, CameraUpdate update) { if (focusLatLng != null) { map.panTo(focusLatLng); } - break; case 'zoomIn': map.zoom = (map.zoom ?? 0) + 1; - break; case 'zoomOut': map.zoom = (map.zoom ?? 0) - 1; - break; case 'zoomTo': map.zoom = json[1] as num?; - break; default: throw UnimplementedError('Unimplemented CameraMove: ${json[0]}.'); } diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/google_maps_controller.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/google_maps_controller.dart index 03bc739bebf6..494029ce02c5 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/google_maps_controller.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/google_maps_controller.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -part of google_maps_flutter_web; +part of '../google_maps_flutter_web.dart'; /// Type used when passing an override to the _createMap function. @visibleForTesting diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/google_maps_flutter_web.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/google_maps_flutter_web.dart index 6b91e9481e34..140fd3e1888d 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/google_maps_flutter_web.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/google_maps_flutter_web.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -part of google_maps_flutter_web; +part of '../google_maps_flutter_web.dart'; /// The web implementation of [GoogleMapsFlutterPlatform]. /// diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/marker.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/marker.dart index a861e7f85d9b..77258504ef67 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/marker.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/marker.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -part of google_maps_flutter_web; +part of '../google_maps_flutter_web.dart'; /// The `MarkerController` class wraps a [gmaps.Marker], how it handles events, and its associated (optional) [gmaps.InfoWindow] widget. class MarkerController { diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/markers.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/markers.dart index 0c378f9daba3..52a659874f45 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/markers.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/markers.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -part of google_maps_flutter_web; +part of '../google_maps_flutter_web.dart'; /// This class manages a set of [MarkerController]s associated to a [GoogleMapController]. class MarkersController extends GeometryController { diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/overlay.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/overlay.dart index 86f5387910cd..5dd092c67ee2 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/overlay.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/overlay.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -part of google_maps_flutter_web; +part of '../google_maps_flutter_web.dart'; /// This wraps a [TileOverlay] in a [gmaps.MapType]. class TileOverlayController { diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/overlays.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/overlays.dart index aa6c19173aa4..26c6a7573a4f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/overlays.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/overlays.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -part of google_maps_flutter_web; +part of '../google_maps_flutter_web.dart'; /// This class manages all the [TileOverlayController]s associated to a [GoogleMapController]. class TileOverlaysController extends GeometryController { diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polygon.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polygon.dart index 9f721518525e..e2147752d795 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polygon.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polygon.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -part of google_maps_flutter_web; +part of '../google_maps_flutter_web.dart'; /// The `PolygonController` class wraps a [gmaps.Polygon] and its `onTap` behavior. class PolygonController { diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polygons.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polygons.dart index 412fd156524b..708182af86f6 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polygons.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polygons.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -part of google_maps_flutter_web; +part of '../google_maps_flutter_web.dart'; /// This class manages a set of [PolygonController]s associated to a [GoogleMapController]. class PolygonsController extends GeometryController { diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polyline.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polyline.dart index 21332e4a506d..04c20d85c6f5 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polyline.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polyline.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -part of google_maps_flutter_web; +part of '../google_maps_flutter_web.dart'; /// The `PolygonController` class wraps a [gmaps.Polyline] and its `onTap` behavior. class PolylineController { diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polylines.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polylines.dart index 0384ea16cc4b..52c8c79a6b4b 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polylines.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polylines.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -part of google_maps_flutter_web; +part of '../google_maps_flutter_web.dart'; /// This class manages a set of [PolylinesController]s associated to a [GoogleMapController]. class PolylinesController extends GeometryController { diff --git a/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml index 4d1010619f51..2293fe78c14a 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter_web description: Web platform implementation of google_maps_flutter repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 -version: 0.5.4+2 +version: 0.5.4+3 environment: sdk: ">=3.1.0 <4.0.0" diff --git a/packages/google_sign_in/google_sign_in/test/google_sign_in_test.dart b/packages/google_sign_in/google_sign_in/test/google_sign_in_test.dart index 94fabc58aec4..9ca4124157f3 100644 --- a/packages/google_sign_in/google_sign_in/test/google_sign_in_test.dart +++ b/packages/google_sign_in/google_sign_in/test/google_sign_in_test.dart @@ -13,7 +13,7 @@ import 'package:mockito/mockito.dart'; import 'google_sign_in_test.mocks.dart'; /// Verify that [GoogleSignInAccount] can be mocked even though it's unused -// ignore: avoid_implementing_value_types, must_be_immutable +// ignore: avoid_implementing_value_types, must_be_immutable, unreachable_from_main class MockGoogleSignInAccount extends Mock implements GoogleSignInAccount {} @GenerateMocks([GoogleSignInPlatform]) diff --git a/packages/google_sign_in/google_sign_in_web/CHANGELOG.md b/packages/google_sign_in/google_sign_in_web/CHANGELOG.md index a5cbeea796a6..73a6b806ac13 100644 --- a/packages/google_sign_in/google_sign_in_web/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in_web/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.12.3+2 + +* Fixes new lint warnings. + ## 0.12.3+1 * Updates `FlexHtmlElementView` (the widget backing `renderButton`) to not diff --git a/packages/google_sign_in/google_sign_in_web/example/lib/src/button_configuration_column.dart b/packages/google_sign_in/google_sign_in_web/example/lib/src/button_configuration_column.dart index 455781f0767c..75ea09559790 100644 --- a/packages/google_sign_in/google_sign_in_web/example/lib/src/button_configuration_column.dart +++ b/packages/google_sign_in/google_sign_in_web/example/lib/src/button_configuration_column.dart @@ -187,7 +187,7 @@ GSIButtonConfiguration _copyConfigWith( } /// Returns a function that modifies the `current` configuration with a `value`, then calls `fn` with it. -Function(T?)? _onChanged( +void Function(T?)? _onChanged( GSIButtonConfiguration? current, OnWebConfigChangeFn? fn) { if (fn == null) { return null; diff --git a/packages/google_sign_in/google_sign_in_web/lib/google_sign_in_web.dart b/packages/google_sign_in/google_sign_in_web/lib/google_sign_in_web.dart index d2cf1420da7c..a7ce3f43c6a0 100644 --- a/packages/google_sign_in/google_sign_in_web/lib/google_sign_in_web.dart +++ b/packages/google_sign_in/google_sign_in_web/lib/google_sign_in_web.dart @@ -6,7 +6,7 @@ import 'dart:async'; import 'dart:js_interop'; import 'dart:ui_web' as ui_web; -import 'package:flutter/foundation.dart' show visibleForTesting, kDebugMode; +import 'package:flutter/foundation.dart' show kDebugMode, visibleForTesting; import 'package:flutter/material.dart'; import 'package:flutter/services.dart' show PlatformException; import 'package:flutter/widgets.dart'; diff --git a/packages/google_sign_in/google_sign_in_web/pubspec.yaml b/packages/google_sign_in/google_sign_in_web/pubspec.yaml index 90697ff63c17..834e666b34ae 100644 --- a/packages/google_sign_in/google_sign_in_web/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_web/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Google Sign-In, a secure authentication system for signing in with a Google account on Android, iOS and Web. repository: https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22 -version: 0.12.3+1 +version: 0.12.3+2 environment: sdk: ">=3.2.0 <4.0.0" diff --git a/packages/image_picker/image_picker/CHANGELOG.md b/packages/image_picker/image_picker/CHANGELOG.md index 03b66b572c83..825e91286e3e 100644 --- a/packages/image_picker/image_picker/CHANGELOG.md +++ b/packages/image_picker/image_picker/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.6 + +* Fixes new lint warnings. + ## 1.0.5 * Updates example app to use non-deprecated video_player method. diff --git a/packages/image_picker/image_picker/lib/image_picker.dart b/packages/image_picker/image_picker/lib/image_picker.dart index b613ed8d35fd..0ad4afc74ef7 100755 --- a/packages/image_picker/image_picker/lib/image_picker.dart +++ b/packages/image_picker/image_picker/lib/image_picker.dart @@ -8,15 +8,15 @@ import 'package:image_picker_platform_interface/image_picker_platform_interface. export 'package:image_picker_platform_interface/image_picker_platform_interface.dart' show - kTypeImage, - kTypeVideo, - ImageSource, CameraDevice, + ImageSource, LostData, LostDataResponse, PickedFile, + RetrieveType, XFile, - RetrieveType; + kTypeImage, + kTypeVideo; /// Provides an easy way to pick an image/video from the image library, /// or to take a picture/video with the camera. diff --git a/packages/image_picker/image_picker/pubspec.yaml b/packages/image_picker/image_picker/pubspec.yaml index 7fde8ca7bb64..5095af7acabe 100755 --- a/packages/image_picker/image_picker/pubspec.yaml +++ b/packages/image_picker/image_picker/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for selecting images from the Android and iOS image library, and taking new pictures with the camera. repository: https://github.com/flutter/packages/tree/main/packages/image_picker/image_picker issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22 -version: 1.0.5 +version: 1.0.6 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/image_picker/image_picker_android/CHANGELOG.md b/packages/image_picker/image_picker_android/CHANGELOG.md index 66a8a8537515..c0b84ef80629 100644 --- a/packages/image_picker/image_picker_android/CHANGELOG.md +++ b/packages/image_picker/image_picker_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.8.9+2 + +* Fixes new lint warnings. + ## 0.8.9+1 * Updates plugin and example Gradle versions to 7.6.3. diff --git a/packages/image_picker/image_picker_android/example/lib/main.dart b/packages/image_picker/image_picker_android/example/lib/main.dart index e9abf0c70c34..94cbd7dcc3a6 100755 --- a/packages/image_picker/image_picker_android/example/lib/main.dart +++ b/packages/image_picker/image_picker_android/example/lib/main.dart @@ -17,6 +17,7 @@ import 'package:image_picker_platform_interface/image_picker_platform_interface. import 'package:mime/mime.dart'; import 'package:video_player/video_player.dart'; +@pragma('vm:entry-point') void appMain() { enableFlutterDriverExtension(); main(); diff --git a/packages/image_picker/image_picker_android/pubspec.yaml b/packages/image_picker/image_picker_android/pubspec.yaml index 03a46ad1b873..80e0d24f3130 100755 --- a/packages/image_picker/image_picker_android/pubspec.yaml +++ b/packages/image_picker/image_picker_android/pubspec.yaml @@ -2,7 +2,7 @@ name: image_picker_android description: Android implementation of the image_picker plugin. repository: https://github.com/flutter/packages/tree/main/packages/image_picker/image_picker_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22 -version: 0.8.9+1 +version: 0.8.9+2 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/image_picker/image_picker_platform_interface/CHANGELOG.md b/packages/image_picker/image_picker_platform_interface/CHANGELOG.md index cbb24a01d7c8..28a026ab8699 100644 --- a/packages/image_picker/image_picker_platform_interface/CHANGELOG.md +++ b/packages/image_picker/image_picker_platform_interface/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 2.9.2 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Fixes new lint warnings. ## 2.9.1 diff --git a/packages/image_picker/image_picker_platform_interface/lib/src/method_channel/method_channel_image_picker.dart b/packages/image_picker/image_picker_platform_interface/lib/src/method_channel/method_channel_image_picker.dart index b21fd29a8d2d..95f571c6df7e 100644 --- a/packages/image_picker/image_picker_platform_interface/lib/src/method_channel/method_channel_image_picker.dart +++ b/packages/image_picker/image_picker_platform_interface/lib/src/method_channel/method_channel_image_picker.dart @@ -312,13 +312,10 @@ class MethodChannelImagePicker extends ImagePickerPlatform { switch (type) { case kTypeImage: retrieveType = RetrieveType.image; - break; case kTypeVideo: retrieveType = RetrieveType.video; - break; case kTypeMedia: retrieveType = RetrieveType.media; - break; } PlatformException? exception; diff --git a/packages/image_picker/image_picker_platform_interface/lib/src/types/media_selection_type.dart b/packages/image_picker/image_picker_platform_interface/lib/src/types/media_selection_type.dart index cd0113497ea1..0420aebd993e 100644 --- a/packages/image_picker/image_picker_platform_interface/lib/src/types/media_selection_type.dart +++ b/packages/image_picker/image_picker_platform_interface/lib/src/types/media_selection_type.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import '../../image_picker_platform_interface.dart'; - /// The type of media to allow the user to select with [ImagePickerPlatform.getMedia]. enum MediaSelectionType { /// Static pictures. diff --git a/packages/image_picker/image_picker_platform_interface/pubspec.yaml b/packages/image_picker/image_picker_platform_interface/pubspec.yaml index f72478a3243a..64fd5b7c7982 100644 --- a/packages/image_picker/image_picker_platform_interface/pubspec.yaml +++ b/packages/image_picker/image_picker_platform_interface/pubspec.yaml @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/image_picker/ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22 # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 2.9.1 +version: 2.9.2 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/image_picker/image_picker_platform_interface/test/picked_file_html_test.dart b/packages/image_picker/image_picker_platform_interface/test/picked_file_html_test.dart index 17233376114a..b5036946eb0f 100644 --- a/packages/image_picker/image_picker_platform_interface/test/picked_file_html_test.dart +++ b/packages/image_picker/image_picker_platform_interface/test/picked_file_html_test.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. @TestOn('chrome') // Uses web-only Flutter SDK +library; import 'dart:convert'; import 'dart:html' as html; diff --git a/packages/image_picker/image_picker_platform_interface/test/picked_file_io_test.dart b/packages/image_picker/image_picker_platform_interface/test/picked_file_io_test.dart index 3e6cd0e01ca6..14b6a8b41392 100644 --- a/packages/image_picker/image_picker_platform_interface/test/picked_file_io_test.dart +++ b/packages/image_picker/image_picker_platform_interface/test/picked_file_io_test.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. @TestOn('vm') // Uses dart:io +library; import 'dart:convert'; import 'dart:io'; diff --git a/packages/in_app_purchase/in_app_purchase/CHANGELOG.md b/packages/in_app_purchase/in_app_purchase/CHANGELOG.md index b1ba56d81f37..d3d915c966a3 100644 --- a/packages/in_app_purchase/in_app_purchase/CHANGELOG.md +++ b/packages/in_app_purchase/in_app_purchase/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 3.1.12 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Fixes new lint warnings. ## 3.1.11 diff --git a/packages/in_app_purchase/in_app_purchase/lib/in_app_purchase.dart b/packages/in_app_purchase/in_app_purchase/lib/in_app_purchase.dart index 9ca7232fbe87..c7a48b48dc22 100644 --- a/packages/in_app_purchase/in_app_purchase/lib/in_app_purchase.dart +++ b/packages/in_app_purchase/in_app_purchase/lib/in_app_purchase.dart @@ -15,8 +15,8 @@ export 'package:in_app_purchase_platform_interface/in_app_purchase_platform_inte ProductDetailsResponse, PurchaseDetails, PurchaseParam, - PurchaseVerificationData, - PurchaseStatus; + PurchaseStatus, + PurchaseVerificationData; /// Basic API for making in app purchases across multiple platforms. class InAppPurchase implements InAppPurchasePlatformAdditionProvider { diff --git a/packages/in_app_purchase/in_app_purchase/pubspec.yaml b/packages/in_app_purchase/in_app_purchase/pubspec.yaml index ba20c18bce36..3dbb1fafda4b 100644 --- a/packages/in_app_purchase/in_app_purchase/pubspec.yaml +++ b/packages/in_app_purchase/in_app_purchase/pubspec.yaml @@ -2,7 +2,7 @@ name: in_app_purchase description: A Flutter plugin for in-app purchases. Exposes APIs for making in-app purchases through the App Store and Google Play. repository: https://github.com/flutter/packages/tree/main/packages/in_app_purchase/in_app_purchase issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22 -version: 3.1.11 +version: 3.1.12 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md b/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md index 8add9459630d..fb472b9d18e0 100644 --- a/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md +++ b/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 0.3.0+16 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Fixes new lint warnings. ## 0.3.0+15 diff --git a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_client_wrapper.dart b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_client_wrapper.dart index 80da270703a9..12067d51451a 100644 --- a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_client_wrapper.dart +++ b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_client_wrapper.dart @@ -335,7 +335,6 @@ class BillingClient { _callbacks[kOnPurchasesUpdated]!.first as PurchasesUpdatedListener; listener(PurchasesResultWrapper.fromJson( (call.arguments as Map).cast())); - break; case _kOnBillingServiceDisconnected: final int handle = (call.arguments as Map)['handle']! as int; @@ -343,7 +342,6 @@ class BillingClient { _callbacks[_kOnBillingServiceDisconnected]! .cast(); onDisconnected[handle](); - break; } } } diff --git a/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml b/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml index bf35d43b6091..ca3dc7e73f63 100644 --- a/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml +++ b/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml @@ -2,7 +2,7 @@ name: in_app_purchase_android description: An implementation for the Android platform of the Flutter `in_app_purchase` plugin. This uses the Android BillingClient APIs. repository: https://github.com/flutter/packages/tree/main/packages/in_app_purchase/in_app_purchase_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22 -version: 0.3.0+15 +version: 0.3.0+16 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/in_app_purchase/in_app_purchase_android/test/billing_client_wrappers/billing_client_wrapper_test.dart b/packages/in_app_purchase/in_app_purchase_android/test/billing_client_wrappers/billing_client_wrapper_test.dart index 97e3bc64c913..a840bd2d0606 100644 --- a/packages/in_app_purchase/in_app_purchase_android/test/billing_client_wrappers/billing_client_wrapper_test.dart +++ b/packages/in_app_purchase/in_app_purchase_android/test/billing_client_wrappers/billing_client_wrapper_test.dart @@ -11,6 +11,20 @@ import '../stub_in_app_purchase_platform.dart'; import 'product_details_wrapper_test.dart'; import 'purchase_wrapper_test.dart'; +const PurchaseWrapper dummyOldPurchase = PurchaseWrapper( + orderId: 'oldOrderId', + packageName: 'oldPackageName', + purchaseTime: 0, + signature: 'oldSignature', + products: ['oldProduct'], + purchaseToken: 'oldPurchaseToken', + isAutoRenewing: false, + originalJson: '', + developerPayload: 'old dummy payload', + isAcknowledged: true, + purchaseState: PurchaseStateWrapper.purchased, +); + void main() { TestWidgetsFlutterBinding.ensureInitialized(); diff --git a/packages/in_app_purchase/in_app_purchase_android/test/billing_client_wrappers/purchase_wrapper_test.dart b/packages/in_app_purchase/in_app_purchase_android/test/billing_client_wrappers/purchase_wrapper_test.dart index 8da1abb8d66e..14cd446bf8a0 100644 --- a/packages/in_app_purchase/in_app_purchase_android/test/billing_client_wrappers/purchase_wrapper_test.dart +++ b/packages/in_app_purchase/in_app_purchase_android/test/billing_client_wrappers/purchase_wrapper_test.dart @@ -60,20 +60,6 @@ const PurchaseHistoryRecordWrapper dummyPurchaseHistoryRecord = developerPayload: 'dummy payload', ); -const PurchaseWrapper dummyOldPurchase = PurchaseWrapper( - orderId: 'oldOrderId', - packageName: 'oldPackageName', - purchaseTime: 0, - signature: 'oldSignature', - products: ['oldProduct'], - purchaseToken: 'oldPurchaseToken', - isAutoRenewing: false, - originalJson: '', - developerPayload: 'old dummy payload', - isAcknowledged: true, - purchaseState: PurchaseStateWrapper.purchased, -); - void main() { group('PurchaseWrapper', () { test('converts from map', () { diff --git a/packages/in_app_purchase/in_app_purchase_android/test/in_app_purchase_android_platform_test.dart b/packages/in_app_purchase/in_app_purchase_android/test/in_app_purchase_android_platform_test.dart index 205e1b0653b4..330e68cff80a 100644 --- a/packages/in_app_purchase/in_app_purchase_android/test/in_app_purchase_android_platform_test.dart +++ b/packages/in_app_purchase/in_app_purchase_android/test/in_app_purchase_android_platform_test.dart @@ -374,8 +374,8 @@ void main() { final Stream> purchaseStream = iapAndroidPlatform.purchaseStream; late StreamSubscription> subscription; - subscription = purchaseStream.listen((_) { - purchaseDetails = _.first; + subscription = purchaseStream.listen((List details) { + purchaseDetails = details.first; completer.complete(purchaseDetails); subscription.cancel(); }, onDone: () {}); @@ -419,8 +419,8 @@ void main() { final Stream> purchaseStream = iapAndroidPlatform.purchaseStream; late StreamSubscription> subscription; - subscription = purchaseStream.listen((_) { - purchaseDetails = _.first; + subscription = purchaseStream.listen((List details) { + purchaseDetails = details.first; completer.complete(purchaseDetails); subscription.cancel(); }, onDone: () {}); @@ -493,8 +493,8 @@ void main() { final Stream> purchaseStream = iapAndroidPlatform.purchaseStream; late StreamSubscription> subscription; - subscription = purchaseStream.listen((_) { - purchaseDetails = _.first; + subscription = purchaseStream.listen((List details) { + purchaseDetails = details.first; completer.complete(purchaseDetails); subscription.cancel(); }, onDone: () {}); @@ -611,8 +611,8 @@ void main() { final Stream> purchaseStream = iapAndroidPlatform.purchaseStream; late StreamSubscription> subscription; - subscription = purchaseStream.listen((_) { - purchaseDetails = _.first; + subscription = purchaseStream.listen((List details) { + purchaseDetails = details.first; completer.complete(purchaseDetails); subscription.cancel(); }, onDone: () {}); @@ -757,8 +757,8 @@ void main() { final Stream> purchaseStream = iapAndroidPlatform.purchaseStream; late StreamSubscription> subscription; - subscription = purchaseStream.listen((_) { - purchaseDetails = _.first; + subscription = purchaseStream.listen((List details) { + purchaseDetails = details.first; completer.complete(purchaseDetails); subscription.cancel(); }, onDone: () {}); @@ -802,8 +802,8 @@ void main() { final Stream> purchaseStream = iapAndroidPlatform.purchaseStream; late StreamSubscription> subscription; - subscription = purchaseStream.listen((_) { - purchaseDetails = _.first; + subscription = purchaseStream.listen((List details) { + purchaseDetails = details.first; completer.complete(purchaseDetails); subscription.cancel(); }, onDone: () {}); diff --git a/packages/in_app_purchase/in_app_purchase_storekit/CHANGELOG.md b/packages/in_app_purchase/in_app_purchase_storekit/CHANGELOG.md index 671ab459c9a6..3401e141573e 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/CHANGELOG.md +++ b/packages/in_app_purchase/in_app_purchase_storekit/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 0.3.8 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Fixes new lint warnings. ## 0.3.7 diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/in_app_purchase_storekit_platform.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/in_app_purchase_storekit_platform.dart index 36d706ce5fe9..9dbdc4785788 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/in_app_purchase_storekit_platform.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/in_app_purchase_storekit_platform.dart @@ -86,7 +86,7 @@ class InAppPurchaseStoreKitPlatform extends InAppPurchasePlatform { @override Future buyConsumable( {required PurchaseParam purchaseParam, bool autoConsume = true}) { - assert(autoConsume == true, 'On iOS, we should always auto consume'); + assert(autoConsume, 'On iOS, we should always auto consume'); return buyNonConsumable(purchaseParam: purchaseParam); } diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart index 7682714ab9cd..eace938c574b 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart @@ -267,8 +267,7 @@ class SKPaymentQueueWrapper { .cast()); return Future(() { if (observer.shouldAddStorePayment( - payment: payment, product: product) == - true) { + payment: payment, product: product)) { SKPaymentQueueWrapper().addPayment(payment); } }); diff --git a/packages/in_app_purchase/in_app_purchase_storekit/pubspec.yaml b/packages/in_app_purchase/in_app_purchase_storekit/pubspec.yaml index 21801b3b05dc..cc9cb27d4878 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/pubspec.yaml +++ b/packages/in_app_purchase/in_app_purchase_storekit/pubspec.yaml @@ -2,7 +2,7 @@ name: in_app_purchase_storekit description: An implementation for the iOS and macOS platforms of the Flutter `in_app_purchase` plugin. This uses the StoreKit Framework. repository: https://github.com/flutter/packages/tree/main/packages/in_app_purchase/in_app_purchase_storekit issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22 -version: 0.3.7 +version: 0.3.8 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/in_app_purchase/in_app_purchase_storekit/test/fakes/fake_storekit_platform.dart b/packages/in_app_purchase/in_app_purchase_storekit/test/fakes/fake_storekit_platform.dart index 6ae002c82517..c73ba81e3477 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/test/fakes/fake_storekit_platform.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/test/fakes/fake_storekit_platform.dart @@ -211,20 +211,16 @@ class FakeStoreKitPlatform { InAppPurchaseStoreKitPlatform.observer.updatedTransactions( transactions: [transactionFinished]); } - break; case '-[InAppPurchasePlugin finishTransaction:result:]': final Map arguments = _getArgumentDictionary(call); finishedTransactions.add(createPurchasedTransaction( arguments['productIdentifier']! as String, arguments['transactionIdentifier']! as String, quantity: transactions.first.payment.quantity)); - break; case '-[SKPaymentQueue startObservingTransactionQueue]': queueIsActive = true; - break; case '-[SKPaymentQueue stopObservingTransactionQueue]': queueIsActive = false; - break; } return Future.sync(() {}); } diff --git a/packages/local_auth/local_auth_platform_interface/CHANGELOG.md b/packages/local_auth/local_auth_platform_interface/CHANGELOG.md index 835f502a9459..c9ace953ef1e 100644 --- a/packages/local_auth/local_auth_platform_interface/CHANGELOG.md +++ b/packages/local_auth/local_auth_platform_interface/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 1.0.9 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Fixes new lint warnings. ## 1.0.8 diff --git a/packages/local_auth/local_auth_platform_interface/lib/default_method_channel_platform.dart b/packages/local_auth/local_auth_platform_interface/lib/default_method_channel_platform.dart index b3b0a653b514..f40bc7914bab 100644 --- a/packages/local_auth/local_auth_platform_interface/lib/default_method_channel_platform.dart +++ b/packages/local_auth/local_auth_platform_interface/lib/default_method_channel_platform.dart @@ -46,13 +46,10 @@ class DefaultLocalAuthPlatform extends LocalAuthPlatform { switch (value) { case 'face': biometrics.add(BiometricType.face); - break; case 'fingerprint': biometrics.add(BiometricType.fingerprint); - break; case 'iris': biometrics.add(BiometricType.iris); - break; case 'undefined': // Sentinel value for the case when nothing is enrolled, but hardware // support for biometrics is available. diff --git a/packages/local_auth/local_auth_platform_interface/pubspec.yaml b/packages/local_auth/local_auth_platform_interface/pubspec.yaml index 4b860d543a4e..d623b7b36af7 100644 --- a/packages/local_auth/local_auth_platform_interface/pubspec.yaml +++ b/packages/local_auth/local_auth_platform_interface/pubspec.yaml @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/local_auth/lo issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+local_auth%22 # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 1.0.8 +version: 1.0.9 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/metrics_center/test/skiaperf_test.dart b/packages/metrics_center/test/skiaperf_test.dart index b4a6d573a86c..8a015cbd83e6 100644 --- a/packages/metrics_center/test/skiaperf_test.dart +++ b/packages/metrics_center/test/skiaperf_test.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. @Timeout(Duration(seconds: 3600)) +library; import 'dart:async'; import 'dart:convert'; diff --git a/packages/path_provider/path_provider_android/test/path_provider_android_test.dart b/packages/path_provider/path_provider_android/test/path_provider_android_test.dart index 6d31a3cd6e50..10c4cd0f2d63 100644 --- a/packages/path_provider/path_provider_android/test/path_provider_android_test.dart +++ b/packages/path_provider/path_provider_android/test/path_provider_android_test.dart @@ -10,12 +10,10 @@ import 'messages_test.g.dart'; const String kTemporaryPath = 'temporaryPath'; const String kApplicationSupportPath = 'applicationSupportPath'; -const String kLibraryPath = 'libraryPath'; const String kApplicationDocumentsPath = 'applicationDocumentsPath'; const String kApplicationCachePath = 'applicationCachePath'; const String kExternalCachePaths = 'externalCachePaths'; const String kExternalStoragePaths = 'externalStoragePaths'; -const String kDownloadsPath = 'downloadsPath'; class _Api implements TestPathProviderApi { _Api({this.returnsExternalStoragePaths = true}); diff --git a/packages/path_provider/path_provider_windows/test/path_provider_windows_test.dart b/packages/path_provider/path_provider_windows/test/path_provider_windows_test.dart index dd8fead6668c..f60b70fb39d7 100644 --- a/packages/path_provider/path_provider_windows/test/path_provider_windows_test.dart +++ b/packages/path_provider/path_provider_windows/test/path_provider_windows_test.dart @@ -1,6 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. + import 'dart:ffi'; import 'dart:io'; @@ -8,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:path_provider_platform_interface/path_provider_platform_interface.dart'; import 'package:path_provider_windows/path_provider_windows.dart'; import 'package:path_provider_windows/src/path_provider_windows_real.dart' - show languageEn, encodingCP1252, encodingUnicode; + show encodingCP1252, encodingUnicode, languageEn; // A fake VersionInfoQuerier that just returns preset responses. class FakeVersionInfoQuerier implements VersionInfoQuerier { @@ -22,6 +23,7 @@ class FakeVersionInfoQuerier implements VersionInfoQuerier { final String encoding; final Map responses; + // ignore: unreachable_from_main String? getStringValue( Pointer? versionInfo, String key, { diff --git a/packages/pigeon/CHANGELOG.md b/packages/pigeon/CHANGELOG.md index 54a50c319ef1..e1450041324d 100644 --- a/packages/pigeon/CHANGELOG.md +++ b/packages/pigeon/CHANGELOG.md @@ -1,3 +1,7 @@ +## 15.0.3 + +* Fixes new lint warnings. + ## 15.0.2 * Prevents optional and non-positional parameters in Flutter APIs. diff --git a/packages/pigeon/lib/cpp_generator.dart b/packages/pigeon/lib/cpp_generator.dart index 41c8226bb806..5247f424052e 100644 --- a/packages/pigeon/lib/cpp_generator.dart +++ b/packages/pigeon/lib/cpp_generator.dart @@ -1791,13 +1791,10 @@ void _writeAccessBlock( switch (access) { case _ClassAccess.public: accessLabel = 'public'; - break; case _ClassAccess.protected: accessLabel = 'protected'; - break; case _ClassAccess.private: accessLabel = 'private'; - break; } indent.addScoped(' $accessLabel:', '', body); } diff --git a/packages/pigeon/lib/generator_tools.dart b/packages/pigeon/lib/generator_tools.dart index a510b55bd74c..fcf255bb8bf0 100644 --- a/packages/pigeon/lib/generator_tools.dart +++ b/packages/pigeon/lib/generator_tools.dart @@ -13,7 +13,7 @@ import 'ast.dart'; /// The current version of pigeon. /// /// This must match the version in pubspec.yaml. -const String pigeonVersion = '15.0.2'; +const String pigeonVersion = '15.0.3'; /// Read all the content from [stdin] to a String. String readStdin() { diff --git a/packages/pigeon/pubspec.yaml b/packages/pigeon/pubspec.yaml index 67f7fa73e691..09b821814534 100644 --- a/packages/pigeon/pubspec.yaml +++ b/packages/pigeon/pubspec.yaml @@ -2,7 +2,7 @@ name: pigeon description: Code generator tool to make communication between Flutter and the host platform type-safe and easier. repository: https://github.com/flutter/packages/tree/main/packages/pigeon issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+pigeon%22 -version: 15.0.2 # This must match the version in lib/generator_tools.dart +version: 15.0.3 # This must match the version in lib/generator_tools.dart environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/pigeon/tool/run_tests.dart b/packages/pigeon/tool/run_tests.dart index 0d7523bae976..6d6639246103 100644 --- a/packages/pigeon/tool/run_tests.dart +++ b/packages/pigeon/tool/run_tests.dart @@ -9,6 +9,8 @@ /// /// For any use other than CI, use test.dart instead. //////////////////////////////////////////////////////////////////////////////// +library; + import 'dart:io'; import 'package:path/path.dart' as p; diff --git a/packages/pigeon/tool/shared/test_suites.dart b/packages/pigeon/tool/shared/test_suites.dart index aecc380ef47e..b11fc9a644c5 100644 --- a/packages/pigeon/tool/shared/test_suites.dart +++ b/packages/pigeon/tool/shared/test_suites.dart @@ -4,7 +4,7 @@ // ignore_for_file: avoid_print -import 'dart:io' show File, Directory; +import 'dart:io' show Directory, File; import 'package:meta/meta.dart'; import 'package:path/path.dart' as p; diff --git a/packages/pigeon/tool/test.dart b/packages/pigeon/tool/test.dart index 83c09684c05c..4c3eab669f1d 100644 --- a/packages/pigeon/tool/test.dart +++ b/packages/pigeon/tool/test.dart @@ -9,6 +9,8 @@ /// /// usage: dart run tool/test.dart //////////////////////////////////////////////////////////////////////////////// +library; + import 'dart:io' show Platform, exit; import 'dart:math'; diff --git a/packages/platform/CHANGELOG.md b/packages/platform/CHANGELOG.md index f489d837058c..4c96a4197de3 100644 --- a/packages/platform/CHANGELOG.md +++ b/packages/platform/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 3.1.4 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Fixes new lint warnings. ## 3.1.3 diff --git a/packages/platform/lib/platform.dart b/packages/platform/lib/platform.dart index 91cd76e3bb46..f096dcb410ee 100644 --- a/packages/platform/lib/platform.dart +++ b/packages/platform/lib/platform.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/// Core interfaces & classes. +// Core interfaces & classes. export 'src/interface/local_platform.dart'; export 'src/interface/platform.dart'; export 'src/testing/fake_platform.dart'; diff --git a/packages/platform/pubspec.yaml b/packages/platform/pubspec.yaml index f580697e6fe7..564b7cca5472 100644 --- a/packages/platform/pubspec.yaml +++ b/packages/platform/pubspec.yaml @@ -2,7 +2,7 @@ name: platform description: A pluggable, mockable platform information abstraction for Dart. repository: https://github.com/flutter/packages/tree/main/packages/platform issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+platform%22 -version: 3.1.3 +version: 3.1.4 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/plugin_platform_interface/CHANGELOG.md b/packages/plugin_platform_interface/CHANGELOG.md index 3ad68b19a606..41e8982ecb95 100644 --- a/packages/plugin_platform_interface/CHANGELOG.md +++ b/packages/plugin_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.1.8 + +* Fixes new lint warnings. + ## 2.1.7 * Changes `MockPlatformInterfaceMixin` to a `mixin class` for better diff --git a/packages/plugin_platform_interface/lib/plugin_platform_interface.dart b/packages/plugin_platform_interface/lib/plugin_platform_interface.dart index 63408dd1e37e..323095478326 100644 --- a/packages/plugin_platform_interface/lib/plugin_platform_interface.dart +++ b/packages/plugin_platform_interface/lib/plugin_platform_interface.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -library plugin_platform_interface; - import 'package:meta/meta.dart'; /// Base class for platform interfaces. diff --git a/packages/plugin_platform_interface/pubspec.yaml b/packages/plugin_platform_interface/pubspec.yaml index 549b148afd29..6787f94aa082 100644 --- a/packages/plugin_platform_interface/pubspec.yaml +++ b/packages/plugin_platform_interface/pubspec.yaml @@ -15,7 +15,7 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ # be done when absolutely necessary and after the ecosystem has already migrated to 2.X.Y version # that is forward compatible with 3.0.0 (ideally the ecosystem have migrated to depend on: # `plugin_platform_interface: >=2.X.Y <4.0.0`). -version: 2.1.7 +version: 2.1.8 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/plugin_platform_interface/test/plugin_platform_interface_test.dart b/packages/plugin_platform_interface/test/plugin_platform_interface_test.dart index 00da4a129f5e..294790d5366c 100644 --- a/packages/plugin_platform_interface/test/plugin_platform_interface_test.dart +++ b/packages/plugin_platform_interface/test/plugin_platform_interface_test.dart @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// Unreachable code is used in docregion. +// ignore_for_file: unreachable_from_main + import 'package:mockito/mockito.dart'; import 'package:plugin_platform_interface/plugin_platform_interface.dart'; import 'package:test/test.dart'; diff --git a/packages/pointer_interceptor/pointer_interceptor/CHANGELOG.md b/packages/pointer_interceptor/pointer_interceptor/CHANGELOG.md index 5c65bae804aa..3729e3bd94a6 100644 --- a/packages/pointer_interceptor/pointer_interceptor/CHANGELOG.md +++ b/packages/pointer_interceptor/pointer_interceptor/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.10.1 + +* Fixes new lint warnings. + ## 0.10.0 * Transitions to federated architecture. diff --git a/packages/pointer_interceptor/pointer_interceptor/lib/pointer_interceptor.dart b/packages/pointer_interceptor/pointer_interceptor/lib/pointer_interceptor.dart index ba15650c46ed..9c1fda3e218b 100644 --- a/packages/pointer_interceptor/pointer_interceptor/lib/pointer_interceptor.dart +++ b/packages/pointer_interceptor/pointer_interceptor/lib/pointer_interceptor.dart @@ -2,7 +2,5 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -library pointer_interceptor; - export 'package:pointer_interceptor/src/pointer_interceptor.dart'; export 'package:pointer_interceptor_platform_interface/pointer_interceptor_platform_interface.dart'; diff --git a/packages/pointer_interceptor/pointer_interceptor/pubspec.yaml b/packages/pointer_interceptor/pointer_interceptor/pubspec.yaml index 4915a62e6f8f..5846d73014f3 100644 --- a/packages/pointer_interceptor/pointer_interceptor/pubspec.yaml +++ b/packages/pointer_interceptor/pointer_interceptor/pubspec.yaml @@ -2,7 +2,7 @@ name: pointer_interceptor description: A widget to prevent clicks from being swallowed by underlying HtmlElementViews on the web. repository: https://github.com/flutter/packages/tree/main/packages/pointer_interceptor/pointer_interceptor issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+pointer_interceptor%22 -version: 0.10.0 +version: 0.10.1 environment: sdk: ">=3.1.0 <4.0.0" diff --git a/packages/process/CHANGELOG.md b/packages/process/CHANGELOG.md index a3a1f1264324..49852187099a 100644 --- a/packages/process/CHANGELOG.md +++ b/packages/process/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 5.0.2 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Fixes new lint warnings. ## 5.0.1 diff --git a/packages/process/lib/src/interface/local_process_manager.dart b/packages/process/lib/src/interface/local_process_manager.dart index 9606a4a671b1..fd0d1c2ced95 100644 --- a/packages/process/lib/src/interface/local_process_manager.dart +++ b/packages/process/lib/src/interface/local_process_manager.dart @@ -6,10 +6,10 @@ import 'dart:convert'; import 'dart:io' show Process, + ProcessException, ProcessResult, ProcessSignal, ProcessStartMode, - ProcessException, systemEncoding; import 'common.dart'; diff --git a/packages/process/pubspec.yaml b/packages/process/pubspec.yaml index 73a1e44d1423..5f284c7bf1c6 100644 --- a/packages/process/pubspec.yaml +++ b/packages/process/pubspec.yaml @@ -2,7 +2,7 @@ name: process description: A pluggable, mockable process invocation abstraction for Dart. repository: https://github.com/flutter/packages/tree/main/packages/process issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+process%22 -version: 5.0.1 +version: 5.0.2 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/quick_actions/quick_actions/test/quick_actions_test.dart b/packages/quick_actions/quick_actions/test/quick_actions_test.dart index be9fd5e7720a..8e93b55fcd19 100644 --- a/packages/quick_actions/quick_actions/test/quick_actions_test.dart +++ b/packages/quick_actions/quick_actions/test/quick_actions_test.dart @@ -66,5 +66,3 @@ class MockQuickActionsPlatform extends Mock Future setShortcutItems(List? items) async => super .noSuchMethod(Invocation.method(#setShortcutItems, [items])); } - -class MockQuickActions extends QuickActions {} diff --git a/packages/quick_actions/quick_actions_ios/test/quick_actions_ios_test.dart b/packages/quick_actions/quick_actions_ios/test/quick_actions_ios_test.dart index c2e281a1a14a..eff84081274d 100644 --- a/packages/quick_actions/quick_actions_ios/test/quick_actions_ios_test.dart +++ b/packages/quick_actions/quick_actions_ios/test/quick_actions_ios_test.dart @@ -7,8 +7,6 @@ import 'package:quick_actions_ios/messages.g.dart'; import 'package:quick_actions_ios/quick_actions_ios.dart'; import 'package:quick_actions_platform_interface/quick_actions_platform_interface.dart'; -const String LAUNCH_ACTION_STRING = 'aString'; - void main() { TestWidgetsFlutterBinding.ensureInitialized(); diff --git a/packages/rfw/CHANGELOG.md b/packages/rfw/CHANGELOG.md index 986072d8433e..75c3c449ac09 100644 --- a/packages/rfw/CHANGELOG.md +++ b/packages/rfw/CHANGELOG.md @@ -1,4 +1,4 @@ -## NEXT +## 1.0.16 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. * Fixes lint warnings. diff --git a/packages/rfw/README.md b/packages/rfw/README.md index 4f967a57a718..623c9ec45a7c 100644 --- a/packages/rfw/README.md +++ b/packages/rfw/README.md @@ -298,7 +298,7 @@ class _ExampleState extends State { static WidgetLibrary _createLocalWidgets() { return LocalWidgetLibrary({ 'GreenBox': (BuildContext context, DataSource source) { - return Container( + return ColoredBox( color: const Color(0xFF002211), child: source.child(['child']), ); @@ -522,7 +522,7 @@ to obtain the widget, in a manner similar to the `v` method: ```rfwtxt 'GreenBox': (BuildContext context, DataSource source) { - return Container(color: const Color(0xFF002211), child: source.child(['child'])); + return ColoredBox(color: const Color(0xFF002211), child: source.child(['child'])); }, ``` @@ -534,7 +534,7 @@ argument that isn't a widget, the `child` method returns an ```rfwtxt 'GreenBox': (BuildContext context, DataSource source) { - return Container(color: const Color(0xFF002211), child: source.optionalChild(['child'])); + return ColoredBox(color: const Color(0xFF002211), child: source.optionalChild(['child'])); }, ``` diff --git a/packages/rfw/example/local/lib/main.dart b/packages/rfw/example/local/lib/main.dart index 0b112efb4120..e7a40b493996 100644 --- a/packages/rfw/example/local/lib/main.dart +++ b/packages/rfw/example/local/lib/main.dart @@ -49,7 +49,7 @@ class _ExampleState extends State { static WidgetLibrary _createLocalWidgets() { return LocalWidgetLibrary({ 'GreenBox': (BuildContext context, DataSource source) { - return Container( + return ColoredBox( color: const Color(0xFF002211), child: source.child(['child']), ); diff --git a/packages/rfw/lib/src/dart/binary.dart b/packages/rfw/lib/src/dart/binary.dart index 4d569289bdec..f36690f2c7d0 100644 --- a/packages/rfw/lib/src/dart/binary.dart +++ b/packages/rfw/lib/src/dart/binary.dart @@ -476,10 +476,8 @@ class _BlobDecoder { switch (type) { case _msSwitch: root = _readSwitch(); - break; case _msWidget: root = _readWidget(); - break; default: throw FormatException('Unrecognized data type 0x${type.toRadixString(16).toUpperCase().padLeft(2, "0")} while decoding widget declaration root.'); } diff --git a/packages/rfw/lib/src/dart/text.dart b/packages/rfw/lib/src/dart/text.dart index 7e8a00c747e3..9ec09b5b3afc 100644 --- a/packages/rfw/lib/src/dart/text.dart +++ b/packages/rfw/lib/src/dart/text.dart @@ -805,31 +805,24 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x7B: // U+007B LEFT CURLY BRACKET character ({) case 0x7D: // U+007D RIGHT CURLY BRACKET character (}) yield _SymbolToken(current, line, column); - break; case 0x22: // U+0022 QUOTATION MARK character (") assert(buffer.isEmpty); mode = _TokenizerMode.doubleQuote; - break; case 0x27: // U+0027 APOSTROPHE character (') assert(buffer.isEmpty); mode = _TokenizerMode.quote; - break; case 0x2D: // U+002D HYPHEN-MINUS character (-) assert(buffer.isEmpty); mode = _TokenizerMode.minus; buffer.add(current); - break; case 0x2E: // U+002E FULL STOP character (.) mode = _TokenizerMode.dot1; - break; case 0x2F: // U+002F SOLIDUS character (/) mode = _TokenizerMode.slash; - break; case 0x30: // U+0030 DIGIT ZERO character (0) assert(buffer.isEmpty); mode = _TokenizerMode.zero; buffer.add(current); - break; case 0x31: // U+0031 DIGIT ONE character (1) case 0x32: // U+0032 DIGIT TWO character (2) case 0x33: // U+0033 DIGIT THREE character (3) @@ -842,7 +835,6 @@ Iterable<_Token> _tokenize(String file) sync* { assert(buffer.isEmpty); mode = _TokenizerMode.integer; buffer.add(current); - break; case 0x41: // U+0041 LATIN CAPITAL LETTER A character case 0x42: // U+0042 LATIN CAPITAL LETTER B character case 0x43: // U+0043 LATIN CAPITAL LETTER C character @@ -899,11 +891,9 @@ Iterable<_Token> _tokenize(String file) sync* { assert(buffer.isEmpty); mode = _TokenizerMode.identifier; buffer.add(current); - break; default: throw ParserException('Unexpected character ${_describeRune(current)}', line, column); } - break; case _TokenizerMode.minus: // "-" assert(buffer.length == 1 && buffer[0] == 0x2D); @@ -922,11 +912,9 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x39: // U+0039 DIGIT NINE character (9) mode = _TokenizerMode.minusInteger; buffer.add(current); - break; default: throw ParserException('Unexpected character ${_describeRune(current)} after minus sign (expected digit)', line, column); } - break; case _TokenizerMode.zero: // "0" assert(buffer.length == 1 && buffer[0] == 0x30); @@ -940,7 +928,6 @@ Iterable<_Token> _tokenize(String file) sync* { yield _IntegerToken(0, line, column); buffer.clear(); mode = _TokenizerMode.main; - break; case 0x28: // U+0028 LEFT PARENTHESIS character (() case 0x29: // U+0029 RIGHT PARENTHESIS character ()) case 0x2C: // U+002C COMMA character (,) @@ -955,11 +942,9 @@ Iterable<_Token> _tokenize(String file) sync* { buffer.clear(); yield _SymbolToken(current, line, column); mode = _TokenizerMode.main; - break; case 0x2E: // U+002E FULL STOP character (.) mode = _TokenizerMode.numericDot; buffer.add(current); - break; case 0x30: // U+0030 DIGIT ZERO character (0) case 0x31: // U+0031 DIGIT ONE character (1) case 0x32: // U+0032 DIGIT TWO character (2) @@ -972,21 +957,17 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x39: // U+0039 DIGIT NINE character (9) mode = _TokenizerMode.integer; buffer.add(current); - break; case 0x45: // U+0045 LATIN CAPITAL LETTER E character case 0x65: // U+0065 LATIN SMALL LETTER E character mode = _TokenizerMode.e; buffer.add(current); - break; case 0x58: // U+0058 LATIN CAPITAL LETTER X character case 0x78: // U+0078 LATIN SMALL LETTER X character mode = _TokenizerMode.x; buffer.clear(); - break; default: throw ParserException('Unexpected character ${_describeRune(current)} after zero', line, column); } - break; case _TokenizerMode.minusInteger: // "-0" switch (current) { @@ -999,7 +980,6 @@ Iterable<_Token> _tokenize(String file) sync* { yield _IntegerToken(int.parse(String.fromCharCodes(buffer), radix: 10), line, column); buffer.clear(); mode = _TokenizerMode.main; - break; case 0x28: // U+0028 LEFT PARENTHESIS character (() case 0x29: // U+0029 RIGHT PARENTHESIS character ()) case 0x2C: // U+002C COMMA character (,) @@ -1014,11 +994,9 @@ Iterable<_Token> _tokenize(String file) sync* { buffer.clear(); yield _SymbolToken(current, line, column); mode = _TokenizerMode.main; - break; case 0x2E: // U+002E FULL STOP character (.) mode = _TokenizerMode.numericDot; buffer.add(current); - break; case 0x30: // U+0030 DIGIT ZERO character (0) case 0x31: // U+0031 DIGIT ONE character (1) case 0x32: // U+0032 DIGIT TWO character (2) @@ -1031,16 +1009,13 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x39: // U+0039 DIGIT NINE character (9) mode = _TokenizerMode.integer; buffer.add(current); - break; case 0x45: // U+0045 LATIN CAPITAL LETTER E character case 0x65: // U+0065 LATIN SMALL LETTER E character mode = _TokenizerMode.e; buffer.add(current); - break; default: throw ParserException('Unexpected character ${_describeRune(current)} after negative zero', line, column); } - break; case _TokenizerMode.integer: // "00", "1", "-00" switch (current) { @@ -1054,7 +1029,6 @@ Iterable<_Token> _tokenize(String file) sync* { yield _IntegerToken(int.parse(String.fromCharCodes(buffer), radix: 10), line, column); buffer.clear(); mode = _TokenizerMode.main; - break; case 0x28: // U+0028 LEFT PARENTHESIS character (() case 0x29: // U+0029 RIGHT PARENTHESIS character ()) case 0x2C: // U+002C COMMA character (,) @@ -1069,11 +1043,9 @@ Iterable<_Token> _tokenize(String file) sync* { buffer.clear(); yield _SymbolToken(current, line, column); mode = _TokenizerMode.main; - break; case 0x2E: // U+002E FULL STOP character (.) mode = _TokenizerMode.numericDot; buffer.add(current); - break; case 0x30: // U+0030 DIGIT ZERO character (0) case 0x31: // U+0031 DIGIT ONE character (1) case 0x32: // U+0032 DIGIT TWO character (2) @@ -1085,16 +1057,13 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x38: // U+0038 DIGIT EIGHT character (8) case 0x39: // U+0039 DIGIT NINE character (9) buffer.add(current); - break; case 0x45: // U+0045 LATIN CAPITAL LETTER E character case 0x65: // U+0065 LATIN SMALL LETTER E character mode = _TokenizerMode.e; buffer.add(current); - break; default: throw ParserException('Unexpected character ${_describeRune(current)}', line, column); } - break; case _TokenizerMode.integerOnly: switch (current) { @@ -1108,7 +1077,6 @@ Iterable<_Token> _tokenize(String file) sync* { yield _IntegerToken(int.parse(String.fromCharCodes(buffer), radix: 10), line, column); buffer.clear(); mode = _TokenizerMode.main; - break; case 0x28: // U+0028 LEFT PARENTHESIS character (() case 0x29: // U+0029 RIGHT PARENTHESIS character ()) case 0x2C: // U+002C COMMA character (,) @@ -1123,12 +1091,10 @@ Iterable<_Token> _tokenize(String file) sync* { buffer.clear(); yield _SymbolToken(current, line, column); mode = _TokenizerMode.main; - break; case 0x2E: // U+002E FULL STOP character (.) yield _IntegerToken(int.parse(String.fromCharCodes(buffer), radix: 10), line, column); buffer.clear(); mode = _TokenizerMode.dot1; - break; case 0x30: // U+0030 DIGIT ZERO character (0) case 0x31: // U+0031 DIGIT ONE character (1) case 0x32: // U+0032 DIGIT TWO character (2) @@ -1140,11 +1106,9 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x38: // U+0038 DIGIT EIGHT character (8) case 0x39: // U+0039 DIGIT NINE character (9) buffer.add(current); // https://github.com/dart-lang/sdk/issues/53349 - break; default: throw ParserException('Unexpected character ${_describeRune(current)} in integer', line, column); } - break; case _TokenizerMode.numericDot: // "0.", "-0.", "00.", "1.", "-00." switch (current) { @@ -1162,11 +1126,9 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x39: // U+0039 DIGIT NINE character (9) mode = _TokenizerMode.fraction; buffer.add(current); - break; default: throw ParserException('Unexpected character ${_describeRune(current)} in fraction component', line, column); } - break; case _TokenizerMode.fraction: // "0.0", "-0.0", "00.0", "1.0", "-00.0" switch (current) { @@ -1179,7 +1141,6 @@ Iterable<_Token> _tokenize(String file) sync* { yield _DoubleToken(double.parse(String.fromCharCodes(buffer)), line, column); buffer.clear(); mode = _TokenizerMode.main; - break; case 0x28: // U+0028 LEFT PARENTHESIS character (() case 0x29: // U+0029 RIGHT PARENTHESIS character ()) case 0x2C: // U+002C COMMA character (,) @@ -1194,7 +1155,6 @@ Iterable<_Token> _tokenize(String file) sync* { buffer.clear(); yield _SymbolToken(current, line, column); mode = _TokenizerMode.main; - break; case 0x30: // U+0030 DIGIT ZERO character (0) case 0x31: // U+0031 DIGIT ONE character (1) case 0x32: // U+0032 DIGIT TWO character (2) @@ -1206,16 +1166,13 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x38: // U+0038 DIGIT EIGHT character (8) case 0x39: // U+0039 DIGIT NINE character (9) buffer.add(current); - break; case 0x45: // U+0045 LATIN CAPITAL LETTER E character case 0x65: // U+0065 LATIN SMALL LETTER E character mode = _TokenizerMode.e; buffer.add(current); - break; default: throw ParserException('Unexpected character ${_describeRune(current)} in fraction component', line, column); } - break; case _TokenizerMode.e: // "0e", "-0e", "00e", "1e", "-00e", "0.0e", "-0.0e", "00.0e", "1.0e", "-00.0e" switch (current) { @@ -1224,7 +1181,6 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x2D: // U+002D HYPHEN-MINUS character (-) mode = _TokenizerMode.negativeExponent; buffer.add(current); - break; case 0x30: // U+0030 DIGIT ZERO character (0) case 0x31: // U+0031 DIGIT ONE character (1) case 0x32: // U+0032 DIGIT TWO character (2) @@ -1237,11 +1193,9 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x39: // U+0039 DIGIT NINE character (9) mode = _TokenizerMode.exponent; buffer.add(current); - break; default: throw ParserException('Unexpected character ${_describeRune(current)} after exponent separator', line, column); } - break; case _TokenizerMode.negativeExponent: // "0e-", "-0e-", "00e-", "1e-", "-00e-", "0.0e-", "-0.0e-", "00.0e-", "1.0e-", "-00.0e-" switch (current) { @@ -1259,11 +1213,9 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x39: // U+0039 DIGIT NINE character (9) mode = _TokenizerMode.exponent; buffer.add(current); - break; default: throw ParserException('Unexpected character ${_describeRune(current)} in exponent', line, column); } - break; case _TokenizerMode.exponent: // "0e0", "-0e0", "00e0", "1e0", "-00e0", "0.0e0", "-0.0e0", "00.0e0", "1.0e0", "-00.0e0", "0e-0", "-0e-0", "00e-0", "1e-0", "-00e-0", "0.0e-0", "-0.0e-0", "00.0e-0", "1.0e-0", "-00.0e-0" switch (current) { @@ -1276,7 +1228,6 @@ Iterable<_Token> _tokenize(String file) sync* { yield _DoubleToken(double.parse(String.fromCharCodes(buffer)), line, column); buffer.clear(); mode = _TokenizerMode.main; - break; case 0x28: // U+0028 LEFT PARENTHESIS character (() case 0x29: // U+0029 RIGHT PARENTHESIS character ()) case 0x2C: // U+002C COMMA character (,) @@ -1291,7 +1242,6 @@ Iterable<_Token> _tokenize(String file) sync* { buffer.clear(); yield _SymbolToken(current, line, column); mode = _TokenizerMode.main; - break; case 0x30: // U+0030 DIGIT ZERO character (0) case 0x31: // U+0031 DIGIT ONE character (1) case 0x32: // U+0032 DIGIT TWO character (2) @@ -1303,11 +1253,9 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x38: // U+0038 DIGIT EIGHT character (8) case 0x39: // U+0039 DIGIT NINE character (9) buffer.add(current); - break; default: throw ParserException('Unexpected character ${_describeRune(current)} in exponent', line, column); } - break; case _TokenizerMode.x: // "0x", "0X" switch (current) { @@ -1337,11 +1285,9 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x66: // U+0066 LATIN SMALL LETTER F character mode = _TokenizerMode.hex; buffer.add(current); - break; default: throw ParserException('Unexpected character ${_describeRune(current)} after 0x prefix', line, column); } - break; case _TokenizerMode.hex: switch (current) { @@ -1354,7 +1300,6 @@ Iterable<_Token> _tokenize(String file) sync* { yield _IntegerToken(int.parse(String.fromCharCodes(buffer), radix: 16), line, column); buffer.clear(); mode = _TokenizerMode.main; - break; case 0x28: // U+0028 LEFT PARENTHESIS character (() case 0x29: // U+0029 RIGHT PARENTHESIS character ()) case 0x2C: // U+002C COMMA character (,) @@ -1369,7 +1314,6 @@ Iterable<_Token> _tokenize(String file) sync* { buffer.clear(); yield _SymbolToken(current, line, column); mode = _TokenizerMode.main; - break; case 0x30: // U+0030 DIGIT ZERO character (0) case 0x31: // U+0031 DIGIT ONE character (1) case 0x32: // U+0032 DIGIT TWO character (2) @@ -1393,11 +1337,9 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x65: // U+0065 LATIN SMALL LETTER E character case 0x66: // U+0066 LATIN SMALL LETTER F character buffer.add(current); - break; default: throw ParserException('Unexpected character ${_describeRune(current)} in hex literal', line, column); } - break; case _TokenizerMode.dot1: // "." switch (current) { @@ -1409,17 +1351,14 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x20: // U+0020 SPACE character yield _SymbolToken(0x2E, line, column); mode = _TokenizerMode.main; - break; case 0x22: // U+0022 QUOTATION MARK character (") yield _SymbolToken(0x2E, line, column); assert(buffer.isEmpty); mode = _TokenizerMode.doubleQuote; - break; case 0x27: // U+0027 APOSTROPHE character (') yield _SymbolToken(0x2E, line, column); assert(buffer.isEmpty); mode = _TokenizerMode.quote; - break; case 0x28: // U+0028 LEFT PARENTHESIS character (() case 0x29: // U+0029 RIGHT PARENTHESIS character ()) case 0x2C: // U+002C COMMA character (,) @@ -1432,10 +1371,8 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x7D: // U+007D RIGHT CURLY BRACKET character (}) yield _SymbolToken(0x2E, line, column); yield _SymbolToken(current, line, column); - break; case 0x2E: // U+002E FULL STOP character (.) mode = _TokenizerMode.dot2; - break; case 0x30: // U+0030 DIGIT ZERO character (0) case 0x31: // U+0031 DIGIT ONE character (1) case 0x32: // U+0032 DIGIT TWO character (2) @@ -1450,7 +1387,6 @@ Iterable<_Token> _tokenize(String file) sync* { assert(buffer.isEmpty); mode = _TokenizerMode.integerOnly; buffer.add(current); - break; case 0x41: // U+0041 LATIN CAPITAL LETTER A character case 0x42: // U+0042 LATIN CAPITAL LETTER B character case 0x43: // U+0043 LATIN CAPITAL LETTER C character @@ -1508,11 +1444,9 @@ Iterable<_Token> _tokenize(String file) sync* { assert(buffer.isEmpty); mode = _TokenizerMode.identifier; buffer.add(current); - break; default: throw ParserException('Unexpected character ${_describeRune(current)} after period', line, column); } - break; case _TokenizerMode.dot2: // ".." switch (current) { @@ -1521,11 +1455,9 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x2E: // U+002E FULL STOP character (.) yield _SymbolToken(_SymbolToken.tripleDot, line, column); mode = _TokenizerMode.main; - break; default: throw ParserException('Unexpected character ${_describeRune(current)} inside "..." symbol', line, column); } - break; case _TokenizerMode.identifier: switch (current) { @@ -1538,7 +1470,6 @@ Iterable<_Token> _tokenize(String file) sync* { yield _IdentifierToken(String.fromCharCodes(buffer), line, column); buffer.clear(); mode = _TokenizerMode.main; - break; case 0x28: // U+0028 LEFT PARENTHESIS character (() case 0x29: // U+0029 RIGHT PARENTHESIS character ()) case 0x2C: // U+002C COMMA character (,) @@ -1553,12 +1484,10 @@ Iterable<_Token> _tokenize(String file) sync* { buffer.clear(); yield _SymbolToken(current, line, column); mode = _TokenizerMode.main; - break; case 0x2E: // U+002E FULL STOP character (.) yield _IdentifierToken(String.fromCharCodes(buffer), line, column); buffer.clear(); mode = _TokenizerMode.dot1; - break; case 0x30: // U+0030 DIGIT ZERO character (0) case 0x31: // U+0031 DIGIT ONE character (1) case 0x32: // U+0032 DIGIT TWO character (2) @@ -1623,11 +1552,9 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x7A: // U+007A LATIN SMALL LETTER Z character case 0x5F: // U+005F LOW LINE character (_) buffer.add(current); - break; default: throw ParserException('Unexpected character ${_describeRune(current)} inside identifier', line, column); } - break; case _TokenizerMode.quote: switch (current) { @@ -1639,14 +1566,11 @@ Iterable<_Token> _tokenize(String file) sync* { yield _StringToken(String.fromCharCodes(buffer), line, column); buffer.clear(); mode = _TokenizerMode.endQuote; - break; case 0x5C: // U+005C REVERSE SOLIDUS character (\) mode = _TokenizerMode.quoteEscape; - break; default: buffer.add(current); } - break; case _TokenizerMode.quoteEscape: switch (current) { @@ -1658,35 +1582,27 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x2F: // U+002F SOLIDUS character (/) buffer.add(current); mode = _TokenizerMode.quote; - break; case 0x62: // U+0062 LATIN SMALL LETTER B character buffer.add(0x08); mode = _TokenizerMode.quote; - break; case 0x66: // U+0066 LATIN SMALL LETTER F character buffer.add(0x0C); mode = _TokenizerMode.quote; - break; case 0x6E: // U+006E LATIN SMALL LETTER N character buffer.add(0x0A); mode = _TokenizerMode.quote; - break; case 0x72: // U+0072 LATIN SMALL LETTER R character buffer.add(0x0D); mode = _TokenizerMode.quote; - break; case 0x74: // U+0074 LATIN SMALL LETTER T character buffer.add(0x09); mode = _TokenizerMode.quote; - break; case 0x75: // U+0075 LATIN SMALL LETTER U character assert(buffer2.isEmpty); mode = _TokenizerMode.quoteEscapeUnicode1; - break; default: throw ParserException('Unexpected character ${_describeRune(current)} after backslash in string', line, column); } - break; case _TokenizerMode.quoteEscapeUnicode1: switch (current) { @@ -1716,11 +1632,9 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x66: // U+0066 LATIN SMALL LETTER F character buffer2.add(current); mode = _TokenizerMode.quoteEscapeUnicode2; - break; default: throw ParserException('Unexpected character ${_describeRune(current)} in Unicode escape', line, column); } - break; case _TokenizerMode.quoteEscapeUnicode2: switch (current) { @@ -1750,11 +1664,9 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x66: // U+0066 LATIN SMALL LETTER F character buffer2.add(current); mode = _TokenizerMode.quoteEscapeUnicode3; - break; default: throw ParserException('Unexpected character ${_describeRune(current)} in Unicode escape', line, column); } - break; case _TokenizerMode.quoteEscapeUnicode3: switch (current) { @@ -1784,11 +1696,9 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x66: // U+0066 LATIN SMALL LETTER F character buffer2.add(current); mode = _TokenizerMode.quoteEscapeUnicode4; - break; default: throw ParserException('Unexpected character ${_describeRune(current)} in Unicode escape', line, column); } - break; case _TokenizerMode.quoteEscapeUnicode4: switch (current) { @@ -1820,11 +1730,9 @@ Iterable<_Token> _tokenize(String file) sync* { buffer.add(int.parse(String.fromCharCodes(buffer2), radix: 16)); buffer2.clear(); mode = _TokenizerMode.quote; - break; default: throw ParserException('Unexpected character ${_describeRune(current)} in Unicode escape', line, column); } - break; case _TokenizerMode.doubleQuote: switch (current) { @@ -1836,14 +1744,11 @@ Iterable<_Token> _tokenize(String file) sync* { yield _StringToken(String.fromCharCodes(buffer), line, column); buffer.clear(); mode = _TokenizerMode.endQuote; - break; case 0x5C: // U+005C REVERSE SOLIDUS character (\) mode = _TokenizerMode.doubleQuoteEscape; - break; default: buffer.add(current); } - break; case _TokenizerMode.doubleQuoteEscape: switch (current) { @@ -1855,35 +1760,27 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x2F: // U+002F SOLIDUS character (/) buffer.add(current); mode = _TokenizerMode.doubleQuote; - break; case 0x62: // U+0062 LATIN SMALL LETTER B character buffer.add(0x08); mode = _TokenizerMode.doubleQuote; - break; case 0x66: // U+0066 LATIN SMALL LETTER F character buffer.add(0x0C); mode = _TokenizerMode.doubleQuote; - break; case 0x6E: // U+006E LATIN SMALL LETTER N character buffer.add(0x0A); mode = _TokenizerMode.doubleQuote; - break; case 0x72: // U+0072 LATIN SMALL LETTER R character buffer.add(0x0D); mode = _TokenizerMode.doubleQuote; - break; case 0x74: // U+0074 LATIN SMALL LETTER T character buffer.add(0x09); mode = _TokenizerMode.doubleQuote; - break; case 0x75: // U+0075 LATIN SMALL LETTER U character assert(buffer2.isEmpty); mode = _TokenizerMode.doubleQuoteEscapeUnicode1; - break; default: throw ParserException('Unexpected character ${_describeRune(current)} after backslash in string', line, column); } - break; case _TokenizerMode.doubleQuoteEscapeUnicode1: switch (current) { @@ -1913,11 +1810,9 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x66: // U+0066 LATIN SMALL LETTER F character buffer2.add(current); mode = _TokenizerMode.doubleQuoteEscapeUnicode2; - break; default: throw ParserException('Unexpected character ${_describeRune(current)} in Unicode escape', line, column); } - break; case _TokenizerMode.doubleQuoteEscapeUnicode2: switch (current) { @@ -1947,11 +1842,9 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x66: // U+0066 LATIN SMALL LETTER F character buffer2.add(current); mode = _TokenizerMode.doubleQuoteEscapeUnicode3; - break; default: throw ParserException('Unexpected character ${_describeRune(current)} in Unicode escape', line, column); } - break; case _TokenizerMode.doubleQuoteEscapeUnicode3: switch (current) { @@ -1981,11 +1874,9 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x66: // U+0066 LATIN SMALL LETTER F character buffer2.add(current); mode = _TokenizerMode.doubleQuoteEscapeUnicode4; - break; default: throw ParserException('Unexpected character ${_describeRune(current)} in Unicode escape', line, column); } - break; case _TokenizerMode.doubleQuoteEscapeUnicode4: switch (current) { @@ -2017,11 +1908,9 @@ Iterable<_Token> _tokenize(String file) sync* { buffer.add(int.parse(String.fromCharCodes(buffer2), radix: 16)); buffer2.clear(); mode = _TokenizerMode.doubleQuote; - break; default: throw ParserException('Unexpected character ${_describeRune(current)} in Unicode escape', line, column); } - break; case _TokenizerMode.endQuote: switch (current) { @@ -2031,7 +1920,6 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x0A: // U+000A LINE FEED (LF) case 0x20: // U+0020 SPACE character mode = _TokenizerMode.main; - break; case 0x28: // U+0028 LEFT PARENTHESIS character (() case 0x29: // U+0029 RIGHT PARENTHESIS character ()) case 0x2C: // U+002C COMMA character (,) @@ -2044,14 +1932,11 @@ Iterable<_Token> _tokenize(String file) sync* { case 0x7D: // U+007D RIGHT CURLY BRACKET character (}) yield _SymbolToken(current, line, column); mode = _TokenizerMode.main; - break; case 0x2E: // U+002E FULL STOP character (.) mode = _TokenizerMode.dot1; - break; default: throw ParserException('Unexpected character ${_describeRune(current)} after end quote', line, column); } - break; case _TokenizerMode.slash: switch (current) { @@ -2059,14 +1944,11 @@ Iterable<_Token> _tokenize(String file) sync* { throw ParserException('Unexpected end of file inside comment delimiter', line, column); case 0x2A: // U+002A ASTERISK character (*) mode = _TokenizerMode.blockComment; - break; case 0x2F: // U+002F SOLIDUS character (/) mode = _TokenizerMode.comment; - break; default: throw ParserException('Unexpected character ${_describeRune(current)} inside comment delimiter', line, column); } - break; case _TokenizerMode.comment: switch (current) { @@ -2075,12 +1957,10 @@ Iterable<_Token> _tokenize(String file) sync* { return; case 0x0A: // U+000A LINE FEED (LF) mode = _TokenizerMode.main; - break; default: // ignored, comment break; } - break; case _TokenizerMode.blockComment: switch (current) { @@ -2088,12 +1968,10 @@ Iterable<_Token> _tokenize(String file) sync* { throw ParserException('Unexpected end of file in block comment', line, column); case 0x2A: // U+002A ASTERISK character (*) mode = _TokenizerMode.blockCommentEnd; - break; default: // ignored, comment break; } - break; case _TokenizerMode.blockCommentEnd: switch (current) { @@ -2101,13 +1979,11 @@ Iterable<_Token> _tokenize(String file) sync* { throw ParserException('Unexpected end of file in block comment', line, column); case 0x2F: // U+002F SOLIDUS character (/) mode = _TokenizerMode.main; - break; default: // ignored, comment mode = _TokenizerMode.blockComment; break; } - break; } index += 1; } @@ -2127,7 +2003,7 @@ class _Parser { void _advance() { assert(_source.current is! _EofToken); final bool advanced = _source.moveNext(); - assert(advanced == true); // see https://github.com/dart-lang/sdk/issues/47017 + assert(advanced); } bool _foundIdentifier(String identifier) { @@ -2457,6 +2333,6 @@ class _Parser { throw ParserException._expected(expectation, _source.current); } final bool more = _source.moveNext(); - assert(more == false); // see https://github.com/dart-lang/sdk/issues/47017 + assert(!more); } } diff --git a/packages/rfw/pubspec.yaml b/packages/rfw/pubspec.yaml index c437ea2413c9..9eb5745d8ff9 100644 --- a/packages/rfw/pubspec.yaml +++ b/packages/rfw/pubspec.yaml @@ -2,7 +2,7 @@ name: rfw description: "Remote Flutter widgets: a library for rendering declarative widget description files at runtime." repository: https://github.com/flutter/packages/tree/main/packages/rfw issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+rfw%22 -version: 1.0.15 +version: 1.0.16 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/rfw/test/readme_test.dart b/packages/rfw/test/readme_test.dart index 4e804a10ef26..7969d86eae4c 100644 --- a/packages/rfw/test/readme_test.dart +++ b/packages/rfw/test/readme_test.dart @@ -143,7 +143,7 @@ List _createLocalWidgets(String region) { return [LocalWidgetLibrary({ // #docregion defaultLocalWidgets 'GreenBox': (BuildContext context, DataSource source) { - return Container(color: const Color(0xFF002211), child: source.child(['child'])); + return ColoredBox(color: const Color(0xFF002211), child: source.child(['child'])); }, 'Hello': (BuildContext context, DataSource source) { return Center(child: Text('Hello, ${source.v(["name"])}!', textDirection: TextDirection.ltr)); @@ -175,7 +175,7 @@ List _createLocalWidgets(String region) { return [LocalWidgetLibrary({ // #docregion child 'GreenBox': (BuildContext context, DataSource source) { - return Container(color: const Color(0xFF002211), child: source.child(['child'])); + return ColoredBox(color: const Color(0xFF002211), child: source.child(['child'])); }, // #enddocregion child // #docregion isMap @@ -191,7 +191,7 @@ List _createLocalWidgets(String region) { return [LocalWidgetLibrary({ // #docregion optionalChild 'GreenBox': (BuildContext context, DataSource source) { - return Container(color: const Color(0xFF002211), child: source.optionalChild(['child'])); + return ColoredBox(color: const Color(0xFF002211), child: source.optionalChild(['child'])); }, // #enddocregion optionalChild // #docregion length diff --git a/packages/shared_preferences/shared_preferences_web/example/integration_test/shared_preferences_web_test.dart b/packages/shared_preferences/shared_preferences_web/example/integration_test/shared_preferences_web_test.dart index b5f905bc966e..9f0faae41367 100644 --- a/packages/shared_preferences/shared_preferences_web/example/integration_test/shared_preferences_web_test.dart +++ b/packages/shared_preferences/shared_preferences_web/example/integration_test/shared_preferences_web_test.dart @@ -12,14 +12,6 @@ import 'package:shared_preferences_web/src/keys_extension.dart'; import 'package:web/helpers.dart' as html; -const Map kTestValues = { - 'flutter.String': 'hello world', - 'flutter.Bool': true, - 'flutter.Int': 42, - 'flutter.Double': 3.14159, - 'flutter.StringList': ['foo', 'bar'], -}; - void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); diff --git a/packages/two_dimensional_scrollables/CHANGELOG.md b/packages/two_dimensional_scrollables/CHANGELOG.md index a47fd6b40c76..dab2102da259 100644 --- a/packages/two_dimensional_scrollables/CHANGELOG.md +++ b/packages/two_dimensional_scrollables/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.5+1 + +* Fixes new lint warnings. + ## 0.0.5 * Exposes addAutomaticKeepAlives in TableCellBuilderDelegate and TableCellListDelegate diff --git a/packages/two_dimensional_scrollables/lib/src/table_view/table.dart b/packages/two_dimensional_scrollables/lib/src/table_view/table.dart index d94bbfe325b5..c40b9bcd321c 100644 --- a/packages/two_dimensional_scrollables/lib/src/table_view/table.dart +++ b/packages/two_dimensional_scrollables/lib/src/table_view/table.dart @@ -368,7 +368,6 @@ class RenderTableViewport extends RenderTwoDimensionalViewport { HitTestEntry( _columnMetrics[cellParentData.tableVicinity.column]!), ); - break; case Axis.horizontal: // Column major order, columns go first. result.add( @@ -378,7 +377,6 @@ class RenderTableViewport extends RenderTwoDimensionalViewport { result.add( HitTestEntry(_rowMetrics[cellParentData.tableVicinity.row]!), ); - break; } return true; } @@ -969,7 +967,6 @@ class RenderTableViewport extends RenderTwoDimensionalViewport { ); decoration.paint(paintingDetails); }); - break; // Column major order. Columns go first. case Axis.horizontal: backgroundColumns.forEach((Rect rect, TableSpanDecoration decoration) { @@ -1027,7 +1024,6 @@ class RenderTableViewport extends RenderTwoDimensionalViewport { ); decoration.paint(paintingDetails); }); - break; // Column major order. Columns go first. case Axis.horizontal: foregroundColumns.forEach((Rect rect, TableSpanDecoration decoration) { diff --git a/packages/two_dimensional_scrollables/lib/src/table_view/table_span.dart b/packages/two_dimensional_scrollables/lib/src/table_view/table_span.dart index 27d28d1028b4..faac24b22d7d 100644 --- a/packages/two_dimensional_scrollables/lib/src/table_view/table_span.dart +++ b/packages/two_dimensional_scrollables/lib/src/table_view/table_span.dart @@ -444,7 +444,6 @@ class TableSpanBorder { details.rect, borderRadius: borderRadius, ); - break; case Axis.vertical: final Border border = Border( left: axisDirection == AxisDirection.down ? leading : trailing, @@ -455,7 +454,6 @@ class TableSpanBorder { details.rect, borderRadius: borderRadius, ); - break; } } } diff --git a/packages/two_dimensional_scrollables/pubspec.yaml b/packages/two_dimensional_scrollables/pubspec.yaml index 34fecd511114..24e106d848da 100644 --- a/packages/two_dimensional_scrollables/pubspec.yaml +++ b/packages/two_dimensional_scrollables/pubspec.yaml @@ -1,6 +1,6 @@ name: two_dimensional_scrollables description: Widgets that scroll using the two dimensional scrolling foundation. -version: 0.0.5 +version: 0.0.5+1 repository: https://github.com/flutter/packages/tree/main/packages/two_dimensional_scrollables issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+two_dimensional_scrollables%22+ diff --git a/packages/url_launcher/url_launcher_android/CHANGELOG.md b/packages/url_launcher/url_launcher_android/CHANGELOG.md index 4ac27d9bc2fd..a3e6435491e1 100644 --- a/packages/url_launcher/url_launcher_android/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_android/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 6.2.1 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Fixes lint warnings. ## 6.2.0 diff --git a/packages/url_launcher/url_launcher_android/lib/url_launcher_android.dart b/packages/url_launcher/url_launcher_android/lib/url_launcher_android.dart index f121084b7578..7955abe2a7c7 100644 --- a/packages/url_launcher/url_launcher_android/lib/url_launcher_android.dart +++ b/packages/url_launcher/url_launcher_android/lib/url_launcher_android.dart @@ -79,7 +79,6 @@ class UrlLauncherAndroid extends UrlLauncherPlatform { case PreferredLaunchMode.inAppWebView: case PreferredLaunchMode.inAppBrowserView: inApp = true; - break; case PreferredLaunchMode.externalApplication: case PreferredLaunchMode.externalNonBrowserApplication: // TODO(stuartmorgan): Add full support for @@ -87,7 +86,6 @@ class UrlLauncherAndroid extends UrlLauncherPlatform { // https://github.com/flutter/flutter/issues/66721. // Currently it's treated the same as externalApplication. inApp = false; - break; case PreferredLaunchMode.platformDefault: // Intentionally treat any new values as platformDefault; see comment in // supportsMode. diff --git a/packages/url_launcher/url_launcher_android/pubspec.yaml b/packages/url_launcher/url_launcher_android/pubspec.yaml index 6a51e813d751..3c5394b0b26a 100644 --- a/packages/url_launcher/url_launcher_android/pubspec.yaml +++ b/packages/url_launcher/url_launcher_android/pubspec.yaml @@ -2,7 +2,7 @@ name: url_launcher_android description: Android implementation of the url_launcher plugin. repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22 -version: 6.2.0 +version: 6.2.1 environment: sdk: ">=3.0.0 <4.0.0" flutter: ">=3.10.0" diff --git a/packages/url_launcher/url_launcher_ios/CHANGELOG.md b/packages/url_launcher/url_launcher_ios/CHANGELOG.md index 044f99fd6d8f..e7c236a2d4c4 100644 --- a/packages/url_launcher/url_launcher_ios/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_ios/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 6.2.2 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Fixes lint warnings. ## 6.2.1 diff --git a/packages/url_launcher/url_launcher_ios/lib/url_launcher_ios.dart b/packages/url_launcher/url_launcher_ios/lib/url_launcher_ios.dart index 9d1ebc9c2361..24b25acb3896 100644 --- a/packages/url_launcher/url_launcher_ios/lib/url_launcher_ios.dart +++ b/packages/url_launcher/url_launcher_ios/lib/url_launcher_ios.dart @@ -75,11 +75,9 @@ class UrlLauncherIOS extends UrlLauncherPlatform { // The iOS implementation doesn't distinguish between these two modes; // both are treated as inAppBrowserView. inApp = true; - break; case PreferredLaunchMode.externalApplication: case PreferredLaunchMode.externalNonBrowserApplication: inApp = false; - break; case PreferredLaunchMode.platformDefault: // Intentionally treat any new values as platformDefault; support for any // new mode requires intentional opt-in, otherwise falling back is the diff --git a/packages/url_launcher/url_launcher_ios/pubspec.yaml b/packages/url_launcher/url_launcher_ios/pubspec.yaml index 677221f47aef..d3191f53b25a 100644 --- a/packages/url_launcher/url_launcher_ios/pubspec.yaml +++ b/packages/url_launcher/url_launcher_ios/pubspec.yaml @@ -2,7 +2,7 @@ name: url_launcher_ios description: iOS implementation of the url_launcher plugin. repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_ios issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22 -version: 6.2.1 +version: 6.2.2 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/url_launcher/url_launcher_platform_interface/CHANGELOG.md b/packages/url_launcher/url_launcher_platform_interface/CHANGELOG.md index fca9d52ae9ac..117f01765755 100644 --- a/packages/url_launcher/url_launcher_platform_interface/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_platform_interface/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 2.2.1 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Fixes new lint warnings. ## 2.2.0 diff --git a/packages/url_launcher/url_launcher_platform_interface/lib/link.dart b/packages/url_launcher/url_launcher_platform_interface/lib/link.dart index a82c16ed3f10..a5310804ad05 100644 --- a/packages/url_launcher/url_launcher_platform_interface/lib/link.dart +++ b/packages/url_launcher/url_launcher_platform_interface/lib/link.dart @@ -28,6 +28,7 @@ const MethodCodec _codec = JSONMethodCodec(); /// /// This is a class instead of an enum to allow future customizability e.g. /// opening a link in a specific iframe. +// ignore: use_enums class LinkTarget { /// Const private constructor with a [debugLabel] to allow the creation of /// multiple distinct const instances. diff --git a/packages/url_launcher/url_launcher_platform_interface/pubspec.yaml b/packages/url_launcher/url_launcher_platform_interface/pubspec.yaml index c90efd867e8d..83f17cde0ab6 100644 --- a/packages/url_launcher/url_launcher_platform_interface/pubspec.yaml +++ b/packages/url_launcher/url_launcher_platform_interface/pubspec.yaml @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22 # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 2.2.0 +version: 2.2.1 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/url_launcher/url_launcher_web/CHANGELOG.md b/packages/url_launcher/url_launcher_web/CHANGELOG.md index ed6042312a10..641b48d27cf2 100644 --- a/packages/url_launcher/url_launcher_web/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_web/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.2.3 + +* Fixes new lint warnings. + ## 2.2.2 * Adds documentation that a launch in a new window/tab needs to be triggered by diff --git a/packages/url_launcher/url_launcher_web/example/integration_test/url_launcher_web_test.dart b/packages/url_launcher/url_launcher_web/example/integration_test/url_launcher_web_test.dart index bce7e136a4e0..ec01d28163aa 100644 --- a/packages/url_launcher/url_launcher_web/example/integration_test/url_launcher_web_test.dart +++ b/packages/url_launcher/url_launcher_web/example/integration_test/url_launcher_web_test.dart @@ -7,7 +7,7 @@ import 'dart:js_util'; import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; -import 'package:mockito/mockito.dart' show any, verify, when, Mock; +import 'package:mockito/mockito.dart' show Mock, any, verify, when; import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart'; import 'package:url_launcher_web/url_launcher_web.dart'; import 'package:web/helpers.dart' as html; diff --git a/packages/url_launcher/url_launcher_web/pubspec.yaml b/packages/url_launcher/url_launcher_web/pubspec.yaml index 371c534a20de..6c89bba58091 100644 --- a/packages/url_launcher/url_launcher_web/pubspec.yaml +++ b/packages/url_launcher/url_launcher_web/pubspec.yaml @@ -2,7 +2,7 @@ name: url_launcher_web description: Web platform implementation of url_launcher repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22 -version: 2.2.2 +version: 2.2.3 environment: sdk: ^3.2.0 diff --git a/packages/video_player/video_player/CHANGELOG.md b/packages/video_player/video_player/CHANGELOG.md index bee3eb6fe74c..ce141f89d6b9 100644 --- a/packages/video_player/video_player/CHANGELOG.md +++ b/packages/video_player/video_player/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 2.8.2 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Fixes new lint warnings. ## 2.8.1 diff --git a/packages/video_player/video_player/example/lib/main.dart b/packages/video_player/video_player/example/lib/main.dart index 7fdd5ae28ce4..0ce77d603b5a 100644 --- a/packages/video_player/video_player/example/lib/main.dart +++ b/packages/video_player/video_player/example/lib/main.dart @@ -6,6 +6,7 @@ /// An example of using the plugin, controlling lifecycle and playback of the /// video. +library; import 'package:flutter/material.dart'; import 'package:video_player/video_player.dart'; @@ -306,9 +307,9 @@ class _ControlsOverlay extends StatelessWidget { reverseDuration: const Duration(milliseconds: 200), child: controller.value.isPlaying ? const SizedBox.shrink() - : Container( + : const ColoredBox( color: Colors.black26, - child: const Center( + child: Center( child: Icon( Icons.play_arrow, color: Colors.white, diff --git a/packages/video_player/video_player/lib/video_player.dart b/packages/video_player/video_player/lib/video_player.dart index 5bd543cd49ab..d79f280ccbd1 100644 --- a/packages/video_player/video_player/lib/video_player.dart +++ b/packages/video_player/video_player/lib/video_player.dart @@ -14,7 +14,7 @@ import 'package:video_player_platform_interface/video_player_platform_interface. import 'src/closed_caption_file.dart'; export 'package:video_player_platform_interface/video_player_platform_interface.dart' - show DurationRange, DataSourceType, VideoFormat, VideoPlayerOptions; + show DataSourceType, DurationRange, VideoFormat, VideoPlayerOptions; export 'src/closed_caption_file.dart'; @@ -406,7 +406,6 @@ class VideoPlayerController extends ValueNotifier { asset: dataSource, package: package, ); - break; case DataSourceType.network: dataSourceDescription = DataSource( sourceType: DataSourceType.network, @@ -414,20 +413,17 @@ class VideoPlayerController extends ValueNotifier { formatHint: formatHint, httpHeaders: httpHeaders, ); - break; case DataSourceType.file: dataSourceDescription = DataSource( sourceType: DataSourceType.file, uri: dataSource, httpHeaders: httpHeaders, ); - break; case DataSourceType.contentUri: dataSourceDescription = DataSource( sourceType: DataSourceType.contentUri, uri: dataSource, ); - break; } if (videoPlayerOptions?.mixWithOthers != null) { @@ -459,7 +455,6 @@ class VideoPlayerController extends ValueNotifier { _applyLooping(); _applyVolume(); _applyPlayPause(); - break; case VideoEventType.completed: // In this case we need to stop _timer, set isPlaying=false, and // position=value.duration. Instead of setting the values directly, @@ -467,16 +462,12 @@ class VideoPlayerController extends ValueNotifier { // and seeks to the last frame of the video. pause().then((void pauseResult) => seekTo(value.duration)); value = value.copyWith(isCompleted: true); - break; case VideoEventType.bufferingUpdate: value = value.copyWith(buffered: event.buffered); - break; case VideoEventType.bufferingStart: value = value.copyWith(isBuffering: true); - break; case VideoEventType.bufferingEnd: value = value.copyWith(isBuffering: false); - break; case VideoEventType.isPlayingStateUpdate: if (event.isPlaying ?? false) { value = @@ -484,7 +475,6 @@ class VideoPlayerController extends ValueNotifier { } else { value = value.copyWith(isPlaying: event.isPlaying); } - break; case VideoEventType.unknown: break; } diff --git a/packages/video_player/video_player/pubspec.yaml b/packages/video_player/video_player/pubspec.yaml index 7eab2ac6cdba..1b169ff64a42 100644 --- a/packages/video_player/video_player/pubspec.yaml +++ b/packages/video_player/video_player/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for displaying inline video with other Flutter widgets on Android, iOS, and web. repository: https://github.com/flutter/packages/tree/main/packages/video_player/video_player issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22 -version: 2.8.1 +version: 2.8.2 environment: sdk: ">=3.1.0 <4.0.0" diff --git a/packages/video_player/video_player_android/CHANGELOG.md b/packages/video_player/video_player_android/CHANGELOG.md index 1b2a874d21dc..4116740efa8c 100644 --- a/packages/video_player/video_player_android/CHANGELOG.md +++ b/packages/video_player/video_player_android/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 2.4.11 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Fixes new lint warnings. ## 2.4.10 diff --git a/packages/video_player/video_player_android/example/lib/main.dart b/packages/video_player/video_player_android/example/lib/main.dart index 38ad5aabaeed..df28b39ac76b 100644 --- a/packages/video_player/video_player_android/example/lib/main.dart +++ b/packages/video_player/video_player_android/example/lib/main.dart @@ -181,9 +181,9 @@ class _ControlsOverlay extends StatelessWidget { reverseDuration: const Duration(milliseconds: 200), child: controller.value.isPlaying ? const SizedBox.shrink() - : Container( + : const ColoredBox( color: Colors.black26, - child: const Center( + child: Center( child: Icon( Icons.play_arrow, color: Colors.white, diff --git a/packages/video_player/video_player_android/example/lib/mini_controller.dart b/packages/video_player/video_player_android/example/lib/mini_controller.dart index cea87ba95fa6..a38013533d62 100644 --- a/packages/video_player/video_player_android/example/lib/mini_controller.dart +++ b/packages/video_player/video_player_android/example/lib/mini_controller.dart @@ -222,25 +222,21 @@ class MiniController extends ValueNotifier { asset: dataSource, package: package, ); - break; case DataSourceType.network: dataSourceDescription = DataSource( sourceType: DataSourceType.network, uri: dataSource, ); - break; case DataSourceType.file: dataSourceDescription = DataSource( sourceType: DataSourceType.file, uri: dataSource, ); - break; case DataSourceType.contentUri: dataSourceDescription = DataSource( sourceType: DataSourceType.contentUri, uri: dataSource, ); - break; } _textureId = (await _platform.create(dataSourceDescription)) ?? @@ -260,22 +256,16 @@ class MiniController extends ValueNotifier { _platform.setVolume(_textureId, 1.0); _platform.setLooping(_textureId, true); _applyPlayPause(); - break; case VideoEventType.completed: pause().then((void pauseResult) => seekTo(value.duration)); - break; case VideoEventType.bufferingUpdate: value = value.copyWith(buffered: event.buffered); - break; case VideoEventType.bufferingStart: value = value.copyWith(isBuffering: true); - break; case VideoEventType.bufferingEnd: value = value.copyWith(isBuffering: false); - break; case VideoEventType.isPlayingStateUpdate: value = value.copyWith(isPlaying: event.isPlaying); - break; case VideoEventType.unknown: break; } diff --git a/packages/video_player/video_player_android/lib/src/android_video_player.dart b/packages/video_player/video_player_android/lib/src/android_video_player.dart index 3d34fc8c94b9..7d4a600397d4 100644 --- a/packages/video_player/video_player_android/lib/src/android_video_player.dart +++ b/packages/video_player/video_player_android/lib/src/android_video_player.dart @@ -41,19 +41,15 @@ class AndroidVideoPlayer extends VideoPlayerPlatform { case DataSourceType.asset: asset = dataSource.asset; packageName = dataSource.package; - break; case DataSourceType.network: uri = dataSource.uri; formatHint = _videoFormatStringMap[dataSource.formatHint]; httpHeaders = dataSource.httpHeaders; - break; case DataSourceType.file: uri = dataSource.uri; httpHeaders = dataSource.httpHeaders; - break; case DataSourceType.contentUri: uri = dataSource.uri; - break; } final CreateMessage message = CreateMessage( asset: asset, diff --git a/packages/video_player/video_player_android/pubspec.yaml b/packages/video_player/video_player_android/pubspec.yaml index ed142458653f..5f488dde7467 100644 --- a/packages/video_player/video_player_android/pubspec.yaml +++ b/packages/video_player/video_player_android/pubspec.yaml @@ -2,7 +2,7 @@ name: video_player_android description: Android implementation of the video_player plugin. repository: https://github.com/flutter/packages/tree/main/packages/video_player/video_player_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22 -version: 2.4.10 +version: 2.4.11 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/video_player/video_player_avfoundation/CHANGELOG.md b/packages/video_player/video_player_avfoundation/CHANGELOG.md index 23316e06354a..3bfde743def7 100644 --- a/packages/video_player/video_player_avfoundation/CHANGELOG.md +++ b/packages/video_player/video_player_avfoundation/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.5.4 + +* Fixes new lint warnings. + ## 2.5.3 * Publishes an instance of the plugin to the registrar on macOS, as on iOS. diff --git a/packages/video_player/video_player_avfoundation/example/lib/main.dart b/packages/video_player/video_player_avfoundation/example/lib/main.dart index a2540ca5f423..313ae7f50dc3 100644 --- a/packages/video_player/video_player_avfoundation/example/lib/main.dart +++ b/packages/video_player/video_player_avfoundation/example/lib/main.dart @@ -239,9 +239,9 @@ class _ControlsOverlay extends StatelessWidget { reverseDuration: const Duration(milliseconds: 200), child: controller.value.isPlaying ? const SizedBox.shrink() - : Container( + : const ColoredBox( color: Colors.black26, - child: const Center( + child: Center( child: Icon( Icons.play_arrow, color: Colors.white, diff --git a/packages/video_player/video_player_avfoundation/example/lib/mini_controller.dart b/packages/video_player/video_player_avfoundation/example/lib/mini_controller.dart index cea87ba95fa6..a38013533d62 100644 --- a/packages/video_player/video_player_avfoundation/example/lib/mini_controller.dart +++ b/packages/video_player/video_player_avfoundation/example/lib/mini_controller.dart @@ -222,25 +222,21 @@ class MiniController extends ValueNotifier { asset: dataSource, package: package, ); - break; case DataSourceType.network: dataSourceDescription = DataSource( sourceType: DataSourceType.network, uri: dataSource, ); - break; case DataSourceType.file: dataSourceDescription = DataSource( sourceType: DataSourceType.file, uri: dataSource, ); - break; case DataSourceType.contentUri: dataSourceDescription = DataSource( sourceType: DataSourceType.contentUri, uri: dataSource, ); - break; } _textureId = (await _platform.create(dataSourceDescription)) ?? @@ -260,22 +256,16 @@ class MiniController extends ValueNotifier { _platform.setVolume(_textureId, 1.0); _platform.setLooping(_textureId, true); _applyPlayPause(); - break; case VideoEventType.completed: pause().then((void pauseResult) => seekTo(value.duration)); - break; case VideoEventType.bufferingUpdate: value = value.copyWith(buffered: event.buffered); - break; case VideoEventType.bufferingStart: value = value.copyWith(isBuffering: true); - break; case VideoEventType.bufferingEnd: value = value.copyWith(isBuffering: false); - break; case VideoEventType.isPlayingStateUpdate: value = value.copyWith(isPlaying: event.isPlaying); - break; case VideoEventType.unknown: break; } diff --git a/packages/video_player/video_player_avfoundation/lib/src/avfoundation_video_player.dart b/packages/video_player/video_player_avfoundation/lib/src/avfoundation_video_player.dart index 868c5986f35f..10e5618f2a65 100644 --- a/packages/video_player/video_player_avfoundation/lib/src/avfoundation_video_player.dart +++ b/packages/video_player/video_player_avfoundation/lib/src/avfoundation_video_player.dart @@ -41,18 +41,14 @@ class AVFoundationVideoPlayer extends VideoPlayerPlatform { case DataSourceType.asset: asset = dataSource.asset; packageName = dataSource.package; - break; case DataSourceType.network: uri = dataSource.uri; formatHint = _videoFormatStringMap[dataSource.formatHint]; httpHeaders = dataSource.httpHeaders; - break; case DataSourceType.file: uri = dataSource.uri; - break; case DataSourceType.contentUri: uri = dataSource.uri; - break; } final CreateMessage message = CreateMessage( asset: asset, diff --git a/packages/video_player/video_player_avfoundation/pubspec.yaml b/packages/video_player/video_player_avfoundation/pubspec.yaml index 76a32f0a293f..cef4a092526e 100644 --- a/packages/video_player/video_player_avfoundation/pubspec.yaml +++ b/packages/video_player/video_player_avfoundation/pubspec.yaml @@ -2,7 +2,7 @@ name: video_player_avfoundation description: iOS and macOS implementation of the video_player plugin. repository: https://github.com/flutter/packages/tree/main/packages/video_player/video_player_avfoundation issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22 -version: 2.5.3 +version: 2.5.4 environment: sdk: ">=3.2.0 <4.0.0" diff --git a/packages/video_player/video_player_web/CHANGELOG.md b/packages/video_player/video_player_web/CHANGELOG.md index 73c39f519151..5c9deb860d1f 100644 --- a/packages/video_player/video_player_web/CHANGELOG.md +++ b/packages/video_player/video_player_web/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 2.1.3 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Fixes new lint warnings. ## 2.1.2 diff --git a/packages/video_player/video_player_web/lib/video_player_web.dart b/packages/video_player/video_player_web/lib/video_player_web.dart index 9fe07d1204e1..67cf2746977d 100644 --- a/packages/video_player/video_player_web/lib/video_player_web.dart +++ b/packages/video_player/video_player_web/lib/video_player_web.dart @@ -56,7 +56,6 @@ class VideoPlayerPlugin extends VideoPlayerPlatform { // Do NOT modify the incoming uri, it can be a Blob, and Safari doesn't // like blobs that have changed. uri = dataSource.uri ?? ''; - break; case DataSourceType.asset: String assetUrl = dataSource.asset!; if (dataSource.package != null && dataSource.package!.isNotEmpty) { @@ -64,7 +63,6 @@ class VideoPlayerPlugin extends VideoPlayerPlatform { } assetUrl = ui_web.assetManager.getAssetUrl(assetUrl); uri = assetUrl; - break; case DataSourceType.file: return Future.error(UnimplementedError( 'web implementation of video_player cannot play local files')); diff --git a/packages/video_player/video_player_web/pubspec.yaml b/packages/video_player/video_player_web/pubspec.yaml index 8b312aef3853..81ad0e6d1bf7 100644 --- a/packages/video_player/video_player_web/pubspec.yaml +++ b/packages/video_player/video_player_web/pubspec.yaml @@ -2,7 +2,7 @@ name: video_player_web description: Web platform implementation of video_player. repository: https://github.com/flutter/packages/tree/main/packages/video_player/video_player_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22 -version: 2.1.2 +version: 2.1.3 environment: sdk: ">=3.1.0 <4.0.0" diff --git a/packages/web_benchmarks/CHANGELOG.md b/packages/web_benchmarks/CHANGELOG.md index 5641ddfb3ab4..f401c3885b27 100644 --- a/packages/web_benchmarks/CHANGELOG.md +++ b/packages/web_benchmarks/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.1.1 + +* Fixes new lint warnings. + ## 1.1.0 * Adds `computeAverage` and `computeDelta` methods to support analysis of benchmark results. diff --git a/packages/web_benchmarks/pubspec.yaml b/packages/web_benchmarks/pubspec.yaml index 117d8dd246e8..aa89736869cb 100644 --- a/packages/web_benchmarks/pubspec.yaml +++ b/packages/web_benchmarks/pubspec.yaml @@ -2,7 +2,7 @@ name: web_benchmarks description: A benchmark harness for performance-testing Flutter apps in Chrome. repository: https://github.com/flutter/packages/tree/main/packages/web_benchmarks issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+web_benchmarks%22 -version: 1.1.0 +version: 1.1.1 environment: sdk: ">=3.2.0 <4.0.0" diff --git a/packages/web_benchmarks/testing/test_app/lib/benchmarks/runner.dart b/packages/web_benchmarks/testing/test_app/lib/benchmarks/runner.dart index cf7ef251fb0a..9a870dfca2e8 100644 --- a/packages/web_benchmarks/testing/test_app/lib/benchmarks/runner.dart +++ b/packages/web_benchmarks/testing/test_app/lib/benchmarks/runner.dart @@ -16,7 +16,7 @@ import '../main.dart'; abstract class AppRecorder extends WidgetRecorder { AppRecorder({required this.benchmarkName}) : super(name: benchmarkName); - final String benchmarkName; + final String benchmarkName; // ignore: unreachable_from_main Future automate(); diff --git a/packages/webview_flutter/webview_flutter/CHANGELOG.md b/packages/webview_flutter/webview_flutter/CHANGELOG.md index 3e2c39d30128..dbe14968153d 100644 --- a/packages/webview_flutter/webview_flutter/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 4.4.3 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Fixes new lint warnings. ## 4.4.2 diff --git a/packages/webview_flutter/webview_flutter/example/lib/main.dart b/packages/webview_flutter/webview_flutter/example/lib/main.dart index d23f4ce96fb9..92e85429e6b9 100644 --- a/packages/webview_flutter/webview_flutter/example/lib/main.dart +++ b/packages/webview_flutter/webview_flutter/example/lib/main.dart @@ -262,46 +262,32 @@ class SampleMenu extends StatelessWidget { switch (value) { case MenuOptions.showUserAgent: _onShowUserAgent(); - break; case MenuOptions.listCookies: _onListCookies(context); - break; case MenuOptions.clearCookies: _onClearCookies(context); - break; case MenuOptions.addToCache: _onAddToCache(context); - break; case MenuOptions.listCache: _onListCache(); - break; case MenuOptions.clearCache: _onClearCache(context); - break; case MenuOptions.navigationDelegate: _onNavigationDelegateExample(); - break; case MenuOptions.doPostRequest: _onDoPostRequest(); - break; case MenuOptions.loadLocalFile: _onLoadLocalFileExample(); - break; case MenuOptions.loadFlutterAsset: _onLoadFlutterAssetExample(); - break; case MenuOptions.loadHtmlString: _onLoadHtmlStringExample(); - break; case MenuOptions.transparentBackground: _onTransparentBackground(); - break; case MenuOptions.setCookie: _onSetCookie(); - break; case MenuOptions.logExample: _onLogExample(); - break; } }, itemBuilder: (BuildContext context) => >[ diff --git a/packages/webview_flutter/webview_flutter/lib/src/legacy/platform_interface.dart b/packages/webview_flutter/webview_flutter/lib/src/legacy/platform_interface.dart index e036d2ef88a5..f346d356ea7d 100644 --- a/packages/webview_flutter/webview_flutter/lib/src/legacy/platform_interface.dart +++ b/packages/webview_flutter/webview_flutter/lib/src/legacy/platform_interface.dart @@ -5,6 +5,8 @@ /// Re-export the classes from the webview_flutter_platform_interface through /// the `platform_interface.dart` file so we don't accidentally break any /// non-endorsed existing implementations of the interface. +library; + export 'package:webview_flutter_platform_interface/src/webview_flutter_platform_interface_legacy.dart' show AutoMediaPlaybackPolicy, @@ -12,16 +14,16 @@ export 'package:webview_flutter_platform_interface/src/webview_flutter_platform_ JavascriptChannel, JavascriptChannelRegistry, JavascriptMessage, - JavascriptMode, JavascriptMessageHandler, + JavascriptMode, + WebResourceError, + WebResourceErrorType, + WebSetting, + WebSettings, + WebViewCookie, WebViewPlatform, WebViewPlatformCallbacksHandler, WebViewPlatformController, WebViewPlatformCreatedCallback, - WebSetting, - WebSettings, - WebResourceError, - WebResourceErrorType, - WebViewCookie, WebViewRequest, WebViewRequestMethod; diff --git a/packages/webview_flutter/webview_flutter/lib/src/legacy/webview.dart b/packages/webview_flutter/webview_flutter/lib/src/legacy/webview.dart index 55826a533b17..0dddb2d5214f 100644 --- a/packages/webview_flutter/webview_flutter/lib/src/legacy/webview.dart +++ b/packages/webview_flutter/webview_flutter/lib/src/legacy/webview.dart @@ -121,10 +121,8 @@ class WebView extends StatefulWidget { switch (defaultTargetPlatform) { case TargetPlatform.android: _platform = SurfaceAndroidWebView(); - break; case TargetPlatform.iOS: _platform = CupertinoWebView(); - break; // ignore: no_default_cases default: throw UnsupportedError( diff --git a/packages/webview_flutter/webview_flutter/lib/webview_flutter.dart b/packages/webview_flutter/webview_flutter/lib/webview_flutter.dart index 4132a61cab73..f4c294a4761a 100644 --- a/packages/webview_flutter/webview_flutter/lib/webview_flutter.dart +++ b/packages/webview_flutter/webview_flutter/lib/webview_flutter.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -library webview_flutter; - export 'package:webview_flutter_platform_interface/webview_flutter_platform_interface.dart' show JavaScriptConsoleMessage, diff --git a/packages/webview_flutter/webview_flutter/pubspec.yaml b/packages/webview_flutter/webview_flutter/pubspec.yaml index 97ebe94ed0e9..2978e8231ea0 100644 --- a/packages/webview_flutter/webview_flutter/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter/pubspec.yaml @@ -2,7 +2,7 @@ name: webview_flutter description: A Flutter plugin that provides a WebView widget on Android and iOS. repository: https://github.com/flutter/packages/tree/main/packages/webview_flutter/webview_flutter issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22 -version: 4.4.2 +version: 4.4.3 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/webview_flutter/webview_flutter/test/legacy/webview_flutter_test.dart b/packages/webview_flutter/webview_flutter/test/legacy/webview_flutter_test.dart index 4db70113dfb2..008e91a8bb29 100644 --- a/packages/webview_flutter/webview_flutter/test/legacy/webview_flutter_test.dart +++ b/packages/webview_flutter/webview_flutter/test/legacy/webview_flutter_test.dart @@ -1277,7 +1277,7 @@ class MyWebViewPlatform implements WebViewPlatform { }) { assert(onWebViewPlatformCreated != null); lastPlatformBuilt = MyWebViewPlatformController( - creationParams, gestureRecognizers, webViewPlatformCallbacksHandler); + creationParams, webViewPlatformCallbacksHandler); onWebViewPlatformCreated!(lastPlatformBuilt); return Container(); } @@ -1289,12 +1289,11 @@ class MyWebViewPlatform implements WebViewPlatform { } class MyWebViewPlatformController extends WebViewPlatformController { - MyWebViewPlatformController(this.creationParams, this.gestureRecognizers, - WebViewPlatformCallbacksHandler platformHandler) + MyWebViewPlatformController( + this.creationParams, WebViewPlatformCallbacksHandler platformHandler) : super(platformHandler); CreationParams? creationParams; - Set>? gestureRecognizers; String? lastUrlLoaded; Map? lastRequestHeaders; diff --git a/packages/webview_flutter/webview_flutter_android/CHANGELOG.md b/packages/webview_flutter/webview_flutter_android/CHANGELOG.md index 09f214c71b3e..ab74abceaf63 100644 --- a/packages/webview_flutter/webview_flutter_android/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.13.2 + +* Fixes new lint warnings. + ## 3.13.1 * Bumps androidx.annotation:annotation from 1.7.0 to 1.7.1. diff --git a/packages/webview_flutter/webview_flutter_android/example/lib/main.dart b/packages/webview_flutter/webview_flutter_android/example/lib/main.dart index 387fdb1bb664..582a48ac92ba 100644 --- a/packages/webview_flutter/webview_flutter_android/example/lib/main.dart +++ b/packages/webview_flutter/webview_flutter_android/example/lib/main.dart @@ -310,52 +310,36 @@ class SampleMenu extends StatelessWidget { switch (value) { case MenuOptions.showUserAgent: _onShowUserAgent(); - break; case MenuOptions.listCookies: _onListCookies(context); - break; case MenuOptions.clearCookies: _onClearCookies(context); - break; case MenuOptions.addToCache: _onAddToCache(context); - break; case MenuOptions.listCache: _onListCache(); - break; case MenuOptions.clearCache: _onClearCache(context); - break; case MenuOptions.navigationDelegate: _onNavigationDelegateExample(); - break; case MenuOptions.doPostRequest: _onDoPostRequest(); - break; case MenuOptions.loadLocalFile: _onLoadLocalFileExample(); - break; case MenuOptions.loadFlutterAsset: _onLoadFlutterAssetExample(); - break; case MenuOptions.loadHtmlString: _onLoadHtmlStringExample(); - break; case MenuOptions.transparentBackground: _onTransparentBackground(); - break; case MenuOptions.setCookie: _onSetCookie(); - break; case MenuOptions.videoExample: _onVideoExample(context); - break; case MenuOptions.logExample: _onLogExample(); - break; case MenuOptions.basicAuthentication: _promptForUrl(context); - break; } }, itemBuilder: (BuildContext context) => >[ diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart index bb90f393cddb..3c9d6d086ac7 100644 --- a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart +++ b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart @@ -204,17 +204,13 @@ class AndroidWebViewController extends PlatformWebViewController { case ConsoleMessageLevel.debug: case ConsoleMessageLevel.tip: logLevel = JavaScriptLogLevel.debug; - break; case ConsoleMessageLevel.error: logLevel = JavaScriptLogLevel.error; - break; case ConsoleMessageLevel.warning: logLevel = JavaScriptLogLevel.warning; - break; case ConsoleMessageLevel.unknown: case ConsoleMessageLevel.log: logLevel = JavaScriptLogLevel.log; - break; } callback(JavaScriptConsoleMessage( @@ -736,13 +732,10 @@ class FileSelectorParams { switch (params.mode) { case android_webview.FileChooserMode.open: mode = FileSelectorMode.open; - break; case android_webview.FileChooserMode.openMultiple: mode = FileSelectorMode.openMultiple; - break; case android_webview.FileChooserMode.save: mode = FileSelectorMode.save; - break; } return FileSelectorParams( diff --git a/packages/webview_flutter/webview_flutter_android/lib/webview_flutter_android.dart b/packages/webview_flutter/webview_flutter_android/lib/webview_flutter_android.dart index 95f835ed8a1d..a9297fa43cb1 100644 --- a/packages/webview_flutter/webview_flutter_android/lib/webview_flutter_android.dart +++ b/packages/webview_flutter/webview_flutter_android/lib/webview_flutter_android.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -library webview_flutter_android; - export 'src/android_webview_controller.dart'; export 'src/android_webview_cookie_manager.dart'; export 'src/android_webview_platform.dart'; diff --git a/packages/webview_flutter/webview_flutter_android/pubspec.yaml b/packages/webview_flutter/webview_flutter_android/pubspec.yaml index d9c7adf6abac..1295ba6c6cb8 100644 --- a/packages/webview_flutter/webview_flutter_android/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_android/pubspec.yaml @@ -2,7 +2,7 @@ name: webview_flutter_android description: A Flutter plugin that provides a WebView widget on Android. repository: https://github.com/flutter/packages/tree/main/packages/webview_flutter/webview_flutter_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22 -version: 3.13.1 +version: 3.13.2 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.dart index ee1e27a2a694..eb5f8a89eef5 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.dart @@ -20,8 +20,8 @@ import 'android_navigation_delegate_test.dart'; import 'android_webview_controller_test.mocks.dart'; import 'android_webview_test.mocks.dart' show - MockTestGeolocationPermissionsCallbackHostApi, - MockTestCustomViewCallbackHostApi; + MockTestCustomViewCallbackHostApi, + MockTestGeolocationPermissionsCallbackHostApi; import 'test_android_webview.g.dart'; @GenerateNiceMocks(>[ diff --git a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.dart b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.dart index b0962ea812db..121a623e0ef7 100644 --- a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.dart +++ b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.dart @@ -724,7 +724,7 @@ void main() { onReceivedRequestError: anyNamed('onReceivedRequestError'), requestLoading: anyNamed('requestLoading'), urlLoading: anyNamed('urlLoading'), - )).captured.single as Function(android_webview.WebView, String); + )).captured.single as void Function(android_webview.WebView, String); onPageStarted(mockWebView, 'https://google.com'); verify(mockCallbacksHandler.onPageStarted('https://google.com')); @@ -741,7 +741,7 @@ void main() { onReceivedRequestError: anyNamed('onReceivedRequestError'), requestLoading: anyNamed('requestLoading'), urlLoading: anyNamed('urlLoading'), - )).captured.single as Function(android_webview.WebView, String); + )).captured.single as void Function(android_webview.WebView, String); onPageFinished(mockWebView, 'https://google.com'); verify(mockCallbacksHandler.onPageFinished('https://google.com')); @@ -759,7 +759,7 @@ void main() { onReceivedRequestError: anyNamed('onReceivedRequestError'), requestLoading: anyNamed('requestLoading'), urlLoading: anyNamed('urlLoading'), - )).captured.single as Function( + )).captured.single as void Function( android_webview.WebView, int, String, String); onReceivedError( @@ -795,7 +795,7 @@ void main() { onReceivedRequestError: captureAnyNamed('onReceivedRequestError'), requestLoading: anyNamed('requestLoading'), urlLoading: anyNamed('urlLoading'), - )).captured.single as Function( + )).captured.single as void Function( android_webview.WebView, android_webview.WebResourceRequest, android_webview.WebResourceError, @@ -844,7 +844,7 @@ void main() { onReceivedRequestError: anyNamed('onReceivedRequestError'), requestLoading: anyNamed('requestLoading'), urlLoading: captureAnyNamed('urlLoading'), - )).captured.single as Function(android_webview.WebView, String); + )).captured.single as void Function(android_webview.WebView, String); urlLoading(mockWebView, 'https://google.com'); verify(mockCallbacksHandler.onNavigationRequest( @@ -872,7 +872,7 @@ void main() { onReceivedRequestError: anyNamed('onReceivedRequestError'), requestLoading: captureAnyNamed('requestLoading'), urlLoading: anyNamed('urlLoading'), - )).captured.single as Function( + )).captured.single as void Function( android_webview.WebView, android_webview.WebResourceRequest, ); diff --git a/packages/webview_flutter/webview_flutter_web/CHANGELOG.md b/packages/webview_flutter/webview_flutter_web/CHANGELOG.md index ec309b91d9fe..2774fce307f3 100644 --- a/packages/webview_flutter/webview_flutter_web/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter_web/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 0.2.2+4 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Fixes new lint warnings. ## 0.2.2+3 diff --git a/packages/webview_flutter/webview_flutter_web/example/lib/main.dart b/packages/webview_flutter/webview_flutter_web/example/lib/main.dart index 092de590e169..9ce006031279 100644 --- a/packages/webview_flutter/webview_flutter_web/example/lib/main.dart +++ b/packages/webview_flutter/webview_flutter_web/example/lib/main.dart @@ -63,7 +63,6 @@ class _SampleMenu extends StatelessWidget { switch (value) { case _MenuOptions.doPostRequest: _onDoPostRequest(controller); - break; } }, itemBuilder: (BuildContext context) => >[ diff --git a/packages/webview_flutter/webview_flutter_web/lib/src/content_type.dart b/packages/webview_flutter/webview_flutter_web/lib/src/content_type.dart index 0aa18ce2318a..e0456a92ff7e 100644 --- a/packages/webview_flutter/webview_flutter_web/lib/src/content_type.dart +++ b/packages/webview_flutter/webview_flutter_web/lib/src/content_type.dart @@ -22,10 +22,8 @@ class ContentType { switch (bits[0]) { case 'charset': _charset = bits[1]; - break; case 'boundary': _boundary = bits[1]; - break; default: throw StateError('Unable to parse "$chunk" in content-type.'); } diff --git a/packages/webview_flutter/webview_flutter_web/lib/webview_flutter_web.dart b/packages/webview_flutter/webview_flutter_web/lib/webview_flutter_web.dart index f11c85e4bf29..a2992abc2812 100644 --- a/packages/webview_flutter/webview_flutter_web/lib/webview_flutter_web.dart +++ b/packages/webview_flutter/webview_flutter_web/lib/webview_flutter_web.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -library webview_flutter_web; - export 'src/http_request_factory.dart'; export 'src/web_webview_controller.dart'; export 'src/web_webview_platform.dart'; diff --git a/packages/webview_flutter/webview_flutter_web/pubspec.yaml b/packages/webview_flutter/webview_flutter_web/pubspec.yaml index 2420900ec29c..5ea71861ca4d 100644 --- a/packages/webview_flutter/webview_flutter_web/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_web/pubspec.yaml @@ -2,7 +2,7 @@ name: webview_flutter_web description: A Flutter plugin that provides a WebView widget on web. repository: https://github.com/flutter/packages/tree/main/packages/webview_flutter/webview_flutter_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22 -version: 0.2.2+3 +version: 0.2.2+4 environment: sdk: ">=3.1.0 <4.0.0" diff --git a/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md b/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md index cc60d2de0941..9e1c155c2a5b 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.10.1 + +* Fixes new lint warnings. + ## 3.10.0 * Adds support for `PlatformNavigationDelegate.setOnHttpAuthRequest`. diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/lib/main.dart b/packages/webview_flutter/webview_flutter_wkwebview/example/lib/main.dart index c2370184bf11..cf8063717910 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/lib/main.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/lib/main.dart @@ -320,49 +320,34 @@ class SampleMenu extends StatelessWidget { switch (value) { case MenuOptions.showUserAgent: _onShowUserAgent(); - break; case MenuOptions.listCookies: _onListCookies(context); - break; case MenuOptions.clearCookies: _onClearCookies(context); - break; case MenuOptions.addToCache: _onAddToCache(context); - break; case MenuOptions.listCache: _onListCache(); - break; case MenuOptions.clearCache: _onClearCache(context); - break; case MenuOptions.navigationDelegate: _onNavigationDelegateExample(); - break; case MenuOptions.doPostRequest: _onDoPostRequest(); - break; case MenuOptions.loadLocalFile: _onLoadLocalFileExample(); - break; case MenuOptions.loadFlutterAsset: _onLoadFlutterAssetExample(); - break; case MenuOptions.loadHtmlString: _onLoadHtmlStringExample(); - break; case MenuOptions.transparentBackground: _onTransparentBackground(); - break; case MenuOptions.setCookie: _onSetCookie(); - break; case MenuOptions.logExample: _onLogExample(); - break; case MenuOptions.basicAuthentication: _promptForUrl(context); - break; } }, itemBuilder: (BuildContext context) => >[ diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation.dart index 2647ed95b8bd..5c6d61aa8f7e 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation.dart @@ -10,7 +10,7 @@ import '../common/weak_reference_utils.dart'; import 'foundation_api_impls.dart'; export 'foundation_api_impls.dart' - show NSUrlSessionAuthChallengeDisposition, NSUrlCredentialPersistence; + show NSUrlCredentialPersistence, NSUrlSessionAuthChallengeDisposition; /// The values that can be returned in a change map. /// diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation_api_impls.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation_api_impls.dart index 7bd1259e2f70..fd8dc58a6ccd 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation_api_impls.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation_api_impls.dart @@ -10,7 +10,7 @@ import '../common/web_kit.g.dart'; import 'foundation.dart'; export '../common/web_kit.g.dart' - show NSUrlSessionAuthChallengeDisposition, NSUrlCredentialPersistence; + show NSUrlCredentialPersistence, NSUrlSessionAuthChallengeDisposition; Iterable _toNSKeyValueObservingOptionsEnumData( @@ -23,16 +23,12 @@ Iterable switch (option) { case NSKeyValueObservingOptions.newValue: value = NSKeyValueObservingOptionsEnum.newValue; - break; case NSKeyValueObservingOptions.oldValue: value = NSKeyValueObservingOptionsEnum.oldValue; - break; case NSKeyValueObservingOptions.initialValue: value = NSKeyValueObservingOptionsEnum.initialValue; - break; case NSKeyValueObservingOptions.priorNotification: value = NSKeyValueObservingOptionsEnum.priorNotification; - break; } return NSKeyValueObservingOptionsEnumData(value: value); diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/web_kit_webview_widget.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/web_kit_webview_widget.dart index f344edb00bb6..6c984ec50bc8 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/web_kit_webview_widget.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/web_kit_webview_widget.dart @@ -252,10 +252,8 @@ class WebKitWebViewPlatformController extends WebViewPlatformController { switch (autoMediaPlaybackPolicy) { case AutoMediaPlaybackPolicy.require_user_action_for_all_media_types: requiresUserAction = true; - break; case AutoMediaPlaybackPolicy.always_allow: requiresUserAction = false; - break; } configuration @@ -578,19 +576,14 @@ class WebKitWebViewPlatformController extends WebViewPlatformController { switch (error.code) { case WKErrorCode.unknown: errorType = WebResourceErrorType.unknown; - break; case WKErrorCode.webContentProcessTerminated: errorType = WebResourceErrorType.webContentProcessTerminated; - break; case WKErrorCode.webViewInvalidated: errorType = WebResourceErrorType.webViewInvalidated; - break; case WKErrorCode.javaScriptExceptionOccurred: errorType = WebResourceErrorType.javaScriptExceptionOccurred; - break; case WKErrorCode.javaScriptResultTypeIsUnsupported: errorType = WebResourceErrorType.javaScriptResultTypeIsUnsupported; - break; } return WebResourceError( diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit.dart index b5bfcd9d346e..d157b3c65892 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit.dart @@ -11,7 +11,7 @@ import '../ui_kit/ui_kit.dart'; import 'web_kit_api_impls.dart'; export 'web_kit_api_impls.dart' - show WKNavigationType, WKPermissionDecision, WKMediaCaptureType; + show WKMediaCaptureType, WKNavigationType, WKPermissionDecision; /// Times at which to inject script content into a webpage. /// diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit_api_impls.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit_api_impls.dart index bb86f2b5bcc9..de28939bbb9c 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit_api_impls.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit_api_impls.dart @@ -13,7 +13,7 @@ import '../foundation/foundation.dart'; import 'web_kit.dart'; export '../common/web_kit.g.dart' - show WKNavigationType, WKPermissionDecision, WKMediaCaptureType; + show WKMediaCaptureType, WKNavigationType, WKPermissionDecision; Iterable _toWKWebsiteDataTypeEnumData( Iterable types) { @@ -22,28 +22,20 @@ Iterable _toWKWebsiteDataTypeEnumData( switch (type) { case WKWebsiteDataType.cookies: value = WKWebsiteDataTypeEnum.cookies; - break; case WKWebsiteDataType.memoryCache: value = WKWebsiteDataTypeEnum.memoryCache; - break; case WKWebsiteDataType.diskCache: value = WKWebsiteDataTypeEnum.diskCache; - break; case WKWebsiteDataType.offlineWebApplicationCache: value = WKWebsiteDataTypeEnum.offlineWebApplicationCache; - break; case WKWebsiteDataType.localStorage: value = WKWebsiteDataTypeEnum.localStorage; - break; case WKWebsiteDataType.sessionStorage: value = WKWebsiteDataTypeEnum.sessionStorage; - break; case WKWebsiteDataType.webSQLDatabases: value = WKWebsiteDataTypeEnum.webSQLDatabases; - break; case WKWebsiteDataType.indexedDBDatabases: value = WKWebsiteDataTypeEnum.indexedDBDatabases; - break; } return WKWebsiteDataTypeEnumData(value: value); @@ -82,46 +74,32 @@ extension _NSHttpCookiePropertyKeyConverter on NSHttpCookiePropertyKey { switch (this) { case NSHttpCookiePropertyKey.comment: value = NSHttpCookiePropertyKeyEnum.comment; - break; case NSHttpCookiePropertyKey.commentUrl: value = NSHttpCookiePropertyKeyEnum.commentUrl; - break; case NSHttpCookiePropertyKey.discard: value = NSHttpCookiePropertyKeyEnum.discard; - break; case NSHttpCookiePropertyKey.domain: value = NSHttpCookiePropertyKeyEnum.domain; - break; case NSHttpCookiePropertyKey.expires: value = NSHttpCookiePropertyKeyEnum.expires; - break; case NSHttpCookiePropertyKey.maximumAge: value = NSHttpCookiePropertyKeyEnum.maximumAge; - break; case NSHttpCookiePropertyKey.name: value = NSHttpCookiePropertyKeyEnum.name; - break; case NSHttpCookiePropertyKey.originUrl: value = NSHttpCookiePropertyKeyEnum.originUrl; - break; case NSHttpCookiePropertyKey.path: value = NSHttpCookiePropertyKeyEnum.path; - break; case NSHttpCookiePropertyKey.port: value = NSHttpCookiePropertyKeyEnum.port; - break; case NSHttpCookiePropertyKey.sameSitePolicy: value = NSHttpCookiePropertyKeyEnum.sameSitePolicy; - break; case NSHttpCookiePropertyKey.secure: value = NSHttpCookiePropertyKeyEnum.secure; - break; case NSHttpCookiePropertyKey.value: value = NSHttpCookiePropertyKeyEnum.value; - break; case NSHttpCookiePropertyKey.version: value = NSHttpCookiePropertyKeyEnum.version; - break; } return NSHttpCookiePropertyKeyEnumData(value: value); @@ -134,10 +112,8 @@ extension _WKUserScriptInjectionTimeConverter on WKUserScriptInjectionTime { switch (this) { case WKUserScriptInjectionTime.atDocumentStart: value = WKUserScriptInjectionTimeEnum.atDocumentStart; - break; case WKUserScriptInjectionTime.atDocumentEnd: value = WKUserScriptInjectionTimeEnum.atDocumentEnd; - break; } return WKUserScriptInjectionTimeEnumData(value: value); @@ -153,16 +129,12 @@ Iterable _toWKAudiovisualMediaTypeEnumData( switch (type) { case WKAudiovisualMediaType.none: value = WKAudiovisualMediaTypeEnum.none; - break; case WKAudiovisualMediaType.audio: value = WKAudiovisualMediaTypeEnum.audio; - break; case WKAudiovisualMediaType.video: value = WKAudiovisualMediaTypeEnum.video; - break; case WKAudiovisualMediaType.all: value = WKAudiovisualMediaTypeEnum.all; - break; } return WKAudiovisualMediaTypeEnumData(value: value); diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_webview_controller.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_webview_controller.dart index 62a4deb8ad43..6c28becacdeb 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_webview_controller.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_webview_controller.dart @@ -192,18 +192,15 @@ class WebKitWebViewController extends PlatformWebViewController { types = { WebViewPermissionResourceType.camera }; - break; case WKMediaCaptureType.cameraAndMicrophone: types = { WebViewPermissionResourceType.camera, WebViewPermissionResourceType.microphone }; - break; case WKMediaCaptureType.microphone: types = { WebViewPermissionResourceType.microphone }; - break; case WKMediaCaptureType.unknown: // The default response for iOS is to prompt. See // https://developer.apple.com/documentation/webkit/wkuidelegate/3763087-webview?language=objc @@ -253,7 +250,6 @@ class WebKitWebViewController extends PlatformWebViewController { change[NSKeyValueChangeKey.newValue]! as double; progressCallback((progress * 100).round()); } - break; case 'URL': final UrlChangeCallback? urlChangeCallback = controller._currentNavigationDelegate?._onUrlChange; @@ -261,7 +257,6 @@ class WebKitWebViewController extends PlatformWebViewController { final NSUrl? url = change[NSKeyValueChangeKey.newValue] as NSUrl?; urlChangeCallback(UrlChange(url: await url?.getAbsoluteString())); } - break; } }; }), @@ -550,16 +545,12 @@ class WebKitWebViewController extends PlatformWebViewController { switch (consoleLog['level']) { case 'error': level = JavaScriptLogLevel.error; - break; case 'warning': level = JavaScriptLogLevel.warning; - break; case 'debug': level = JavaScriptLogLevel.debug; - break; case 'info': level = JavaScriptLogLevel.info; - break; case 'log': default: level = JavaScriptLogLevel.log; diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/webview_flutter_wkwebview.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/webview_flutter_wkwebview.dart index f54fb73bcda3..01dbb61babe8 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/webview_flutter_wkwebview.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/webview_flutter_wkwebview.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -library webview_flutter_wkwebview; - export 'src/webkit_webview_controller.dart'; export 'src/webkit_webview_cookie_manager.dart'; export 'src/webkit_webview_platform.dart'; diff --git a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml index a7e58858c08e..4df9efce3d7a 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml @@ -2,7 +2,7 @@ name: webview_flutter_wkwebview description: A Flutter plugin that provides a WebView widget based on Apple's WKWebView control. repository: https://github.com/flutter/packages/tree/main/packages/webview_flutter/webview_flutter_wkwebview issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22 -version: 3.10.0 +version: 3.10.1 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/xdg_directories/CHANGELOG.md b/packages/xdg_directories/CHANGELOG.md index a705fe74d7d1..cb11d4827d84 100644 --- a/packages/xdg_directories/CHANGELOG.md +++ b/packages/xdg_directories/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 1.0.4 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Fixes new lint warnings. ## 1.0.3 diff --git a/packages/xdg_directories/example/integration_test/xdg_directories_test.dart b/packages/xdg_directories/example/integration_test/xdg_directories_test.dart index 8628394cf1cc..b25732e61ff9 100644 --- a/packages/xdg_directories/example/integration_test/xdg_directories_test.dart +++ b/packages/xdg_directories/example/integration_test/xdg_directories_test.dart @@ -11,9 +11,9 @@ import 'package:xdg_directories_example/main.dart'; void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); - testWidgets('xdg_directories_demo', (WidgetTester _) async { + testWidgets('xdg_directories_demo', (WidgetTester tester) async { // Build our app and trigger a frame. - await _.pumpWidget(const MyApp()); + await tester.pumpWidget(const MyApp()); expect(find.textContaining(dataHome.path), findsWidgets); expect(find.textContaining(configHome.path), findsWidgets); diff --git a/packages/xdg_directories/lib/xdg_directories.dart b/packages/xdg_directories/lib/xdg_directories.dart index 7e115a5aab25..60448a0ddc2f 100644 --- a/packages/xdg_directories/lib/xdg_directories.dart +++ b/packages/xdg_directories/lib/xdg_directories.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -library xdg_directories; - import 'dart:convert'; import 'dart:io'; diff --git a/packages/xdg_directories/pubspec.yaml b/packages/xdg_directories/pubspec.yaml index dbc52075e95d..85358008c68f 100644 --- a/packages/xdg_directories/pubspec.yaml +++ b/packages/xdg_directories/pubspec.yaml @@ -2,7 +2,7 @@ name: xdg_directories description: A Dart package for reading XDG directory configuration information on Linux. repository: https://github.com/flutter/packages/tree/main/packages/xdg_directories issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+xdg_directories%22 -version: 1.0.3 +version: 1.0.4 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/script/tool/test/common/package_looping_command_test.dart b/script/tool/test/common/package_looping_command_test.dart index 96ef53c48e47..f5084943949a 100644 --- a/script/tool/test/common/package_looping_command_test.dart +++ b/script/tool/test/common/package_looping_command_test.dart @@ -106,7 +106,6 @@ void main() { PackageLoopingType packageLoopingType = PackageLoopingType.topLevelOnly, bool failsDuringInit = false, bool warnsDuringInit = false, - bool warnsDuringCleanup = false, bool captureOutput = false, String? customFailureListHeader, String? customFailureListFooter, @@ -132,7 +131,6 @@ void main() { packageLoopingType: packageLoopingType, failsDuringInit: failsDuringInit, warnsDuringInit: warnsDuringInit, - warnsDuringCleanup: warnsDuringCleanup, customFailureListHeader: customFailureListHeader, customFailureListFooter: customFailureListFooter, captureOutput: captureOutput, @@ -835,7 +833,6 @@ void main() { final TestPackageLoopingCommand command = createTestCommand( hasLongOutput: false, - warnsDuringCleanup: true, warnsDuringInit: true, ); final List output = await runCommand(command); @@ -866,7 +863,6 @@ class TestPackageLoopingCommand extends PackageLoopingCommand { this.customFailureListFooter, this.failsDuringInit = false, this.warnsDuringInit = false, - this.warnsDuringCleanup = false, this.captureOutput = false, super.processRunner, super.gitDir, @@ -880,7 +876,6 @@ class TestPackageLoopingCommand extends PackageLoopingCommand { final bool failsDuringInit; final bool warnsDuringInit; - final bool warnsDuringCleanup; @override bool hasLongOutput; diff --git a/script/tool/test/common/pub_version_finder_test.dart b/script/tool/test/common/pub_version_finder_test.dart index 1692cf214abe..88d1a7f9c091 100644 --- a/script/tool/test/common/pub_version_finder_test.dart +++ b/script/tool/test/common/pub_version_finder_test.dart @@ -3,12 +3,10 @@ // found in the LICENSE file. import 'dart:convert'; -import 'dart:io'; import 'package:flutter_plugin_tools/src/common/pub_version_finder.dart'; import 'package:http/http.dart' as http; import 'package:http/testing.dart'; -import 'package:mockito/mockito.dart'; import 'package:pub_semver/pub_semver.dart'; import 'package:test/test.dart'; @@ -85,5 +83,3 @@ void main() { expect(response.httpResponse.body, json.encode(httpResponse)); }); } - -class MockProcessResult extends Mock implements ProcessResult {} diff --git a/script/tool/test/util.dart b/script/tool/test/util.dart index 1fd6abd80b3c..f507b988a0da 100644 --- a/script/tool/test/util.dart +++ b/script/tool/test/util.dart @@ -329,8 +329,8 @@ String _pluginPlatformSection( Future> runCapturingPrint( CommandRunner runner, List args, { - Function(Error error)? errorHandler, - Function(Exception error)? exceptionHandler, + void Function(Error error)? errorHandler, + void Function(Exception error)? exceptionHandler, }) async { final List prints = []; final ZoneSpecification spec = ZoneSpecification( diff --git a/script/tool/test/version_check_command_test.dart b/script/tool/test/version_check_command_test.dart index 13bee57785c0..0a30c4dde401 100644 --- a/script/tool/test/version_check_command_test.dart +++ b/script/tool/test/version_check_command_test.dart @@ -3,7 +3,6 @@ // found in the LICENSE file. import 'dart:convert'; -import 'dart:io' as io; import 'package:args/command_runner.dart'; import 'package:file/file.dart'; @@ -40,8 +39,6 @@ void testAllowedVersion( } } -class MockProcessResult extends Mock implements io.ProcessResult {} - void main() { const String indentation = ' '; group('VersionCheckCommand', () {