mirror of
https://github.com/flutter/samples.git
synced 2026-05-20 22:17:17 +00:00
Migrate desktop_photo_search to top level (#1002)
This commit is contained in:
41
desktop_photo_search/fluent_ui/lib/src/unsplash/links.dart
Normal file
41
desktop_photo_search/fluent_ui/lib/src/unsplash/links.dart
Normal file
@@ -0,0 +1,41 @@
|
||||
// Copyright 2019 The Flutter team. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
import '../serializers.dart';
|
||||
|
||||
part 'links.g.dart';
|
||||
|
||||
abstract class Links implements Built<Links, LinksBuilder> {
|
||||
factory Links([void Function(LinksBuilder)? updates]) = _$Links;
|
||||
|
||||
Links._();
|
||||
|
||||
@BuiltValueField(wireName: 'self')
|
||||
String? get self;
|
||||
|
||||
@BuiltValueField(wireName: 'html')
|
||||
String? get html;
|
||||
|
||||
@BuiltValueField(wireName: 'download')
|
||||
String? get download;
|
||||
|
||||
@BuiltValueField(wireName: 'download_location')
|
||||
String? get downloadLocation;
|
||||
|
||||
String toJson() {
|
||||
return json.encode(serializers.serializeWith(Links.serializer, this));
|
||||
}
|
||||
|
||||
static Links? fromJson(String jsonString) {
|
||||
return serializers.deserializeWith(
|
||||
Links.serializer, json.decode(jsonString));
|
||||
}
|
||||
|
||||
static Serializer<Links> get serializer => _$linksSerializer;
|
||||
}
|
||||
Reference in New Issue
Block a user