Skip to content

Commit 34ebdf6

Browse files
committed
Migrate away from deprecated strong mode options
1 parent 2b852d5 commit 34ebdf6

10 files changed

+40
-14
lines changed

analysis_options.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
analyzer:
2-
strong-mode:
3-
implicit-dynamic: false
2+
language:
3+
# strict-casts: true 11 issues found
4+
strict-inference: true
5+
strict-raw-types: true
6+
47
errors:
58
# treat missing required parameters as a warning (not a hint)
69
missing_required_param: warning

lib/config/config.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ class Config {
174174
final MacOSConfig? macOSConfig;
175175

176176
/// Creates [Config] icons from [json]
177-
factory Config.fromJson(Map json) => _$ConfigFromJson(json);
177+
factory Config.fromJson(Map<dynamic, dynamic> json) => _$ConfigFromJson(json);
178178

179179
/// whether or not there is configuration for adaptive icons for android
180180
bool get hasAndroidAdaptiveConfig =>

lib/config/config.g.dart

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/config/macos_config.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ class MacOSConfig {
2323
});
2424

2525
/// Creates [WebConfig] from [json]
26-
factory MacOSConfig.fromJson(Map json) => _$MacOSConfigFromJson(json);
26+
factory MacOSConfig.fromJson(Map<dynamic, dynamic> json) =>
27+
_$MacOSConfigFromJson(json);
2728

2829
/// Creates [Map] from [WebConfig]
2930
Map<String, dynamic> toJson() => _$MacOSConfigToJson(this);

lib/config/web_config.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ class WebConfig {
3232
});
3333

3434
/// Creates [WebConfig] from [json]
35-
factory WebConfig.fromJson(Map json) => _$WebConfigFromJson(json);
35+
factory WebConfig.fromJson(Map<dynamic, dynamic> json) =>
36+
_$WebConfigFromJson(json);
3637

3738
/// Creates [Map] from [WebConfig]
3839
Map<String, dynamic> toJson() => _$WebConfigToJson(this);

lib/config/windows_config.dart

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ class WindowsConfig {
2727
});
2828

2929
/// Creates [WindowsConfig] from [json]
30-
factory WindowsConfig.fromJson(Map json) => _$WindowsConfigFromJson(json);
30+
factory WindowsConfig.fromJson(Map<dynamic, dynamic> json) =>
31+
_$WindowsConfigFromJson(json);
3132

3233
/// Creates [Map] from [WindowsConfig]
33-
Map toJson() => _$WindowsConfigToJson(this);
34+
Map<String, dynamic> toJson() => _$WindowsConfigToJson(this);
3435

3536
@override
3637
String toString() => 'WindowsConfig: ${toJson()}';

lib/pubspec_parser.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ class PubspecParser {
99
PubspecParser._();
1010

1111
/// parses the pubspec located at [path] to map
12-
static Map fromPathToMap(String path) {
12+
static Map<dynamic, dynamic> fromPathToMap(String path) {
1313
final File file = File(path);
1414
final String yamlString = file.readAsStringSync();
15-
final Map yamlMap = loadYaml(yamlString);
15+
final Map<dynamic, dynamic> yamlMap = loadYaml(yamlString);
1616
return yamlMap;
1717
}
1818
}

test/abs/icon_generator_test.mocks.dart

+6
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ class MockConfig extends _i1.Mock implements _i3.Config {
4040
_i1.throwOnMissingStub(this);
4141
}
4242

43+
@override
44+
int get adaptiveIconForegroundInset => (super.noSuchMethod(
45+
Invocation.getter(#adaptiveIconForegroundInset),
46+
returnValue: 0,
47+
) as int);
48+
4349
@override
4450
int get minSdkAndroid => (super.noSuchMethod(
4551
Invocation.getter(#minSdkAndroid),

test/macos/macos_icon_generator_test.mocks.dart

+7
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ class _FakeProgress_1 extends _i1.SmartFake implements _i2.Progress {
4747
///
4848
/// See the documentation for Mockito's code generation for more information.
4949
class MockConfig extends _i1.Mock implements _i3.Config {
50+
@override
51+
int get adaptiveIconForegroundInset => (super.noSuchMethod(
52+
Invocation.getter(#adaptiveIconForegroundInset),
53+
returnValue: 0,
54+
returnValueForMissingStub: 0,
55+
) as int);
56+
5057
@override
5158
int get minSdkAndroid => (super.noSuchMethod(
5259
Invocation.getter(#minSdkAndroid),

test/windows/windows_icon_generator_test.mocks.dart

+9-3
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ class MockConfig extends _i1.Mock implements _i3.Config {
5151
_i1.throwOnMissingStub(this);
5252
}
5353

54+
@override
55+
int get adaptiveIconForegroundInset => (super.noSuchMethod(
56+
Invocation.getter(#adaptiveIconForegroundInset),
57+
returnValue: 0,
58+
) as int);
59+
5460
@override
5561
int get minSdkAndroid => (super.noSuchMethod(
5662
Invocation.getter(#minSdkAndroid),
@@ -157,13 +163,13 @@ class MockWindowsConfig extends _i1.Mock implements _i5.WindowsConfig {
157163
) as bool);
158164

159165
@override
160-
Map<dynamic, dynamic> toJson() => (super.noSuchMethod(
166+
Map<String, dynamic> toJson() => (super.noSuchMethod(
161167
Invocation.method(
162168
#toJson,
163169
[],
164170
),
165-
returnValue: <dynamic, dynamic>{},
166-
) as Map<dynamic, dynamic>);
171+
returnValue: <String, dynamic>{},
172+
) as Map<String, dynamic>);
167173
}
168174

169175
/// A class which mocks [FLILogger].

0 commit comments

Comments
 (0)