1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 13:58:47 +00:00

Updates for 1.9 (#139)

This commit is contained in:
Andrew Brogdon
2019-09-10 08:47:34 -07:00
committed by GitHub
parent f955976837
commit 16fa475ff8
31 changed files with 194 additions and 265 deletions

View File

@@ -8,7 +8,6 @@
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
@@ -41,7 +40,6 @@
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
@@ -74,7 +72,6 @@
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
2D5378251FAA1A9400D5DBA9 /* flutter_assets */,
3B80C3931E831B6300D905FE /* App.framework */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEBA1CF902C7004384FC /* Flutter.framework */,
@@ -192,7 +189,6 @@
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;

View File

@@ -42,19 +42,20 @@ class BasicsPage extends StatelessWidget {
final localTheme = Theme.of(context).textTheme;
final boldStyle = localTheme.body1.copyWith(fontWeight: FontWeight.w600);
final dynamicListOfInts = json.decode(JsonStrings.listOfInts);
final dynamic dynamicListOfInts = json.decode(JsonStrings.listOfInts);
final strongListOfInts = List<int>.from(dynamicListOfInts);
final dynamicListOfStrings = json.decode(JsonStrings.listOfStrings);
final dynamic dynamicListOfStrings = json.decode(JsonStrings.listOfStrings);
final strongListOfStrings = List<String>.from(dynamicListOfStrings);
final dynamicListOfDoubles = json.decode(JsonStrings.listOfDoubles);
final dynamic dynamicListOfDoubles = json.decode(JsonStrings.listOfDoubles);
final strongListOfDoubles = List<double>.from(dynamicListOfDoubles);
final dynamicListOfDynamics = json.decode(JsonStrings.listOfDynamics);
final dynamic dynamicListOfDynamics =
json.decode(JsonStrings.listOfDynamics);
final strongListOfDynamics = List<dynamic>.from(dynamicListOfDynamics);
final dynamicMapOfDynamics = json.decode(JsonStrings.mapOfDynamics);
final dynamic dynamicMapOfDynamics = json.decode(JsonStrings.mapOfDynamics);
final strongMapOfDynamics = Map<String, dynamic>.from(dynamicMapOfDynamics);
return ListView(
@@ -149,7 +150,7 @@ class ConvertedSimplePage extends StatelessWidget {
Widget build(BuildContext context) {
List<ConvertedSimpleObject> objects = JsonStrings.simpleObjects.map(
(jsonString) {
final parsedJson = json.decode(jsonString);
final dynamic parsedJson = json.decode(jsonString);
return ConvertedSimpleObject.fromJson(parsedJson);
},
).toList();
@@ -170,7 +171,7 @@ class ConvertedComplexPage extends StatelessWidget {
Widget build(BuildContext context) {
List<ConvertedComplexObject> objects = JsonStrings.complexObjects.map(
(jsonString) {
final parsedJson = json.decode(jsonString);
final dynamic parsedJson = json.decode(jsonString);
return ConvertedComplexObject.fromJson(parsedJson);
},
).toList();
@@ -189,12 +190,12 @@ class ConvertedComplexPage extends StatelessWidget {
class ConvertedListPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final parsedJson = json.decode(JsonStrings.listOfSimpleObjects);
final dynamic parsedJson = json.decode(JsonStrings.listOfSimpleObjects);
final deserializedObjects =
parsedJson.map((o) => ConvertedComplexObject.fromJson(o));
final dynamic deserializedObjects =
parsedJson.map((dynamic o) => ConvertedComplexObject.fromJson(o));
final listOfObjects = deserializedObjects.toList();
final dynamic listOfObjects = deserializedObjects.toList();
return ListView(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
@@ -212,7 +213,7 @@ class SerializableSimplePage extends StatelessWidget {
Widget build(BuildContext context) {
List<SerializableSimpleObject> objects = JsonStrings.simpleObjects.map(
(jsonString) {
final parsedJson = json.decode(jsonString);
final dynamic parsedJson = json.decode(jsonString);
return SerializableSimpleObject.fromJson(parsedJson);
},
).toList();
@@ -233,7 +234,7 @@ class SerializableComplexPage extends StatelessWidget {
Widget build(BuildContext context) {
List<SerializableComplexObject> objects = JsonStrings.complexObjects.map(
(jsonString) {
final parsedJson = json.decode(jsonString);
final dynamic parsedJson = json.decode(jsonString);
return SerializableComplexObject.fromJson(parsedJson);
},
).toList();
@@ -252,12 +253,12 @@ class SerializableComplexPage extends StatelessWidget {
class SerializableListPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final parsedJson = json.decode(JsonStrings.listOfSimpleObjects);
final dynamic parsedJson = json.decode(JsonStrings.listOfSimpleObjects);
final deserializedObjects =
parsedJson.map((o) => SerializableSimpleObject.fromJson(o));
final dynamic deserializedObjects =
parsedJson.map((dynamic o) => SerializableSimpleObject.fromJson(o));
final listOfObjects = deserializedObjects.toList();
final dynamic listOfObjects = deserializedObjects.toList();
return ListView(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
@@ -275,7 +276,7 @@ class BuiltSimplePage extends StatelessWidget {
Widget build(BuildContext context) {
List<BuiltSimpleObject> objects = JsonStrings.simpleObjects.map(
(jsonString) {
final parsedJson = json.decode(jsonString);
final dynamic parsedJson = json.decode(jsonString);
return serializers.deserializeWith(
BuiltSimpleObject.serializer, parsedJson);
},
@@ -297,7 +298,7 @@ class BuiltComplexPage extends StatelessWidget {
Widget build(BuildContext context) {
List<BuiltComplexObject> objects = JsonStrings.complexObjects.map(
(jsonString) {
final parsedJson = json.decode(jsonString);
final dynamic parsedJson = json.decode(jsonString);
return serializers.deserializeWith(
BuiltComplexObject.serializer, parsedJson);
},
@@ -317,12 +318,12 @@ class BuiltComplexPage extends StatelessWidget {
class BuiltListPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final parsedJson = json.decode(JsonStrings.listOfSimpleObjects);
final dynamic parsedJson = json.decode(JsonStrings.listOfSimpleObjects);
final deserializedObjects = parsedJson.map(
(o) => serializers.deserializeWith(BuiltComplexObject.serializer, o));
final dynamic deserializedObjects = parsedJson.map((dynamic o) =>
serializers.deserializeWith(BuiltComplexObject.serializer, o));
final listOfObjects = deserializedObjects.toList();
final dynamic listOfObjects = deserializedObjects.toList();
return ListView(
padding: const EdgeInsets.symmetric(horizontal: 16.0),

View File

@@ -7,98 +7,98 @@ packages:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "0.35.4"
version: "0.36.4"
analyzer_plugin:
dependency: transitive
description:
name: analyzer_plugin
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1-alpha.7"
version: "0.1.0"
args:
dependency: transitive
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.1"
version: "1.5.2"
async:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0"
version: "2.3.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
version: "1.0.5"
build:
dependency: transitive
description:
name: build
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.4"
version: "1.1.6"
build_config:
dependency: transitive
description:
name: build_config
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.2"
version: "0.4.1+1"
build_daemon:
dependency: transitive
description:
name: build_daemon
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.0"
version: "2.0.0"
build_resolvers:
dependency: transitive
description:
name: build_resolvers
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
version: "1.0.7"
build_runner:
dependency: "direct dev"
description:
name: build_runner
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.3"
version: "1.6.8"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.3"
version: "3.1.0"
built_collection:
dependency: "direct main"
description:
name: built_collection
url: "https://pub.dartlang.org"
source: hosted
version: "4.2.0"
version: "4.2.2"
built_value:
dependency: "direct main"
description:
name: built_value
url: "https://pub.dartlang.org"
source: hosted
version: "6.4.0"
version: "6.7.1"
built_value_generator:
dependency: "direct dev"
description:
name: built_value_generator
url: "https://pub.dartlang.org"
source: hosted
version: "6.4.0"
version: "6.7.1"
charcode:
dependency: transitive
description:
@@ -106,6 +106,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.2"
checked_yaml:
dependency: transitive
description:
name: checked_yaml
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
code_builder:
dependency: transitive
description:
@@ -133,21 +140,21 @@ packages:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.6"
version: "2.1.2"
csslib:
dependency: transitive
description:
name: csslib
url: "https://pub.dartlang.org"
source: hosted
version: "0.15.0"
version: "0.16.1"
dart_style:
dependency: transitive
description:
name: dart_style
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.4"
version: "1.2.9"
fixnum:
dependency: transitive
description:
@@ -171,7 +178,7 @@ packages:
name: front_end
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.14"
version: "0.1.19"
glob:
dependency: transitive
description:
@@ -192,7 +199,7 @@ packages:
name: html
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.4+2"
version: "0.14.0+2"
http:
dependency: transitive
description:
@@ -206,7 +213,7 @@ packages:
name: http_multi_server
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.6"
version: "2.1.0"
http_parser:
dependency: transitive
description:
@@ -234,21 +241,21 @@ packages:
name: json_annotation
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0"
version: "3.0.0"
json_serializable:
dependency: "direct dev"
description:
name: json_serializable
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.1"
version: "3.2.2"
kernel:
dependency: transitive
description:
name: kernel
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.14"
version: "0.3.19"
logging:
dependency: transitive
description:
@@ -269,21 +276,21 @@ packages:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
version: "1.1.7"
mime:
dependency: transitive
description:
name: mime
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.6+2"
version: "0.9.6+3"
package_config:
dependency: transitive
description:
name: package_config
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
version: "1.1.0"
package_resolver:
dependency: transitive
description:
@@ -297,14 +304,14 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.2"
version: "1.6.4"
pedantic:
dependency: "direct dev"
description:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
version: "1.8.0+1"
pool:
dependency: transitive
description:
@@ -325,14 +332,14 @@ packages:
name: pubspec_parse
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.4"
version: "0.1.5"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.3"
version: "2.0.5"
shelf:
dependency: transitive
description:
@@ -358,7 +365,7 @@ packages:
name: source_gen
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.4+2"
version: "0.9.4+4"
source_span:
dependency: transitive
description:
@@ -386,14 +393,14 @@ packages:
name: stream_transform
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.16+1"
version: "0.0.19"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
version: "1.0.5"
term_glyph:
dependency: transitive
description:
@@ -414,7 +421,7 @@ packages:
name: timing
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.1+1"
version: "0.1.1+2"
typed_data:
dependency: transitive
description:
@@ -422,13 +429,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
utf:
dependency: transitive
description:
name: utf
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.0+5"
vector_math:
dependency: transitive
description:
@@ -442,20 +442,20 @@ packages:
name: watcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.7+10"
version: "0.9.7+12"
web_socket_channel:
dependency: transitive
description:
name: web_socket_channel
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.12"
version: "1.0.15"
yaml:
dependency: transitive
description:
name: yaml
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.15"
version: "2.1.16"
sdks:
dart: ">=2.2.2 <3.0.0"
dart: ">=2.5.0 <3.0.0"

View File

@@ -2,26 +2,25 @@ name: jsonexample
description: A demonstration of JSON parsing
environment:
sdk: '>=2.1.0 <3.0.0'
sdk: '>=2.5.0 <3.0.0'
dependencies:
json_annotation: ^2.0.0
built_collection: ^4.0.0
built_value: ^6.1.5
json_annotation: ^3.0.0
built_collection: ^4.2.2
built_value: ^6.7.1
flutter:
sdk: flutter
dev_dependencies:
build_runner: ^1.0.0
built_value_generator: ^6.1.5
json_serializable: ^2.2.1
pedantic: ^1.7.0
build_runner: ^1.6.8
built_value_generator: ^6.7.1
json_serializable: ^3.2.2
pedantic: ^1.8.0+1
flutter_test:
sdk: flutter
flutter:
uses-material-design: true

View File

@@ -24,9 +24,9 @@ void main() {
'aString': 'Blah, blah, blah.',
'anInt': 1,
'aDouble': 1.0,
'aListOfStrings': [],
'aListOfInts': [],
'aListOfDoubles': []
'aListOfStrings': <String>[],
'aListOfInts': <int>[],
'aListOfDoubles': <double>[]
};
const unexpectedPropertiesJson = <String, dynamic>{
@@ -73,9 +73,9 @@ void main() {
expect(simpleObject.aString, "Blah, blah, blah.");
expect(simpleObject.anInt, 1);
expect(simpleObject.aDouble, 1.0);
expect(simpleObject.aListOfStrings, []);
expect(simpleObject.aListOfInts, []);
expect(simpleObject.aListOfDoubles, []);
expect(simpleObject.aListOfStrings, <String>[]);
expect(simpleObject.aListOfInts, <int>[]);
expect(simpleObject.aListOfDoubles, <double>[]);
});
test('Extra properties', () {
@@ -124,9 +124,9 @@ void main() {
expect(simpleObject.aString, "Blah, blah, blah.");
expect(simpleObject.anInt, 1);
expect(simpleObject.aDouble, 1.0);
expect(simpleObject.aListOfStrings, []);
expect(simpleObject.aListOfInts, []);
expect(simpleObject.aListOfDoubles, []);
expect(simpleObject.aListOfStrings, <String>[]);
expect(simpleObject.aListOfInts, <int>[]);
expect(simpleObject.aListOfDoubles, <double>[]);
});
test('Unexpected properties are ignored', () {
@@ -178,9 +178,9 @@ void main() {
expect(simpleObject.aString, "Blah, blah, blah.");
expect(simpleObject.anInt, 1);
expect(simpleObject.aDouble, 1.0);
expect(simpleObject.aListOfStrings, []);
expect(simpleObject.aListOfInts, []);
expect(simpleObject.aListOfDoubles, []);
expect(simpleObject.aListOfStrings, <String>[]);
expect(simpleObject.aListOfInts, <int>[]);
expect(simpleObject.aListOfDoubles, <double>[]);
});
test('Unexpected properties are ignored', () {