1
0
mirror of https://github.com/flutter/samples.git synced 2026-05-31 11:29:48 +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,53 @@
// 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 'exif.g.dart';
abstract class Exif implements Built<Exif, ExifBuilder> {
factory Exif([void Function(ExifBuilder) updates]) = _$Exif;
Exif._();
@nullable
@BuiltValueField(wireName: 'make')
String get make;
@nullable
@BuiltValueField(wireName: 'model')
String get model;
@nullable
@BuiltValueField(wireName: 'exposure_time')
String get exposureTime;
@nullable
@BuiltValueField(wireName: 'aperture')
String get aperture;
@nullable
@BuiltValueField(wireName: 'focal_length')
String get focalLength;
@nullable
@BuiltValueField(wireName: 'iso')
int get iso;
String toJson() {
return json.encode(serializers.serializeWith(Exif.serializer, this));
}
static Exif fromJson(String jsonString) {
return serializers.deserializeWith(
Exif.serializer, json.decode(jsonString));
}
static Serializer<Exif> get serializer => _$exifSerializer;
}