fromJson method

  1. @override
int fromJson(
  1. Object json
)

Implementation

@override
int fromJson(Object json) => switch (json) {
      int() => json,
      double() => json.toInt(),
      String() => int.tryParse(json) ?? 0,
      Object() => json as int,
    };