1
0
mirror of https://github.com/flutter/samples.git synced 2026-05-30 02:49:40 +00:00

Desktop photo search (#174)

This commit is contained in:
Brett Morgan
2019-12-11 07:22:42 +11:00
committed by GitHub
parent 8c27a25d50
commit f07b4a90d5
74 changed files with 7380 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
// 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';
import 'position.dart';
part 'location.g.dart';
abstract class Location implements Built<Location, LocationBuilder> {
factory Location([void Function(LocationBuilder) updates]) = _$Location;
Location._();
@nullable
@BuiltValueField(wireName: 'city')
String get city;
@nullable
@BuiltValueField(wireName: 'country')
String get country;
@nullable
@BuiltValueField(wireName: 'position')
Position get position;
String toJson() {
return json.encode(serializers.serializeWith(Location.serializer, this));
}
static Location fromJson(String jsonString) {
return serializers.deserializeWith(
Location.serializer, json.decode(jsonString));
}
static Serializer<Location> get serializer => _$locationSerializer;
}