diff --git a/_test_yaml/pubspec.yaml b/_test_yaml/pubspec.yaml index 4bcc26f14..f682e6e88 100644 --- a/_test_yaml/pubspec.yaml +++ b/_test_yaml/pubspec.yaml @@ -10,7 +10,7 @@ dev_dependencies: build_runner: ^2.0.0 build_verify: ^3.0.0 checked_yaml: any - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 json_annotation: ^4.7.0 json_serializable: any path: ^1.8.2 diff --git a/analysis_options.yaml b/analysis_options.yaml index 375e7720b..4786eef5b 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -14,23 +14,17 @@ linter: - avoid_void_async - cancel_subscriptions - cascade_invocations - - comment_references - invalid_case_patterns - join_return_with_assignment - literal_only_boolean_expressions - missing_whitespace_between_adjacent_strings - no_runtimeType_toString - package_api_docs - - prefer_const_constructors - prefer_const_declarations - prefer_expression_function_bodies - prefer_final_locals - - prefer_relative_imports - sort_child_properties_last - - test_types_in_equals - - type_literal_in_constant_pattern - unnecessary_breaks - unsafe_html - use_full_hex_values_for_flutter_colors - use_string_buffers - - use_super_parameters diff --git a/checked_yaml/pubspec.yaml b/checked_yaml/pubspec.yaml index c164cab1a..821c9de5e 100644 --- a/checked_yaml/pubspec.yaml +++ b/checked_yaml/pubspec.yaml @@ -23,7 +23,7 @@ dependencies: dev_dependencies: build_runner: ^2.0.0 build_verify: ^3.0.0 - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 json_serializable: ^6.0.0 path: ^1.0.0 test: ^1.16.0 diff --git a/checked_yaml/test/example_test.dart b/checked_yaml/test/example_test.dart index a5d55786d..08ff6f358 100644 --- a/checked_yaml/test/example_test.dart +++ b/checked_yaml/test/example_test.dart @@ -114,7 +114,7 @@ line 1, column 10: Unsupported value for "name". Cannot be empty. }); } -void _expectThrows(String yamlContent, matcher) => expect( +void _expectThrows(String yamlContent, String matcher) => expect( () => _run(yamlContent), throwsA( isA().having( diff --git a/example/lib/json_converter_example.dart b/example/lib/json_converter_example.dart index d408223c3..3ca92c6f1 100644 --- a/example/lib/json_converter_example.dart +++ b/example/lib/json_converter_example.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// ignore_for_file: inference_failure_on_instance_creation + import 'package:json_annotation/json_annotation.dart'; part 'json_converter_example.g.dart'; diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 9eeb261d5..6191089bd 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -19,7 +19,7 @@ dev_dependencies: build_verify: ^3.0.0 # Not required to use `json_serializable`. - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 # REQUIRED! json_serializable: ^6.6.0 diff --git a/example/test/json_convert_example_test.dart b/example/test/json_convert_example_test.dart index 1801b21cc..5751b72de 100644 --- a/example/test/json_convert_example_test.dart +++ b/example/test/json_convert_example_test.dart @@ -83,8 +83,8 @@ void main() { throwsTypeError, ); - final collection2 = - GenericCollection.fromJson(jsonDecode(encoded) as Map); + final collection2 = GenericCollection.fromJson( + jsonDecode(encoded) as Map); expect(collection2.results, [ 1, diff --git a/json_annotation/pubspec.yaml b/json_annotation/pubspec.yaml index ce60661f9..a6b97a231 100644 --- a/json_annotation/pubspec.yaml +++ b/json_annotation/pubspec.yaml @@ -17,7 +17,7 @@ dependencies: meta: ^1.4.0 dev_dependencies: - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 # When changing JsonSerializable class. # build_runner: ^2.0.0 # json_serializable: any diff --git a/json_serializable/CHANGELOG.md b/json_serializable/CHANGELOG.md index 49a067ba7..0d36ca8af 100644 --- a/json_serializable/CHANGELOG.md +++ b/json_serializable/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.7.2-wip + +- Add type arguments to `Map` literals used for `Record` serialization. + ## 6.7.1 - Support the latest `package:analyzer`. diff --git a/json_serializable/build.yaml b/json_serializable/build.yaml index fb0052e74..e52d7d814 100644 --- a/json_serializable/build.yaml +++ b/json_serializable/build.yaml @@ -8,6 +8,10 @@ targets: - lines_longer_than_80_chars # Only for the JSON literal output file - text_direction_code_point_in_literal + # Too much work in generated code + - inference_failure_on_function_invocation + # Need to update sourcegen_helper to generate List/Map with the right type params + - inference_failure_on_collection_literal json_serializable: generate_for: diff --git a/json_serializable/example/example.g.dart b/json_serializable/example/example.g.dart index 21820874c..0ed069cae 100644 --- a/json_serializable/example/example.g.dart +++ b/json_serializable/example/example.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'example.dart'; diff --git a/json_serializable/lib/src/type_helpers/record_helper.dart b/json_serializable/lib/src/type_helpers/record_helper.dart index f086948bf..42b13025e 100644 --- a/json_serializable/lib/src/type_helpers/record_helper.dart +++ b/json_serializable/lib/src/type_helpers/record_helper.dart @@ -90,7 +90,7 @@ $helperName( ); } - final mapValue = '{${items.map((e) => '$e,').join()}}'; + final mapValue = '{${items.map((e) => '$e,').join()}}'; return targetType.isNullableType ? ifNullOrElse( diff --git a/json_serializable/pubspec.yaml b/json_serializable/pubspec.yaml index cfb3dd8a8..8f55a01f0 100644 --- a/json_serializable/pubspec.yaml +++ b/json_serializable/pubspec.yaml @@ -1,5 +1,5 @@ name: json_serializable -version: 6.7.1 +version: 6.7.2-wip description: >- Automatically generate code for converting to and from JSON by annotating Dart classes. @@ -34,7 +34,7 @@ dev_dependencies: path: ../shared_test build_runner: ^2.0.0 build_verify: ^3.0.0 - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 dart_style: ^2.0.0 logging: ^1.0.0 source_gen_test: ^1.0.0 diff --git a/json_serializable/test/default_value/default_value.g.dart b/json_serializable/test/default_value/default_value.g.dart index 4cf5cda7d..0614284e6 100644 --- a/json_serializable/test/default_value/default_value.g.dart +++ b/json_serializable/test/default_value/default_value.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'default_value.dart'; diff --git a/json_serializable/test/default_value/default_value.g_any_map__checked.g.dart b/json_serializable/test/default_value/default_value.g_any_map__checked.g.dart index b3a0669c9..24be86d8a 100644 --- a/json_serializable/test/default_value/default_value.g_any_map__checked.g.dart +++ b/json_serializable/test/default_value/default_value.g_any_map__checked.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'default_value.g_any_map__checked.dart'; diff --git a/json_serializable/test/default_value/default_value_test.dart b/json_serializable/test/default_value/default_value_test.dart index 59b82fc3c..d2d057c28 100644 --- a/json_serializable/test/default_value/default_value_test.dart +++ b/json_serializable/test/default_value/default_value_test.dart @@ -15,8 +15,8 @@ const _defaultInstance = { 'fieldString': 'string', 'fieldInt': 42, 'fieldDouble': 3.14, - 'fieldListEmpty': [], - 'fieldSetEmpty': [], + 'fieldListEmpty': [], + 'fieldSetEmpty': [], 'fieldMapEmpty': {}, 'fieldListSimple': [1, 2, 3], 'fieldSetSimple': ['entry1', 'entry2'], diff --git a/json_serializable/test/default_value/implicit_default_value.g.dart b/json_serializable/test/default_value/implicit_default_value.g.dart index 1a3973134..9bd1f19e0 100644 --- a/json_serializable/test/default_value/implicit_default_value.g.dart +++ b/json_serializable/test/default_value/implicit_default_value.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'implicit_default_value.dart'; diff --git a/json_serializable/test/field_matrix_test.field_matrix.g.dart b/json_serializable/test/field_matrix_test.field_matrix.g.dart index cdb054b03..84891ef9a 100644 --- a/json_serializable/test/field_matrix_test.field_matrix.g.dart +++ b/json_serializable/test/field_matrix_test.field_matrix.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'field_matrix_test.field_matrix.dart'; diff --git a/json_serializable/test/generic_files/generic_argument_factories.g.dart b/json_serializable/test/generic_files/generic_argument_factories.g.dart index 87755ac37..188ac7116 100644 --- a/json_serializable/test/generic_files/generic_argument_factories.g.dart +++ b/json_serializable/test/generic_files/generic_argument_factories.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'generic_argument_factories.dart'; diff --git a/json_serializable/test/generic_files/generic_argument_factories_nullable.g.dart b/json_serializable/test/generic_files/generic_argument_factories_nullable.g.dart index 5527d2fed..17b278eed 100644 --- a/json_serializable/test/generic_files/generic_argument_factories_nullable.g.dart +++ b/json_serializable/test/generic_files/generic_argument_factories_nullable.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'generic_argument_factories_nullable.dart'; diff --git a/json_serializable/test/generic_files/generic_class.dart b/json_serializable/test/generic_files/generic_class.dart index 6149d8dba..0870c956f 100644 --- a/json_serializable/test/generic_files/generic_class.dart +++ b/json_serializable/test/generic_files/generic_class.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// ignore_for_file: inference_failure_on_instance_creation + import 'package:collection/collection.dart'; import 'package:json_annotation/json_annotation.dart'; diff --git a/json_serializable/test/generic_files/generic_class.g.dart b/json_serializable/test/generic_files/generic_class.g.dart index c2f216483..c5809241c 100644 --- a/json_serializable/test/generic_files/generic_class.g.dart +++ b/json_serializable/test/generic_files/generic_class.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'generic_class.dart'; diff --git a/json_serializable/test/generic_files/generic_test.dart b/json_serializable/test/generic_files/generic_test.dart index 7de5f80d5..e4f82d6f3 100644 --- a/json_serializable/test/generic_files/generic_test.dart +++ b/json_serializable/test/generic_files/generic_test.dart @@ -24,6 +24,7 @@ void main() { } test('no type args', () { + // ignore: inference_failure_on_instance_creation roundTripGenericClass(GenericClass() ..fieldDynamic = 1 ..fieldInt = 2 diff --git a/json_serializable/test/integration/converter_examples.g.dart b/json_serializable/test/integration/converter_examples.g.dart index de339009e..26da277f0 100644 --- a/json_serializable/test/integration/converter_examples.g.dart +++ b/json_serializable/test/integration/converter_examples.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'converter_examples.dart'; diff --git a/json_serializable/test/integration/create_per_field_to_json_example.g.dart b/json_serializable/test/integration/create_per_field_to_json_example.g.dart index 29c4baa7b..0587c26ba 100644 --- a/json_serializable/test/integration/create_per_field_to_json_example.g.dart +++ b/json_serializable/test/integration/create_per_field_to_json_example.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'create_per_field_to_json_example.dart'; diff --git a/json_serializable/test/integration/field_map_example.g.dart b/json_serializable/test/integration/field_map_example.g.dart index 5c50eadc3..d47e01793 100644 --- a/json_serializable/test/integration/field_map_example.g.dart +++ b/json_serializable/test/integration/field_map_example.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'field_map_example.dart'; diff --git a/json_serializable/test/integration/integration_test.dart b/json_serializable/test/integration/integration_test.dart index 76b01f8fa..9305b4f9b 100644 --- a/json_serializable/test/integration/integration_test.dart +++ b/json_serializable/test/integration/integration_test.dart @@ -13,7 +13,7 @@ import 'json_enum_example.dart'; import 'json_test_common.dart' show Category, Platform, StatusCode; import 'json_test_example.dart'; -Matcher _throwsArgumentError(matcher) => +Matcher _throwsArgumentError(Object matcher) => throwsA(isArgumentError.having((e) => e.message, 'message', matcher)); void main() { diff --git a/json_serializable/test/integration/json_enum_example.g.dart b/json_serializable/test/integration/json_enum_example.g.dart index 818e057ae..6408e9e1d 100644 --- a/json_serializable/test/integration/json_enum_example.g.dart +++ b/json_serializable/test/integration/json_enum_example.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'json_enum_example.dart'; diff --git a/json_serializable/test/integration/json_test_example.g.dart b/json_serializable/test/integration/json_test_example.g.dart index 4681280b8..b6a5330d4 100644 --- a/json_serializable/test/integration/json_test_example.g.dart +++ b/json_serializable/test/integration/json_test_example.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'json_test_example.dart'; diff --git a/json_serializable/test/integration/json_test_example.g_any_map.g.dart b/json_serializable/test/integration/json_test_example.g_any_map.g.dart index 1e86e1fbc..b8ba1f9f4 100644 --- a/json_serializable/test/integration/json_test_example.g_any_map.g.dart +++ b/json_serializable/test/integration/json_test_example.g_any_map.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'json_test_example.g_any_map.dart'; diff --git a/json_serializable/test/kitchen_sink/kitchen_sink.dart b/json_serializable/test/kitchen_sink/kitchen_sink.dart index b0ff20f00..86525d9c8 100644 --- a/json_serializable/test/kitchen_sink/kitchen_sink.dart +++ b/json_serializable/test/kitchen_sink/kitchen_sink.dart @@ -249,6 +249,7 @@ class JsonConverterTestClass implements k.JsonConverterTestClass { } @JsonSerializable() +// ignore: inference_failure_on_instance_creation @GenericConverter() class JsonConverterGeneric { S item; diff --git a/json_serializable/test/kitchen_sink/kitchen_sink.g.dart b/json_serializable/test/kitchen_sink/kitchen_sink.g.dart index 1396ff044..d9230fbc5 100644 --- a/json_serializable/test/kitchen_sink/kitchen_sink.g.dart +++ b/json_serializable/test/kitchen_sink/kitchen_sink.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'kitchen_sink.dart'; @@ -142,7 +142,7 @@ Map _$KitchenSinkToJson(KitchenSink instance) => 'validatedPropertyNo42': instance.validatedPropertyNo42, 'recordField': instance.recordField == null ? null - : { + : { r'$1': instance.recordField!.$1, r'$2': instance.recordField!.$2, 'truth': instance.recordField!.truth, diff --git a/json_serializable/test/kitchen_sink/kitchen_sink.g_any_map.dart b/json_serializable/test/kitchen_sink/kitchen_sink.g_any_map.dart index 6f8b5c69f..f00f38ebc 100644 --- a/json_serializable/test/kitchen_sink/kitchen_sink.g_any_map.dart +++ b/json_serializable/test/kitchen_sink/kitchen_sink.g_any_map.dart @@ -251,6 +251,7 @@ class JsonConverterTestClass implements k.JsonConverterTestClass { @JsonSerializable( anyMap: true, ) +// ignore: inference_failure_on_instance_creation @GenericConverter() class JsonConverterGeneric { S item; diff --git a/json_serializable/test/kitchen_sink/kitchen_sink.g_any_map.g.dart b/json_serializable/test/kitchen_sink/kitchen_sink.g_any_map.g.dart index 6cfb749ea..74a348f5e 100644 --- a/json_serializable/test/kitchen_sink/kitchen_sink.g_any_map.g.dart +++ b/json_serializable/test/kitchen_sink/kitchen_sink.g_any_map.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'kitchen_sink.g_any_map.dart'; @@ -134,7 +134,7 @@ Map _$KitchenSinkToJson(KitchenSink instance) => 'validatedPropertyNo42': instance.validatedPropertyNo42, 'recordField': instance.recordField == null ? null - : { + : { r'$1': instance.recordField!.$1, r'$2': instance.recordField!.$2, 'truth': instance.recordField!.truth, diff --git a/json_serializable/test/kitchen_sink/kitchen_sink.g_any_map__checked.dart b/json_serializable/test/kitchen_sink/kitchen_sink.g_any_map__checked.dart index fe5bcbba7..0d9dc1144 100644 --- a/json_serializable/test/kitchen_sink/kitchen_sink.g_any_map__checked.dart +++ b/json_serializable/test/kitchen_sink/kitchen_sink.g_any_map__checked.dart @@ -253,6 +253,7 @@ class JsonConverterTestClass implements k.JsonConverterTestClass { checked: true, anyMap: true, ) +// ignore: inference_failure_on_instance_creation @GenericConverter() class JsonConverterGeneric { S item; diff --git a/json_serializable/test/kitchen_sink/kitchen_sink.g_any_map__checked.g.dart b/json_serializable/test/kitchen_sink/kitchen_sink.g_any_map__checked.g.dart index 02fc36586..d08da32c5 100644 --- a/json_serializable/test/kitchen_sink/kitchen_sink.g_any_map__checked.g.dart +++ b/json_serializable/test/kitchen_sink/kitchen_sink.g_any_map__checked.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'kitchen_sink.g_any_map__checked.dart'; @@ -187,7 +187,7 @@ Map _$KitchenSinkToJson(KitchenSink instance) => 'validatedPropertyNo42': instance.validatedPropertyNo42, 'recordField': instance.recordField == null ? null - : { + : { r'$1': instance.recordField!.$1, r'$2': instance.recordField!.$2, 'truth': instance.recordField!.truth, diff --git a/json_serializable/test/kitchen_sink/kitchen_sink.g_exclude_null.dart b/json_serializable/test/kitchen_sink/kitchen_sink.g_exclude_null.dart index 9476908a6..5dda14726 100644 --- a/json_serializable/test/kitchen_sink/kitchen_sink.g_exclude_null.dart +++ b/json_serializable/test/kitchen_sink/kitchen_sink.g_exclude_null.dart @@ -253,6 +253,7 @@ class JsonConverterTestClass implements k.JsonConverterTestClass { @JsonSerializable( includeIfNull: false, ) +// ignore: inference_failure_on_instance_creation @GenericConverter() class JsonConverterGeneric { S item; diff --git a/json_serializable/test/kitchen_sink/kitchen_sink.g_exclude_null.g.dart b/json_serializable/test/kitchen_sink/kitchen_sink.g_exclude_null.g.dart index e9f8662ad..76504317c 100644 --- a/json_serializable/test/kitchen_sink/kitchen_sink.g_exclude_null.g.dart +++ b/json_serializable/test/kitchen_sink/kitchen_sink.g_exclude_null.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'kitchen_sink.g_exclude_null.dart'; @@ -151,7 +151,7 @@ Map _$KitchenSinkToJson(KitchenSink instance) { 'recordField', instance.recordField == null ? null - : { + : { r'$1': instance.recordField!.$1, r'$2': instance.recordField!.$2, 'truth': instance.recordField!.truth, diff --git a/json_serializable/test/kitchen_sink/kitchen_sink.g_explicit_to_json.dart b/json_serializable/test/kitchen_sink/kitchen_sink.g_explicit_to_json.dart index 48afb79fc..efccc8f08 100644 --- a/json_serializable/test/kitchen_sink/kitchen_sink.g_explicit_to_json.dart +++ b/json_serializable/test/kitchen_sink/kitchen_sink.g_explicit_to_json.dart @@ -253,6 +253,7 @@ class JsonConverterTestClass implements k.JsonConverterTestClass { @JsonSerializable( explicitToJson: true, ) +// ignore: inference_failure_on_instance_creation @GenericConverter() class JsonConverterGeneric { S item; diff --git a/json_serializable/test/kitchen_sink/kitchen_sink.g_explicit_to_json.g.dart b/json_serializable/test/kitchen_sink/kitchen_sink.g_explicit_to_json.g.dart index 24101a1b6..ff092269c 100644 --- a/json_serializable/test/kitchen_sink/kitchen_sink.g_explicit_to_json.g.dart +++ b/json_serializable/test/kitchen_sink/kitchen_sink.g_explicit_to_json.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'kitchen_sink.g_explicit_to_json.dart'; @@ -144,7 +144,7 @@ Map _$KitchenSinkToJson(KitchenSink instance) => 'validatedPropertyNo42': instance.validatedPropertyNo42, 'recordField': instance.recordField == null ? null - : { + : { r'$1': instance.recordField!.$1, r'$2': instance.recordField!.$2, 'truth': instance.recordField!.truth, diff --git a/json_serializable/test/kitchen_sink/kitchen_sink_test.dart b/json_serializable/test/kitchen_sink/kitchen_sink_test.dart index f3519050b..3cd0c399f 100644 --- a/json_serializable/test/kitchen_sink/kitchen_sink_test.dart +++ b/json_serializable/test/kitchen_sink/kitchen_sink_test.dart @@ -12,7 +12,7 @@ import 'kitchen_sink_interface.dart'; import 'kitchen_sink_test_shared.dart'; import 'strict_keys_object.dart'; -Matcher _isMissingKeyException(expectedMessage) => +Matcher _isMissingKeyException(String expectedMessage) => isA() .having((e) => e.message, 'message', expectedMessage); @@ -99,17 +99,17 @@ void _nullableTests(KitchenSinkFactory factory) { expect(json, const { 'duration': 0, - 'durationList': [], + 'durationList': [], 'bigInt': '0', - 'bigIntMap': {}, + 'bigIntMap': {}, 'nullableBigInt': '0', - 'nullableBigIntMap': {}, + 'nullableBigIntMap': {}, 'numberSilly': 0, - 'numberSillySet': [], + 'numberSillySet': [], 'dateTime': 0, 'trivialString': '', 'nullableNumberSilly': 0, - 'nullableNumberSillySet': [], + 'nullableNumberSillySet': [], }); expect(json.keys, unorderedEquals(_jsonConverterValidValues.keys)); diff --git a/json_serializable/test/kitchen_sink/kitchen_sink_yaml_test.dart b/json_serializable/test/kitchen_sink/kitchen_sink_yaml_test.dart index e1fcb1039..951a90df7 100644 --- a/json_serializable/test/kitchen_sink/kitchen_sink_yaml_test.dart +++ b/json_serializable/test/kitchen_sink/kitchen_sink_yaml_test.dart @@ -42,7 +42,7 @@ void _testBadValue(String key, Object? badValue, KitchenSinkFactory factory, for (final isJson in [true, false]) { test('`$key` fails with value `$badValue`- ${isJson ? 'json' : 'yaml'}', () { - var copy = Map.from(validValues); + var copy = Map.of(validValues); copy[key] = badValue; if (!isJson) { @@ -88,7 +88,7 @@ Matcher _getMatcher(bool checked, String? expectedKey, bool checkedAssignment) { return throwsA(innerMatcher); } -Matcher _isAUnrecognizedKeysException(expectedMessage) => +Matcher _isAUnrecognizedKeysException(String expectedMessage) => isA() .having((e) => e.message, 'message', expectedMessage); diff --git a/json_serializable/test/kitchen_sink/simple_object.g.dart b/json_serializable/test/kitchen_sink/simple_object.g.dart index c18d4558c..b0bbfbef0 100644 --- a/json_serializable/test/kitchen_sink/simple_object.g.dart +++ b/json_serializable/test/kitchen_sink/simple_object.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'simple_object.dart'; diff --git a/json_serializable/test/kitchen_sink/strict_keys_object.g.dart b/json_serializable/test/kitchen_sink/strict_keys_object.g.dart index b8dc65ec6..b6b00cce3 100644 --- a/json_serializable/test/kitchen_sink/strict_keys_object.g.dart +++ b/json_serializable/test/kitchen_sink/strict_keys_object.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'strict_keys_object.dart'; diff --git a/json_serializable/test/literal/json_literal.g.dart b/json_serializable/test/literal/json_literal.g.dart index 02294b603..9e0993dde 100644 --- a/json_serializable/test/literal/json_literal.g.dart +++ b/json_serializable/test/literal/json_literal.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'json_literal.dart'; diff --git a/json_serializable/test/src/_json_serializable_test_input.dart b/json_serializable/test/src/_json_serializable_test_input.dart index f77864668..af82c8440 100644 --- a/json_serializable/test/src/_json_serializable_test_input.dart +++ b/json_serializable/test/src/_json_serializable_test_input.dart @@ -81,7 +81,7 @@ class GeneralTestClass1 { late DateTime dateOfBirth; dynamic dynamicType; - //ignore: prefer_typing_uninitialized_variables,type_annotate_public_apis + //ignore: prefer_typing_uninitialized_variables,type_annotate_public_apis,inference_failure_on_uninitialized_variable var varType; late List listOfInts; } diff --git a/json_serializable/test/src/json_converter_test_input.dart b/json_serializable/test/src/json_converter_test_input.dart index ac7852f61..865ee06a6 100644 --- a/json_serializable/test/src/json_converter_test_input.dart +++ b/json_serializable/test/src/json_converter_test_input.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// ignore_for_file: inference_failure_on_instance_creation + part of '_json_serializable_test_input.dart'; @ShouldGenerate(r''' diff --git a/json_serializable/test/supported_types/input.g.dart b/json_serializable/test/supported_types/input.g.dart index a07530cb6..4c7e8053d 100644 --- a/json_serializable/test/supported_types/input.g.dart +++ b/json_serializable/test/supported_types/input.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'input.dart'; diff --git a/json_serializable/test/supported_types/input.type_bigint.g.dart b/json_serializable/test/supported_types/input.type_bigint.g.dart index 39f10c238..379bdbd50 100644 --- a/json_serializable/test/supported_types/input.type_bigint.g.dart +++ b/json_serializable/test/supported_types/input.type_bigint.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'input.type_bigint.dart'; diff --git a/json_serializable/test/supported_types/input.type_bool.g.dart b/json_serializable/test/supported_types/input.type_bool.g.dart index 7964a3a21..4077ce108 100644 --- a/json_serializable/test/supported_types/input.type_bool.g.dart +++ b/json_serializable/test/supported_types/input.type_bool.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'input.type_bool.dart'; diff --git a/json_serializable/test/supported_types/input.type_datetime.g.dart b/json_serializable/test/supported_types/input.type_datetime.g.dart index 043bce089..461e30ebb 100644 --- a/json_serializable/test/supported_types/input.type_datetime.g.dart +++ b/json_serializable/test/supported_types/input.type_datetime.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'input.type_datetime.dart'; diff --git a/json_serializable/test/supported_types/input.type_double.g.dart b/json_serializable/test/supported_types/input.type_double.g.dart index 921716796..163485d5a 100644 --- a/json_serializable/test/supported_types/input.type_double.g.dart +++ b/json_serializable/test/supported_types/input.type_double.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'input.type_double.dart'; diff --git a/json_serializable/test/supported_types/input.type_duration.g.dart b/json_serializable/test/supported_types/input.type_duration.g.dart index cee2811f2..7ea4c7da6 100644 --- a/json_serializable/test/supported_types/input.type_duration.g.dart +++ b/json_serializable/test/supported_types/input.type_duration.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'input.type_duration.dart'; diff --git a/json_serializable/test/supported_types/input.type_enumtype.g.dart b/json_serializable/test/supported_types/input.type_enumtype.g.dart index b8f1901fc..77d67e064 100644 --- a/json_serializable/test/supported_types/input.type_enumtype.g.dart +++ b/json_serializable/test/supported_types/input.type_enumtype.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'input.type_enumtype.dart'; diff --git a/json_serializable/test/supported_types/input.type_int.g.dart b/json_serializable/test/supported_types/input.type_int.g.dart index 848d81cf1..ddb06ed57 100644 --- a/json_serializable/test/supported_types/input.type_int.g.dart +++ b/json_serializable/test/supported_types/input.type_int.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'input.type_int.dart'; diff --git a/json_serializable/test/supported_types/input.type_iterable.g.dart b/json_serializable/test/supported_types/input.type_iterable.g.dart index 885d166a8..95c3e0557 100644 --- a/json_serializable/test/supported_types/input.type_iterable.g.dart +++ b/json_serializable/test/supported_types/input.type_iterable.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'input.type_iterable.dart'; @@ -599,7 +599,7 @@ Map _$SimpleClassOfRecordToJson( SimpleClassOfRecord instance) => { 'value': instance.value - .map((e) => { + .map((e) => { r'$1': e.$1, r'$2': e.$2, 'truth': e.truth, @@ -630,7 +630,7 @@ Map _$SimpleClassNullableOfRecordToJson( SimpleClassNullableOfRecord instance) => { 'value': instance.value - ?.map((e) => { + ?.map((e) => { r'$1': e.$1, r'$2': e.$2, 'truth': e.truth, diff --git a/json_serializable/test/supported_types/input.type_list.g.dart b/json_serializable/test/supported_types/input.type_list.g.dart index b21a959b6..2f4497581 100644 --- a/json_serializable/test/supported_types/input.type_list.g.dart +++ b/json_serializable/test/supported_types/input.type_list.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'input.type_list.dart'; @@ -635,7 +635,7 @@ Map _$SimpleClassOfRecordToJson( SimpleClassOfRecord instance) => { 'value': instance.value - .map((e) => { + .map((e) => { r'$1': e.$1, r'$2': e.$2, 'truth': e.truth, @@ -668,7 +668,7 @@ Map _$SimpleClassNullableOfRecordToJson( SimpleClassNullableOfRecord instance) => { 'value': instance.value - ?.map((e) => { + ?.map((e) => { r'$1': e.$1, r'$2': e.$2, 'truth': e.truth, diff --git a/json_serializable/test/supported_types/input.type_map.g.dart b/json_serializable/test/supported_types/input.type_map.g.dart index dc17f2907..5f29d60ab 100644 --- a/json_serializable/test/supported_types/input.type_map.g.dart +++ b/json_serializable/test/supported_types/input.type_map.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'input.type_map.dart'; @@ -5301,11 +5301,12 @@ SimpleClassOfBigIntToRecord _$SimpleClassOfBigIntToRecordFromJson( Map _$SimpleClassOfBigIntToRecordToJson( SimpleClassOfBigIntToRecord instance) => { - 'value': instance.value.map((k, e) => MapEntry(k.toString(), { - r'$1': e.$1, - r'$2': e.$2, - 'truth': e.truth, - })), + 'value': + instance.value.map((k, e) => MapEntry(k.toString(), { + r'$1': e.$1, + r'$2': e.$2, + 'truth': e.truth, + })), }; $Rec _$recordConvert<$Rec>( @@ -5334,11 +5335,12 @@ SimpleClassNullableOfBigIntToRecord Map _$SimpleClassNullableOfBigIntToRecordToJson( SimpleClassNullableOfBigIntToRecord instance) => { - 'value': instance.value?.map((k, e) => MapEntry(k.toString(), { - r'$1': e.$1, - r'$2': e.$2, - 'truth': e.truth, - })), + 'value': instance.value + ?.map((k, e) => MapEntry(k.toString(), { + r'$1': e.$1, + r'$2': e.$2, + 'truth': e.truth, + })), }; SimpleClassOfDateTimeToRecord _$SimpleClassOfDateTimeToRecordFromJson( @@ -5361,11 +5363,12 @@ SimpleClassOfDateTimeToRecord _$SimpleClassOfDateTimeToRecordFromJson( Map _$SimpleClassOfDateTimeToRecordToJson( SimpleClassOfDateTimeToRecord instance) => { - 'value': instance.value.map((k, e) => MapEntry(k.toIso8601String(), { - r'$1': e.$1, - r'$2': e.$2, - 'truth': e.truth, - })), + 'value': instance.value + .map((k, e) => MapEntry(k.toIso8601String(), { + r'$1': e.$1, + r'$2': e.$2, + 'truth': e.truth, + })), }; SimpleClassNullableOfDateTimeToRecord @@ -5389,11 +5392,12 @@ SimpleClassNullableOfDateTimeToRecord Map _$SimpleClassNullableOfDateTimeToRecordToJson( SimpleClassNullableOfDateTimeToRecord instance) => { - 'value': instance.value?.map((k, e) => MapEntry(k.toIso8601String(), { - r'$1': e.$1, - r'$2': e.$2, - 'truth': e.truth, - })), + 'value': instance.value + ?.map((k, e) => MapEntry(k.toIso8601String(), { + r'$1': e.$1, + r'$2': e.$2, + 'truth': e.truth, + })), }; SimpleClassOfDynamicToRecord _$SimpleClassOfDynamicToRecordFromJson( @@ -5416,7 +5420,7 @@ SimpleClassOfDynamicToRecord _$SimpleClassOfDynamicToRecordFromJson( Map _$SimpleClassOfDynamicToRecordToJson( SimpleClassOfDynamicToRecord instance) => { - 'value': instance.value.map((k, e) => MapEntry(k, { + 'value': instance.value.map((k, e) => MapEntry(k, { r'$1': e.$1, r'$2': e.$2, 'truth': e.truth, @@ -5443,7 +5447,7 @@ SimpleClassNullableOfDynamicToRecord Map _$SimpleClassNullableOfDynamicToRecordToJson( SimpleClassNullableOfDynamicToRecord instance) => { - 'value': instance.value?.map((k, e) => MapEntry(k, { + 'value': instance.value?.map((k, e) => MapEntry(k, { r'$1': e.$1, r'$2': e.$2, 'truth': e.truth, @@ -5470,11 +5474,12 @@ SimpleClassOfEnumTypeToRecord _$SimpleClassOfEnumTypeToRecordFromJson( Map _$SimpleClassOfEnumTypeToRecordToJson( SimpleClassOfEnumTypeToRecord instance) => { - 'value': instance.value.map((k, e) => MapEntry(_$EnumTypeEnumMap[k]!, { - r'$1': e.$1, - r'$2': e.$2, - 'truth': e.truth, - })), + 'value': instance.value + .map((k, e) => MapEntry(_$EnumTypeEnumMap[k]!, { + r'$1': e.$1, + r'$2': e.$2, + 'truth': e.truth, + })), }; SimpleClassNullableOfEnumTypeToRecord @@ -5498,11 +5503,12 @@ SimpleClassNullableOfEnumTypeToRecord Map _$SimpleClassNullableOfEnumTypeToRecordToJson( SimpleClassNullableOfEnumTypeToRecord instance) => { - 'value': instance.value?.map((k, e) => MapEntry(_$EnumTypeEnumMap[k]!, { - r'$1': e.$1, - r'$2': e.$2, - 'truth': e.truth, - })), + 'value': instance.value + ?.map((k, e) => MapEntry(_$EnumTypeEnumMap[k]!, { + r'$1': e.$1, + r'$2': e.$2, + 'truth': e.truth, + })), }; SimpleClassOfIntToRecord _$SimpleClassOfIntToRecordFromJson( @@ -5525,11 +5531,12 @@ SimpleClassOfIntToRecord _$SimpleClassOfIntToRecordFromJson( Map _$SimpleClassOfIntToRecordToJson( SimpleClassOfIntToRecord instance) => { - 'value': instance.value.map((k, e) => MapEntry(k.toString(), { - r'$1': e.$1, - r'$2': e.$2, - 'truth': e.truth, - })), + 'value': + instance.value.map((k, e) => MapEntry(k.toString(), { + r'$1': e.$1, + r'$2': e.$2, + 'truth': e.truth, + })), }; SimpleClassNullableOfIntToRecord _$SimpleClassNullableOfIntToRecordFromJson( @@ -5552,11 +5559,12 @@ SimpleClassNullableOfIntToRecord _$SimpleClassNullableOfIntToRecordFromJson( Map _$SimpleClassNullableOfIntToRecordToJson( SimpleClassNullableOfIntToRecord instance) => { - 'value': instance.value?.map((k, e) => MapEntry(k.toString(), { - r'$1': e.$1, - r'$2': e.$2, - 'truth': e.truth, - })), + 'value': instance.value + ?.map((k, e) => MapEntry(k.toString(), { + r'$1': e.$1, + r'$2': e.$2, + 'truth': e.truth, + })), }; SimpleClassOfObjectToRecord _$SimpleClassOfObjectToRecordFromJson( @@ -5579,7 +5587,7 @@ SimpleClassOfObjectToRecord _$SimpleClassOfObjectToRecordFromJson( Map _$SimpleClassOfObjectToRecordToJson( SimpleClassOfObjectToRecord instance) => { - 'value': instance.value.map((k, e) => MapEntry(k, { + 'value': instance.value.map((k, e) => MapEntry(k, { r'$1': e.$1, r'$2': e.$2, 'truth': e.truth, @@ -5606,7 +5614,7 @@ SimpleClassNullableOfObjectToRecord Map _$SimpleClassNullableOfObjectToRecordToJson( SimpleClassNullableOfObjectToRecord instance) => { - 'value': instance.value?.map((k, e) => MapEntry(k, { + 'value': instance.value?.map((k, e) => MapEntry(k, { r'$1': e.$1, r'$2': e.$2, 'truth': e.truth, @@ -5633,7 +5641,7 @@ SimpleClassOfStringToRecord _$SimpleClassOfStringToRecordFromJson( Map _$SimpleClassOfStringToRecordToJson( SimpleClassOfStringToRecord instance) => { - 'value': instance.value.map((k, e) => MapEntry(k, { + 'value': instance.value.map((k, e) => MapEntry(k, { r'$1': e.$1, r'$2': e.$2, 'truth': e.truth, @@ -5660,7 +5668,7 @@ SimpleClassNullableOfStringToRecord Map _$SimpleClassNullableOfStringToRecordToJson( SimpleClassNullableOfStringToRecord instance) => { - 'value': instance.value?.map((k, e) => MapEntry(k, { + 'value': instance.value?.map((k, e) => MapEntry(k, { r'$1': e.$1, r'$2': e.$2, 'truth': e.truth, @@ -5687,11 +5695,12 @@ SimpleClassOfUriToRecord _$SimpleClassOfUriToRecordFromJson( Map _$SimpleClassOfUriToRecordToJson( SimpleClassOfUriToRecord instance) => { - 'value': instance.value.map((k, e) => MapEntry(k.toString(), { - r'$1': e.$1, - r'$2': e.$2, - 'truth': e.truth, - })), + 'value': + instance.value.map((k, e) => MapEntry(k.toString(), { + r'$1': e.$1, + r'$2': e.$2, + 'truth': e.truth, + })), }; SimpleClassNullableOfUriToRecord _$SimpleClassNullableOfUriToRecordFromJson( @@ -5714,11 +5723,12 @@ SimpleClassNullableOfUriToRecord _$SimpleClassNullableOfUriToRecordFromJson( Map _$SimpleClassNullableOfUriToRecordToJson( SimpleClassNullableOfUriToRecord instance) => { - 'value': instance.value?.map((k, e) => MapEntry(k.toString(), { - r'$1': e.$1, - r'$2': e.$2, - 'truth': e.truth, - })), + 'value': instance.value + ?.map((k, e) => MapEntry(k.toString(), { + r'$1': e.$1, + r'$2': e.$2, + 'truth': e.truth, + })), }; SimpleClassOfBigIntToString _$SimpleClassOfBigIntToStringFromJson( diff --git a/json_serializable/test/supported_types/input.type_num.g.dart b/json_serializable/test/supported_types/input.type_num.g.dart index fbd27bbba..f25274d8f 100644 --- a/json_serializable/test/supported_types/input.type_num.g.dart +++ b/json_serializable/test/supported_types/input.type_num.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'input.type_num.dart'; diff --git a/json_serializable/test/supported_types/input.type_object.g.dart b/json_serializable/test/supported_types/input.type_object.g.dart index 7959daa78..b35be59b6 100644 --- a/json_serializable/test/supported_types/input.type_object.g.dart +++ b/json_serializable/test/supported_types/input.type_object.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'input.type_object.dart'; diff --git a/json_serializable/test/supported_types/input.type_record.g.dart b/json_serializable/test/supported_types/input.type_record.g.dart index 19f2da859..5c96d58c8 100644 --- a/json_serializable/test/supported_types/input.type_record.g.dart +++ b/json_serializable/test/supported_types/input.type_record.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'input.type_record.dart'; @@ -14,7 +14,7 @@ SimpleClass _$SimpleClassFromJson(Map json) => SimpleClass( Map _$SimpleClassToJson(SimpleClass instance) => { - 'value': {}, + 'value': {}, }; SimpleClassNullable _$SimpleClassNullableFromJson(Map json) => @@ -25,7 +25,7 @@ SimpleClassNullable _$SimpleClassNullableFromJson(Map json) => Map _$SimpleClassNullableToJson( SimpleClassNullable instance) => { - 'value': instance.value == null ? null : {}, + 'value': instance.value == null ? null : {}, }; SimpleClassOfBigInt _$SimpleClassOfBigIntFromJson(Map json) => @@ -42,7 +42,7 @@ SimpleClassOfBigInt _$SimpleClassOfBigIntFromJson(Map json) => Map _$SimpleClassOfBigIntToJson( SimpleClassOfBigInt instance) => { - 'value': { + 'value': { r'$1': instance.value.$1.toString(), 'named': instance.value.named.toString(), }, @@ -71,7 +71,7 @@ Map _$SimpleClassNullableOfBigIntToJson( { 'value': instance.value == null ? null - : { + : { r'$1': instance.value!.$1.toString(), 'named': instance.value!.named.toString(), }, @@ -102,7 +102,7 @@ SimpleClassOfBigIntNullable _$SimpleClassOfBigIntNullableFromJson( Map _$SimpleClassOfBigIntNullableToJson( SimpleClassOfBigIntNullable instance) => { - 'value': { + 'value': { r'$1': instance.value.$1?.toString(), 'named': instance.value.named?.toString(), }, @@ -129,7 +129,7 @@ Map _$SimpleClassNullableOfBigIntNullableToJson( { 'value': instance.value == null ? null - : { + : { r'$1': instance.value!.$1?.toString(), 'named': instance.value!.named?.toString(), }, @@ -148,7 +148,7 @@ SimpleClassOfBool _$SimpleClassOfBoolFromJson(Map json) => Map _$SimpleClassOfBoolToJson(SimpleClassOfBool instance) => { - 'value': { + 'value': { r'$1': instance.value.$1, 'named': instance.value.named, }, @@ -171,7 +171,7 @@ Map _$SimpleClassNullableOfBoolToJson( { 'value': instance.value == null ? null - : { + : { r'$1': instance.value!.$1, 'named': instance.value!.named, }, @@ -192,7 +192,7 @@ SimpleClassOfBoolNullable _$SimpleClassOfBoolNullableFromJson( Map _$SimpleClassOfBoolNullableToJson( SimpleClassOfBoolNullable instance) => { - 'value': { + 'value': { r'$1': instance.value.$1, 'named': instance.value.named, }, @@ -215,7 +215,7 @@ Map _$SimpleClassNullableOfBoolNullableToJson( { 'value': instance.value == null ? null - : { + : { r'$1': instance.value!.$1, 'named': instance.value!.named, }, @@ -236,7 +236,7 @@ SimpleClassOfDateTime _$SimpleClassOfDateTimeFromJson( Map _$SimpleClassOfDateTimeToJson( SimpleClassOfDateTime instance) => { - 'value': { + 'value': { r'$1': instance.value.$1.toIso8601String(), 'named': instance.value.named.toIso8601String(), }, @@ -259,7 +259,7 @@ Map _$SimpleClassNullableOfDateTimeToJson( { 'value': instance.value == null ? null - : { + : { r'$1': instance.value!.$1.toIso8601String(), 'named': instance.value!.named.toIso8601String(), }, @@ -284,7 +284,7 @@ SimpleClassOfDateTimeNullable _$SimpleClassOfDateTimeNullableFromJson( Map _$SimpleClassOfDateTimeNullableToJson( SimpleClassOfDateTimeNullable instance) => { - 'value': { + 'value': { r'$1': instance.value.$1?.toIso8601String(), 'named': instance.value.named?.toIso8601String(), }, @@ -312,7 +312,7 @@ Map _$SimpleClassNullableOfDateTimeNullableToJson( { 'value': instance.value == null ? null - : { + : { r'$1': instance.value!.$1?.toIso8601String(), 'named': instance.value!.named?.toIso8601String(), }, @@ -332,7 +332,7 @@ SimpleClassOfDouble _$SimpleClassOfDoubleFromJson(Map json) => Map _$SimpleClassOfDoubleToJson( SimpleClassOfDouble instance) => { - 'value': { + 'value': { r'$1': instance.value.$1, 'named': instance.value.named, }, @@ -355,7 +355,7 @@ Map _$SimpleClassNullableOfDoubleToJson( { 'value': instance.value == null ? null - : { + : { r'$1': instance.value!.$1, 'named': instance.value!.named, }, @@ -376,7 +376,7 @@ SimpleClassOfDoubleNullable _$SimpleClassOfDoubleNullableFromJson( Map _$SimpleClassOfDoubleNullableToJson( SimpleClassOfDoubleNullable instance) => { - 'value': { + 'value': { r'$1': instance.value.$1, 'named': instance.value.named, }, @@ -399,7 +399,7 @@ Map _$SimpleClassNullableOfDoubleNullableToJson( { 'value': instance.value == null ? null - : { + : { r'$1': instance.value!.$1, 'named': instance.value!.named, }, @@ -420,7 +420,7 @@ SimpleClassOfDuration _$SimpleClassOfDurationFromJson( Map _$SimpleClassOfDurationToJson( SimpleClassOfDuration instance) => { - 'value': { + 'value': { r'$1': instance.value.$1.inMicroseconds, 'named': instance.value.named.inMicroseconds, }, @@ -443,7 +443,7 @@ Map _$SimpleClassNullableOfDurationToJson( { 'value': instance.value == null ? null - : { + : { r'$1': instance.value!.$1.inMicroseconds, 'named': instance.value!.named.inMicroseconds, }, @@ -468,7 +468,7 @@ SimpleClassOfDurationNullable _$SimpleClassOfDurationNullableFromJson( Map _$SimpleClassOfDurationNullableToJson( SimpleClassOfDurationNullable instance) => { - 'value': { + 'value': { r'$1': instance.value.$1?.inMicroseconds, 'named': instance.value.named?.inMicroseconds, }, @@ -496,7 +496,7 @@ Map _$SimpleClassNullableOfDurationNullableToJson( { 'value': instance.value == null ? null - : { + : { r'$1': instance.value!.$1?.inMicroseconds, 'named': instance.value!.named?.inMicroseconds, }, @@ -517,7 +517,7 @@ SimpleClassOfDynamic _$SimpleClassOfDynamicFromJson( Map _$SimpleClassOfDynamicToJson( SimpleClassOfDynamic instance) => { - 'value': { + 'value': { r'$1': instance.value.$1, 'named': instance.value.named, }, @@ -540,7 +540,7 @@ Map _$SimpleClassNullableOfDynamicToJson( { 'value': instance.value == null ? null - : { + : { r'$1': instance.value!.$1, 'named': instance.value!.named, }, @@ -561,7 +561,7 @@ SimpleClassOfEnumType _$SimpleClassOfEnumTypeFromJson( Map _$SimpleClassOfEnumTypeToJson( SimpleClassOfEnumType instance) => { - 'value': { + 'value': { r'$1': _$EnumTypeEnumMap[instance.value.$1]!, 'named': _$EnumTypeEnumMap[instance.value.named]!, }, @@ -591,7 +591,7 @@ Map _$SimpleClassNullableOfEnumTypeToJson( { 'value': instance.value == null ? null - : { + : { r'$1': _$EnumTypeEnumMap[instance.value!.$1]!, 'named': _$EnumTypeEnumMap[instance.value!.named]!, }, @@ -612,7 +612,7 @@ SimpleClassOfEnumTypeNullable _$SimpleClassOfEnumTypeNullableFromJson( Map _$SimpleClassOfEnumTypeNullableToJson( SimpleClassOfEnumTypeNullable instance) => { - 'value': { + 'value': { r'$1': _$EnumTypeEnumMap[instance.value.$1], 'named': _$EnumTypeEnumMap[instance.value.named], }, @@ -637,7 +637,7 @@ Map _$SimpleClassNullableOfEnumTypeNullableToJson( { 'value': instance.value == null ? null - : { + : { r'$1': _$EnumTypeEnumMap[instance.value!.$1], 'named': _$EnumTypeEnumMap[instance.value!.named], }, @@ -658,7 +658,7 @@ SimpleClassOfFromJsonDynamicParam _$SimpleClassOfFromJsonDynamicParamFromJson( Map _$SimpleClassOfFromJsonDynamicParamToJson( SimpleClassOfFromJsonDynamicParam instance) => { - 'value': { + 'value': { r'$1': instance.value.$1, 'named': instance.value.named, }, @@ -682,7 +682,7 @@ Map _$SimpleClassNullableOfFromJsonDynamicParamToJson( { 'value': instance.value == null ? null - : { + : { r'$1': instance.value!.$1, 'named': instance.value!.named, }, @@ -704,7 +704,7 @@ SimpleClassOfFromJsonNullableObjectParam Map _$SimpleClassOfFromJsonNullableObjectParamToJson( SimpleClassOfFromJsonNullableObjectParam instance) => { - 'value': { + 'value': { r'$1': instance.value.$1, 'named': instance.value.named, }, @@ -728,7 +728,7 @@ Map _$SimpleClassNullableOfFromJsonNullableObjectParamToJson( { 'value': instance.value == null ? null - : { + : { r'$1': instance.value!.$1, 'named': instance.value!.named, }, @@ -749,7 +749,7 @@ SimpleClassOfFromJsonObjectParam _$SimpleClassOfFromJsonObjectParamFromJson( Map _$SimpleClassOfFromJsonObjectParamToJson( SimpleClassOfFromJsonObjectParam instance) => { - 'value': { + 'value': { r'$1': instance.value.$1, 'named': instance.value.named, }, @@ -774,7 +774,7 @@ Map _$SimpleClassNullableOfFromJsonObjectParamToJson( { 'value': instance.value == null ? null - : { + : { r'$1': instance.value!.$1, 'named': instance.value!.named, }, @@ -793,7 +793,7 @@ SimpleClassOfInt _$SimpleClassOfIntFromJson(Map json) => Map _$SimpleClassOfIntToJson(SimpleClassOfInt instance) => { - 'value': { + 'value': { r'$1': instance.value.$1, 'named': instance.value.named, }, @@ -816,7 +816,7 @@ Map _$SimpleClassNullableOfIntToJson( { 'value': instance.value == null ? null - : { + : { r'$1': instance.value!.$1, 'named': instance.value!.named, }, @@ -837,7 +837,7 @@ SimpleClassOfIntNullable _$SimpleClassOfIntNullableFromJson( Map _$SimpleClassOfIntNullableToJson( SimpleClassOfIntNullable instance) => { - 'value': { + 'value': { r'$1': instance.value.$1, 'named': instance.value.named, }, @@ -860,7 +860,7 @@ Map _$SimpleClassNullableOfIntNullableToJson( { 'value': instance.value == null ? null - : { + : { r'$1': instance.value!.$1, 'named': instance.value!.named, }, @@ -879,7 +879,7 @@ SimpleClassOfNum _$SimpleClassOfNumFromJson(Map json) => Map _$SimpleClassOfNumToJson(SimpleClassOfNum instance) => { - 'value': { + 'value': { r'$1': instance.value.$1, 'named': instance.value.named, }, @@ -902,7 +902,7 @@ Map _$SimpleClassNullableOfNumToJson( { 'value': instance.value == null ? null - : { + : { r'$1': instance.value!.$1, 'named': instance.value!.named, }, @@ -923,7 +923,7 @@ SimpleClassOfNumNullable _$SimpleClassOfNumNullableFromJson( Map _$SimpleClassOfNumNullableToJson( SimpleClassOfNumNullable instance) => { - 'value': { + 'value': { r'$1': instance.value.$1, 'named': instance.value.named, }, @@ -946,7 +946,7 @@ Map _$SimpleClassNullableOfNumNullableToJson( { 'value': instance.value == null ? null - : { + : { r'$1': instance.value!.$1, 'named': instance.value!.named, }, @@ -966,7 +966,7 @@ SimpleClassOfObject _$SimpleClassOfObjectFromJson(Map json) => Map _$SimpleClassOfObjectToJson( SimpleClassOfObject instance) => { - 'value': { + 'value': { r'$1': instance.value.$1, 'named': instance.value.named, }, @@ -989,7 +989,7 @@ Map _$SimpleClassNullableOfObjectToJson( { 'value': instance.value == null ? null - : { + : { r'$1': instance.value!.$1, 'named': instance.value!.named, }, @@ -1010,7 +1010,7 @@ SimpleClassOfObjectNullable _$SimpleClassOfObjectNullableFromJson( Map _$SimpleClassOfObjectNullableToJson( SimpleClassOfObjectNullable instance) => { - 'value': { + 'value': { r'$1': instance.value.$1, 'named': instance.value.named, }, @@ -1033,7 +1033,7 @@ Map _$SimpleClassNullableOfObjectNullableToJson( { 'value': instance.value == null ? null - : { + : { r'$1': instance.value!.$1, 'named': instance.value!.named, }, @@ -1067,13 +1067,13 @@ SimpleClassOfRecord _$SimpleClassOfRecordFromJson(Map json) => Map _$SimpleClassOfRecordToJson( SimpleClassOfRecord instance) => { - 'value': { - r'$1': { + 'value': { + r'$1': { r'$1': instance.value.$1.$1, r'$2': instance.value.$1.$2, 'truth': instance.value.$1.truth, }, - 'named': { + 'named': { r'$1': instance.value.named.$1, r'$2': instance.value.named.$2, 'truth': instance.value.named.truth, @@ -1112,13 +1112,13 @@ Map _$SimpleClassNullableOfRecordToJson( { 'value': instance.value == null ? null - : { - r'$1': { + : { + r'$1': { r'$1': instance.value!.$1.$1, r'$2': instance.value!.$1.$2, 'truth': instance.value!.$1.truth, }, - 'named': { + 'named': { r'$1': instance.value!.named.$1, r'$2': instance.value!.named.$2, 'truth': instance.value!.named.truth, @@ -1140,7 +1140,7 @@ SimpleClassOfString _$SimpleClassOfStringFromJson(Map json) => Map _$SimpleClassOfStringToJson( SimpleClassOfString instance) => { - 'value': { + 'value': { r'$1': instance.value.$1, 'named': instance.value.named, }, @@ -1163,7 +1163,7 @@ Map _$SimpleClassNullableOfStringToJson( { 'value': instance.value == null ? null - : { + : { r'$1': instance.value!.$1, 'named': instance.value!.named, }, @@ -1184,7 +1184,7 @@ SimpleClassOfStringNullable _$SimpleClassOfStringNullableFromJson( Map _$SimpleClassOfStringNullableToJson( SimpleClassOfStringNullable instance) => { - 'value': { + 'value': { r'$1': instance.value.$1, 'named': instance.value.named, }, @@ -1207,7 +1207,7 @@ Map _$SimpleClassNullableOfStringNullableToJson( { 'value': instance.value == null ? null - : { + : { r'$1': instance.value!.$1, 'named': instance.value!.named, }, @@ -1226,7 +1226,7 @@ SimpleClassOfUri _$SimpleClassOfUriFromJson(Map json) => Map _$SimpleClassOfUriToJson(SimpleClassOfUri instance) => { - 'value': { + 'value': { r'$1': instance.value.$1.toString(), 'named': instance.value.named.toString(), }, @@ -1249,7 +1249,7 @@ Map _$SimpleClassNullableOfUriToJson( { 'value': instance.value == null ? null - : { + : { r'$1': instance.value!.$1.toString(), 'named': instance.value!.named.toString(), }, @@ -1274,7 +1274,7 @@ SimpleClassOfUriNullable _$SimpleClassOfUriNullableFromJson( Map _$SimpleClassOfUriNullableToJson( SimpleClassOfUriNullable instance) => { - 'value': { + 'value': { r'$1': instance.value.$1?.toString(), 'named': instance.value.named?.toString(), }, @@ -1301,7 +1301,7 @@ Map _$SimpleClassNullableOfUriNullableToJson( { 'value': instance.value == null ? null - : { + : { r'$1': instance.value!.$1?.toString(), 'named': instance.value!.named?.toString(), }, diff --git a/json_serializable/test/supported_types/input.type_set.g.dart b/json_serializable/test/supported_types/input.type_set.g.dart index 861b0c4fe..73866adf9 100644 --- a/json_serializable/test/supported_types/input.type_set.g.dart +++ b/json_serializable/test/supported_types/input.type_set.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'input.type_set.dart'; @@ -637,7 +637,7 @@ Map _$SimpleClassOfRecordToJson( SimpleClassOfRecord instance) => { 'value': instance.value - .map((e) => { + .map((e) => { r'$1': e.$1, r'$2': e.$2, 'truth': e.truth, @@ -670,7 +670,7 @@ Map _$SimpleClassNullableOfRecordToJson( SimpleClassNullableOfRecord instance) => { 'value': instance.value - ?.map((e) => { + ?.map((e) => { r'$1': e.$1, r'$2': e.$2, 'truth': e.truth, diff --git a/json_serializable/test/supported_types/input.type_string.g.dart b/json_serializable/test/supported_types/input.type_string.g.dart index 4b1c64a20..6db4a402d 100644 --- a/json_serializable/test/supported_types/input.type_string.g.dart +++ b/json_serializable/test/supported_types/input.type_string.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'input.type_string.dart'; diff --git a/json_serializable/test/supported_types/input.type_uri.g.dart b/json_serializable/test/supported_types/input.type_uri.g.dart index e224f7036..b13890e87 100644 --- a/json_serializable/test/supported_types/input.type_uri.g.dart +++ b/json_serializable/test/supported_types/input.type_uri.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'input.type_uri.dart'; diff --git a/json_serializable/tool/readme/readme_examples.g.dart b/json_serializable/tool/readme/readme_examples.g.dart index be265dd6d..c22e9025b 100644 --- a/json_serializable/tool/readme/readme_examples.g.dart +++ b/json_serializable/tool/readme/readme_examples.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal +// ignore_for_file: lines_longer_than_80_chars, text_direction_code_point_in_literal, inference_failure_on_function_invocation, inference_failure_on_collection_literal part of 'readme_examples.dart'; diff --git a/json_serializable/tool/test_builder.dart b/json_serializable/tool/test_builder.dart index a0926b098..c2e5379b0 100644 --- a/json_serializable/tool/test_builder.dart +++ b/json_serializable/tool/test_builder.dart @@ -21,8 +21,7 @@ class _TestBuilder implements Builder { final sourceContent = await buildStep.readAsString(buildStep.inputId); - final factories = - SplayTreeMap.from({'$_kitchenSinkBaseName.dart': 'normal'}); + final factories = SplayTreeMap.of({'$_kitchenSinkBaseName.dart': 'normal'}); for (var config in _fileConfigurationMap[baseName]!) { final extension = _configToExtension(config); diff --git a/shared_test/pubspec.yaml b/shared_test/pubspec.yaml index c52b9527e..6cb35af92 100644 --- a/shared_test/pubspec.yaml +++ b/shared_test/pubspec.yaml @@ -8,4 +8,4 @@ dependencies: test: ^1.6.0 dev_dependencies: - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0