Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
analyzer:
strong-mode:
implicit-dynamic: false
language:
# strict-casts: true 11 issues found
strict-inference: true
strict-raw-types: true

errors:
# treat missing required parameters as a warning (not a hint)
missing_required_param: warning
Expand All @@ -20,12 +23,9 @@ analyzer:

linter:
rules:
# See all available options here
# https://github.com/dart-lang/linter/blob/master/example/all.yaml
# See all available options at https://dart.dev/lints
- always_declare_return_types
- always_put_control_body_on_new_line

- always_require_non_null_named_parameters
- annotate_overrides
- avoid_empty_else
- avoid_field_initializers_in_const_classes
Expand Down Expand Up @@ -70,7 +70,6 @@ linter:
- prefer_const_declarations
- prefer_const_literals_to_create_immutables
- prefer_contains
- prefer_equal_for_default_values
- prefer_final_fields
- prefer_final_locals
- prefer_foreach
Expand Down
2 changes: 1 addition & 1 deletion lib/config/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class Config {
final MacOSConfig? macOSConfig;

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

/// whether or not there is configuration for adaptive icons for android
bool get hasAndroidAdaptiveConfig =>
Expand Down
5 changes: 3 additions & 2 deletions lib/config/config.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion lib/config/macos_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ class MacOSConfig {
});

/// Creates [WebConfig] from [json]
factory MacOSConfig.fromJson(Map json) => _$MacOSConfigFromJson(json);
factory MacOSConfig.fromJson(Map<dynamic, dynamic> json) =>
_$MacOSConfigFromJson(json);

/// Creates [Map] from [WebConfig]
Map<String, dynamic> toJson() => _$MacOSConfigToJson(this);
Expand Down
3 changes: 2 additions & 1 deletion lib/config/web_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class WebConfig {
});

/// Creates [WebConfig] from [json]
factory WebConfig.fromJson(Map json) => _$WebConfigFromJson(json);
factory WebConfig.fromJson(Map<dynamic, dynamic> json) =>
_$WebConfigFromJson(json);

/// Creates [Map] from [WebConfig]
Map<String, dynamic> toJson() => _$WebConfigToJson(this);
Expand Down
5 changes: 3 additions & 2 deletions lib/config/windows_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ class WindowsConfig {
});

/// Creates [WindowsConfig] from [json]
factory WindowsConfig.fromJson(Map json) => _$WindowsConfigFromJson(json);
factory WindowsConfig.fromJson(Map<dynamic, dynamic> json) =>
_$WindowsConfigFromJson(json);

/// Creates [Map] from [WindowsConfig]
Map toJson() => _$WindowsConfigToJson(this);
Map<String, dynamic> toJson() => _$WindowsConfigToJson(this);

@override
String toString() => 'WindowsConfig: ${toJson()}';
Expand Down
4 changes: 2 additions & 2 deletions lib/pubspec_parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ class PubspecParser {
PubspecParser._();

/// parses the pubspec located at [path] to map
static Map fromPathToMap(String path) {
static Map<dynamic, dynamic> fromPathToMap(String path) {
final File file = File(path);
final String yamlString = file.readAsStringSync();
final Map yamlMap = loadYaml(yamlString);
final Map<dynamic, dynamic> yamlMap = loadYaml(yamlString);
return yamlMap;
}
}
6 changes: 6 additions & 0 deletions test/abs/icon_generator_test.mocks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ class MockConfig extends _i1.Mock implements _i3.Config {
_i1.throwOnMissingStub(this);
}

@override
int get adaptiveIconForegroundInset => (super.noSuchMethod(
Invocation.getter(#adaptiveIconForegroundInset),
returnValue: 0,
) as int);

@override
int get minSdkAndroid => (super.noSuchMethod(
Invocation.getter(#minSdkAndroid),
Expand Down
7 changes: 7 additions & 0 deletions test/macos/macos_icon_generator_test.mocks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ class _FakeProgress_1 extends _i1.SmartFake implements _i2.Progress {
///
/// See the documentation for Mockito's code generation for more information.
class MockConfig extends _i1.Mock implements _i3.Config {
@override
int get adaptiveIconForegroundInset => (super.noSuchMethod(
Invocation.getter(#adaptiveIconForegroundInset),
returnValue: 0,
returnValueForMissingStub: 0,
) as int);

@override
int get minSdkAndroid => (super.noSuchMethod(
Invocation.getter(#minSdkAndroid),
Expand Down
12 changes: 9 additions & 3 deletions test/windows/windows_icon_generator_test.mocks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ class MockConfig extends _i1.Mock implements _i3.Config {
_i1.throwOnMissingStub(this);
}

@override
int get adaptiveIconForegroundInset => (super.noSuchMethod(
Invocation.getter(#adaptiveIconForegroundInset),
returnValue: 0,
) as int);

@override
int get minSdkAndroid => (super.noSuchMethod(
Invocation.getter(#minSdkAndroid),
Expand Down Expand Up @@ -157,13 +163,13 @@ class MockWindowsConfig extends _i1.Mock implements _i5.WindowsConfig {
) as bool);

@override
Map<dynamic, dynamic> toJson() => (super.noSuchMethod(
Map<String, dynamic> toJson() => (super.noSuchMethod(
Invocation.method(
#toJson,
[],
),
returnValue: <dynamic, dynamic>{},
) as Map<dynamic, dynamic>);
returnValue: <String, dynamic>{},
) as Map<String, dynamic>);
}

/// A class which mocks [FLILogger].
Expand Down