mirror of https://github.com/flutter/samples.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
133 lines
4.2 KiB
133 lines
4.2 KiB
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of data;
|
|
|
|
// **************************************************************************
|
|
// JsonSerializableGenerator
|
|
// **************************************************************************
|
|
|
|
Index _$IndexFromJson(Map json) => $checkedCreate(
|
|
'Index',
|
|
json,
|
|
($checkedConvert) {
|
|
final val = Index(
|
|
$checkedConvert(
|
|
'samples',
|
|
(v) => (v as List<dynamic>)
|
|
.map((e) => Sample.fromJson(e as Map))
|
|
.toList()),
|
|
);
|
|
return val;
|
|
},
|
|
);
|
|
|
|
Map<String, dynamic> _$IndexToJson(Index instance) => <String, dynamic>{
|
|
'samples': instance.samples,
|
|
};
|
|
|
|
Sample _$SampleFromJson(Map json) => $checkedCreate(
|
|
'Sample',
|
|
json,
|
|
($checkedConvert) {
|
|
final val = Sample(
|
|
name: $checkedConvert('name', (v) => v as String),
|
|
author: $checkedConvert('author', (v) => v as String? ?? 'Flutter'),
|
|
screenshots: $checkedConvert(
|
|
'screenshots',
|
|
(v) => (v as List<dynamic>)
|
|
.map((e) => Screenshot.fromJson(e as Map))
|
|
.toList()),
|
|
source: $checkedConvert('source', (v) => v as String),
|
|
web: $checkedConvert('web', (v) => v as String?),
|
|
description: $checkedConvert('description', (v) => v as String),
|
|
difficulty:
|
|
$checkedConvert('difficulty', (v) => v as String? ?? 'beginner'),
|
|
widgets: $checkedConvert(
|
|
'widgets',
|
|
(v) =>
|
|
(v as List<dynamic>?)?.map((e) => e as String).toList() ??
|
|
const []),
|
|
packages: $checkedConvert(
|
|
'packages',
|
|
(v) =>
|
|
(v as List<dynamic>?)?.map((e) => e as String).toList() ??
|
|
const []),
|
|
tags: $checkedConvert(
|
|
'tags',
|
|
(v) =>
|
|
(v as List<dynamic>?)?.map((e) => e as String).toList() ??
|
|
const []),
|
|
platforms: $checkedConvert(
|
|
'platforms',
|
|
(v) =>
|
|
(v as List<dynamic>?)?.map((e) => e as String).toList() ??
|
|
const []),
|
|
links: $checkedConvert(
|
|
'links',
|
|
(v) =>
|
|
(v as List<dynamic>?)
|
|
?.map((e) => Link.fromJson(e as Map))
|
|
.toList() ??
|
|
const []),
|
|
type: $checkedConvert('type', (v) => v as String),
|
|
date: $checkedConvert(
|
|
'date', (v) => v == null ? null : DateTime.parse(v as String)),
|
|
channel: $checkedConvert('channel', (v) => v as String?),
|
|
);
|
|
return val;
|
|
},
|
|
);
|
|
|
|
Map<String, dynamic> _$SampleToJson(Sample instance) => <String, dynamic>{
|
|
'name': instance.name,
|
|
'author': instance.author,
|
|
'screenshots': instance.screenshots,
|
|
'source': instance.source,
|
|
'web': instance.web,
|
|
'description': instance.description,
|
|
'difficulty': instance.difficulty,
|
|
'widgets': instance.widgets,
|
|
'packages': instance.packages,
|
|
'tags': instance.tags,
|
|
'platforms': instance.platforms,
|
|
'links': instance.links,
|
|
'type': instance.type,
|
|
'date': instance.date?.toIso8601String(),
|
|
'channel': instance.channel,
|
|
};
|
|
|
|
Screenshot _$ScreenshotFromJson(Map json) => $checkedCreate(
|
|
'Screenshot',
|
|
json,
|
|
($checkedConvert) {
|
|
final val = Screenshot(
|
|
$checkedConvert('url', (v) => v as String),
|
|
$checkedConvert('alt', (v) => v as String),
|
|
);
|
|
return val;
|
|
},
|
|
);
|
|
|
|
Map<String, dynamic> _$ScreenshotToJson(Screenshot instance) =>
|
|
<String, dynamic>{
|
|
'url': instance.url,
|
|
'alt': instance.alt,
|
|
};
|
|
|
|
Link _$LinkFromJson(Map json) => $checkedCreate(
|
|
'Link',
|
|
json,
|
|
($checkedConvert) {
|
|
final val = Link(
|
|
$checkedConvert('text', (v) => v as String),
|
|
$checkedConvert('href', (v) => v as String),
|
|
);
|
|
return val;
|
|
},
|
|
);
|
|
|
|
Map<String, dynamic> _$LinkToJson(Link instance) => <String, dynamic>{
|
|
'text': instance.text,
|
|
'href': instance.href,
|
|
};
|