From b267b4e03ebc3f29cbdbb8038e885b8de045de0b Mon Sep 17 00:00:00 2001 From: evgeny Date: Tue, 8 Oct 2024 15:03:40 +0100 Subject: [PATCH] fix: analyze --- analysis_options.yaml | 4 ---- .../push_notifications_received_sliver.dart | 4 ++-- .../ui/push_notifications/push_notifications_sliver.dart | 4 ++-- example/lib/ui/realtime_sliver.dart | 4 ++-- lib/src/platform/src/codec.dart | 2 -- test/ably_flutter_plugin_test.dart | 6 ++++-- test/mock_method_call_manager.dart | 4 ++-- 7 files changed, 12 insertions(+), 16 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 8b475187e..f815b7078 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -24,7 +24,6 @@ linter: rules: - always_declare_return_types - always_put_required_named_parameters_first - - always_require_non_null_named_parameters - always_use_package_imports - avoid_bool_literals_in_conditional_expressions - avoid_catches_without_on_clauses @@ -44,8 +43,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 - avoid_setters_without_getters @@ -66,7 +63,6 @@ linter: - do_not_use_environment - empty_constructor_bodies - hash_and_equals - - invariant_booleans - join_return_with_assignment - leading_newlines_in_multiline_strings - lines_longer_than_80_chars diff --git a/example/lib/ui/push_notifications/push_notifications_received_sliver.dart b/example/lib/ui/push_notifications/push_notifications_received_sliver.dart index 15060211e..1b5b9a663 100644 --- a/example/lib/ui/push_notifications/push_notifications_received_sliver.dart +++ b/example/lib/ui/push_notifications/push_notifications_received_sliver.dart @@ -14,9 +14,9 @@ class PushNotificationsReceivedSliver extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( + const Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: const [ + children: [ Text( 'Received messages', style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), diff --git a/example/lib/ui/push_notifications/push_notifications_sliver.dart b/example/lib/ui/push_notifications/push_notifications_sliver.dart index 06a702a91..0653c4d62 100644 --- a/example/lib/ui/push_notifications/push_notifications_sliver.dart +++ b/example/lib/ui/push_notifications/push_notifications_sliver.dart @@ -47,8 +47,8 @@ class PushNotificationsSliver extends StatelessWidget { ], ); - Widget buildSummaryText() => Column( - children: const [ + Widget buildSummaryText() => const Column( + children: [ Text( 'Activate your device, view your local device information, ' 'subscribe to a push channel with either your device or ' diff --git a/example/lib/ui/realtime_sliver.dart b/example/lib/ui/realtime_sliver.dart index 15e143e5c..1f02e0849 100644 --- a/example/lib/ui/realtime_sliver.dart +++ b/example/lib/ui/realtime_sliver.dart @@ -262,8 +262,8 @@ class RealtimeSliver extends HookWidget { ), PaginatedResultViewer( title: 'History', - subtitle: Column( - children: const [ + subtitle: const Column( + children: [ TextRow( 'Hint', 'Use realtime history as a way to get messages that were' diff --git a/lib/src/platform/src/codec.dart b/lib/src/platform/src/codec.dart index dcd4e41fe..953d7d5b7 100644 --- a/lib/src/platform/src/codec.dart +++ b/lib/src/platform/src/codec.dart @@ -1,8 +1,6 @@ import 'dart:io' as io show Platform; -import 'dart:typed_data'; import 'package:ably_flutter/ably_flutter.dart'; import 'package:ably_flutter/src/platform/platform_internal.dart'; -import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; /// @nodoc diff --git a/test/ably_flutter_plugin_test.dart b/test/ably_flutter_plugin_test.dart index a5d8004ce..9fd9cc46d 100644 --- a/test/ably_flutter_plugin_test.dart +++ b/test/ably_flutter_plugin_test.dart @@ -15,7 +15,8 @@ void main() { const _nativeLibraryVersion = '1.1.0'; setUp(() { - channel.setMockMethodCallHandler((methodCall) async { + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger + .setMockMethodCallHandler(channel, (methodCall) async { switch (methodCall.method) { case PlatformMethod.resetAblyClients: return true; @@ -39,7 +40,8 @@ void main() { }); tearDown(() { - channel.setMockMethodCallHandler(null); + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger + .setMockMethodCallHandler(channel, null); }); test(PlatformMethod.getPlatformVersion, () async { diff --git a/test/mock_method_call_manager.dart b/test/mock_method_call_manager.dart index 03992d42c..57860137b 100644 --- a/test/mock_method_call_manager.dart +++ b/test/mock_method_call_manager.dart @@ -14,7 +14,7 @@ class MockMethodCallManager { MockMethodCallManager() { final channel = MethodChannel('io.ably.flutter.plugin', StandardMethodCodec(Codec())); - TestDefaultBinaryMessengerBinding.instance!.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(channel, handler); Platform(methodChannel: channel); } @@ -25,7 +25,7 @@ class MockMethodCallManager { handleCounter = 0; final channel = MethodChannel('io.ably.flutter.plugin', StandardMethodCodec(Codec())); - TestDefaultBinaryMessengerBinding.instance!.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(channel, handler); Platform(methodChannel: channel); }