mirror of
https://github.com/flutter/samples.git
synced 2026-03-31 16:55:34 +00:00
Fixes the dependencies for the examples, unbreaks Travis. (#11)
* Updated jsonexample for new dep versions. * Fixes for other examples.
This commit is contained in:
committed by
Filip Hracek
parent
c02d0208fa
commit
9d5686ae13
@@ -8,8 +8,7 @@ import 'package:jsonexample/json_serializable/serializable_simple_object.dart';
|
||||
part 'serializable_complex_object.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class SerializableComplexObject extends Object
|
||||
with _$SerializableComplexObjectSerializerMixin {
|
||||
class SerializableComplexObject {
|
||||
SerializableComplexObject({
|
||||
this.aString,
|
||||
this.anInt,
|
||||
@@ -32,4 +31,6 @@ class SerializableComplexObject extends Object
|
||||
|
||||
factory SerializableComplexObject.fromJson(Map<String, dynamic> json) =>
|
||||
_$SerializableComplexObjectFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$SerializableComplexObjectToJson(this);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
// 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.
|
||||
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'serializable_complex_object.dart';
|
||||
@@ -11,46 +7,38 @@ part of 'serializable_complex_object.dart';
|
||||
// **************************************************************************
|
||||
|
||||
SerializableComplexObject _$SerializableComplexObjectFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
new SerializableComplexObject(
|
||||
aString: json['aString'] as String,
|
||||
anInt: json['anInt'] as int,
|
||||
aDouble: (json['aDouble'] as num)?.toDouble(),
|
||||
anObject: json['anObject'] == null
|
||||
? null
|
||||
: new SerializableSimpleObject.fromJson(
|
||||
json['anObject'] as Map<String, dynamic>),
|
||||
aListOfStrings:
|
||||
(json['aListOfStrings'] as List)?.map((e) => e as String)?.toList(),
|
||||
aListOfInts:
|
||||
(json['aListOfInts'] as List)?.map((e) => e as int)?.toList(),
|
||||
aListOfDoubles: (json['aListOfDoubles'] as List)
|
||||
?.map((e) => (e as num)?.toDouble())
|
||||
?.toList(),
|
||||
aListOfObjects: (json['aListOfObjects'] as List)
|
||||
?.map((e) => e == null
|
||||
? null
|
||||
: new SerializableSimpleObject.fromJson(
|
||||
e as Map<String, dynamic>))
|
||||
?.toList());
|
||||
|
||||
abstract class _$SerializableComplexObjectSerializerMixin {
|
||||
String get aString;
|
||||
int get anInt;
|
||||
double get aDouble;
|
||||
SerializableSimpleObject get anObject;
|
||||
List<String> get aListOfStrings;
|
||||
List<int> get aListOfInts;
|
||||
List<double> get aListOfDoubles;
|
||||
List<SerializableSimpleObject> get aListOfObjects;
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'aString': aString,
|
||||
'anInt': anInt,
|
||||
'aDouble': aDouble,
|
||||
'anObject': anObject,
|
||||
'aListOfStrings': aListOfStrings,
|
||||
'aListOfInts': aListOfInts,
|
||||
'aListOfDoubles': aListOfDoubles,
|
||||
'aListOfObjects': aListOfObjects
|
||||
};
|
||||
Map<String, dynamic> json) {
|
||||
return SerializableComplexObject(
|
||||
aString: json['aString'] as String,
|
||||
anInt: json['anInt'] as int,
|
||||
aDouble: (json['aDouble'] as num)?.toDouble(),
|
||||
anObject: json['anObject'] == null
|
||||
? null
|
||||
: SerializableSimpleObject.fromJson(
|
||||
json['anObject'] as Map<String, dynamic>),
|
||||
aListOfStrings:
|
||||
(json['aListOfStrings'] as List)?.map((e) => e as String)?.toList(),
|
||||
aListOfInts:
|
||||
(json['aListOfInts'] as List)?.map((e) => e as int)?.toList(),
|
||||
aListOfDoubles: (json['aListOfDoubles'] as List)
|
||||
?.map((e) => (e as num)?.toDouble())
|
||||
?.toList(),
|
||||
aListOfObjects: (json['aListOfObjects'] as List)
|
||||
?.map((e) => e == null
|
||||
? null
|
||||
: SerializableSimpleObject.fromJson(e as Map<String, dynamic>))
|
||||
?.toList());
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$SerializableComplexObjectToJson(
|
||||
SerializableComplexObject instance) =>
|
||||
<String, dynamic>{
|
||||
'aString': instance.aString,
|
||||
'anInt': instance.anInt,
|
||||
'aDouble': instance.aDouble,
|
||||
'anObject': instance.anObject,
|
||||
'aListOfStrings': instance.aListOfStrings,
|
||||
'aListOfInts': instance.aListOfInts,
|
||||
'aListOfDoubles': instance.aListOfDoubles,
|
||||
'aListOfObjects': instance.aListOfObjects
|
||||
};
|
||||
|
||||
@@ -9,8 +9,7 @@ part 'serializable_simple_object.g.dart';
|
||||
/// An annotation for the code generator to know that this class needs the
|
||||
/// JSON serialization logic to be generated.
|
||||
@JsonSerializable()
|
||||
class SerializableSimpleObject extends Object
|
||||
with _$SerializableSimpleObjectSerializerMixin {
|
||||
class SerializableSimpleObject {
|
||||
SerializableSimpleObject({
|
||||
this.aString,
|
||||
this.anInt,
|
||||
@@ -29,4 +28,6 @@ class SerializableSimpleObject extends Object
|
||||
|
||||
factory SerializableSimpleObject.fromJson(Map<String, dynamic> json) =>
|
||||
_$SerializableSimpleObjectFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$SerializableSimpleObjectToJson(this);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
// 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.
|
||||
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'serializable_simple_object.dart';
|
||||
@@ -11,32 +7,27 @@ part of 'serializable_simple_object.dart';
|
||||
// **************************************************************************
|
||||
|
||||
SerializableSimpleObject _$SerializableSimpleObjectFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
new SerializableSimpleObject(
|
||||
aString: json['aString'] as String,
|
||||
anInt: json['anInt'] as int,
|
||||
aDouble: (json['aDouble'] as num)?.toDouble(),
|
||||
aListOfStrings:
|
||||
(json['aListOfStrings'] as List)?.map((e) => e as String)?.toList(),
|
||||
aListOfInts:
|
||||
(json['aListOfInts'] as List)?.map((e) => e as int)?.toList(),
|
||||
aListOfDoubles: (json['aListOfDoubles'] as List)
|
||||
?.map((e) => (e as num)?.toDouble())
|
||||
?.toList());
|
||||
|
||||
abstract class _$SerializableSimpleObjectSerializerMixin {
|
||||
String get aString;
|
||||
int get anInt;
|
||||
double get aDouble;
|
||||
List<String> get aListOfStrings;
|
||||
List<int> get aListOfInts;
|
||||
List<double> get aListOfDoubles;
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'aString': aString,
|
||||
'anInt': anInt,
|
||||
'aDouble': aDouble,
|
||||
'aListOfStrings': aListOfStrings,
|
||||
'aListOfInts': aListOfInts,
|
||||
'aListOfDoubles': aListOfDoubles
|
||||
};
|
||||
Map<String, dynamic> json) {
|
||||
return SerializableSimpleObject(
|
||||
aString: json['aString'] as String,
|
||||
anInt: json['anInt'] as int,
|
||||
aDouble: (json['aDouble'] as num)?.toDouble(),
|
||||
aListOfStrings:
|
||||
(json['aListOfStrings'] as List)?.map((e) => e as String)?.toList(),
|
||||
aListOfInts:
|
||||
(json['aListOfInts'] as List)?.map((e) => e as int)?.toList(),
|
||||
aListOfDoubles: (json['aListOfDoubles'] as List)
|
||||
?.map((e) => (e as num)?.toDouble())
|
||||
?.toList());
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$SerializableSimpleObjectToJson(
|
||||
SerializableSimpleObject instance) =>
|
||||
<String, dynamic>{
|
||||
'aString': instance.aString,
|
||||
'anInt': instance.anInt,
|
||||
'aDouble': instance.aDouble,
|
||||
'aListOfStrings': instance.aListOfStrings,
|
||||
'aListOfInts': instance.aListOfInts,
|
||||
'aListOfDoubles': instance.aListOfDoubles
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user