Fixes the dependencies for the examples, unbreaks Travis. (#11)

* Updated jsonexample for new dep versions.

* Fixes for other examples.
pull/13/head
Andrew Brogdon 6 years ago committed by Filip Hracek
parent c02d0208fa
commit 9d5686ae13

@ -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 // GENERATED CODE - DO NOT MODIFY BY HAND
part of 'built_complex_object.dart'; part of 'built_complex_object.dart';
@ -13,10 +9,14 @@ part of 'built_complex_object.dart';
// ignore_for_file: always_put_control_body_on_new_line // ignore_for_file: always_put_control_body_on_new_line
// ignore_for_file: annotate_overrides // ignore_for_file: annotate_overrides
// ignore_for_file: avoid_annotating_with_dynamic // ignore_for_file: avoid_annotating_with_dynamic
// ignore_for_file: avoid_catches_without_on_clauses
// ignore_for_file: avoid_returning_this // ignore_for_file: avoid_returning_this
// ignore_for_file: lines_longer_than_80_chars
// ignore_for_file: omit_local_variable_types // ignore_for_file: omit_local_variable_types
// ignore_for_file: prefer_expression_function_bodies // ignore_for_file: prefer_expression_function_bodies
// ignore_for_file: sort_constructors_first // ignore_for_file: sort_constructors_first
// ignore_for_file: unnecessary_const
// ignore_for_file: unnecessary_new
Serializer<BuiltComplexObject> _$builtComplexObjectSerializer = Serializer<BuiltComplexObject> _$builtComplexObjectSerializer =
new _$BuiltComplexObjectSerializer(); new _$BuiltComplexObjectSerializer();
@ -30,7 +30,7 @@ class _$BuiltComplexObjectSerializer
@override @override
Iterable serialize(Serializers serializers, BuiltComplexObject object, Iterable serialize(Serializers serializers, BuiltComplexObject object,
{FullType specifiedType: FullType.unspecified}) { {FullType specifiedType = FullType.unspecified}) {
final result = <Object>[]; final result = <Object>[];
if (object.aString != null) { if (object.aString != null) {
result result
@ -90,7 +90,7 @@ class _$BuiltComplexObjectSerializer
@override @override
BuiltComplexObject deserialize(Serializers serializers, Iterable serialized, BuiltComplexObject deserialize(Serializers serializers, Iterable serialized,
{FullType specifiedType: FullType.unspecified}) { {FullType specifiedType = FullType.unspecified}) {
final result = new BuiltComplexObjectBuilder(); final result = new BuiltComplexObjectBuilder();
final iterator = serialized.iterator; final iterator = serialized.iterator;
@ -188,10 +188,10 @@ class _$BuiltComplexObject extends BuiltComplexObject {
new BuiltComplexObjectBuilder()..replace(this); new BuiltComplexObjectBuilder()..replace(this);
@override @override
bool operator ==(dynamic other) { bool operator ==(Object other) {
if (identical(other, this)) return true; if (identical(other, this)) return true;
if (other is! BuiltComplexObject) return false; return other is BuiltComplexObject &&
return aString == other.aString && aString == other.aString &&
anInt == other.anInt && anInt == other.anInt &&
aDouble == other.aDouble && aDouble == other.aDouble &&
anObject == other.anObject && anObject == other.anObject &&

@ -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 // GENERATED CODE - DO NOT MODIFY BY HAND
part of 'built_simple_object.dart'; part of 'built_simple_object.dart';
@ -13,10 +9,14 @@ part of 'built_simple_object.dart';
// ignore_for_file: always_put_control_body_on_new_line // ignore_for_file: always_put_control_body_on_new_line
// ignore_for_file: annotate_overrides // ignore_for_file: annotate_overrides
// ignore_for_file: avoid_annotating_with_dynamic // ignore_for_file: avoid_annotating_with_dynamic
// ignore_for_file: avoid_catches_without_on_clauses
// ignore_for_file: avoid_returning_this // ignore_for_file: avoid_returning_this
// ignore_for_file: lines_longer_than_80_chars
// ignore_for_file: omit_local_variable_types // ignore_for_file: omit_local_variable_types
// ignore_for_file: prefer_expression_function_bodies // ignore_for_file: prefer_expression_function_bodies
// ignore_for_file: sort_constructors_first // ignore_for_file: sort_constructors_first
// ignore_for_file: unnecessary_const
// ignore_for_file: unnecessary_new
Serializer<BuiltSimpleObject> _$builtSimpleObjectSerializer = Serializer<BuiltSimpleObject> _$builtSimpleObjectSerializer =
new _$BuiltSimpleObjectSerializer(); new _$BuiltSimpleObjectSerializer();
@ -30,7 +30,7 @@ class _$BuiltSimpleObjectSerializer
@override @override
Iterable serialize(Serializers serializers, BuiltSimpleObject object, Iterable serialize(Serializers serializers, BuiltSimpleObject object,
{FullType specifiedType: FullType.unspecified}) { {FullType specifiedType = FullType.unspecified}) {
final result = <Object>[]; final result = <Object>[];
if (object.aString != null) { if (object.aString != null) {
result result
@ -77,7 +77,7 @@ class _$BuiltSimpleObjectSerializer
@override @override
BuiltSimpleObject deserialize(Serializers serializers, Iterable serialized, BuiltSimpleObject deserialize(Serializers serializers, Iterable serialized,
{FullType specifiedType: FullType.unspecified}) { {FullType specifiedType = FullType.unspecified}) {
final result = new BuiltSimpleObjectBuilder(); final result = new BuiltSimpleObjectBuilder();
final iterator = serialized.iterator; final iterator = serialized.iterator;
@ -158,10 +158,10 @@ class _$BuiltSimpleObject extends BuiltSimpleObject {
new BuiltSimpleObjectBuilder()..replace(this); new BuiltSimpleObjectBuilder()..replace(this);
@override @override
bool operator ==(dynamic other) { bool operator ==(Object other) {
if (identical(other, this)) return true; if (identical(other, this)) return true;
if (other is! BuiltSimpleObject) return false; return other is BuiltSimpleObject &&
return aString == other.aString && aString == other.aString &&
anInt == other.anInt && anInt == other.anInt &&
aDouble == other.aDouble && aDouble == other.aDouble &&
aListOfStrings == other.aListOfStrings && aListOfStrings == other.aListOfStrings &&

@ -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 // GENERATED CODE - DO NOT MODIFY BY HAND
part of serializers; part of serializers;
@ -13,10 +9,14 @@ part of serializers;
// ignore_for_file: always_put_control_body_on_new_line // ignore_for_file: always_put_control_body_on_new_line
// ignore_for_file: annotate_overrides // ignore_for_file: annotate_overrides
// ignore_for_file: avoid_annotating_with_dynamic // ignore_for_file: avoid_annotating_with_dynamic
// ignore_for_file: avoid_catches_without_on_clauses
// ignore_for_file: avoid_returning_this // ignore_for_file: avoid_returning_this
// ignore_for_file: lines_longer_than_80_chars
// ignore_for_file: omit_local_variable_types // ignore_for_file: omit_local_variable_types
// ignore_for_file: prefer_expression_function_bodies // ignore_for_file: prefer_expression_function_bodies
// ignore_for_file: sort_constructors_first // ignore_for_file: sort_constructors_first
// ignore_for_file: unnecessary_const
// ignore_for_file: unnecessary_new
Serializers _$serializers = (new Serializers().toBuilder() Serializers _$serializers = (new Serializers().toBuilder()
..add(BuiltComplexObject.serializer) ..add(BuiltComplexObject.serializer)

@ -8,8 +8,7 @@ import 'package:jsonexample/json_serializable/serializable_simple_object.dart';
part 'serializable_complex_object.g.dart'; part 'serializable_complex_object.g.dart';
@JsonSerializable() @JsonSerializable()
class SerializableComplexObject extends Object class SerializableComplexObject {
with _$SerializableComplexObjectSerializerMixin {
SerializableComplexObject({ SerializableComplexObject({
this.aString, this.aString,
this.anInt, this.anInt,
@ -32,4 +31,6 @@ class SerializableComplexObject extends Object
factory SerializableComplexObject.fromJson(Map<String, dynamic> json) => factory SerializableComplexObject.fromJson(Map<String, dynamic> json) =>
_$SerializableComplexObjectFromJson(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 // GENERATED CODE - DO NOT MODIFY BY HAND
part of 'serializable_complex_object.dart'; part of 'serializable_complex_object.dart';
@ -11,46 +7,38 @@ part of 'serializable_complex_object.dart';
// ************************************************************************** // **************************************************************************
SerializableComplexObject _$SerializableComplexObjectFromJson( SerializableComplexObject _$SerializableComplexObjectFromJson(
Map<String, dynamic> json) => Map<String, dynamic> json) {
new SerializableComplexObject( return SerializableComplexObject(
aString: json['aString'] as String, aString: json['aString'] as String,
anInt: json['anInt'] as int, anInt: json['anInt'] as int,
aDouble: (json['aDouble'] as num)?.toDouble(), aDouble: (json['aDouble'] as num)?.toDouble(),
anObject: json['anObject'] == null anObject: json['anObject'] == null
? null ? null
: new SerializableSimpleObject.fromJson( : SerializableSimpleObject.fromJson(
json['anObject'] as Map<String, dynamic>), json['anObject'] as Map<String, dynamic>),
aListOfStrings: aListOfStrings:
(json['aListOfStrings'] as List)?.map((e) => e as String)?.toList(), (json['aListOfStrings'] as List)?.map((e) => e as String)?.toList(),
aListOfInts: aListOfInts:
(json['aListOfInts'] as List)?.map((e) => e as int)?.toList(), (json['aListOfInts'] as List)?.map((e) => e as int)?.toList(),
aListOfDoubles: (json['aListOfDoubles'] as List) aListOfDoubles: (json['aListOfDoubles'] as List)
?.map((e) => (e as num)?.toDouble()) ?.map((e) => (e as num)?.toDouble())
?.toList(), ?.toList(),
aListOfObjects: (json['aListOfObjects'] as List) aListOfObjects: (json['aListOfObjects'] as List)
?.map((e) => e == null ?.map((e) => e == null
? null ? null
: new SerializableSimpleObject.fromJson( : SerializableSimpleObject.fromJson(e as Map<String, dynamic>))
e as Map<String, dynamic>)) ?.toList());
?.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> _$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 /// An annotation for the code generator to know that this class needs the
/// JSON serialization logic to be generated. /// JSON serialization logic to be generated.
@JsonSerializable() @JsonSerializable()
class SerializableSimpleObject extends Object class SerializableSimpleObject {
with _$SerializableSimpleObjectSerializerMixin {
SerializableSimpleObject({ SerializableSimpleObject({
this.aString, this.aString,
this.anInt, this.anInt,
@ -29,4 +28,6 @@ class SerializableSimpleObject extends Object
factory SerializableSimpleObject.fromJson(Map<String, dynamic> json) => factory SerializableSimpleObject.fromJson(Map<String, dynamic> json) =>
_$SerializableSimpleObjectFromJson(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 // GENERATED CODE - DO NOT MODIFY BY HAND
part of 'serializable_simple_object.dart'; part of 'serializable_simple_object.dart';
@ -11,32 +7,27 @@ part of 'serializable_simple_object.dart';
// ************************************************************************** // **************************************************************************
SerializableSimpleObject _$SerializableSimpleObjectFromJson( SerializableSimpleObject _$SerializableSimpleObjectFromJson(
Map<String, dynamic> json) => Map<String, dynamic> json) {
new SerializableSimpleObject( return SerializableSimpleObject(
aString: json['aString'] as String, aString: json['aString'] as String,
anInt: json['anInt'] as int, anInt: json['anInt'] as int,
aDouble: (json['aDouble'] as num)?.toDouble(), aDouble: (json['aDouble'] as num)?.toDouble(),
aListOfStrings: aListOfStrings:
(json['aListOfStrings'] as List)?.map((e) => e as String)?.toList(), (json['aListOfStrings'] as List)?.map((e) => e as String)?.toList(),
aListOfInts: aListOfInts:
(json['aListOfInts'] as List)?.map((e) => e as int)?.toList(), (json['aListOfInts'] as List)?.map((e) => e as int)?.toList(),
aListOfDoubles: (json['aListOfDoubles'] as List) aListOfDoubles: (json['aListOfDoubles'] as List)
?.map((e) => (e as num)?.toDouble()) ?.map((e) => (e as num)?.toDouble())
?.toList()); ?.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> _$SerializableSimpleObjectToJson(
SerializableSimpleObject instance) =>
<String, dynamic>{
'aString': instance.aString,
'anInt': instance.anInt,
'aDouble': instance.aDouble,
'aListOfStrings': instance.aListOfStrings,
'aListOfInts': instance.aListOfInts,
'aListOfDoubles': instance.aListOfDoubles
};

@ -1,20 +1,21 @@
name: jsonexample name: jsonexample
description: A demonstration of JSON parsing description: A demonstration of JSON parsing
dependencies: environment:
sdk: '>=2.0.0-dev <3.0.0'
json_annotation: ^0.2.3 dependencies:
built_collection: '>=2.0.0 <4.0.0' json_annotation: ^1.0.0
built_value: ^5.5.1 built_collection: '>=2.0.0 <5.0.0'
built_value: ^6.1.0
flutter: flutter:
sdk: flutter sdk: flutter
dev_dependencies: dev_dependencies:
build_runner: '>=0.9.0 <0.11.0'
build_runner: ^0.8.0 built_value_generator: ^6.1.0
json_serializable: ^0.5.0 json_serializable: ^1.0.0
built_value_generator: ^5.5.0
flutter_test: flutter_test:
sdk: flutter sdk: flutter
@ -22,3 +23,4 @@ dev_dependencies:
flutter: flutter:
uses-material-design: true uses-material-design: true

@ -0,0 +1,15 @@
.DS_Store
.dart_tool/
.packages
.pub/
.idea
.atom
.flutter-plugins
build/
*.iml
.symlinks/
Podfile.lock
GeneratedPluginRegistrant.h
GeneratedPluginRegistrant.m
GeneratedPluginRegistrant.java

@ -0,0 +1,44 @@
.idea/
.vagrant/
.sconsign.dblite
.svn/
.DS_Store
*.swp
profile
DerivedData/
build/
GeneratedPluginRegistrant.h
GeneratedPluginRegistrant.m
.generated/
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
!default.pbxuser
!default.mode1v3
!default.mode2v3
!default.perspectivev3
xcuserdata
*.moved-aside
*.pyc
*sync/
Icon?
.tags*
/Flutter/app.flx
/Flutter/app.zip
/Flutter/flutter_assets/
/Flutter/App.framework
/Flutter/Flutter.framework
/Flutter/Generated.xcconfig
/ServiceDefinitions.json
Pods/

@ -9,5 +9,3 @@ flutter:
uses-material-design: true uses-material-design: true
assets: assets:
- assets/flutter-mark-square-64.png - assets/flutter-mark-square-64.png
# PUBSPEC CHECKSUM: 2aa2

@ -6,9 +6,9 @@ dependencies:
sdk: flutter sdk: flutter
cupertino_icons: ^0.1.2 cupertino_icons: ^0.1.2
intl: 0.15.6 intl: ^0.15.7
scoped_model: 0.2.0 scoped_model: ^0.3.0
shrine_images: 1.0.0 shrine_images: ^1.0.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:

Loading…
Cancel
Save