From 3aff2cc044eef3115499fa16ea4f00b770809c4a Mon Sep 17 00:00:00 2001 From: Sergey Molchanovsky Date: Mon, 16 Dec 2024 12:43:43 +0300 Subject: [PATCH 1/9] remove explicit WidgetBuilder type --- flutter_mobx/test/helpers.dart | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/flutter_mobx/test/helpers.dart b/flutter_mobx/test/helpers.dart index 086151fa..f6e6d860 100644 --- a/flutter_mobx/test/helpers.dart +++ b/flutter_mobx/test/helpers.dart @@ -1,4 +1,3 @@ -import 'package:flutter/widgets.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:mobx/mobx.dart'; import 'package:mobx/src/core.dart' show ReactionImpl; @@ -21,7 +20,11 @@ class MockReaction extends Mock implements ReactionImpl { // ignore: must_be_immutable class TestObserver extends Observer { - TestObserver(this.reaction, {super.key, required WidgetBuilder super.builder}); + TestObserver( + this.reaction, { + super.key, + required super.builder, + }); final Reaction reaction; @@ -37,7 +40,7 @@ class TestObserver extends Observer { class LoggingObserver extends Observer { // ignore: prefer_const_constructors_in_immutables LoggingObserver({ - required WidgetBuilder super.builder, + required super.builder, super.warnWhenNoObservables, super.key, }); @@ -54,7 +57,7 @@ class LoggingObserver extends Observer { class FlutterErrorThrowingObserver extends Observer { // ignore: prefer_const_constructors_in_immutables FlutterErrorThrowingObserver({ - required WidgetBuilder super.builder, + required super.builder, required this.errorToThrow, super.key, }); From 5431c0b75cdf6334cdabcc6ecfbce119740b1aac Mon Sep 17 00:00:00 2001 From: Sergey Molchanovsky Date: Mon, 16 Dec 2024 12:55:50 +0300 Subject: [PATCH 2/9] ignore --- mobx_codegen/test/generator_usage_test.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/mobx_codegen/test/generator_usage_test.dart b/mobx_codegen/test/generator_usage_test.dart index 833aafc1..fef3353a 100644 --- a/mobx_codegen/test/generator_usage_test.dart +++ b/mobx_codegen/test/generator_usage_test.dart @@ -15,6 +15,7 @@ abstract class _TestStore with Store { @observable String field1; + // ignore: unused_element_parameter @observable String? field2; From 95d1d43ec8fae681c31952d0ce4d36fedf8ff099 Mon Sep 17 00:00:00 2001 From: Sergey Molchanovsky Date: Mon, 16 Dec 2024 12:57:08 +0300 Subject: [PATCH 3/9] Revert "ignore" This reverts commit 5431c0b75cdf6334cdabcc6ecfbce119740b1aac. --- mobx_codegen/test/generator_usage_test.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/mobx_codegen/test/generator_usage_test.dart b/mobx_codegen/test/generator_usage_test.dart index fef3353a..833aafc1 100644 --- a/mobx_codegen/test/generator_usage_test.dart +++ b/mobx_codegen/test/generator_usage_test.dart @@ -15,7 +15,6 @@ abstract class _TestStore with Store { @observable String field1; - // ignore: unused_element_parameter @observable String? field2; From 6887d5188a55bff63eb4d651c8cca77a98ea605d Mon Sep 17 00:00:00 2001 From: Sergey Molchanovsky Date: Mon, 16 Dec 2024 13:00:32 +0300 Subject: [PATCH 4/9] Revert "remove explicit WidgetBuilder type" This reverts commit 3aff2cc044eef3115499fa16ea4f00b770809c4a. --- flutter_mobx/test/helpers.dart | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/flutter_mobx/test/helpers.dart b/flutter_mobx/test/helpers.dart index f6e6d860..086151fa 100644 --- a/flutter_mobx/test/helpers.dart +++ b/flutter_mobx/test/helpers.dart @@ -1,3 +1,4 @@ +import 'package:flutter/widgets.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:mobx/mobx.dart'; import 'package:mobx/src/core.dart' show ReactionImpl; @@ -20,11 +21,7 @@ class MockReaction extends Mock implements ReactionImpl { // ignore: must_be_immutable class TestObserver extends Observer { - TestObserver( - this.reaction, { - super.key, - required super.builder, - }); + TestObserver(this.reaction, {super.key, required WidgetBuilder super.builder}); final Reaction reaction; @@ -40,7 +37,7 @@ class TestObserver extends Observer { class LoggingObserver extends Observer { // ignore: prefer_const_constructors_in_immutables LoggingObserver({ - required super.builder, + required WidgetBuilder super.builder, super.warnWhenNoObservables, super.key, }); @@ -57,7 +54,7 @@ class LoggingObserver extends Observer { class FlutterErrorThrowingObserver extends Observer { // ignore: prefer_const_constructors_in_immutables FlutterErrorThrowingObserver({ - required super.builder, + required WidgetBuilder super.builder, required this.errorToThrow, super.key, }); From 485614c73b2e5b1fe858d2e143249f374120a176 Mon Sep 17 00:00:00 2001 From: Sergey Molchanovsky Date: Mon, 16 Dec 2024 13:01:43 +0300 Subject: [PATCH 5/9] upd. flutter_lints --- flutter_mobx/pubspec.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flutter_mobx/pubspec.yaml b/flutter_mobx/pubspec.yaml index fbfc69b8..3ba7521f 100644 --- a/flutter_mobx/pubspec.yaml +++ b/flutter_mobx/pubspec.yaml @@ -10,7 +10,7 @@ homepage: https://mobx.netlify.app topics: - reactive-programming - state-management - - ui + - user-interface environment: sdk: ">=3.0.0 <4.0.0" @@ -24,7 +24,7 @@ dependencies: dev_dependencies: build_runner: ^2.4.9 - flutter_lints: ^4.0.0 + flutter_lints: ^5.0.0 flutter_test: sdk: flutter mocktail: ^1.0.3 From 78a9a2548a301983c53bb16392894c7be8dab438 Mon Sep 17 00:00:00 2001 From: Sergey Molchanovsky Date: Mon, 16 Dec 2024 13:04:35 +0300 Subject: [PATCH 6/9] remove lib name --- flutter_mobx/lib/flutter_mobx.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/flutter_mobx/lib/flutter_mobx.dart b/flutter_mobx/lib/flutter_mobx.dart index 51601bb6..7c46ae40 100644 --- a/flutter_mobx/lib/flutter_mobx.dart +++ b/flutter_mobx/lib/flutter_mobx.dart @@ -32,8 +32,6 @@ /// ); /// -library flutter_mobx; - export 'package:flutter_mobx/src/multi_reaction_builder.dart'; export 'package:flutter_mobx/src/observer.dart'; export 'package:flutter_mobx/src/observer_widget_mixin.dart'; From f262692a936fe9355d6efe2270b87c25e6fe1e1d Mon Sep 17 00:00:00 2001 From: Sergey Molchanovsky Date: Mon, 16 Dec 2024 13:13:47 +0300 Subject: [PATCH 7/9] Revert "remove lib name" This reverts commit 78a9a2548a301983c53bb16392894c7be8dab438. --- flutter_mobx/lib/flutter_mobx.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flutter_mobx/lib/flutter_mobx.dart b/flutter_mobx/lib/flutter_mobx.dart index 7c46ae40..51601bb6 100644 --- a/flutter_mobx/lib/flutter_mobx.dart +++ b/flutter_mobx/lib/flutter_mobx.dart @@ -32,6 +32,8 @@ /// ); /// +library flutter_mobx; + export 'package:flutter_mobx/src/multi_reaction_builder.dart'; export 'package:flutter_mobx/src/observer.dart'; export 'package:flutter_mobx/src/observer_widget_mixin.dart'; From cd77e14e768e4c832412aa371917d348fc1e5dec Mon Sep 17 00:00:00 2001 From: Sergey Molchanovsky Date: Mon, 16 Dec 2024 13:16:38 +0300 Subject: [PATCH 8/9] ignore warning --- flutter_mobx/lib/flutter_mobx.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/flutter_mobx/lib/flutter_mobx.dart b/flutter_mobx/lib/flutter_mobx.dart index 51601bb6..9229a448 100644 --- a/flutter_mobx/lib/flutter_mobx.dart +++ b/flutter_mobx/lib/flutter_mobx.dart @@ -32,6 +32,7 @@ /// ); /// +// ignore: unnecessary_library_name library flutter_mobx; export 'package:flutter_mobx/src/multi_reaction_builder.dart'; From 400e590d9f31b8d414245b7f28020714164e8f3b Mon Sep 17 00:00:00 2001 From: Sergey Molchanovsky Date: Mon, 16 Dec 2024 13:27:14 +0300 Subject: [PATCH 9/9] fix unused_element --- mobx_codegen/analysis_options.yaml | 2 ++ mobx_codegen/test/generator_usage_test.dart | 1 - mobx_examples/lib/todos/todo_widgets.dart | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mobx_codegen/analysis_options.yaml b/mobx_codegen/analysis_options.yaml index 998047e8..e28d8613 100644 --- a/mobx_codegen/analysis_options.yaml +++ b/mobx_codegen/analysis_options.yaml @@ -1,6 +1,8 @@ include: package:lints/recommended.yaml analyzer: + errors: + unused_element: ignore exclude: - test/data/**.dart - test/*.g.dart diff --git a/mobx_codegen/test/generator_usage_test.dart b/mobx_codegen/test/generator_usage_test.dart index 833aafc1..950adeea 100644 --- a/mobx_codegen/test/generator_usage_test.dart +++ b/mobx_codegen/test/generator_usage_test.dart @@ -9,7 +9,6 @@ class TestStore = _TestStore with _$TestStore; bool customEquals(String? oldValue, String? newValue) => oldValue != newValue; abstract class _TestStore with Store { - // ignore: unused_element _TestStore(this.field1, {this.field2}); @observable diff --git a/mobx_examples/lib/todos/todo_widgets.dart b/mobx_examples/lib/todos/todo_widgets.dart index 5ff0b503..4e65b4a0 100644 --- a/mobx_examples/lib/todos/todo_widgets.dart +++ b/mobx_examples/lib/todos/todo_widgets.dart @@ -121,7 +121,7 @@ class ActionBar extends StatelessWidget { }, ), Observer( - builder: (_) => ButtonBar( + builder: (_) => OverflowBar( children: [ ElevatedButton( onPressed: list.canRemoveAllCompleted