mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 22:09:06 +00:00
Adding JSON example. (#1)
This commit is contained in:
35
jsonexample/lib/built_value/built_simple_object.dart
Normal file
35
jsonexample/lib/built_value/built_simple_object.dart
Normal file
@@ -0,0 +1,35 @@
|
||||
// Copyright 2018 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'built_simple_object.g.dart';
|
||||
|
||||
abstract class BuiltSimpleObject
|
||||
implements Built<BuiltSimpleObject, BuiltSimpleObjectBuilder> {
|
||||
static Serializer<BuiltSimpleObject> get serializer =>
|
||||
_$builtSimpleObjectSerializer;
|
||||
|
||||
@nullable
|
||||
String get aString;
|
||||
|
||||
@nullable
|
||||
int get anInt;
|
||||
|
||||
@nullable
|
||||
double get aDouble;
|
||||
|
||||
BuiltList<String> get aListOfStrings;
|
||||
|
||||
BuiltList<int> get aListOfInts;
|
||||
|
||||
BuiltList<double> get aListOfDoubles;
|
||||
|
||||
BuiltSimpleObject._();
|
||||
|
||||
factory BuiltSimpleObject([updates(BuiltSimpleObjectBuilder b)]) =
|
||||
_$BuiltSimpleObject;
|
||||
}
|
||||
Reference in New Issue
Block a user