Skip to content
Merged
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
1 change: 1 addition & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ linter:
- unnecessary_breaks
- use_full_hex_values_for_flutter_colors
- use_string_buffers
- unnecessary_ignore
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ _JsonConvertData? _typeConverterFrom(

final annotationElement = match.elementAnnotation?.element;
if (annotationElement is PropertyAccessorElement) {
// ignore: deprecated_member_use
final enclosing = annotationElement.enclosingElement3;

var accessString = annotationElement.name;
Expand Down
1 change: 0 additions & 1 deletion json_serializable/lib/src/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ ConstructorElement? _constructorByNameOrNull(
) {
try {
return constructorByName(classElement, name);
// ignore: avoid_catching_errors
} on InvalidGenerationSourceError {
return null;
}
Expand Down
1 change: 0 additions & 1 deletion json_serializable/test/supported_types/extra_map_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 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: prefer_const_declarations
@TestOn('vm')
library;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 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: prefer_const_declarations
@TestOn('vm')
library;

Expand Down Expand Up @@ -87,8 +86,8 @@ void main() {
}); // end nullable group
}

final _defaultValue = '12345';
final _altValue = '67890';
const _defaultValue = '12345';
const _altValue = '67890';

final _defaultInput = <String, Object?>{
'value': _defaultValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 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: prefer_const_declarations
@TestOn('vm')
library;

Expand Down Expand Up @@ -87,8 +86,8 @@ void main() {
}); // end nullable group
}

final _defaultValue = true;
final _altValue = false;
const _defaultValue = true;
const _altValue = false;

final _defaultInput = <String, Object?>{
'value': _defaultValue,
Expand Down
5 changes: 2 additions & 3 deletions json_serializable/test/supported_types/type_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 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: prefer_const_declarations
@TestOn('vm')
library;

Expand Down Expand Up @@ -53,8 +52,8 @@ void main() {
}); // end non-nullable group
}

final _defaultValue = 42;
final _altValue = 43;
const _defaultValue = 42;
const _altValue = 43;

final _defaultInput = <String, Object?>{
'value': _defaultValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 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: prefer_const_declarations
@TestOn('vm')
library;

Expand Down Expand Up @@ -87,8 +86,8 @@ void main() {
}); // end nullable group
}

final _defaultValue = '2020-01-01T00:00:00.000';
final _altValue = '2018-01-01T00:00:00.000';
const _defaultValue = '2020-01-01T00:00:00.000';
const _altValue = '2018-01-01T00:00:00.000';

final _defaultInput = <String, Object?>{
'value': _defaultValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 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: prefer_const_declarations
@TestOn('vm')
library;

Expand Down Expand Up @@ -87,8 +86,8 @@ void main() {
}); // end nullable group
}

final _defaultValue = 3.14;
final _altValue = 6.28;
const _defaultValue = 3.14;
const _altValue = 6.28;

final _defaultInput = <String, Object?>{
'value': _defaultValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 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: prefer_const_declarations
@TestOn('vm')
library;

Expand Down Expand Up @@ -87,8 +86,8 @@ void main() {
}); // end nullable group
}

final _defaultValue = 1234;
final _altValue = 2345;
const _defaultValue = 1234;
const _altValue = 2345;

final _defaultInput = <String, Object?>{
'value': _defaultValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 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: prefer_const_declarations
@TestOn('vm')
library;

Expand Down Expand Up @@ -87,8 +86,8 @@ void main() {
}); // end nullable group
}

final _defaultValue = 'alpha';
final _altValue = 'beta';
const _defaultValue = 'alpha';
const _altValue = 'beta';

final _defaultInput = <String, Object?>{
'value': _defaultValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 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: prefer_const_declarations
@TestOn('vm')
library;

Expand Down Expand Up @@ -87,8 +86,8 @@ void main() {
}); // end nullable group
}

final _defaultValue = 42;
final _altValue = 43;
const _defaultValue = 42;
const _altValue = 43;

final _defaultInput = <String, Object?>{
'value': _defaultValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 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: prefer_const_declarations
@TestOn('vm')
library;

Expand Down Expand Up @@ -87,8 +86,8 @@ void main() {
}); // end nullable group
}

final _defaultValue = [42, true, false, null];
final _altValue = [43, false];
const _defaultValue = [42, true, false, null];
const _altValue = [43, false];

final _defaultInput = <String, Object?>{
'value': _defaultValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 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: prefer_const_declarations
@TestOn('vm')
library;

Expand Down Expand Up @@ -87,8 +86,8 @@ void main() {
}); // end nullable group
}

final _defaultValue = [42, true, false, null];
final _altValue = [43, false];
const _defaultValue = [42, true, false, null];
const _altValue = [43, false];

final _defaultInput = <String, Object?>{
'value': _defaultValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 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: prefer_const_declarations
@TestOn('vm')
library;

Expand Down Expand Up @@ -87,8 +86,8 @@ void main() {
}); // end nullable group
}

final _defaultValue = {'a': 1};
final _altValue = {'b': 2};
const _defaultValue = {'a': 1};
const _altValue = {'b': 2};

final _defaultInput = <String, Object?>{
'value': _defaultValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 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: prefer_const_declarations
@TestOn('vm')
library;

Expand Down Expand Up @@ -87,8 +86,8 @@ void main() {
}); // end nullable group
}

final _defaultValue = 88.6;
final _altValue = 29;
const _defaultValue = 88.6;
const _altValue = 29;

final _defaultInput = <String, Object?>{
'value': _defaultValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 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: prefer_const_declarations
@TestOn('vm')
library;

Expand Down Expand Up @@ -87,8 +86,8 @@ void main() {
}); // end nullable group
}

final _defaultValue = 'o1';
final _altValue = 'o2';
const _defaultValue = 'o1';
const _altValue = 'o2';

final _defaultInput = <String, Object?>{
'value': _defaultValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 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: prefer_const_declarations
@TestOn('vm')
library;

Expand Down Expand Up @@ -87,8 +86,8 @@ void main() {
}); // end nullable group
}

final _defaultValue = [42, true, false, null];
final _altValue = [43, false];
const _defaultValue = [42, true, false, null];
const _altValue = [43, false];

final _defaultInput = <String, Object?>{
'value': _defaultValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 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: prefer_const_declarations
@TestOn('vm')
library;

Expand Down Expand Up @@ -87,8 +86,8 @@ void main() {
}); // end nullable group
}

final _defaultValue = 'a string';
final _altValue = 'another string';
const _defaultValue = 'a string';
const _altValue = 'another string';

final _defaultInput = <String, Object?>{
'value': _defaultValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 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: prefer_const_declarations
@TestOn('vm')
library;

Expand Down Expand Up @@ -87,8 +86,8 @@ void main() {
}); // end nullable group
}

final _defaultValue = 'https://example.com';
final _altValue = 'https://dart.dev';
const _defaultValue = 'https://example.com';
const _altValue = 'https://dart.dev';

final _defaultInput = <String, Object?>{
'value': _defaultValue,
Expand Down
8 changes: 4 additions & 4 deletions json_serializable/tool/test_type_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,12 @@ class TestTypeData {

yield Replacement(
'''
final _defaultValue = 42;
final _altValue = 43;
const _defaultValue = 42;
const _altValue = 43;
''',
'''
final _defaultValue = $jsonExpression;
final _altValue = $altJsonExpression;
const _defaultValue = $jsonExpression;
const _altValue = $altJsonExpression;
''',
);

Expand Down