Skip to content

Commit

Permalink
Null safety migration
Browse files Browse the repository at this point in the history
  • Loading branch information
alexei-sintotski committed Jun 24, 2021
1 parent af12ff8 commit 72171da
Show file tree
Hide file tree
Showing 24 changed files with 288 additions and 159 deletions.
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@ language: dart

script:
- dev/dart_quality_checks.sh

after_success:
- pub run test_coverage
- bash <(curl -s https://codecov.io/bash)
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [3.0.0] - Null safety
* Kudos to https://github.com/spkersten for help!

## [2.0.1+1] - Dart 2.10 and pub.dev compliance

## [2.0.1] - 2020-04-23
Expand Down
11 changes: 11 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ linter:
- avoid_catching_errors
- avoid_classes_with_only_static_members
- avoid_double_and_int_checks
- avoid_dynamic_calls
- avoid_empty_else
- avoid_equals_and_hash_code_on_mutable_classes
- avoid_escaping_inner_quotes
Expand All @@ -25,6 +26,7 @@ linter:
- avoid_implementing_value_types
- avoid_init_to_null
- avoid_js_rounded_ints
- avoid_multiple_declarations_per_line
- avoid_null_checks_in_equality_operators
- avoid_positional_boolean_parameters
- avoid_print
Expand All @@ -41,6 +43,7 @@ linter:
- avoid_shadowing_type_parameters
- avoid_single_cascade_in_expression_statements
- avoid_slow_async_io
- avoid_type_to_string
- avoid_types_as_parameter_names
- avoid_types_on_closure_parameters
- avoid_unnecessary_containers
Expand All @@ -52,11 +55,13 @@ linter:
- camel_case_types
- cancel_subscriptions
- cascade_invocations
- cast_nullable_to_non_nullable
- close_sinks
- comment_references
- constant_identifier_names
- control_flow_in_finally
- curly_braces_in_flow_control_structures
- deprecated_consistency
- diagnostic_describe_all_properties
- directives_ordering
- do_not_use_environment
Expand Down Expand Up @@ -84,6 +89,7 @@ linter:
- no_logic_in_create_state
- no_runtimeType_toString
- non_constant_identifier_names
- null_check_on_nullable_type_parameter
- null_closures
- omit_local_variable_types
- one_member_abstracts
Expand Down Expand Up @@ -141,6 +147,7 @@ linter:
- sort_unnamed_constructors_first
- test_types_in_equals
- throw_in_finally
- tighten_type_of_initializing_formals
- type_annotate_public_apis
- type_init_formals
- unawaited_futures
Expand All @@ -151,6 +158,7 @@ linter:
- unnecessary_lambdas
- unnecessary_new
- unnecessary_null_aware_assignments
- unnecessary_null_checks
- unnecessary_null_in_if_null_operators
- unnecessary_nullable_for_final_variable_declarations
- unnecessary_overrides
Expand All @@ -162,11 +170,14 @@ linter:
- unnecessary_this
- unrelated_type_equality_checks
- unsafe_html
- use_build_context_synchronously
- use_full_hex_values_for_flutter_colors
- use_function_type_syntax_for_parameters
- use_if_null_to_convert_nulls_to_bools
- use_is_even_rather_than_modulo
- use_key_in_widget_constructors
- use_late_for_private_fields_and_variables
- use_named_constants
- use_raw_strings
- use_rethrow_when_possible
- use_setters_to_change_properties
Expand Down
2 changes: 2 additions & 0 deletions dev/ignored_lint_warning_for_generated_code.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: avoid_annotating_with_dynamic
// ignore_for_file: avoid_dynamic_calls
// ignore_for_file: avoid_equals_and_hash_code_on_mutable_classes
// ignore_for_file: duplicate_ignore
// ignore_for_file: lines_longer_than_80_chars
// ignore_for_file: prefer_asserts_with_message
// ignore_for_file: prefer_expression_function_bodies
Expand Down
3 changes: 1 addition & 2 deletions lib/src/package_dependency/dependency_type/serializers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import 'definition.dart';
// ignore_for_file: public_member_api_docs

extension StringToDependencyType on String {
DependencyType parseDependencyType() => _dependencyTypeMap[this];
DependencyType parseDependencyType() => _dependencyTypeMap[this]!;
}

extension DependencyTypeToJson on DependencyType {
Expand All @@ -41,7 +41,6 @@ extension DependencyTypeToJson on DependencyType {
case DependencyType.transitive:
return _Tokens.transitive;
}
throw AssertionError(this);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ part 'git_package_dependency.g.dart';
class GitPackageDependency extends $GitPackageDependency {
/// Default constructor
const GitPackageDependency({
@required this.package,
@required this.version,
@required this.ref,
@required this.url,
@required this.path,
@required this.resolvedRef,
@required this.type,
required this.package,
required this.version,
required this.ref,
required this.url,
required this.path,
required this.resolvedRef,
required this.type,
});

final String package;
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ part 'hosted_package_dependency.g.dart';
class HostedPackageDependency extends $HostedPackageDependency {
/// Default constructor
const HostedPackageDependency({
@required this.package,
@required this.version,
@required this.name,
@required this.url,
@required this.type,
required this.package,
required this.version,
required this.name,
required this.url,
required this.type,
});

final String package;
Expand Down

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

Loading

0 comments on commit 72171da

Please sign in to comment.