Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: linting and analyzer issues #533

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
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
6 changes: 2 additions & 4 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
analyzer:
strong-mode:
implicit-dynamic: false
language:
strict-raw-types: true
OutdatedGuy marked this conversation as resolved.
Show resolved Hide resolved
errors:
# treat missing required parameters as a warning (not a hint)
missing_required_param: warning
Expand All @@ -25,7 +25,6 @@ linter:
- 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 +69,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
4 changes: 3 additions & 1 deletion lib/config/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ class Config {
final MacOSConfig? macOSConfig;

/// Creates [Config] icons from [json]
factory Config.fromJson(Map json) => _$ConfigFromJson(json);
// ? Using `Map<dynamic, dynamic>` as `YamlMap` is not castable to
// ? `Map<String, dynamic>`
factory Config.fromJson(Map<dynamic, dynamic> json) => _$ConfigFromJson(json);
OutdatedGuy marked this conversation as resolved.
Show resolved Hide resolved

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

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

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

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

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

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

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

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

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

@override
String toString() => 'WindowsConfig: ${toJson()}';
Expand Down
Loading
Loading