Skip to content

Commit bdb1184

Browse files
committed
Use Object? instead of dynamic
Discussion in dart-lang/language#3192 indicates a general move away from dynamic.
1 parent 98e5910 commit bdb1184

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/json_utils.dart

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
/// packages defining the same type.
44
library json_utils;
55

6+
// Get a nullable type object, idea taken from https://github.com/dart-lang/sdk/issues/48856
67
typedef Nullable<T> = T?;
78

8-
typedef JsonMap = Map<String, dynamic>;
9-
typedef JsonList = List<dynamic>;
10-
typedef Json = dynamic;
9+
typedef JsonMap = Map<String, Object?>;
10+
typedef JsonList = List<Object?>;
11+
typedef Json = Object?;
1112

1213
class MalformedJsonException implements Exception {
1314
MalformedJsonException(this.message, this.json);

0 commit comments

Comments
 (0)