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

@ -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,14 +7,14 @@ part of 'serializable_complex_object.dart';
// **************************************************************************
SerializableComplexObject _$SerializableComplexObjectFromJson(
Map<String, dynamic> json) =>
new SerializableComplexObject(
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
: new SerializableSimpleObject.fromJson(
: SerializableSimpleObject.fromJson(
json['anObject'] as Map<String, dynamic>),
aListOfStrings:
(json['aListOfStrings'] as List)?.map((e) => e as String)?.toList(),
@ -30,27 +26,19 @@ SerializableComplexObject _$SerializableComplexObjectFromJson(
aListOfObjects: (json['aListOfObjects'] as List)
?.map((e) => e == null
? null
: new SerializableSimpleObject.fromJson(
e as Map<String, dynamic>))
: 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> _$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,8 +7,8 @@ part of 'serializable_simple_object.dart';
// **************************************************************************
SerializableSimpleObject _$SerializableSimpleObjectFromJson(
Map<String, dynamic> json) =>
new SerializableSimpleObject(
Map<String, dynamic> json) {
return SerializableSimpleObject(
aString: json['aString'] as String,
anInt: json['anInt'] as int,
aDouble: (json['aDouble'] as num)?.toDouble(),
@ -23,20 +19,15 @@ SerializableSimpleObject _$SerializableSimpleObjectFromJson(
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> _$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
description: A demonstration of JSON parsing
dependencies:
environment:
sdk: '>=2.0.0-dev <3.0.0'
json_annotation: ^0.2.3
built_collection: '>=2.0.0 <4.0.0'
built_value: ^5.5.1
dependencies:
json_annotation: ^1.0.0
built_collection: '>=2.0.0 <5.0.0'
built_value: ^6.1.0
flutter:
sdk: flutter
dev_dependencies:
build_runner: ^0.8.0
json_serializable: ^0.5.0
built_value_generator: ^5.5.0
build_runner: '>=0.9.0 <0.11.0'
built_value_generator: ^6.1.0
json_serializable: ^1.0.0
flutter_test:
sdk: flutter
@ -22,3 +23,4 @@ dev_dependencies:
flutter:
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
assets:
- assets/flutter-mark-square-64.png
# PUBSPEC CHECKSUM: 2aa2

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

Loading…
Cancel
Save