diff --git a/examples/marvel/lib/src/marvel.g.dart b/examples/marvel/lib/src/marvel.g.dart index 1762d17db..e0d7b3122 100644 --- a/examples/marvel/lib/src/marvel.g.dart +++ b/examples/marvel/lib/src/marvel.g.dart @@ -8,7 +8,7 @@ part of 'marvel.dart'; _$CharacterImpl _$$CharacterImplFromJson(Map json) => _$CharacterImpl( - id: json['id'] as int, + id: (json['id'] as num).toInt(), name: json['name'] as String, thumbnail: Thumbnail.fromJson(json['thumbnail'] as Map), ); @@ -48,7 +48,7 @@ _$MarvelDataImpl _$$MarvelDataImplFromJson(Map json) => (json['results'] as List) .map((e) => e as Map) .toList(), - json['total'] as int, + (json['total'] as num).toInt(), ); Map _$$MarvelDataImplToJson(_$MarvelDataImpl instance) => diff --git a/examples/pub/lib/pub_repository.g.dart b/examples/pub/lib/pub_repository.g.dart index d58e4e823..91e268ac2 100644 --- a/examples/pub/lib/pub_repository.g.dart +++ b/examples/pub/lib/pub_repository.g.dart @@ -11,9 +11,9 @@ part of 'pub_repository.dart'; _$PackageMetricsScoreImpl _$$PackageMetricsScoreImplFromJson( Map json) => _$PackageMetricsScoreImpl( - grantedPoints: json['grantedPoints'] as int, - maxPoints: json['maxPoints'] as int, - likeCount: json['likeCount'] as int, + grantedPoints: (json['grantedPoints'] as num).toInt(), + maxPoints: (json['maxPoints'] as num).toInt(), + likeCount: (json['likeCount'] as num).toInt(), popularityScore: (json['popularityScore'] as num).toDouble(), tags: (json['tags'] as List).map((e) => e as String).toList(), ); diff --git a/examples/stackoverflow/lib/question.g.dart b/examples/stackoverflow/lib/question.g.dart index 2f15b3978..039da7180 100644 --- a/examples/stackoverflow/lib/question.g.dart +++ b/examples/stackoverflow/lib/question.g.dart @@ -14,7 +14,7 @@ _$QuestionsResponseImpl _$$QuestionsResponseImplFromJson( items: (json['items'] as List) .map((e) => Question.fromJson(e as Map)) .toList(), - total: json['total'] as int, + total: (json['total'] as num).toInt(), ); Map _$$QuestionsResponseImplToJson( @@ -27,17 +27,17 @@ Map _$$QuestionsResponseImplToJson( _$QuestionImpl _$$QuestionImplFromJson(Map json) => _$QuestionImpl( tags: (json['tags'] as List).map((e) => e as String).toList(), - viewCount: json['view_count'] as int, - score: json['score'] as int, - bountyAmount: json['bounty_amount'] as int?, - acceptedAnswerId: json['accepted_answer_id'] as int?, + viewCount: (json['view_count'] as num).toInt(), + score: (json['score'] as num).toInt(), + bountyAmount: (json['bounty_amount'] as num?)?.toInt(), + acceptedAnswerId: (json['accepted_answer_id'] as num?)?.toInt(), owner: User.fromJson((json['owner'] as Map).map( (k, e) => MapEntry(k, e as Object), )), - answerCount: json['answer_count'] as int, - creationDate: - const TimestampParser().fromJson(json['creation_date'] as int), - questionId: json['question_id'] as int, + answerCount: (json['answer_count'] as num).toInt(), + creationDate: const TimestampParser() + .fromJson((json['creation_date'] as num).toInt()), + questionId: (json['question_id'] as num).toInt(), link: json['link'] as String, title: json['title'] as String, body: json['body'] as String, diff --git a/examples/stackoverflow/lib/user.g.dart b/examples/stackoverflow/lib/user.g.dart index 50fcbf23f..d0c674aaf 100644 --- a/examples/stackoverflow/lib/user.g.dart +++ b/examples/stackoverflow/lib/user.g.dart @@ -9,8 +9,8 @@ part of 'user.dart'; // ************************************************************************** _$UserImpl _$$UserImplFromJson(Map json) => _$UserImpl( - reputation: json['reputation'] as int, - userId: json['user_id'] as int, + reputation: (json['reputation'] as num).toInt(), + userId: (json['user_id'] as num).toInt(), badgeCounts: json['badge_counts'] == null ? null : BadgeCount.fromJson( @@ -34,9 +34,9 @@ Map _$$UserImplToJson(_$UserImpl instance) => _$BadgeCountImpl _$$BadgeCountImplFromJson(Map json) => _$BadgeCountImpl( - bronze: json['bronze'] as int, - silver: json['silver'] as int, - gold: json['gold'] as int, + bronze: (json['bronze'] as num).toInt(), + silver: (json['silver'] as num).toInt(), + gold: (json['gold'] as num).toInt(), ); Map _$$BadgeCountImplToJson(_$BadgeCountImpl instance) => diff --git a/packages/riverpod/example/lib/models.g.dart b/packages/riverpod/example/lib/models.g.dart index 839ebc7df..827662299 100644 --- a/packages/riverpod/example/lib/models.g.dart +++ b/packages/riverpod/example/lib/models.g.dart @@ -44,7 +44,7 @@ Map _$$MarvelDataImplToJson(_$MarvelDataImpl instance) => }; _$ComicImpl _$$ComicImplFromJson(Map json) => _$ComicImpl( - id: json['id'] as int, + id: (json['id'] as num).toInt(), title: json['title'] as String, ); diff --git a/website/docs/case_studies/cancel/detail_screen/codegen.g.dart b/website/docs/case_studies/cancel/detail_screen/codegen.g.dart index 69ee1d982..d58964929 100644 --- a/website/docs/case_studies/cancel/detail_screen/codegen.g.dart +++ b/website/docs/case_studies/cancel/detail_screen/codegen.g.dart @@ -12,7 +12,7 @@ _$ActivityImpl _$$ActivityImplFromJson(Map json) => _$ActivityImpl( activity: json['activity'] as String, type: json['type'] as String, - participants: json['participants'] as int, + participants: (json['participants'] as num).toInt(), price: (json['price'] as num).toDouble(), ); diff --git a/website/docs/case_studies/pull_to_refresh/activity/codegen.g.dart b/website/docs/case_studies/pull_to_refresh/activity/codegen.g.dart index 79ae3cd00..1b29b30b7 100644 --- a/website/docs/case_studies/pull_to_refresh/activity/codegen.g.dart +++ b/website/docs/case_studies/pull_to_refresh/activity/codegen.g.dart @@ -12,7 +12,7 @@ _$ActivityImpl _$$ActivityImplFromJson(Map json) => _$ActivityImpl( activity: json['activity'] as String, type: json['type'] as String, - participants: json['participants'] as int, + participants: (json['participants'] as num).toInt(), price: (json['price'] as num).toDouble(), ); diff --git a/website/docs/case_studies/pull_to_refresh/full_app/codegen.g.dart b/website/docs/case_studies/pull_to_refresh/full_app/codegen.g.dart index 69ee1d982..d58964929 100644 --- a/website/docs/case_studies/pull_to_refresh/full_app/codegen.g.dart +++ b/website/docs/case_studies/pull_to_refresh/full_app/codegen.g.dart @@ -12,7 +12,7 @@ _$ActivityImpl _$$ActivityImplFromJson(Map json) => _$ActivityImpl( activity: json['activity'] as String, type: json['type'] as String, - participants: json['participants'] as int, + participants: (json['participants'] as num).toInt(), price: (json['price'] as num).toDouble(), ); diff --git a/website/docs/essentials/first_request/codegen/activity.g.dart b/website/docs/essentials/first_request/codegen/activity.g.dart index 55a7a5383..6abf6d0e2 100644 --- a/website/docs/essentials/first_request/codegen/activity.g.dart +++ b/website/docs/essentials/first_request/codegen/activity.g.dart @@ -13,7 +13,7 @@ _$ActivityImpl _$$ActivityImplFromJson(Map json) => key: json['key'] as String, activity: json['activity'] as String, type: json['type'] as String, - participants: json['participants'] as int, + participants: (json['participants'] as num).toInt(), price: (json['price'] as num).toDouble(), ); diff --git a/website/docs/from_provider/helpers/item.g.dart b/website/docs/from_provider/helpers/item.g.dart index 3c653e18c..c94f37f0b 100644 --- a/website/docs/from_provider/helpers/item.g.dart +++ b/website/docs/from_provider/helpers/item.g.dart @@ -9,7 +9,7 @@ part of 'item.dart'; // ************************************************************************** _$ItemImpl _$$ItemImplFromJson(Map json) => _$ItemImpl( - id: json['id'] as int, + id: (json['id'] as num).toInt(), ); Map _$$ItemImplToJson(_$ItemImpl instance) =>