1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 22:09:06 +00:00

Landing beta changes in master for the new stable release (#747)

This commit is contained in:
Andrew Brogdon
2021-03-03 11:44:35 -08:00
committed by GitHub
parent 6c81510d6e
commit 8c1cd0b049
101 changed files with 1006 additions and 1040 deletions

View File

@@ -28,14 +28,14 @@ packages:
name: async name: async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.5.0-nullsafety.1" version: "2.5.0-nullsafety.3"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
name: boolean_selector name: boolean_selector
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0-nullsafety.3"
build: build:
dependency: transitive dependency: transitive
description: description:
@@ -63,14 +63,14 @@ packages:
name: characters name: characters
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.3" version: "1.1.0-nullsafety.5"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
name: charcode name: charcode
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0-nullsafety.3"
cli_util: cli_util:
dependency: transitive dependency: transitive
description: description:
@@ -84,7 +84,7 @@ packages:
name: clock name: clock
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0-nullsafety.3"
code_builder: code_builder:
dependency: transitive dependency: transitive
description: description:
@@ -98,7 +98,7 @@ packages:
name: collection name: collection
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.15.0-nullsafety.3" version: "1.15.0-nullsafety.5"
convert: convert:
dependency: transitive dependency: transitive
description: description:
@@ -126,7 +126,7 @@ packages:
name: fake_async name: fake_async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0-nullsafety.3"
file: file:
dependency: transitive dependency: transitive
description: description:
@@ -185,14 +185,14 @@ packages:
name: matcher name: matcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.12.10-nullsafety.1" version: "0.12.10-nullsafety.3"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0-nullsafety.6"
mockito: mockito:
dependency: "direct dev" dependency: "direct dev"
description: description:
@@ -227,7 +227,7 @@ packages:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0-nullsafety.1" version: "1.8.0-nullsafety.3"
pedantic: pedantic:
dependency: transitive dependency: transitive
description: description:
@@ -274,56 +274,56 @@ packages:
name: source_span name: source_span
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0-nullsafety.2" version: "1.8.0-nullsafety.4"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.1" version: "1.10.0-nullsafety.6"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0-nullsafety.3"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0-nullsafety.3"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0-nullsafety.3"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.19-nullsafety.2" version: "0.2.19-nullsafety.6"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
name: typed_data name: typed_data
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0-nullsafety.5"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.3" version: "2.1.0-nullsafety.5"
watcher: watcher:
dependency: transitive dependency: transitive
description: description:
@@ -339,4 +339,4 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.10.0 <2.11.0" dart: ">=2.12.0-0.0 <3.0.0"

View File

@@ -9,11 +9,7 @@
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 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, ); }; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
@@ -26,8 +22,6 @@
dstPath = ""; dstPath = "";
dstSubfolderSpec = 10; dstSubfolderSpec = 10;
files = ( files = (
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
); );
name = "Embed Frameworks"; name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
@@ -38,13 +32,11 @@
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; }; 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>"; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; }; 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>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
@@ -57,8 +49,6 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@@ -68,9 +58,7 @@
9740EEB11CF90186004384FC /* Flutter */ = { 9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
3B80C3931E831B6300D905FE /* App.framework */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEBA1CF902C7004384FC /* Flutter.framework */,
9740EEB21CF90195004384FC /* Debug.xcconfig */, 9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9740EEB31CF90195004384FC /* Generated.xcconfig */, 9740EEB31CF90195004384FC /* Generated.xcconfig */,
@@ -201,7 +189,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
}; };
9740EEB61CF901F6004384FC /* Run Script */ = { 9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
@@ -253,7 +241,6 @@
/* Begin XCBuildConfiguration section */ /* Begin XCBuildConfiguration section */
249021D3217E4FDB00AE95B9 /* Profile */ = { 249021D3217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
@@ -330,7 +317,6 @@
}; };
97C147031CF9000F007C117D /* Debug */ = { 97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
@@ -386,7 +372,6 @@
}; };
97C147041CF9000F007C117D /* Release */ = { 97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;

View File

@@ -2,6 +2,6 @@
<Workspace <Workspace
version = "1.0"> version = "1.0">
<FileRef <FileRef
location = "group:Runner.xcodeproj"> location = "self:">
</FileRef> </FileRef>
</Workspace> </Workspace>

View File

@@ -31,7 +31,11 @@ class Demo {
final String route; final String route;
final WidgetBuilder builder; final WidgetBuilder builder;
const Demo({this.name, this.route, this.builder}); const Demo({
required this.name,
required this.route,
required this.builder,
});
} }
final basicDemos = [ final basicDemos = [

View File

@@ -18,9 +18,9 @@ class AnimatedContainerDemo extends StatefulWidget {
} }
class _AnimatedContainerDemoState extends State<AnimatedContainerDemo> { class _AnimatedContainerDemoState extends State<AnimatedContainerDemo> {
Color color; late Color color;
double borderRadius; late double borderRadius;
double margin; late double margin;
@override @override
void initState() { void initState() {

View File

@@ -20,7 +20,7 @@ class _AnimationControllerDemoState extends State<AnimationControllerDemo>
// Widget is not visible. // Widget is not visible.
static const Duration _duration = Duration(seconds: 1); static const Duration _duration = Duration(seconds: 1);
AnimationController controller; late final AnimationController controller;
@override @override
void initState() { void initState() {

View File

@@ -15,8 +15,8 @@ class _TweenDemoState extends State<TweenDemo>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
static const Duration _duration = Duration(seconds: 1); static const Duration _duration = Duration(seconds: 1);
static const double accountBalance = 1000000; static const double accountBalance = 1000000;
AnimationController controller; late final AnimationController controller;
Animation<double> animation; late final Animation<double> animation;
@override @override
void initState() { void initState() {

View File

@@ -16,8 +16,8 @@ class _AnimatedBuilderDemoState extends State<AnimatedBuilderDemo>
static const Color beginColor = Colors.deepPurple; static const Color beginColor = Colors.deepPurple;
static const Color endColor = Colors.deepOrange; static const Color endColor = Colors.deepOrange;
Duration duration = Duration(milliseconds: 800); Duration duration = Duration(milliseconds: 800);
AnimationController controller; late AnimationController controller;
Animation<Color> animation; late Animation<Color?> animation;
@override @override
void initState() { void initState() {

View File

@@ -5,13 +5,13 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class TypewriterTween extends Tween<String> { class TypewriterTween extends Tween<String> {
TypewriterTween({String begin = '', String end}) TypewriterTween({String begin = '', String end = ''})
: super(begin: begin, end: end); : super(begin: begin, end: end);
@override @override
String lerp(double t) { String lerp(double t) {
var cutoff = (end.length * t).round(); var cutoff = (end!.length * t).round();
return end.substring(0, cutoff); return end!.substring(0, cutoff);
} }
} }
@@ -26,8 +26,8 @@ class _CustomTweenDemoState extends State<CustomTweenDemo>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
static const Duration _duration = Duration(seconds: 3); static const Duration _duration = Duration(seconds: 3);
static const String message = loremIpsum; static const String message = loremIpsum;
AnimationController controller; late final AnimationController controller;
Animation<String> animation; late final Animation<String> animation;
@override @override
void initState() { void initState() {

View File

@@ -14,8 +14,8 @@ class TweenSequenceDemo extends StatefulWidget {
class _TweenSequenceDemoState extends State<TweenSequenceDemo> class _TweenSequenceDemoState extends State<TweenSequenceDemo>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
static const Duration duration = Duration(seconds: 3); static const Duration duration = Duration(seconds: 3);
AnimationController controller; late final AnimationController controller;
Animation<Color> animation; late final Animation<Color?> animation;
static final colors = [ static final colors = [
Colors.red, Colors.red,
@@ -31,7 +31,7 @@ class _TweenSequenceDemoState extends State<TweenSequenceDemo>
void initState() { void initState() {
super.initState(); super.initState();
final sequenceItems = <TweenSequenceItem<Color>>[]; final sequenceItems = <TweenSequenceItem<Color?>>[];
for (var i = 0; i < colors.length; i++) { for (var i = 0; i < colors.length; i++) {
final beginColor = colors[i]; final beginColor = colors[i];
@@ -39,7 +39,7 @@ class _TweenSequenceDemoState extends State<TweenSequenceDemo>
final weight = 1 / colors.length; final weight = 1 / colors.length;
sequenceItems.add( sequenceItems.add(
TweenSequenceItem<Color>( TweenSequenceItem<Color?>(
tween: ColorTween(begin: beginColor, end: endColor), tween: ColorTween(begin: beginColor, end: endColor),
weight: weight, weight: weight,
), ),
@@ -47,7 +47,7 @@ class _TweenSequenceDemoState extends State<TweenSequenceDemo>
} }
controller = AnimationController(duration: duration, vsync: this); controller = AnimationController(duration: duration, vsync: this);
animation = TweenSequence<Color>(sequenceItems).animate(controller); animation = TweenSequence<Color?>(sequenceItems).animate(controller);
} }
@override @override

View File

@@ -15,9 +15,9 @@ class FadeTransitionDemo extends StatefulWidget {
class _FadeTransitionDemoState extends State<FadeTransitionDemo> class _FadeTransitionDemoState extends State<FadeTransitionDemo>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
AnimationController _controller; late final AnimationController _controller;
Animation<double> _animation; late final Animation<double> _animation;
CurvedAnimation _curve; late final CurvedAnimation _curve;
@override @override
void initState() { void initState() {

View File

@@ -14,23 +14,31 @@ class AnimatedListDemo extends StatefulWidget {
class _AnimatedListDemoState extends State<AnimatedListDemo> { class _AnimatedListDemoState extends State<AnimatedListDemo> {
final GlobalKey<AnimatedListState> _listKey = GlobalKey(); final GlobalKey<AnimatedListState> _listKey = GlobalKey();
final listData = initialListData; final listData = [
UserModel(0, 'Govind', 'Dixit'),
UserModel(1, 'Greta', 'Stoll'),
UserModel(2, 'Monty', 'Carlo'),
UserModel(3, 'Petey', 'Cruiser'),
UserModel(4, 'Barry', 'Cade'),
];
final initialListSize = 5;
void addUser() { void addUser() {
setState(() { setState(() {
var index = listData.length; var index = listData.length;
listData.add( listData.add(
UserModel(firstName: 'New', lastName: 'Person'), UserModel(++_maxIdValue, 'New', 'Person'),
); );
_listKey.currentState _listKey.currentState!
.insertItem(index, duration: Duration(milliseconds: 300)); .insertItem(index, duration: Duration(milliseconds: 300));
}); });
} }
void deleteUser(int index) { void deleteUser(int id) {
setState(() { setState(() {
final index = listData.indexWhere((u) => u.id == id);
var user = listData.removeAt(index); var user = listData.removeAt(index);
_listKey.currentState.removeItem( _listKey.currentState!.removeItem(
index, index,
(context, animation) { (context, animation) {
return FadeTransition( return FadeTransition(
@@ -49,7 +57,7 @@ class _AnimatedListDemoState extends State<AnimatedListDemo> {
}); });
} }
Widget _buildItem(UserModel user, [int index]) { Widget _buildItem(UserModel user) {
return ListTile( return ListTile(
key: ValueKey<UserModel>(user), key: ValueKey<UserModel>(user),
title: Text(user.firstName), title: Text(user.firstName),
@@ -59,7 +67,7 @@ class _AnimatedListDemoState extends State<AnimatedListDemo> {
), ),
trailing: IconButton( trailing: IconButton(
icon: Icon(Icons.delete), icon: Icon(Icons.delete),
onPressed: () => deleteUser(index), onPressed: () => deleteUser(user.id),
), ),
); );
} }
@@ -79,11 +87,11 @@ class _AnimatedListDemoState extends State<AnimatedListDemo> {
body: SafeArea( body: SafeArea(
child: AnimatedList( child: AnimatedList(
key: _listKey, key: _listKey,
initialItemCount: initialListData.length, initialItemCount: 5,
itemBuilder: (context, index, animation) { itemBuilder: (context, index, animation) {
return FadeTransition( return FadeTransition(
opacity: animation, opacity: animation,
child: _buildItem(listData[index], index), child: _buildItem(listData[index]),
); );
}, },
), ),
@@ -93,31 +101,15 @@ class _AnimatedListDemoState extends State<AnimatedListDemo> {
} }
class UserModel { class UserModel {
const UserModel({this.firstName, this.lastName}); UserModel(
this.id,
this.firstName,
this.lastName,
);
final int id;
final String firstName; final String firstName;
final String lastName; final String lastName;
} }
List<UserModel> initialListData = [ int _maxIdValue = 4;
UserModel(
firstName: 'Govind',
lastName: 'Dixit',
),
UserModel(
firstName: 'Greta',
lastName: 'Stoll',
),
UserModel(
firstName: 'Monty',
lastName: 'Carlo',
),
UserModel(
firstName: 'Petey',
lastName: 'Cruiser',
),
UserModel(
firstName: 'Barry',
lastName: 'Cade',
),
];

View File

@@ -14,8 +14,8 @@ class AnimatedPositionedDemo extends StatefulWidget {
} }
class _AnimatedPositionedDemoState extends State<AnimatedPositionedDemo> { class _AnimatedPositionedDemoState extends State<AnimatedPositionedDemo> {
double topPosition; late double topPosition;
double leftPosition; late double leftPosition;
double generateTopPosition(double top) => Random().nextDouble() * top; double generateTopPosition(double top) => Random().nextDouble() * top;
@@ -41,8 +41,7 @@ class _AnimatedPositionedDemoState extends State<AnimatedPositionedDemo> {
final appBar = AppBar(title: Text('AnimatedPositioned')); final appBar = AppBar(title: Text('AnimatedPositioned'));
final topPadding = MediaQuery.of(context).padding.top; final topPadding = MediaQuery.of(context).padding.top;
// AnimatedPositioned animates changes to a widget's position within a Stack // AnimatedPositioned animates changes to a widget's position within a Stack
return SafeArea( return Scaffold(
child: Scaffold(
appBar: appBar, appBar: appBar,
body: Container( body: Container(
height: size.height, height: size.height,
@@ -66,7 +65,7 @@ class _AnimatedPositionedDemoState extends State<AnimatedPositionedDemo> {
'Click Me', 'Click Me',
style: TextStyle( style: TextStyle(
color: color:
Theme.of(context).buttonTheme.colorScheme.onPrimary, Theme.of(context).buttonTheme.colorScheme!.onPrimary,
), ),
), ),
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
@@ -76,7 +75,6 @@ class _AnimatedPositionedDemoState extends State<AnimatedPositionedDemo> {
], ],
), ),
), ),
),
); );
} }
} }

View File

@@ -30,8 +30,8 @@ class AnimatedSwitcherDemo extends StatefulWidget {
} }
class _AnimatedSwitcherDemoState extends State<AnimatedSwitcherDemo> { class _AnimatedSwitcherDemoState extends State<AnimatedSwitcherDemo> {
Widget container; late Widget container;
int keyCount; late int keyCount;
@override @override
void initState() { void initState() {
@@ -53,7 +53,7 @@ class _AnimatedSwitcherDemoState extends State<AnimatedSwitcherDemo> {
child: Text( child: Text(
'Change Widget', 'Change Widget',
style: TextStyle( style: TextStyle(
color: Theme.of(context).buttonTheme.colorScheme.onPrimary), color: Theme.of(context).buttonTheme.colorScheme!.onPrimary),
), ),
), ),
], ],

View File

@@ -15,7 +15,7 @@ class CardSwipeDemo extends StatefulWidget {
} }
class _CardSwipeDemoState extends State<CardSwipeDemo> { class _CardSwipeDemoState extends State<CardSwipeDemo> {
List<String> fileNames; late List<String> fileNames;
@override @override
void initState() { void initState() {
@@ -102,8 +102,8 @@ class SwipeableCard extends StatefulWidget {
final VoidCallback onSwiped; final VoidCallback onSwiped;
SwipeableCard({ SwipeableCard({
this.onSwiped, required this.onSwiped,
this.imageAssetName, required this.imageAssetName,
}); });
@override @override
@@ -112,9 +112,9 @@ class SwipeableCard extends StatefulWidget {
class _SwipeableCardState extends State<SwipeableCard> class _SwipeableCardState extends State<SwipeableCard>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
AnimationController _controller; late AnimationController _controller;
Animation<Offset> _animation; late Animation<Offset> _animation;
double _dragStartX; late double _dragStartX;
bool _isSwipingLeft = false; bool _isSwipingLeft = false;
@override @override
@@ -155,18 +155,29 @@ class _SwipeableCardState extends State<SwipeableCard>
} }
setState(() { setState(() {
final size = context.size;
if (size == null) {
return;
}
// Calculate the amount dragged in unit coordinates (between 0 and 1) // Calculate the amount dragged in unit coordinates (between 0 and 1)
// using this widgets width. // using this widgets width.
_controller.value = _controller.value =
(details.localPosition.dx - _dragStartX).abs() / context.size.width; (details.localPosition.dx - _dragStartX).abs() / size.width;
}); });
} }
/// Runs the fling / spring animation using the final velocity of the drag /// Runs the fling / spring animation using the final velocity of the drag
/// gesture. /// gesture.
void _dragEnd(DragEndDetails details) { void _dragEnd(DragEndDetails details) {
var velocity = final size = context.size;
(details.velocity.pixelsPerSecond.dx / context.size.width).abs();
if (size == null) {
return;
}
var velocity = (details.velocity.pixelsPerSecond.dx / size.width).abs();
_animate(velocity: velocity); _animate(velocity: velocity);
} }

View File

@@ -46,15 +46,15 @@ typedef OnCurrentItemChangedCallback = void Function(int currentItem);
class Carousel extends StatefulWidget { class Carousel extends StatefulWidget {
final IndexedWidgetBuilder itemBuilder; final IndexedWidgetBuilder itemBuilder;
const Carousel({Key key, @required this.itemBuilder}); const Carousel({Key? key, required this.itemBuilder}) : super(key: key);
@override @override
_CarouselState createState() => _CarouselState(); _CarouselState createState() => _CarouselState();
} }
class _CarouselState extends State<Carousel> { class _CarouselState extends State<Carousel> {
PageController _controller; late final PageController _controller;
int _currentPage; late int _currentPage;
bool _pageHasChanged = false; bool _pageHasChanged = false;
@override @override
@@ -81,11 +81,11 @@ class _CarouselState extends State<Carousel> {
itemBuilder: (context, index) => AnimatedBuilder( itemBuilder: (context, index) => AnimatedBuilder(
animation: _controller, animation: _controller,
builder: (context, child) { builder: (context, child) {
var result = _pageHasChanged ? _controller.page : _currentPage * 1.0; var result = _pageHasChanged ? _controller.page! : _currentPage * 1.0;
// The horizontal position of the page between a 1 and 0 // The horizontal position of the page between a 1 and 0
var value = result - index; var value = result - index;
value = (1 - (value.abs() * .5)).clamp(0.0, 1.0) as double; value = (1 - (value.abs() * .5)).clamp(0.0, 1.0);
return Center( return Center(
child: SizedBox( child: SizedBox(

View File

@@ -15,14 +15,15 @@ class CurvedAnimationDemo extends StatefulWidget {
class CurveChoice { class CurveChoice {
final Curve curve; final Curve curve;
final String name; final String name;
const CurveChoice({this.curve, this.name});
const CurveChoice({required this.curve, required this.name});
} }
class _CurvedAnimationDemoState extends State<CurvedAnimationDemo> class _CurvedAnimationDemoState extends State<CurvedAnimationDemo>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
AnimationController controller; late final AnimationController controller;
Animation<double> animationRotation; late final Animation<double> animationRotation;
Animation<Offset> animationTranslation; late final Animation<Offset> animationTranslation;
static const _duration = Duration(seconds: 4); static const _duration = Duration(seconds: 4);
List<CurveChoice> curves = [ List<CurveChoice> curves = [
CurveChoice(curve: Curves.bounceIn, name: 'Bounce In'), CurveChoice(curve: Curves.bounceIn, name: 'Bounce In'),
@@ -38,8 +39,8 @@ class _CurvedAnimationDemoState extends State<CurvedAnimationDemo>
CurveChoice(curve: Curves.easeInCirc, name: 'Ease In Circle'), CurveChoice(curve: Curves.easeInCirc, name: 'Ease In Circle'),
CurveChoice(curve: Curves.easeOutCirc, name: 'Ease Out Circle'), CurveChoice(curve: Curves.easeOutCirc, name: 'Ease Out Circle'),
]; ];
CurveChoice selectedForwardCurve, selectedReverseCurve; late CurveChoice selectedForwardCurve, selectedReverseCurve;
CurvedAnimation curvedAnimation; late final CurvedAnimation curvedAnimation;
@override @override
void initState() { void initState() {
@@ -100,10 +101,12 @@ class _CurvedAnimationDemoState extends State<CurvedAnimationDemo>
value: curve, child: Text(curve.name)); value: curve, child: Text(curve.name));
}).toList(), }).toList(),
onChanged: (newCurve) { onChanged: (newCurve) {
if (newCurve != null) {
setState(() { setState(() {
selectedForwardCurve = newCurve; selectedForwardCurve = newCurve;
curvedAnimation.curve = selectedForwardCurve.curve; curvedAnimation.curve = selectedForwardCurve.curve;
}); });
}
}, },
value: selectedForwardCurve, value: selectedForwardCurve,
), ),
@@ -118,10 +121,12 @@ class _CurvedAnimationDemoState extends State<CurvedAnimationDemo>
value: curve, child: Text(curve.name)); value: curve, child: Text(curve.name));
}).toList(), }).toList(),
onChanged: (newCurve) { onChanged: (newCurve) {
if (newCurve != null) {
setState(() { setState(() {
selectedReverseCurve = newCurve; selectedReverseCurve = newCurve;
curvedAnimation.reverseCurve = selectedReverseCurve.curve; curvedAnimation.reverseCurve = selectedReverseCurve.curve;
}); });
}
}, },
value: selectedReverseCurve, value: selectedReverseCurve,
), ),

View File

@@ -18,7 +18,7 @@ class HeroAnimationDemo extends StatelessWidget {
tag: 'hero-page-child', tag: 'hero-page-child',
child: _createHeroContainer( child: _createHeroContainer(
size: 50.0, size: 50.0,
color: Colors.grey[300], color: Colors.grey.shade300,
), ),
), ),
onTap: () => Navigator.of(context) onTap: () => Navigator.of(context)
@@ -47,7 +47,10 @@ class HeroPage extends StatelessWidget {
} }
} }
StatelessWidget _createHeroContainer({double size, Color color}) { StatelessWidget _createHeroContainer({
required double size,
required Color color,
}) {
return Container( return Container(
height: size, height: size,
width: size, width: size,

View File

@@ -27,7 +27,7 @@ class PhysicsCardDragDemo extends StatelessWidget {
/// released. /// released.
class DraggableCard extends StatefulWidget { class DraggableCard extends StatefulWidget {
final Widget child; final Widget child;
DraggableCard({this.child}); DraggableCard({required this.child});
@override @override
_DraggableCardState createState() => _DraggableCardState(); _DraggableCardState createState() => _DraggableCardState();
@@ -35,7 +35,7 @@ class DraggableCard extends StatefulWidget {
class _DraggableCardState extends State<DraggableCard> class _DraggableCardState extends State<DraggableCard>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
AnimationController _controller; late final AnimationController _controller;
/// The alignment of the card as it is dragged or being animated. /// The alignment of the card as it is dragged or being animated.
/// ///
@@ -44,7 +44,7 @@ class _DraggableCardState extends State<DraggableCard>
/// this value is set to the value of the [_animation]. /// this value is set to the value of the [_animation].
var _dragAlignment = Alignment.center; var _dragAlignment = Alignment.center;
Animation<Alignment> _animation; late Animation<Alignment> _animation;
final _spring = const SpringDescription( final _spring = const SpringDescription(
mass: 10, mass: 10,

View File

@@ -13,8 +13,8 @@ class RepeatingAnimationDemo extends StatefulWidget {
class RepeatingAnimationDemoState extends State<RepeatingAnimationDemo> class RepeatingAnimationDemoState extends State<RepeatingAnimationDemo>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
AnimationController _controller; late final AnimationController _controller;
Animation<BorderRadius> _borderRadius; late final Animation<BorderRadius> _borderRadius;
@override @override
void initState() { void initState() {

View File

@@ -94,7 +94,7 @@ packages:
name: pedantic name: pedantic
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.9.2" version: "1.10.0"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter

View File

@@ -3,12 +3,12 @@ description: A new Flutter project.
version: 1.0.0+1 version: 1.0.0+1
environment: environment:
sdk: ">=2.10.0 <3.0.0" sdk: ">=2.12.0-0 <3.0.0"
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
cupertino_icons: ^1.0.0 cupertino_icons: ^1.0.2
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:

View File

@@ -1,2 +1,3 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig" #include "Generated.xcconfig"

View File

@@ -1,2 +1,3 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig" #include "Generated.xcconfig"

View File

@@ -373,4 +373,4 @@ packages:
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.12.0-0.0 <3.0.0" dart: ">=2.12.0-0.0 <3.0.0"
flutter: ">=1.16.0 <2.0.0" flutter: ">=1.16.0"

View File

@@ -1,2 +1,3 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig" #include "Generated.xcconfig"

View File

@@ -1,2 +1,3 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig" #include "Generated.xcconfig"

View File

@@ -1,2 +1,3 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig" #include "Generated.xcconfig"

View File

@@ -1,2 +1,3 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig" #include "Generated.xcconfig"

View File

@@ -38,7 +38,7 @@ class App extends StatelessWidget {
} }
class HomePage extends StatefulWidget { class HomePage extends StatefulWidget {
const HomePage({@required this.title}); const HomePage({required this.title});
final String title; final String title;
@@ -49,7 +49,7 @@ class HomePage extends StatefulWidget {
} }
class _HomePageState extends State<HomePage> { class _HomePageState extends State<HomePage> {
Stream<QuerySnapshot> _iceCreamStores; late Stream<QuerySnapshot> _iceCreamStores;
final Completer<GoogleMapController> _mapController = Completer(); final Completer<GoogleMapController> _mapController = Completer();
@override @override
@@ -80,13 +80,13 @@ class _HomePageState extends State<HomePage> {
return Stack( return Stack(
children: [ children: [
StoreMap( StoreMap(
documents: snapshot.data.docs, documents: snapshot.data!.docs,
initialPosition: initialPosition, initialPosition: initialPosition,
mapController: _mapController, mapController: _mapController,
), ),
StoreCarousel( StoreCarousel(
mapController: _mapController, mapController: _mapController,
documents: snapshot.data.docs, documents: snapshot.data!.docs,
), ),
], ],
); );
@@ -98,9 +98,9 @@ class _HomePageState extends State<HomePage> {
class StoreCarousel extends StatelessWidget { class StoreCarousel extends StatelessWidget {
const StoreCarousel({ const StoreCarousel({
Key key, Key? key,
@required this.documents, required this.documents,
@required this.mapController, required this.mapController,
}) : super(key: key); }) : super(key: key);
final List<DocumentSnapshot> documents; final List<DocumentSnapshot> documents;
@@ -126,9 +126,9 @@ class StoreCarousel extends StatelessWidget {
class StoreCarouselList extends StatelessWidget { class StoreCarouselList extends StatelessWidget {
const StoreCarouselList({ const StoreCarouselList({
Key key, Key? key,
@required this.documents, required this.documents,
@required this.mapController, required this.mapController,
}) : super(key: key); }) : super(key: key);
final List<DocumentSnapshot> documents; final List<DocumentSnapshot> documents;
@@ -161,9 +161,9 @@ class StoreCarouselList extends StatelessWidget {
class StoreListTile extends StatefulWidget { class StoreListTile extends StatefulWidget {
const StoreListTile({ const StoreListTile({
Key key, Key? key,
@required this.document, required this.document,
@required this.mapController, required this.mapController,
}) : super(key: key); }) : super(key: key);
final DocumentSnapshot document; final DocumentSnapshot document;
@@ -239,10 +239,10 @@ class _StoreListTileState extends State<StoreListTile> {
class StoreMap extends StatelessWidget { class StoreMap extends StatelessWidget {
const StoreMap({ const StoreMap({
Key key, Key? key,
@required this.documents, required this.documents,
@required this.initialPosition, required this.initialPosition,
@required this.mapController, required this.mapController,
}) : super(key: key); }) : super(key: key);
final List<DocumentSnapshot> documents; final List<DocumentSnapshot> documents;
@@ -265,8 +265,8 @@ class StoreMap extends StatelessWidget {
document['location'].longitude as double, document['location'].longitude as double,
), ),
infoWindow: InfoWindow( infoWindow: InfoWindow(
title: document['name'] as String, title: document['name'] as String?,
snippet: document['address'] as String, snippet: document['address'] as String?,
), ),
)) ))
.toSet(), .toSet(),

View File

@@ -3,21 +3,21 @@ description: A new Flutter project.
version: 1.0.0+1 version: 1.0.0+1
environment: environment:
sdk: ">=2.10.0 <3.0.0" sdk: ">=2.12.0-0 <3.0.0"
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
cloud_firestore: ^0.16.0 cloud_firestore: ^0.17.0-1.0.nullsafety.2
firebase_core: ^0.7.0 firebase_core: ^0.8.0-1.0.nullsafety.2
google_maps_flutter: ^1.2.0 google_maps_flutter: ^2.0.0
google_maps_webservice: ^0.0.19 google_maps_webservice: ^0.0.20-nullsafety.0
location: ^3.0.2 location: ^4.0.0-nullsafety.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
pedantic: ^1.9.0 pedantic: ^1.10.0
flutter: flutter:
uses-material-design: true uses-material-design: true

View File

@@ -32,7 +32,7 @@ class MyHomePage extends StatelessWidget {
appBar: AppBar( appBar: AppBar(
title: Text('Infinite List Sample'), title: Text('Infinite List Sample'),
), ),
body: Selector<Catalog, int>( body: Selector<Catalog, int?>(
// Selector is a widget from package:provider. It allows us to listen // Selector is a widget from package:provider. It allows us to listen
// to only one aspect of a provided value. In this case, we are only // to only one aspect of a provided value. In this case, we are only
// listening to the catalog's `itemCount`, because that's all we need // listening to the catalog's `itemCount`, because that's all we need

View File

@@ -12,9 +12,9 @@ class Item {
final String name; final String name;
Item({ Item({
@required this.color, required this.color,
@required this.name, required this.name,
@required this.price, required this.price,
}); });
Item.loading() : this(color: Colors.grey, name: '...', price: 0); Item.loading() : this(color: Colors.grey, name: '...', price: 0);

View File

@@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'item.dart'; import 'item.dart';
const int itemsPerPage = 20; const int itemsPerPage = 20;
@@ -17,8 +14,8 @@ class ItemPage {
final bool hasNext; final bool hasNext;
ItemPage({ ItemPage({
@required this.items, required this.items,
@required this.startingIndex, required this.startingIndex,
@required this.hasNext, required this.hasNext,
}); });
} }

View File

@@ -32,7 +32,7 @@ class Catalog extends ChangeNotifier {
/// The size of the catalog. This is `null` at first, and only when the user /// The size of the catalog. This is `null` at first, and only when the user
/// reaches the end of the catalog, it will hold the actual number. /// reaches the end of the catalog, it will hold the actual number.
int itemCount; int? itemCount;
/// After the catalog is disposed, we don't allow it to call /// After the catalog is disposed, we don't allow it to call
/// [notifyListeners]. /// [notifyListeners].
@@ -62,7 +62,7 @@ class Catalog extends ChangeNotifier {
// If the corresponding page is already in memory, return immediately. // If the corresponding page is already in memory, return immediately.
if (_pages.containsKey(startingIndex)) { if (_pages.containsKey(startingIndex)) {
var item = _pages[startingIndex].items[index - startingIndex]; var item = _pages[startingIndex]!.items[index - startingIndex];
return item; return item;
} }

View File

@@ -11,7 +11,7 @@ import 'api/item.dart';
class ItemTile extends StatelessWidget { class ItemTile extends StatelessWidget {
final Item item; final Item item;
ItemTile({@required this.item, Key key}) : super(key: key); ItemTile({required this.item, Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@@ -34,7 +34,7 @@ class ItemTile extends StatelessWidget {
/// This is the widget responsible for building the "still loading" item /// This is the widget responsible for building the "still loading" item
/// in the list (represented with "..." and a crossed square). /// in the list (represented with "..." and a crossed square).
class LoadingItemTile extends StatelessWidget { class LoadingItemTile extends StatelessWidget {
const LoadingItemTile({Key key}) : super(key: key); const LoadingItemTile({Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

View File

@@ -7,56 +7,56 @@ packages:
name: async name: async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.5.0-nullsafety.1" version: "2.5.0"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
name: boolean_selector name: boolean_selector
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.3" version: "1.1.0"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
name: charcode name: charcode
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.15.0-nullsafety.3" version: "1.15.0"
cupertino_icons: cupertino_icons:
dependency: "direct main" dependency: "direct main"
description: description:
name: cupertino_icons name: cupertino_icons
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0" version: "1.0.2"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@@ -73,42 +73,42 @@ packages:
name: matcher name: matcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.12.10-nullsafety.1" version: "0.12.10"
meta: meta:
dependency: "direct main" dependency: "direct main"
description: description:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0"
nested: nested:
dependency: transitive dependency: transitive
description: description:
name: nested name: nested
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.0.4" version: "0.0.5-nullsafety.1"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0-nullsafety.1" version: "1.8.0"
pedantic: pedantic:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: pedantic name: pedantic
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.9.2" version: "1.10.0"
provider: provider:
dependency: "direct main" dependency: "direct main"
description: description:
name: provider name: provider
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.3.2+3" version: "5.0.0-nullsafety.3"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@@ -120,56 +120,56 @@ packages:
name: source_span name: source_span
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0-nullsafety.2" version: "1.8.0"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.1" version: "1.10.0"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.19-nullsafety.2" version: "0.2.19"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
name: typed_data name: typed_data
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.3" version: "2.1.0"
sdks: sdks:
dart: ">=2.10.0 <2.11.0" dart: ">=2.12.0-0.0 <3.0.0"
flutter: ">=1.16.0" flutter: ">=1.16.0"

View File

@@ -5,21 +5,21 @@ description: >
version: 1.0.0+1 version: 1.0.0+1
environment: environment:
sdk: ">=2.10.0 <3.0.0" sdk: '>=2.12.0-0 <3.0.0'
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
cupertino_icons: ^1.0.0 cupertino_icons: ^1.0.2
meta: ^1.1.8 meta: ^1.3.0
provider: ^4.0.0 provider: ^5.0.0-nullsafety.3
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
pedantic: ^1.9.0 pedantic: ^1.10.0
flutter: flutter:
uses-material-design: true uses-material-design: true

View File

@@ -1,3 +1,4 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig" #include "Generated.xcconfig"

View File

@@ -1,2 +1,3 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig" #include "Generated.xcconfig"

View File

@@ -7,42 +7,42 @@ packages:
name: async name: async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.5.0-nullsafety.1" version: "2.5.0-nullsafety.3"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
name: boolean_selector name: boolean_selector
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0-nullsafety.3"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.3" version: "1.1.0-nullsafety.5"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
name: charcode name: charcode
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0-nullsafety.3"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0-nullsafety.3"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.15.0-nullsafety.3" version: "1.15.0-nullsafety.5"
cupertino_icons: cupertino_icons:
dependency: "direct main" dependency: "direct main"
description: description:
@@ -70,7 +70,7 @@ packages:
name: fake_async name: fake_async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0-nullsafety.3"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@@ -87,21 +87,21 @@ packages:
name: matcher name: matcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.12.10-nullsafety.1" version: "0.12.10-nullsafety.3"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0-nullsafety.6"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0-nullsafety.1" version: "1.8.0-nullsafety.3"
plugin_platform_interface: plugin_platform_interface:
dependency: transitive dependency: transitive
description: description:
@@ -120,56 +120,56 @@ packages:
name: source_span name: source_span
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0-nullsafety.2" version: "1.8.0-nullsafety.4"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.1" version: "1.10.0-nullsafety.6"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0-nullsafety.3"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0-nullsafety.3"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0-nullsafety.3"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.19-nullsafety.2" version: "0.2.19-nullsafety.6"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
name: typed_data name: typed_data
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0-nullsafety.5"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.3" version: "2.1.0-nullsafety.5"
sdks: sdks:
dart: ">=2.10.0-110 <2.11.0" dart: ">=2.12.0-0.0 <3.0.0"
flutter: ">=1.12.13+hotfix.5 <2.0.0" flutter: ">=1.12.13+hotfix.5"

View File

@@ -9,11 +9,7 @@
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 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, ); }; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
@@ -26,8 +22,6 @@
dstPath = ""; dstPath = "";
dstSubfolderSpec = 10; dstSubfolderSpec = 10;
files = ( files = (
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
); );
name = "Embed Frameworks"; name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
@@ -38,13 +32,11 @@
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; }; 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>"; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; }; 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>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
@@ -57,8 +49,6 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@@ -68,9 +58,7 @@
9740EEB11CF90186004384FC /* Flutter */ = { 9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
3B80C3931E831B6300D905FE /* App.framework */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEBA1CF902C7004384FC /* Flutter.framework */,
9740EEB21CF90195004384FC /* Debug.xcconfig */, 9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9740EEB31CF90195004384FC /* Generated.xcconfig */, 9740EEB31CF90195004384FC /* Generated.xcconfig */,
@@ -201,7 +189,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
}; };
9740EEB61CF901F6004384FC /* Run Script */ = { 9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
@@ -253,7 +241,6 @@
/* Begin XCBuildConfiguration section */ /* Begin XCBuildConfiguration section */
249021D3217E4FDB00AE95B9 /* Profile */ = { 249021D3217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
@@ -330,7 +317,6 @@
}; };
97C147031CF9000F007C117D /* Debug */ = { 97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
@@ -386,7 +372,6 @@
}; };
97C147041CF9000F007C117D /* Release */ = { 97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;

View File

@@ -2,6 +2,6 @@
<Workspace <Workspace
version = "1.0"> version = "1.0">
<FileRef <FileRef
location = "group:Runner.xcodeproj"> location = "self:">
</FileRef> </FileRef>
</Workspace> </Workspace>

View File

@@ -87,17 +87,15 @@ class DataTransferPage extends StatelessWidget {
} }
class DataTransferIsolateController extends ChangeNotifier { class DataTransferIsolateController extends ChangeNotifier {
Isolate _isolate; Isolate? _isolate;
ReceivePort _incomingReceivePort; late ReceivePort _incomingReceivePort;
SendPort _outgoingSendPort; late SendPort _outgoingSendPort;
final currentProgress = <String>[]; final currentProgress = <String>[];
int runningTest = 0; int runningTest = 0;
Stopwatch _timer = Stopwatch(); Stopwatch _timer = Stopwatch();
double progressPercent = 0; double progressPercent = 0;
Isolate get newIsolate => _isolate;
bool get running => runningTest != 0; bool get running => runningTest != 0;
DataTransferIsolateController() { DataTransferIsolateController() {
@@ -262,7 +260,7 @@ Iterable<int> createNums() sync* {
} }
} }
Future<void> generateAndSum( Future<int> generateAndSum(
SendPort callerSP, SendPort callerSP,
Iterable<int> iter, Iterable<int> iter,
int length, int length,

View File

@@ -86,7 +86,7 @@ class InfiniteProcessPage extends StatelessWidget {
Radio<int>( Radio<int>(
value: i, value: i,
groupValue: controller.currentMultiplier, groupValue: controller.currentMultiplier,
onChanged: (val) => controller.setMultiplier(val), onChanged: (val) => controller.setMultiplier(val!),
), ),
Text('${i}x') Text('${i}x')
], ],
@@ -101,10 +101,10 @@ class InfiniteProcessPage extends StatelessWidget {
} }
class InfiniteProcessIsolateController extends ChangeNotifier { class InfiniteProcessIsolateController extends ChangeNotifier {
Isolate newIsolate; Isolate? newIsolate;
ReceivePort receivePort; late ReceivePort receivePort;
SendPort newIceSP; late SendPort newIceSP;
Capability capability; Capability? capability;
int _currentMultiplier = 1; int _currentMultiplier = 1;
final List<int> _currentResults = []; final List<int> _currentResults = [];
@@ -146,17 +146,17 @@ class InfiniteProcessIsolateController extends ChangeNotifier {
} }
void terminate() { void terminate() {
newIsolate.kill(); newIsolate?.kill();
_created = false; _created = false;
_currentResults.clear(); _currentResults.clear();
notifyListeners(); notifyListeners();
} }
void pausedSwitch() { void pausedSwitch() {
if (_paused) { if (_paused && capability != null) {
newIsolate.resume(capability); newIsolate?.resume(capability!);
} else { } else {
capability = newIsolate.pause(); capability = newIsolate?.pause();
} }
_paused = !_paused; _paused = !_paused;

View File

@@ -88,7 +88,7 @@ class _PerformancePageState extends State<PerformancePage> {
var snackBar = SnackBar( var snackBar = SnackBar(
content: Text('Main Isolate Done!'), content: Text('Main Isolate Done!'),
); );
Scaffold.of(context).showSnackBar(snackBar); ScaffoldMessenger.of(context).showSnackBar(snackBar);
}); });
setState(() { setState(() {
@@ -102,7 +102,7 @@ class _PerformancePageState extends State<PerformancePage> {
var snackBar = SnackBar( var snackBar = SnackBar(
content: Text('Secondary Isolate Done!'), content: Text('Secondary Isolate Done!'),
); );
Scaffold.of(context).showSnackBar(snackBar); ScaffoldMessenger.of(context).showSnackBar(snackBar);
}); });
setState(() { setState(() {
@@ -131,8 +131,8 @@ class SmoothAnimationWidget extends StatefulWidget {
class SmoothAnimationWidgetState extends State<SmoothAnimationWidget> class SmoothAnimationWidgetState extends State<SmoothAnimationWidget>
with TickerProviderStateMixin { with TickerProviderStateMixin {
AnimationController _animationController; late final AnimationController _animationController;
Animation<BorderRadius> _borderAnimation; late final Animation<BorderRadius> _borderAnimation;
@override @override
void initState() { void initState() {

View File

@@ -7,49 +7,49 @@ packages:
name: async name: async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.5.0-nullsafety.1" version: "2.5.0"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
name: boolean_selector name: boolean_selector
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.3" version: "1.1.0"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
name: charcode name: charcode
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.15.0-nullsafety.3" version: "1.15.0"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@@ -66,42 +66,42 @@ packages:
name: matcher name: matcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.12.10-nullsafety.1" version: "0.12.10"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0"
nested: nested:
dependency: transitive dependency: transitive
description: description:
name: nested name: nested
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.0.4" version: "1.0.0"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0-nullsafety.1" version: "1.8.0"
pedantic: pedantic:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: pedantic name: pedantic
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.9.2" version: "1.10.0"
provider: provider:
dependency: "direct main" dependency: "direct main"
description: description:
name: provider name: provider
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.3.2+3" version: "5.0.0-nullsafety.5"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@@ -113,56 +113,56 @@ packages:
name: source_span name: source_span
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0-nullsafety.2" version: "1.8.0"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.1" version: "1.10.0"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.19-nullsafety.2" version: "0.2.19"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
name: typed_data name: typed_data
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.3" version: "2.1.0"
sdks: sdks:
dart: ">=2.10.0-110 <2.11.0" dart: ">=2.12.0-0.0 <3.0.0"
flutter: ">=1.16.0" flutter: ">=1.16.0"

View File

@@ -3,17 +3,17 @@ description: A Flutter sample to demonstrate isolates
version: 1.0.0+1 version: 1.0.0+1
environment: environment:
sdk: ">=2.5.0 <3.0.0" sdk: ">=2.12.0-0 <3.0.0"
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
provider: ^4.0.5 provider: ^5.0.0-0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
pedantic: ^1.9.0 pedantic: ^1.10.0
flutter: flutter:

View File

@@ -15,7 +15,5 @@
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
void main() { void main() {
testWidgets('This test will always pass', (tester) async { testWidgets('This test will always pass', (tester) async {});
return true;
});
} }

View File

@@ -9,11 +9,7 @@
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 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, ); }; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
@@ -26,8 +22,6 @@
dstPath = ""; dstPath = "";
dstSubfolderSpec = 10; dstSubfolderSpec = 10;
files = ( files = (
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
); );
name = "Embed Frameworks"; name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
@@ -38,13 +32,11 @@
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; }; 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>"; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; }; 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>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
@@ -57,8 +49,6 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@@ -68,9 +58,7 @@
9740EEB11CF90186004384FC /* Flutter */ = { 9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
3B80C3931E831B6300D905FE /* App.framework */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEBA1CF902C7004384FC /* Flutter.framework */,
9740EEB21CF90195004384FC /* Debug.xcconfig */, 9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9740EEB31CF90195004384FC /* Generated.xcconfig */, 9740EEB31CF90195004384FC /* Generated.xcconfig */,
@@ -201,7 +189,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
}; };
9740EEB61CF901F6004384FC /* Run Script */ = { 9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
@@ -253,7 +241,6 @@
/* Begin XCBuildConfiguration section */ /* Begin XCBuildConfiguration section */
249021D3217E4FDB00AE95B9 /* Profile */ = { 249021D3217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
@@ -330,7 +317,6 @@
}; };
97C147031CF9000F007C117D /* Debug */ = { 97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
@@ -386,7 +372,6 @@
}; };
97C147041CF9000F007C117D /* Release */ = { 97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;

View File

@@ -2,6 +2,6 @@
<Workspace <Workspace
version = "1.0"> version = "1.0">
<FileRef <FileRef
location = "group:Runner.xcodeproj"> location = "self:">
</FileRef> </FileRef>
</Workspace> </Workspace>

View File

@@ -14,29 +14,21 @@ abstract class BuiltComplexObject
static Serializer<BuiltComplexObject> get serializer => static Serializer<BuiltComplexObject> get serializer =>
_$builtComplexObjectSerializer; _$builtComplexObjectSerializer;
@nullable String? get aString;
String get aString;
@nullable int? get anInt;
int get anInt;
@nullable double? get aDouble;
double get aDouble;
@nullable BuiltSimpleObject? get anObject;
BuiltSimpleObject get anObject;
@nullable BuiltList<String>? get aListOfStrings;
BuiltList<String> get aListOfStrings;
@nullable BuiltList<int>? get aListOfInts;
BuiltList<int> get aListOfInts;
@nullable BuiltList<double>? get aListOfDoubles;
BuiltList<double> get aListOfDoubles;
@nullable BuiltList<BuiltSimpleObject>? get aListOfObjects;
BuiltList<BuiltSimpleObject> get aListOfObjects;
BuiltComplexObject._(); BuiltComplexObject._();

View File

@@ -20,55 +20,63 @@ class _$BuiltComplexObjectSerializer
Iterable<Object> serialize(Serializers serializers, BuiltComplexObject object, Iterable<Object> serialize(Serializers serializers, BuiltComplexObject object,
{FullType specifiedType = FullType.unspecified}) { {FullType specifiedType = FullType.unspecified}) {
final result = <Object>[]; final result = <Object>[];
if (object.aString != null) { Object? value;
value = object.aString;
if (value != null) {
result result
..add('aString') ..add('aString')
..add(serializers.serialize(object.aString, ..add(serializers.serialize(value,
specifiedType: const FullType(String))); specifiedType: const FullType(String)));
} }
if (object.anInt != null) { value = object.anInt;
if (value != null) {
result result
..add('anInt') ..add('anInt')
..add(serializers.serialize(object.anInt, ..add(serializers.serialize(value, specifiedType: const FullType(int)));
specifiedType: const FullType(int)));
} }
if (object.aDouble != null) { value = object.aDouble;
if (value != null) {
result result
..add('aDouble') ..add('aDouble')
..add(serializers.serialize(object.aDouble, ..add(serializers.serialize(value,
specifiedType: const FullType(double))); specifiedType: const FullType(double)));
} }
if (object.anObject != null) { value = object.anObject;
if (value != null) {
result result
..add('anObject') ..add('anObject')
..add(serializers.serialize(object.anObject, ..add(serializers.serialize(value,
specifiedType: const FullType(BuiltSimpleObject))); specifiedType: const FullType(BuiltSimpleObject)));
} }
if (object.aListOfStrings != null) { value = object.aListOfStrings;
if (value != null) {
result result
..add('aListOfStrings') ..add('aListOfStrings')
..add(serializers.serialize(object.aListOfStrings, ..add(serializers.serialize(value,
specifiedType: specifiedType:
const FullType(BuiltList, const [const FullType(String)]))); const FullType(BuiltList, const [const FullType(String)])));
} }
if (object.aListOfInts != null) { value = object.aListOfInts;
if (value != null) {
result result
..add('aListOfInts') ..add('aListOfInts')
..add(serializers.serialize(object.aListOfInts, ..add(serializers.serialize(value,
specifiedType: specifiedType:
const FullType(BuiltList, const [const FullType(int)]))); const FullType(BuiltList, const [const FullType(int)])));
} }
if (object.aListOfDoubles != null) { value = object.aListOfDoubles;
if (value != null) {
result result
..add('aListOfDoubles') ..add('aListOfDoubles')
..add(serializers.serialize(object.aListOfDoubles, ..add(serializers.serialize(value,
specifiedType: specifiedType:
const FullType(BuiltList, const [const FullType(double)]))); const FullType(BuiltList, const [const FullType(double)])));
} }
if (object.aListOfObjects != null) { value = object.aListOfObjects;
if (value != null) {
result result
..add('aListOfObjects') ..add('aListOfObjects')
..add(serializers.serialize(object.aListOfObjects, ..add(serializers.serialize(value,
specifiedType: const FullType( specifiedType: const FullType(
BuiltList, const [const FullType(BuiltSimpleObject)]))); BuiltList, const [const FullType(BuiltSimpleObject)])));
} }
@@ -85,7 +93,7 @@ class _$BuiltComplexObjectSerializer
while (iterator.moveNext()) { while (iterator.moveNext()) {
final key = iterator.current as String; final key = iterator.current as String;
iterator.moveNext(); iterator.moveNext();
final dynamic value = iterator.current; final Object value = iterator.current;
switch (key) { switch (key) {
case 'aString': case 'aString':
result.aString = serializers.deserialize(value, result.aString = serializers.deserialize(value,
@@ -137,24 +145,24 @@ class _$BuiltComplexObjectSerializer
class _$BuiltComplexObject extends BuiltComplexObject { class _$BuiltComplexObject extends BuiltComplexObject {
@override @override
final String aString; final String? aString;
@override @override
final int anInt; final int? anInt;
@override @override
final double aDouble; final double? aDouble;
@override @override
final BuiltSimpleObject anObject; final BuiltSimpleObject? anObject;
@override @override
final BuiltList<String> aListOfStrings; final BuiltList<String>? aListOfStrings;
@override @override
final BuiltList<int> aListOfInts; final BuiltList<int>? aListOfInts;
@override @override
final BuiltList<double> aListOfDoubles; final BuiltList<double>? aListOfDoubles;
@override @override
final BuiltList<BuiltSimpleObject> aListOfObjects; final BuiltList<BuiltSimpleObject>? aListOfObjects;
factory _$BuiltComplexObject( factory _$BuiltComplexObject(
[void Function(BuiltComplexObjectBuilder) updates]) => [void Function(BuiltComplexObjectBuilder)? updates]) =>
(new BuiltComplexObjectBuilder()..update(updates)).build(); (new BuiltComplexObjectBuilder()..update(updates)).build();
_$BuiltComplexObject._( _$BuiltComplexObject._(
@@ -224,62 +232,63 @@ class _$BuiltComplexObject extends BuiltComplexObject {
class BuiltComplexObjectBuilder class BuiltComplexObjectBuilder
implements Builder<BuiltComplexObject, BuiltComplexObjectBuilder> { implements Builder<BuiltComplexObject, BuiltComplexObjectBuilder> {
_$BuiltComplexObject _$v; _$BuiltComplexObject? _$v;
String _aString; String? _aString;
String get aString => _$this._aString; String? get aString => _$this._aString;
set aString(String aString) => _$this._aString = aString; set aString(String? aString) => _$this._aString = aString;
int _anInt; int? _anInt;
int get anInt => _$this._anInt; int? get anInt => _$this._anInt;
set anInt(int anInt) => _$this._anInt = anInt; set anInt(int? anInt) => _$this._anInt = anInt;
double _aDouble; double? _aDouble;
double get aDouble => _$this._aDouble; double? get aDouble => _$this._aDouble;
set aDouble(double aDouble) => _$this._aDouble = aDouble; set aDouble(double? aDouble) => _$this._aDouble = aDouble;
BuiltSimpleObjectBuilder _anObject; BuiltSimpleObjectBuilder? _anObject;
BuiltSimpleObjectBuilder get anObject => BuiltSimpleObjectBuilder get anObject =>
_$this._anObject ??= new BuiltSimpleObjectBuilder(); _$this._anObject ??= new BuiltSimpleObjectBuilder();
set anObject(BuiltSimpleObjectBuilder anObject) => set anObject(BuiltSimpleObjectBuilder? anObject) =>
_$this._anObject = anObject; _$this._anObject = anObject;
ListBuilder<String> _aListOfStrings; ListBuilder<String>? _aListOfStrings;
ListBuilder<String> get aListOfStrings => ListBuilder<String> get aListOfStrings =>
_$this._aListOfStrings ??= new ListBuilder<String>(); _$this._aListOfStrings ??= new ListBuilder<String>();
set aListOfStrings(ListBuilder<String> aListOfStrings) => set aListOfStrings(ListBuilder<String>? aListOfStrings) =>
_$this._aListOfStrings = aListOfStrings; _$this._aListOfStrings = aListOfStrings;
ListBuilder<int> _aListOfInts; ListBuilder<int>? _aListOfInts;
ListBuilder<int> get aListOfInts => ListBuilder<int> get aListOfInts =>
_$this._aListOfInts ??= new ListBuilder<int>(); _$this._aListOfInts ??= new ListBuilder<int>();
set aListOfInts(ListBuilder<int> aListOfInts) => set aListOfInts(ListBuilder<int>? aListOfInts) =>
_$this._aListOfInts = aListOfInts; _$this._aListOfInts = aListOfInts;
ListBuilder<double> _aListOfDoubles; ListBuilder<double>? _aListOfDoubles;
ListBuilder<double> get aListOfDoubles => ListBuilder<double> get aListOfDoubles =>
_$this._aListOfDoubles ??= new ListBuilder<double>(); _$this._aListOfDoubles ??= new ListBuilder<double>();
set aListOfDoubles(ListBuilder<double> aListOfDoubles) => set aListOfDoubles(ListBuilder<double>? aListOfDoubles) =>
_$this._aListOfDoubles = aListOfDoubles; _$this._aListOfDoubles = aListOfDoubles;
ListBuilder<BuiltSimpleObject> _aListOfObjects; ListBuilder<BuiltSimpleObject>? _aListOfObjects;
ListBuilder<BuiltSimpleObject> get aListOfObjects => ListBuilder<BuiltSimpleObject> get aListOfObjects =>
_$this._aListOfObjects ??= new ListBuilder<BuiltSimpleObject>(); _$this._aListOfObjects ??= new ListBuilder<BuiltSimpleObject>();
set aListOfObjects(ListBuilder<BuiltSimpleObject> aListOfObjects) => set aListOfObjects(ListBuilder<BuiltSimpleObject>? aListOfObjects) =>
_$this._aListOfObjects = aListOfObjects; _$this._aListOfObjects = aListOfObjects;
BuiltComplexObjectBuilder(); BuiltComplexObjectBuilder();
BuiltComplexObjectBuilder get _$this { BuiltComplexObjectBuilder get _$this {
if (_$v != null) { final $v = _$v;
_aString = _$v.aString; if ($v != null) {
_anInt = _$v.anInt; _aString = $v.aString;
_aDouble = _$v.aDouble; _anInt = $v.anInt;
_anObject = _$v.anObject?.toBuilder(); _aDouble = $v.aDouble;
_aListOfStrings = _$v.aListOfStrings?.toBuilder(); _anObject = $v.anObject?.toBuilder();
_aListOfInts = _$v.aListOfInts?.toBuilder(); _aListOfStrings = $v.aListOfStrings?.toBuilder();
_aListOfDoubles = _$v.aListOfDoubles?.toBuilder(); _aListOfInts = $v.aListOfInts?.toBuilder();
_aListOfObjects = _$v.aListOfObjects?.toBuilder(); _aListOfDoubles = $v.aListOfDoubles?.toBuilder();
_aListOfObjects = $v.aListOfObjects?.toBuilder();
_$v = null; _$v = null;
} }
return this; return this;
@@ -287,14 +296,12 @@ class BuiltComplexObjectBuilder
@override @override
void replace(BuiltComplexObject other) { void replace(BuiltComplexObject other) {
if (other == null) { ArgumentError.checkNotNull(other, 'other');
throw new ArgumentError.notNull('other');
}
_$v = other as _$BuiltComplexObject; _$v = other as _$BuiltComplexObject;
} }
@override @override
void update(void Function(BuiltComplexObjectBuilder) updates) { void update(void Function(BuiltComplexObjectBuilder)? updates) {
if (updates != null) updates(this); if (updates != null) updates(this);
} }
@@ -313,7 +320,7 @@ class BuiltComplexObjectBuilder
aListOfDoubles: _aListOfDoubles?.build(), aListOfDoubles: _aListOfDoubles?.build(),
aListOfObjects: _aListOfObjects?.build()); aListOfObjects: _aListOfObjects?.build());
} catch (_) { } catch (_) {
String _$failedField; late String _$failedField;
try { try {
_$failedField = 'anObject'; _$failedField = 'anObject';
_anObject?.build(); _anObject?.build();

View File

@@ -13,23 +13,17 @@ abstract class BuiltSimpleObject
static Serializer<BuiltSimpleObject> get serializer => static Serializer<BuiltSimpleObject> get serializer =>
_$builtSimpleObjectSerializer; _$builtSimpleObjectSerializer;
@nullable String? get aString;
String get aString;
@nullable int? get anInt;
int get anInt;
@nullable double? get aDouble;
double get aDouble;
@nullable BuiltList<String>? get aListOfStrings;
BuiltList<String> get aListOfStrings;
@nullable BuiltList<int>? get aListOfInts;
BuiltList<int> get aListOfInts;
@nullable BuiltList<double>? get aListOfDoubles;
BuiltList<double> get aListOfDoubles;
BuiltSimpleObject._(); BuiltSimpleObject._();

View File

@@ -20,42 +20,48 @@ class _$BuiltSimpleObjectSerializer
Iterable<Object> serialize(Serializers serializers, BuiltSimpleObject object, Iterable<Object> serialize(Serializers serializers, BuiltSimpleObject object,
{FullType specifiedType = FullType.unspecified}) { {FullType specifiedType = FullType.unspecified}) {
final result = <Object>[]; final result = <Object>[];
if (object.aString != null) { Object? value;
value = object.aString;
if (value != null) {
result result
..add('aString') ..add('aString')
..add(serializers.serialize(object.aString, ..add(serializers.serialize(value,
specifiedType: const FullType(String))); specifiedType: const FullType(String)));
} }
if (object.anInt != null) { value = object.anInt;
if (value != null) {
result result
..add('anInt') ..add('anInt')
..add(serializers.serialize(object.anInt, ..add(serializers.serialize(value, specifiedType: const FullType(int)));
specifiedType: const FullType(int)));
} }
if (object.aDouble != null) { value = object.aDouble;
if (value != null) {
result result
..add('aDouble') ..add('aDouble')
..add(serializers.serialize(object.aDouble, ..add(serializers.serialize(value,
specifiedType: const FullType(double))); specifiedType: const FullType(double)));
} }
if (object.aListOfStrings != null) { value = object.aListOfStrings;
if (value != null) {
result result
..add('aListOfStrings') ..add('aListOfStrings')
..add(serializers.serialize(object.aListOfStrings, ..add(serializers.serialize(value,
specifiedType: specifiedType:
const FullType(BuiltList, const [const FullType(String)]))); const FullType(BuiltList, const [const FullType(String)])));
} }
if (object.aListOfInts != null) { value = object.aListOfInts;
if (value != null) {
result result
..add('aListOfInts') ..add('aListOfInts')
..add(serializers.serialize(object.aListOfInts, ..add(serializers.serialize(value,
specifiedType: specifiedType:
const FullType(BuiltList, const [const FullType(int)]))); const FullType(BuiltList, const [const FullType(int)])));
} }
if (object.aListOfDoubles != null) { value = object.aListOfDoubles;
if (value != null) {
result result
..add('aListOfDoubles') ..add('aListOfDoubles')
..add(serializers.serialize(object.aListOfDoubles, ..add(serializers.serialize(value,
specifiedType: specifiedType:
const FullType(BuiltList, const [const FullType(double)]))); const FullType(BuiltList, const [const FullType(double)])));
} }
@@ -72,7 +78,7 @@ class _$BuiltSimpleObjectSerializer
while (iterator.moveNext()) { while (iterator.moveNext()) {
final key = iterator.current as String; final key = iterator.current as String;
iterator.moveNext(); iterator.moveNext();
final dynamic value = iterator.current; final Object value = iterator.current;
switch (key) { switch (key) {
case 'aString': case 'aString':
result.aString = serializers.deserialize(value, result.aString = serializers.deserialize(value,
@@ -113,20 +119,20 @@ class _$BuiltSimpleObjectSerializer
class _$BuiltSimpleObject extends BuiltSimpleObject { class _$BuiltSimpleObject extends BuiltSimpleObject {
@override @override
final String aString; final String? aString;
@override @override
final int anInt; final int? anInt;
@override @override
final double aDouble; final double? aDouble;
@override @override
final BuiltList<String> aListOfStrings; final BuiltList<String>? aListOfStrings;
@override @override
final BuiltList<int> aListOfInts; final BuiltList<int>? aListOfInts;
@override @override
final BuiltList<double> aListOfDoubles; final BuiltList<double>? aListOfDoubles;
factory _$BuiltSimpleObject( factory _$BuiltSimpleObject(
[void Function(BuiltSimpleObjectBuilder) updates]) => [void Function(BuiltSimpleObjectBuilder)? updates]) =>
(new BuiltSimpleObjectBuilder()..update(updates)).build(); (new BuiltSimpleObjectBuilder()..update(updates)).build();
_$BuiltSimpleObject._( _$BuiltSimpleObject._(
@@ -185,48 +191,49 @@ class _$BuiltSimpleObject extends BuiltSimpleObject {
class BuiltSimpleObjectBuilder class BuiltSimpleObjectBuilder
implements Builder<BuiltSimpleObject, BuiltSimpleObjectBuilder> { implements Builder<BuiltSimpleObject, BuiltSimpleObjectBuilder> {
_$BuiltSimpleObject _$v; _$BuiltSimpleObject? _$v;
String _aString; String? _aString;
String get aString => _$this._aString; String? get aString => _$this._aString;
set aString(String aString) => _$this._aString = aString; set aString(String? aString) => _$this._aString = aString;
int _anInt; int? _anInt;
int get anInt => _$this._anInt; int? get anInt => _$this._anInt;
set anInt(int anInt) => _$this._anInt = anInt; set anInt(int? anInt) => _$this._anInt = anInt;
double _aDouble; double? _aDouble;
double get aDouble => _$this._aDouble; double? get aDouble => _$this._aDouble;
set aDouble(double aDouble) => _$this._aDouble = aDouble; set aDouble(double? aDouble) => _$this._aDouble = aDouble;
ListBuilder<String> _aListOfStrings; ListBuilder<String>? _aListOfStrings;
ListBuilder<String> get aListOfStrings => ListBuilder<String> get aListOfStrings =>
_$this._aListOfStrings ??= new ListBuilder<String>(); _$this._aListOfStrings ??= new ListBuilder<String>();
set aListOfStrings(ListBuilder<String> aListOfStrings) => set aListOfStrings(ListBuilder<String>? aListOfStrings) =>
_$this._aListOfStrings = aListOfStrings; _$this._aListOfStrings = aListOfStrings;
ListBuilder<int> _aListOfInts; ListBuilder<int>? _aListOfInts;
ListBuilder<int> get aListOfInts => ListBuilder<int> get aListOfInts =>
_$this._aListOfInts ??= new ListBuilder<int>(); _$this._aListOfInts ??= new ListBuilder<int>();
set aListOfInts(ListBuilder<int> aListOfInts) => set aListOfInts(ListBuilder<int>? aListOfInts) =>
_$this._aListOfInts = aListOfInts; _$this._aListOfInts = aListOfInts;
ListBuilder<double> _aListOfDoubles; ListBuilder<double>? _aListOfDoubles;
ListBuilder<double> get aListOfDoubles => ListBuilder<double> get aListOfDoubles =>
_$this._aListOfDoubles ??= new ListBuilder<double>(); _$this._aListOfDoubles ??= new ListBuilder<double>();
set aListOfDoubles(ListBuilder<double> aListOfDoubles) => set aListOfDoubles(ListBuilder<double>? aListOfDoubles) =>
_$this._aListOfDoubles = aListOfDoubles; _$this._aListOfDoubles = aListOfDoubles;
BuiltSimpleObjectBuilder(); BuiltSimpleObjectBuilder();
BuiltSimpleObjectBuilder get _$this { BuiltSimpleObjectBuilder get _$this {
if (_$v != null) { final $v = _$v;
_aString = _$v.aString; if ($v != null) {
_anInt = _$v.anInt; _aString = $v.aString;
_aDouble = _$v.aDouble; _anInt = $v.anInt;
_aListOfStrings = _$v.aListOfStrings?.toBuilder(); _aDouble = $v.aDouble;
_aListOfInts = _$v.aListOfInts?.toBuilder(); _aListOfStrings = $v.aListOfStrings?.toBuilder();
_aListOfDoubles = _$v.aListOfDoubles?.toBuilder(); _aListOfInts = $v.aListOfInts?.toBuilder();
_aListOfDoubles = $v.aListOfDoubles?.toBuilder();
_$v = null; _$v = null;
} }
return this; return this;
@@ -234,14 +241,12 @@ class BuiltSimpleObjectBuilder
@override @override
void replace(BuiltSimpleObject other) { void replace(BuiltSimpleObject other) {
if (other == null) { ArgumentError.checkNotNull(other, 'other');
throw new ArgumentError.notNull('other');
}
_$v = other as _$BuiltSimpleObject; _$v = other as _$BuiltSimpleObject;
} }
@override @override
void update(void Function(BuiltSimpleObjectBuilder) updates) { void update(void Function(BuiltSimpleObjectBuilder)? updates) {
if (updates != null) updates(this); if (updates != null) updates(this);
} }
@@ -258,7 +263,7 @@ class BuiltSimpleObjectBuilder
aListOfInts: _aListOfInts?.build(), aListOfInts: _aListOfInts?.build(),
aListOfDoubles: _aListOfDoubles?.build()); aListOfDoubles: _aListOfDoubles?.build());
} catch (_) { } catch (_) {
String _$failedField; late String _$failedField;
try { try {
_$failedField = 'aListOfStrings'; _$failedField = 'aListOfStrings';
_aListOfStrings?.build(); _aListOfStrings?.build();

View File

@@ -16,22 +16,20 @@ class ConvertedComplexObject {
this.aListOfObjects, this.aListOfObjects,
}); });
final String aString; final String? aString;
final int anInt; final int? anInt;
final double aDouble; final double? aDouble;
final ConvertedSimpleObject anObject; final ConvertedSimpleObject? anObject;
final List<String> aListOfStrings; final List<String>? aListOfStrings;
final List<int> aListOfInts; final List<int>? aListOfInts;
final List<double> aListOfDoubles; final List<double>? aListOfDoubles;
final List<ConvertedSimpleObject> aListOfObjects; final List<ConvertedSimpleObject>? aListOfObjects;
factory ConvertedComplexObject.fromJson(Map<String, dynamic> json) { factory ConvertedComplexObject.fromJson(Map<String, dynamic> json) {
if (json == null) return null;
return ConvertedComplexObject( return ConvertedComplexObject(
aString: json['aString'] as String, aString: json['aString'] as String?,
anInt: json['anInt'] as int, anInt: json['anInt'] as int?,
aDouble: json['aDouble'] as double, aDouble: json['aDouble'] as double?,
anObject: json['anObject'] != null anObject: json['anObject'] != null
? ConvertedSimpleObject.fromJson( ? ConvertedSimpleObject.fromJson(
json['anObject'] as Map<String, dynamic>) json['anObject'] as Map<String, dynamic>)

View File

@@ -12,20 +12,18 @@ class ConvertedSimpleObject {
this.aListOfDoubles, this.aListOfDoubles,
}); });
final String aString; final String? aString;
final int anInt; final int? anInt;
final double aDouble; final double? aDouble;
final List<String> aListOfStrings; final List<String>? aListOfStrings;
final List<int> aListOfInts; final List<int>? aListOfInts;
final List<double> aListOfDoubles; final List<double>? aListOfDoubles;
factory ConvertedSimpleObject.fromJson(Map<String, dynamic> json) { factory ConvertedSimpleObject.fromJson(Map<String, dynamic> json) {
if (json == null) return null;
return ConvertedSimpleObject( return ConvertedSimpleObject(
aString: json['aString'] as String, aString: json['aString'] as String?,
anInt: json['anInt'] as int, anInt: json['anInt'] as int?,
aDouble: json['aDouble'] as double, aDouble: json['aDouble'] as double?,
aListOfStrings: json['aListOfStrings'] != null aListOfStrings: json['aListOfStrings'] != null
? List<String>.from(json['aListOfStrings'] as Iterable<dynamic>) ? List<String>.from(json['aListOfStrings'] as Iterable<dynamic>)
: null, : null,

View File

@@ -20,14 +20,14 @@ class SerializableComplexObject {
this.aListOfObjects, this.aListOfObjects,
}); });
final String aString; final String? aString;
final int anInt; final int? anInt;
final double aDouble; final double? aDouble;
final SerializableSimpleObject anObject; final SerializableSimpleObject? anObject;
final List<String> aListOfStrings; final List<String>? aListOfStrings;
final List<int> aListOfInts; final List<int>? aListOfInts;
final List<double> aListOfDoubles; final List<double>? aListOfDoubles;
final List<SerializableSimpleObject> aListOfObjects; final List<SerializableSimpleObject>? aListOfObjects;
factory SerializableComplexObject.fromJson(Map<String, dynamic> json) => factory SerializableComplexObject.fromJson(Map<String, dynamic> json) =>
_$SerializableComplexObjectFromJson(json); _$SerializableComplexObjectFromJson(json);

View File

@@ -9,24 +9,25 @@ part of 'serializable_complex_object.dart';
SerializableComplexObject _$SerializableComplexObjectFromJson( SerializableComplexObject _$SerializableComplexObjectFromJson(
Map<String, dynamic> json) { Map<String, dynamic> json) {
return 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
: SerializableSimpleObject.fromJson( : SerializableSimpleObject.fromJson(
json['anObject'] as Map<String, dynamic>), json['anObject'] as Map<String, dynamic>),
aListOfStrings: aListOfStrings: (json['aListOfStrings'] as List<dynamic>?)
(json['aListOfStrings'] as List)?.map((e) => e as String)?.toList(), ?.map((e) => e as String)
aListOfInts: (json['aListOfInts'] as List)?.map((e) => e as int)?.toList(), .toList(),
aListOfDoubles: (json['aListOfDoubles'] as List) aListOfInts:
?.map((e) => (e as num)?.toDouble()) (json['aListOfInts'] as List<dynamic>?)?.map((e) => e as int).toList(),
?.toList(), aListOfDoubles: (json['aListOfDoubles'] as List<dynamic>?)
aListOfObjects: (json['aListOfObjects'] as List) ?.map((e) => (e as num).toDouble())
?.map((e) => e == null .toList(),
? null aListOfObjects: (json['aListOfObjects'] as List<dynamic>?)
: SerializableSimpleObject.fromJson(e as Map<String, dynamic>)) ?.map(
?.toList(), (e) => SerializableSimpleObject.fromJson(e as Map<String, dynamic>))
.toList(),
); );
} }

View File

@@ -19,12 +19,12 @@ class SerializableSimpleObject {
this.aListOfDoubles, this.aListOfDoubles,
}); });
final String aString; final String? aString;
final int anInt; final int? anInt;
final double aDouble; final double? aDouble;
final List<String> aListOfStrings; final List<String>? aListOfStrings;
final List<int> aListOfInts; final List<int>? aListOfInts;
final List<double> aListOfDoubles; final List<double>? aListOfDoubles;
factory SerializableSimpleObject.fromJson(Map<String, dynamic> json) => factory SerializableSimpleObject.fromJson(Map<String, dynamic> json) =>
_$SerializableSimpleObjectFromJson(json); _$SerializableSimpleObjectFromJson(json);

View File

@@ -9,15 +9,17 @@ part of 'serializable_simple_object.dart';
SerializableSimpleObject _$SerializableSimpleObjectFromJson( SerializableSimpleObject _$SerializableSimpleObjectFromJson(
Map<String, dynamic> json) { Map<String, dynamic> json) {
return 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<dynamic>?)
(json['aListOfStrings'] as List)?.map((e) => e as String)?.toList(), ?.map((e) => e as String)
aListOfInts: (json['aListOfInts'] as List)?.map((e) => e as int)?.toList(), .toList(),
aListOfDoubles: (json['aListOfDoubles'] as List) aListOfInts:
?.map((e) => (e as num)?.toDouble()) (json['aListOfInts'] as List<dynamic>?)?.map((e) => e as int).toList(),
?.toList(), aListOfDoubles: (json['aListOfDoubles'] as List<dynamic>?)
?.map((e) => (e as num).toDouble())
.toList(),
); );
} }

View File

@@ -21,7 +21,7 @@ class MyApp extends StatelessWidget {
} }
class MyHomePage extends StatelessWidget { class MyHomePage extends StatelessWidget {
MyHomePage({Key key}) : super(key: key); MyHomePage({Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

View File

@@ -39,7 +39,7 @@ class BasicsPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final localTheme = Theme.of(context).textTheme; final localTheme = Theme.of(context).textTheme;
final boldStyle = final boldStyle =
localTheme.bodyText2.copyWith(fontWeight: FontWeight.w600); localTheme.bodyText2!.copyWith(fontWeight: FontWeight.w600);
final dynamicListOfInts = json.decode(JsonStrings.listOfInts) as List; final dynamicListOfInts = json.decode(JsonStrings.listOfInts) as List;
final strongListOfInts = List<int>.from(dynamicListOfInts); final strongListOfInts = List<int>.from(dynamicListOfInts);
@@ -134,7 +134,7 @@ class BasicsPage extends StatelessWidget {
}, },
children: createMapRows( children: createMapRows(
strongMapOfDynamics, strongMapOfDynamics,
localTheme.bodyText2, localTheme.bodyText2!,
boldStyle, boldStyle,
), ),
), ),
@@ -275,7 +275,7 @@ class BuiltSimplePage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
var objects = JsonStrings.simpleObjects.map( var objects = JsonStrings.simpleObjects.map(
(jsonString) { (jsonString) {
final dynamic parsedJson = json.decode(jsonString); final parsedJson = json.decode(jsonString) as Object;
return serializers.deserializeWith( return serializers.deserializeWith(
BuiltSimpleObject.serializer, parsedJson); BuiltSimpleObject.serializer, parsedJson);
}, },
@@ -297,7 +297,7 @@ class BuiltComplexPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
var objects = JsonStrings.complexObjects.map( var objects = JsonStrings.complexObjects.map(
(jsonString) { (jsonString) {
final dynamic parsedJson = json.decode(jsonString); final parsedJson = json.decode(jsonString) as Object;
return serializers.deserializeWith( return serializers.deserializeWith(
BuiltComplexObject.serializer, parsedJson); BuiltComplexObject.serializer, parsedJson);
}, },

View File

@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
String prettyPrintList(Iterable iter) { String prettyPrintList(Iterable? iter) {
if (iter == null) return 'NULL'; if (iter == null) return 'NULL';
final buff = StringBuffer(); final buff = StringBuffer();

View File

@@ -14,7 +14,7 @@ class SimpleObjectView extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final localTheme = Theme.of(context).textTheme; final localTheme = Theme.of(context).textTheme;
final boldStyle = final boldStyle =
localTheme.bodyText2.copyWith(fontWeight: FontWeight.w600); localTheme.bodyText2!.copyWith(fontWeight: FontWeight.w600);
if (simpleObject == null) return Text('NULL', style: localTheme.bodyText2); if (simpleObject == null) return Text('NULL', style: localTheme.bodyText2);
@@ -59,7 +59,7 @@ class SimpleObjectView extends StatelessWidget {
Text('aListOfStrings:', style: boldStyle), Text('aListOfStrings:', style: boldStyle),
Text( Text(
prettyPrintList( prettyPrintList(
simpleObject.aListOfStrings as Iterable<dynamic>, simpleObject.aListOfStrings as Iterable<dynamic>?,
), ),
style: localTheme.bodyText2, style: localTheme.bodyText2,
), ),
@@ -69,7 +69,7 @@ class SimpleObjectView extends StatelessWidget {
children: [ children: [
Text('aListOfInts:', style: boldStyle), Text('aListOfInts:', style: boldStyle),
Text( Text(
prettyPrintList(simpleObject.aListOfInts as Iterable<dynamic>), prettyPrintList(simpleObject.aListOfInts as Iterable<dynamic>?),
style: localTheme.bodyText2, style: localTheme.bodyText2,
), ),
], ],
@@ -81,7 +81,8 @@ class SimpleObjectView extends StatelessWidget {
child: Text('aListOfDoubles:', style: boldStyle), child: Text('aListOfDoubles:', style: boldStyle),
), ),
Text( Text(
prettyPrintList(simpleObject.aListOfDoubles as Iterable<dynamic>), prettyPrintList(
simpleObject.aListOfDoubles as Iterable<dynamic>?),
style: localTheme.bodyText2, style: localTheme.bodyText2,
), ),
], ],
@@ -126,7 +127,7 @@ class ComplexObjectView extends StatelessWidget {
ComplexObjectView(dynamic obj) : complexObject = obj; ComplexObjectView(dynamic obj) : complexObject = obj;
List<Widget> _generateSimpleObjectWidgets(Iterable<dynamic> simpleObjects) { List<Widget> _generateSimpleObjectWidgets(Iterable<dynamic>? simpleObjects) {
if (simpleObjects == null) { if (simpleObjects == null) {
return [ return [
const Padding( const Padding(
@@ -158,7 +159,7 @@ class ComplexObjectView extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final localTheme = Theme.of(context).textTheme; final localTheme = Theme.of(context).textTheme;
final boldStyle = final boldStyle =
localTheme.bodyText2.copyWith(fontWeight: FontWeight.w600); localTheme.bodyText2!.copyWith(fontWeight: FontWeight.w600);
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@@ -216,7 +217,7 @@ class ComplexObjectView extends StatelessWidget {
Text('aListOfStrings:', style: boldStyle), Text('aListOfStrings:', style: boldStyle),
Text( Text(
prettyPrintList( prettyPrintList(
complexObject.aListOfStrings as Iterable<dynamic>), complexObject.aListOfStrings as Iterable<dynamic>?),
style: localTheme.bodyText2, style: localTheme.bodyText2,
), ),
], ],
@@ -226,7 +227,7 @@ class ComplexObjectView extends StatelessWidget {
Text('aListOfInts:', style: boldStyle), Text('aListOfInts:', style: boldStyle),
Text( Text(
prettyPrintList( prettyPrintList(
complexObject.aListOfInts as Iterable<dynamic>), complexObject.aListOfInts as Iterable<dynamic>?),
style: localTheme.bodyText2, style: localTheme.bodyText2,
), ),
], ],
@@ -239,7 +240,7 @@ class ComplexObjectView extends StatelessWidget {
), ),
Text( Text(
prettyPrintList( prettyPrintList(
complexObject.aListOfDoubles as Iterable<dynamic>), complexObject.aListOfDoubles as Iterable<dynamic>?),
style: localTheme.bodyText2, style: localTheme.bodyText2,
), ),
], ],
@@ -257,7 +258,7 @@ class ComplexObjectView extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: _generateSimpleObjectWidgets( children: _generateSimpleObjectWidgets(
complexObject.aListOfObjects as Iterable<dynamic>), complexObject.aListOfObjects as Iterable<dynamic>?),
), ),
), ),
], ],

View File

@@ -7,14 +7,14 @@ packages:
name: _fe_analyzer_shared name: _fe_analyzer_shared
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "7.0.0" version: "12.0.0"
analyzer: analyzer:
dependency: transitive dependency: transitive
description: description:
name: analyzer name: analyzer
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.39.17" version: "0.40.6"
args: args:
dependency: transitive dependency: transitive
description: description:
@@ -28,91 +28,91 @@ packages:
name: async name: async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.5.0-nullsafety.1" version: "2.5.0-nullsafety.3"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
name: boolean_selector name: boolean_selector
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0-nullsafety.3"
build: build:
dependency: transitive dependency: transitive
description: description:
name: build name: build
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0" version: "1.6.2"
build_config: build_config:
dependency: transitive dependency: transitive
description: description:
name: build_config name: build_config
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.4.2" version: "0.4.5"
build_daemon: build_daemon:
dependency: transitive dependency: transitive
description: description:
name: build_daemon name: build_daemon
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.4" version: "2.1.7"
build_resolvers: build_resolvers:
dependency: transitive dependency: transitive
description: description:
name: build_resolvers name: build_resolvers
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.11" version: "1.5.3"
build_runner: build_runner:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: build_runner name: build_runner
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.2" version: "1.11.1"
build_runner_core: build_runner_core:
dependency: transitive dependency: transitive
description: description:
name: build_runner_core name: build_runner_core
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.0.1" version: "6.1.7"
built_collection: built_collection:
dependency: "direct main" dependency: "direct main"
description: description:
name: built_collection name: built_collection
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.3.2" version: "5.0.0-nullsafety.0"
built_value: built_value:
dependency: "direct main" dependency: "direct main"
description: description:
name: built_value name: built_value
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "7.1.0" version: "8.0.0-nullsafety.0"
built_value_generator: built_value_generator:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: built_value_generator name: built_value_generator
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "7.1.0" version: "8.0.0-nullsafety.0"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.3" version: "1.1.0-nullsafety.5"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
name: charcode name: charcode
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0-nullsafety.3"
checked_yaml: checked_yaml:
dependency: transitive dependency: transitive
description: description:
@@ -133,21 +133,21 @@ packages:
name: clock name: clock
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0-nullsafety.3"
code_builder: code_builder:
dependency: transitive dependency: transitive
description: description:
name: code_builder name: code_builder
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.5.0" version: "3.6.0"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.15.0-nullsafety.3" version: "1.15.0-nullsafety.5"
convert: convert:
dependency: transitive dependency: transitive
description: description:
@@ -162,27 +162,20 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.5" version: "2.1.5"
csslib:
dependency: transitive
description:
name: csslib
url: "https://pub.dartlang.org"
source: hosted
version: "0.16.2"
dart_style: dart_style:
dependency: transitive dependency: transitive
description: description:
name: dart_style name: dart_style
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.6" version: "1.3.10"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0-nullsafety.3"
file: file:
dependency: transitive dependency: transitive
description: description:
@@ -196,7 +189,7 @@ packages:
name: fixnum name: fixnum
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.10.11" version: "1.0.0"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@@ -221,13 +214,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.0" version: "0.2.0"
html:
dependency: transitive
description:
name: html
url: "https://pub.dartlang.org"
source: hosted
version: "0.14.0+4"
http_multi_server: http_multi_server:
dependency: transitive dependency: transitive
description: description:
@@ -262,49 +248,49 @@ packages:
name: js name: js
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.6.2" version: "0.6.3"
json_annotation: json_annotation:
dependency: "direct main" dependency: "direct main"
description: description:
name: json_annotation name: json_annotation
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.1.1" version: "4.0.0-nullsafety.0"
json_serializable: json_serializable:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: json_serializable name: json_serializable
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.5.1" version: "4.0.0-nullsafety.0"
logging: logging:
dependency: transitive dependency: transitive
description: description:
name: logging name: logging
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.11.4" version: "1.0.0"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.12.10-nullsafety.1" version: "0.12.10-nullsafety.3"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0-nullsafety.6"
mime: mime:
dependency: transitive dependency: transitive
description: description:
name: mime name: mime
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.9.7" version: "1.0.0"
node_interop: node_interop:
dependency: transitive dependency: transitive
description: description:
@@ -332,14 +318,14 @@ packages:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0-nullsafety.1" version: "1.8.0-nullsafety.3"
pedantic: pedantic:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: pedantic name: pedantic
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.9.2" version: "1.10.0"
pool: pool:
dependency: transitive dependency: transitive
description: description:
@@ -381,7 +367,7 @@ packages:
name: shelf_web_socket name: shelf_web_socket
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.3" version: "0.2.4"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@@ -393,28 +379,28 @@ packages:
name: source_gen name: source_gen
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.9.7+1" version: "0.9.10+1"
source_span: source_span:
dependency: transitive dependency: transitive
description: description:
name: source_span name: source_span
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0-nullsafety.2" version: "1.8.0-nullsafety.4"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.1" version: "1.10.0-nullsafety.6"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0-nullsafety.3"
stream_transform: stream_transform:
dependency: transitive dependency: transitive
description: description:
@@ -428,21 +414,21 @@ packages:
name: string_scanner name: string_scanner
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0-nullsafety.3"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0-nullsafety.3"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.19-nullsafety.2" version: "0.2.19-nullsafety.6"
timing: timing:
dependency: transitive dependency: transitive
description: description:
@@ -456,14 +442,14 @@ packages:
name: typed_data name: typed_data
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0-nullsafety.5"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.3" version: "2.1.0-nullsafety.5"
watcher: watcher:
dependency: transitive dependency: transitive
description: description:
@@ -477,7 +463,7 @@ packages:
name: web_socket_channel name: web_socket_channel
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0" version: "1.2.0"
yaml: yaml:
dependency: transitive dependency: transitive
description: description:
@@ -486,4 +472,4 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.10.0-110 <2.11.0" dart: ">=2.12.0-0.0 <3.0.0"

View File

@@ -2,12 +2,12 @@ name: jsonexample
description: A demonstration of JSON parsing description: A demonstration of JSON parsing
environment: environment:
sdk: '>=2.5.0 <3.0.0' sdk: '>=2.12.0-0 <3.0.0'
dependencies: dependencies:
json_annotation: ^3.0.1 json_annotation: ^4.0.0-0
built_collection: ^4.3.2 built_collection: ^5.0.0-0
built_value: ^7.0.4 built_value: ^8.0.0-0
flutter: flutter:
sdk: flutter sdk: flutter
@@ -15,9 +15,9 @@ dependencies:
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
build_runner: ^1.7.2 build_runner: ^1.11.1
built_value_generator: ^7.0.4 built_value_generator: ^8.0.0-0
json_serializable: ^3.2.5 json_serializable: ^4.0.0-0
pedantic: ^1.9.0 pedantic: ^1.9.0
flutter: flutter:

View File

@@ -127,22 +127,23 @@ void main() {
expect(complexObject.aListOfStrings, ['one', 'two', 'three']); expect(complexObject.aListOfStrings, ['one', 'two', 'three']);
expect(complexObject.aListOfInts, [1, 2, 3]); expect(complexObject.aListOfInts, [1, 2, 3]);
expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]); expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]);
expect(complexObject.anObject.aString, 'Blah, blah, blah.'); expect(complexObject.anObject?.aString, 'Blah, blah, blah.');
expect(complexObject.anObject.anInt, 1); expect(complexObject.anObject?.anInt, 1);
expect(complexObject.anObject.aDouble, 1.0); expect(complexObject.anObject?.aDouble, 1.0);
expect(complexObject.anObject.aListOfStrings, ['one', 'two', 'three']); expect(complexObject.anObject?.aListOfStrings, ['one', 'two', 'three']);
expect(complexObject.anObject.aListOfInts, [1, 2, 3]); expect(complexObject.anObject?.aListOfInts, [1, 2, 3]);
expect(complexObject.anObject.aListOfDoubles, [1.0, 2.0, 3.0]); expect(complexObject.anObject?.aListOfDoubles, [1.0, 2.0, 3.0]);
expect(complexObject.aListOfObjects.length, 3); expect(complexObject.aListOfObjects?.length, 3);
for (var i = 0; i < 3; i++) { for (var i = 0; i < 3; i++) {
expect(complexObject.aListOfObjects[i].aString, 'Blah, blah, blah.'); expect(complexObject.aListOfObjects?[i].aString, 'Blah, blah, blah.');
expect(complexObject.aListOfObjects[i].anInt, i + 1); expect(complexObject.aListOfObjects?[i].anInt, i + 1);
expect(complexObject.aListOfObjects[i].aDouble, 1.0); expect(complexObject.aListOfObjects?[i].aDouble, 1.0);
expect(complexObject.aListOfObjects[i].aListOfStrings, expect(complexObject.aListOfObjects?[i].aListOfStrings,
['one', 'two', 'three']); ['one', 'two', 'three']);
expect(complexObject.aListOfObjects[i].aListOfInts, [1, 2, 3]); expect(complexObject.aListOfObjects?[i].aListOfInts, [1, 2, 3]);
expect(complexObject.aListOfObjects[i].aListOfDoubles, [1.0, 2.0, 3.0]); expect(
complexObject.aListOfObjects?[i].aListOfDoubles, [1.0, 2.0, 3.0]);
} }
}); });
@@ -169,21 +170,21 @@ void main() {
expect(complexObject.aListOfStrings, ['one', 'two', 'three']); expect(complexObject.aListOfStrings, ['one', 'two', 'three']);
expect(complexObject.aListOfInts, [1, 2, 3]); expect(complexObject.aListOfInts, [1, 2, 3]);
expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]); expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]);
expect(complexObject.anObject.aString, isNull); expect(complexObject.anObject?.aString, isNull);
expect(complexObject.anObject.anInt, isNull); expect(complexObject.anObject?.anInt, isNull);
expect(complexObject.anObject.aDouble, isNull); expect(complexObject.anObject?.aDouble, isNull);
expect(complexObject.anObject.aListOfStrings, isNull); expect(complexObject.anObject?.aListOfStrings, isNull);
expect(complexObject.anObject.aListOfInts, isNull); expect(complexObject.anObject?.aListOfInts, isNull);
expect(complexObject.anObject.aListOfDoubles, isNull); expect(complexObject.anObject?.aListOfDoubles, isNull);
expect(complexObject.aListOfObjects.length, 3); expect(complexObject.aListOfObjects?.length, 3);
for (var i = 0; i < 3; i++) { for (var i = 0; i < 3; i++) {
expect(complexObject.aListOfObjects[i].aString, isNull); expect(complexObject.aListOfObjects?[i].aString, isNull);
expect(complexObject.aListOfObjects[i].anInt, isNull); expect(complexObject.aListOfObjects?[i].anInt, isNull);
expect(complexObject.aListOfObjects[i].aDouble, isNull); expect(complexObject.aListOfObjects?[i].aDouble, isNull);
expect(complexObject.aListOfObjects[i].aListOfStrings, isNull); expect(complexObject.aListOfObjects?[i].aListOfStrings, isNull);
expect(complexObject.aListOfObjects[i].aListOfInts, isNull); expect(complexObject.aListOfObjects?[i].aListOfInts, isNull);
expect(complexObject.aListOfObjects[i].aListOfDoubles, isNull); expect(complexObject.aListOfObjects?[i].aListOfDoubles, isNull);
} }
}); });
@@ -197,22 +198,23 @@ void main() {
expect(complexObject.aListOfStrings, ['one', 'two', 'three']); expect(complexObject.aListOfStrings, ['one', 'two', 'three']);
expect(complexObject.aListOfInts, [1, 2, 3]); expect(complexObject.aListOfInts, [1, 2, 3]);
expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]); expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]);
expect(complexObject.anObject.aString, 'Blah, blah, blah.'); expect(complexObject.anObject?.aString, 'Blah, blah, blah.');
expect(complexObject.anObject.anInt, 1); expect(complexObject.anObject?.anInt, 1);
expect(complexObject.anObject.aDouble, 1.0); expect(complexObject.anObject?.aDouble, 1.0);
expect(complexObject.anObject.aListOfStrings, ['one', 'two', 'three']); expect(complexObject.anObject?.aListOfStrings, ['one', 'two', 'three']);
expect(complexObject.anObject.aListOfInts, [1, 2, 3]); expect(complexObject.anObject?.aListOfInts, [1, 2, 3]);
expect(complexObject.anObject.aListOfDoubles, [1.0, 2.0, 3.0]); expect(complexObject.anObject?.aListOfDoubles, [1.0, 2.0, 3.0]);
expect(complexObject.aListOfObjects.length, 3); expect(complexObject.aListOfObjects?.length, 3);
for (var i = 0; i < 3; i++) { for (var i = 0; i < 3; i++) {
expect(complexObject.aListOfObjects[i].aString, 'Blah, blah, blah.'); expect(complexObject.aListOfObjects?[i].aString, 'Blah, blah, blah.');
expect(complexObject.aListOfObjects[i].anInt, i + 1); expect(complexObject.aListOfObjects?[i].anInt, i + 1);
expect(complexObject.aListOfObjects[i].aDouble, 1.0); expect(complexObject.aListOfObjects?[i].aDouble, 1.0);
expect(complexObject.aListOfObjects[i].aListOfStrings, expect(complexObject.aListOfObjects?[i].aListOfStrings,
['one', 'two', 'three']); ['one', 'two', 'three']);
expect(complexObject.aListOfObjects[i].aListOfInts, [1, 2, 3]); expect(complexObject.aListOfObjects?[i].aListOfInts, [1, 2, 3]);
expect(complexObject.aListOfObjects[i].aListOfDoubles, [1.0, 2.0, 3.0]); expect(
complexObject.aListOfObjects?[i].aListOfDoubles, [1.0, 2.0, 3.0]);
} }
}); });
}); });
@@ -228,22 +230,23 @@ void main() {
expect(complexObject.aListOfStrings, ['one', 'two', 'three']); expect(complexObject.aListOfStrings, ['one', 'two', 'three']);
expect(complexObject.aListOfInts, [1, 2, 3]); expect(complexObject.aListOfInts, [1, 2, 3]);
expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]); expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]);
expect(complexObject.anObject.aString, 'Blah, blah, blah.'); expect(complexObject.anObject?.aString, 'Blah, blah, blah.');
expect(complexObject.anObject.anInt, 1); expect(complexObject.anObject?.anInt, 1);
expect(complexObject.anObject.aDouble, 1.0); expect(complexObject.anObject?.aDouble, 1.0);
expect(complexObject.anObject.aListOfStrings, ['one', 'two', 'three']); expect(complexObject.anObject?.aListOfStrings, ['one', 'two', 'three']);
expect(complexObject.anObject.aListOfInts, [1, 2, 3]); expect(complexObject.anObject?.aListOfInts, [1, 2, 3]);
expect(complexObject.anObject.aListOfDoubles, [1.0, 2.0, 3.0]); expect(complexObject.anObject?.aListOfDoubles, [1.0, 2.0, 3.0]);
expect(complexObject.aListOfObjects.length, 3); expect(complexObject.aListOfObjects?.length, 3);
for (var i = 0; i < 3; i++) { for (var i = 0; i < 3; i++) {
expect(complexObject.aListOfObjects[i].aString, 'Blah, blah, blah.'); expect(complexObject.aListOfObjects?[i].aString, 'Blah, blah, blah.');
expect(complexObject.aListOfObjects[i].anInt, i + 1); expect(complexObject.aListOfObjects?[i].anInt, i + 1);
expect(complexObject.aListOfObjects[i].aDouble, 1.0); expect(complexObject.aListOfObjects?[i].aDouble, 1.0);
expect(complexObject.aListOfObjects[i].aListOfStrings, expect(complexObject.aListOfObjects?[i].aListOfStrings,
['one', 'two', 'three']); ['one', 'two', 'three']);
expect(complexObject.aListOfObjects[i].aListOfInts, [1, 2, 3]); expect(complexObject.aListOfObjects?[i].aListOfInts, [1, 2, 3]);
expect(complexObject.aListOfObjects[i].aListOfDoubles, [1.0, 2.0, 3.0]); expect(
complexObject.aListOfObjects?[i].aListOfDoubles, [1.0, 2.0, 3.0]);
} }
}); });
@@ -270,21 +273,21 @@ void main() {
expect(complexObject.aListOfStrings, ['one', 'two', 'three']); expect(complexObject.aListOfStrings, ['one', 'two', 'three']);
expect(complexObject.aListOfInts, [1, 2, 3]); expect(complexObject.aListOfInts, [1, 2, 3]);
expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]); expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]);
expect(complexObject.anObject.aString, isNull); expect(complexObject.anObject?.aString, isNull);
expect(complexObject.anObject.anInt, isNull); expect(complexObject.anObject?.anInt, isNull);
expect(complexObject.anObject.aDouble, isNull); expect(complexObject.anObject?.aDouble, isNull);
expect(complexObject.anObject.aListOfStrings, isNull); expect(complexObject.anObject?.aListOfStrings, isNull);
expect(complexObject.anObject.aListOfInts, isNull); expect(complexObject.anObject?.aListOfInts, isNull);
expect(complexObject.anObject.aListOfDoubles, isNull); expect(complexObject.anObject?.aListOfDoubles, isNull);
expect(complexObject.aListOfObjects.length, 3); expect(complexObject.aListOfObjects?.length, 3);
for (var i = 0; i < 3; i++) { for (var i = 0; i < 3; i++) {
expect(complexObject.aListOfObjects[i].aString, isNull); expect(complexObject.aListOfObjects?[i].aString, isNull);
expect(complexObject.aListOfObjects[i].anInt, isNull); expect(complexObject.aListOfObjects?[i].anInt, isNull);
expect(complexObject.aListOfObjects[i].aDouble, isNull); expect(complexObject.aListOfObjects?[i].aDouble, isNull);
expect(complexObject.aListOfObjects[i].aListOfStrings, isNull); expect(complexObject.aListOfObjects?[i].aListOfStrings, isNull);
expect(complexObject.aListOfObjects[i].aListOfInts, isNull); expect(complexObject.aListOfObjects?[i].aListOfInts, isNull);
expect(complexObject.aListOfObjects[i].aListOfDoubles, isNull); expect(complexObject.aListOfObjects?[i].aListOfDoubles, isNull);
} }
}); });
@@ -298,22 +301,23 @@ void main() {
expect(complexObject.aListOfStrings, ['one', 'two', 'three']); expect(complexObject.aListOfStrings, ['one', 'two', 'three']);
expect(complexObject.aListOfInts, [1, 2, 3]); expect(complexObject.aListOfInts, [1, 2, 3]);
expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]); expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]);
expect(complexObject.anObject.aString, 'Blah, blah, blah.'); expect(complexObject.anObject?.aString, 'Blah, blah, blah.');
expect(complexObject.anObject.anInt, 1); expect(complexObject.anObject?.anInt, 1);
expect(complexObject.anObject.aDouble, 1.0); expect(complexObject.anObject?.aDouble, 1.0);
expect(complexObject.anObject.aListOfStrings, ['one', 'two', 'three']); expect(complexObject.anObject?.aListOfStrings, ['one', 'two', 'three']);
expect(complexObject.anObject.aListOfInts, [1, 2, 3]); expect(complexObject.anObject?.aListOfInts, [1, 2, 3]);
expect(complexObject.anObject.aListOfDoubles, [1.0, 2.0, 3.0]); expect(complexObject.anObject?.aListOfDoubles, [1.0, 2.0, 3.0]);
expect(complexObject.aListOfObjects.length, 3); expect(complexObject.aListOfObjects?.length, 3);
for (var i = 0; i < 3; i++) { for (var i = 0; i < 3; i++) {
expect(complexObject.aListOfObjects[i].aString, 'Blah, blah, blah.'); expect(complexObject.aListOfObjects?[i].aString, 'Blah, blah, blah.');
expect(complexObject.aListOfObjects[i].anInt, i + 1); expect(complexObject.aListOfObjects?[i].anInt, i + 1);
expect(complexObject.aListOfObjects[i].aDouble, 1.0); expect(complexObject.aListOfObjects?[i].aDouble, 1.0);
expect(complexObject.aListOfObjects[i].aListOfStrings, expect(complexObject.aListOfObjects?[i].aListOfStrings,
['one', 'two', 'three']); ['one', 'two', 'three']);
expect(complexObject.aListOfObjects[i].aListOfInts, [1, 2, 3]); expect(complexObject.aListOfObjects?[i].aListOfInts, [1, 2, 3]);
expect(complexObject.aListOfObjects[i].aListOfDoubles, [1.0, 2.0, 3.0]); expect(
complexObject.aListOfObjects?[i].aListOfDoubles, [1.0, 2.0, 3.0]);
} }
}); });
}); });
@@ -329,22 +333,23 @@ void main() {
expect(complexObject.aListOfStrings, ['one', 'two', 'three']); expect(complexObject.aListOfStrings, ['one', 'two', 'three']);
expect(complexObject.aListOfInts, [1, 2, 3]); expect(complexObject.aListOfInts, [1, 2, 3]);
expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]); expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]);
expect(complexObject.anObject.aString, 'Blah, blah, blah.'); expect(complexObject.anObject?.aString, 'Blah, blah, blah.');
expect(complexObject.anObject.anInt, 1); expect(complexObject.anObject?.anInt, 1);
expect(complexObject.anObject.aDouble, 1.0); expect(complexObject.anObject?.aDouble, 1.0);
expect(complexObject.anObject.aListOfStrings, ['one', 'two', 'three']); expect(complexObject.anObject?.aListOfStrings, ['one', 'two', 'three']);
expect(complexObject.anObject.aListOfInts, [1, 2, 3]); expect(complexObject.anObject?.aListOfInts, [1, 2, 3]);
expect(complexObject.anObject.aListOfDoubles, [1.0, 2.0, 3.0]); expect(complexObject.anObject?.aListOfDoubles, [1.0, 2.0, 3.0]);
expect(complexObject.aListOfObjects.length, 3); expect(complexObject.aListOfObjects?.length, 3);
for (var i = 0; i < 3; i++) { for (var i = 0; i < 3; i++) {
expect(complexObject.aListOfObjects[i].aString, 'Blah, blah, blah.'); expect(complexObject.aListOfObjects?[i].aString, 'Blah, blah, blah.');
expect(complexObject.aListOfObjects[i].anInt, i + 1); expect(complexObject.aListOfObjects?[i].anInt, i + 1);
expect(complexObject.aListOfObjects[i].aDouble, 1.0); expect(complexObject.aListOfObjects?[i].aDouble, 1.0);
expect(complexObject.aListOfObjects[i].aListOfStrings, expect(complexObject.aListOfObjects?[i].aListOfStrings,
['one', 'two', 'three']); ['one', 'two', 'three']);
expect(complexObject.aListOfObjects[i].aListOfInts, [1, 2, 3]); expect(complexObject.aListOfObjects?[i].aListOfInts, [1, 2, 3]);
expect(complexObject.aListOfObjects[i].aListOfDoubles, [1.0, 2.0, 3.0]); expect(
complexObject.aListOfObjects?[i].aListOfDoubles, [1.0, 2.0, 3.0]);
} }
}); });
@@ -372,21 +377,21 @@ void main() {
expect(complexObject.aListOfStrings, ['one', 'two', 'three']); expect(complexObject.aListOfStrings, ['one', 'two', 'three']);
expect(complexObject.aListOfInts, [1, 2, 3]); expect(complexObject.aListOfInts, [1, 2, 3]);
expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]); expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]);
expect(complexObject.anObject.aString, isNull); expect(complexObject.anObject?.aString, isNull);
expect(complexObject.anObject.anInt, isNull); expect(complexObject.anObject?.anInt, isNull);
expect(complexObject.anObject.aDouble, isNull); expect(complexObject.anObject?.aDouble, isNull);
expect(complexObject.anObject.aListOfStrings, isNull); expect(complexObject.anObject?.aListOfStrings, isNull);
expect(complexObject.anObject.aListOfInts, isNull); expect(complexObject.anObject?.aListOfInts, isNull);
expect(complexObject.anObject.aListOfDoubles, isNull); expect(complexObject.anObject?.aListOfDoubles, isNull);
expect(complexObject.aListOfObjects.length, 3); expect(complexObject.aListOfObjects?.length, 3);
for (var i = 0; i < 3; i++) { for (var i = 0; i < 3; i++) {
expect(complexObject.aListOfObjects[i].aString, isNull); expect(complexObject.aListOfObjects?[i].aString, isNull);
expect(complexObject.aListOfObjects[i].anInt, isNull); expect(complexObject.aListOfObjects?[i].anInt, isNull);
expect(complexObject.aListOfObjects[i].aDouble, isNull); expect(complexObject.aListOfObjects?[i].aDouble, isNull);
expect(complexObject.aListOfObjects[i].aListOfStrings, isNull); expect(complexObject.aListOfObjects?[i].aListOfStrings, isNull);
expect(complexObject.aListOfObjects[i].aListOfInts, isNull); expect(complexObject.aListOfObjects?[i].aListOfInts, isNull);
expect(complexObject.aListOfObjects[i].aListOfDoubles, isNull); expect(complexObject.aListOfObjects?[i].aListOfDoubles, isNull);
} }
}); });
@@ -400,22 +405,23 @@ void main() {
expect(complexObject.aListOfStrings, ['one', 'two', 'three']); expect(complexObject.aListOfStrings, ['one', 'two', 'three']);
expect(complexObject.aListOfInts, [1, 2, 3]); expect(complexObject.aListOfInts, [1, 2, 3]);
expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]); expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]);
expect(complexObject.anObject.aString, 'Blah, blah, blah.'); expect(complexObject.anObject?.aString, 'Blah, blah, blah.');
expect(complexObject.anObject.anInt, 1); expect(complexObject.anObject?.anInt, 1);
expect(complexObject.anObject.aDouble, 1.0); expect(complexObject.anObject?.aDouble, 1.0);
expect(complexObject.anObject.aListOfStrings, ['one', 'two', 'three']); expect(complexObject.anObject?.aListOfStrings, ['one', 'two', 'three']);
expect(complexObject.anObject.aListOfInts, [1, 2, 3]); expect(complexObject.anObject?.aListOfInts, [1, 2, 3]);
expect(complexObject.anObject.aListOfDoubles, [1.0, 2.0, 3.0]); expect(complexObject.anObject?.aListOfDoubles, [1.0, 2.0, 3.0]);
expect(complexObject.aListOfObjects.length, 3); expect(complexObject.aListOfObjects?.length, 3);
for (var i = 0; i < 3; i++) { for (var i = 0; i < 3; i++) {
expect(complexObject.aListOfObjects[i].aString, 'Blah, blah, blah.'); expect(complexObject.aListOfObjects?[i].aString, 'Blah, blah, blah.');
expect(complexObject.aListOfObjects[i].anInt, i + 1); expect(complexObject.aListOfObjects?[i].anInt, i + 1);
expect(complexObject.aListOfObjects[i].aDouble, 1.0); expect(complexObject.aListOfObjects?[i].aDouble, 1.0);
expect(complexObject.aListOfObjects[i].aListOfStrings, expect(complexObject.aListOfObjects?[i].aListOfStrings,
['one', 'two', 'three']); ['one', 'two', 'three']);
expect(complexObject.aListOfObjects[i].aListOfInts, [1, 2, 3]); expect(complexObject.aListOfObjects?[i].aListOfInts, [1, 2, 3]);
expect(complexObject.aListOfObjects[i].aListOfDoubles, [1.0, 2.0, 3.0]); expect(
complexObject.aListOfObjects?[i].aListOfDoubles, [1.0, 2.0, 3.0]);
} }
}); });
}); });

View File

@@ -1,2 +1,3 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig" #include "Generated.xcconfig"

View File

@@ -1,2 +1,3 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig" #include "Generated.xcconfig"

View File

@@ -204,7 +204,7 @@ class PlaceMapState extends State<PlaceMap> {
}); });
// Show a confirmation snackbar that has an action to edit the new place. // Show a confirmation snackbar that has an action to edit the new place.
Scaffold.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
duration: Duration(seconds: 3), duration: Duration(seconds: 3),
content: content:

View File

@@ -22,9 +22,7 @@ class _MethodChannelDemoState extends State<MethodChannelDemo> {
appBar: AppBar( appBar: AppBar(
title: const Text('MethodChannel Demo'), title: const Text('MethodChannel Demo'),
), ),
body: Builder( body: Column(
builder: (context) {
return Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text( Text(
@@ -42,8 +40,7 @@ class _MethodChannelDemoState extends State<MethodChannelDemo> {
ElevatedButton.icon( ElevatedButton.icon(
onPressed: () async { onPressed: () async {
try { try {
final value = final value = await Counter.increment(counterValue: count);
await Counter.increment(counterValue: count);
setState(() => count = value); setState(() => count = value);
} catch (error) { } catch (error) {
showErrorMessage( showErrorMessage(
@@ -61,8 +58,7 @@ class _MethodChannelDemoState extends State<MethodChannelDemo> {
ElevatedButton.icon( ElevatedButton.icon(
onPressed: () async { onPressed: () async {
try { try {
final value = final value = await Counter.decrement(counterValue: count);
await Counter.decrement(counterValue: count);
setState(() => count = value); setState(() => count = value);
} catch (error) { } catch (error) {
showErrorMessage( showErrorMessage(
@@ -77,15 +73,15 @@ class _MethodChannelDemoState extends State<MethodChannelDemo> {
], ],
) )
], ],
);
},
), ),
); );
} }
void showErrorMessage(BuildContext context, String errorMessage) { void showErrorMessage(BuildContext context, String errorMessage) {
Scaffold.of(context).showSnackBar(SnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(errorMessage), content: Text(errorMessage),
)); ),
);
} }
} }

View File

@@ -25,11 +25,7 @@ class _PetListScreenState extends State<PetListScreen> {
BasicMessageChannel('stringCodecDemo', StringCodec()) BasicMessageChannel('stringCodecDemo', StringCodec())
.setMessageHandler((message) async { .setMessageHandler((message) async {
if (message == null) { if (message == null) {
scaffoldKey.currentState.showSnackBar( showSnackBar('An error occurred while adding pet details.', context);
SnackBar(
content:
const Text('An error occurred while adding pet details.')),
);
} else { } else {
setState(() { setState(() {
petListModel = PetListModel.fromJson(message); petListModel = PetListModel.fromJson(message);
@@ -91,10 +87,10 @@ class BuildPetList extends StatelessWidget {
}, },
); );
} }
}
void showSnackBar(String message, BuildContext context) { void showSnackBar(String message, BuildContext context) {
Scaffold.of(context).showSnackBar(SnackBar( ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text(message), content: Text(message),
)); ));
}
} }

View File

@@ -7,56 +7,56 @@ packages:
name: async name: async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.5.0-nullsafety.1" version: "2.5.0-nullsafety.3"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
name: boolean_selector name: boolean_selector
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0-nullsafety.3"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.3" version: "1.1.0-nullsafety.5"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
name: charcode name: charcode
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0-nullsafety.3"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0-nullsafety.3"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.15.0-nullsafety.3" version: "1.15.0-nullsafety.5"
cupertino_icons: cupertino_icons:
dependency: "direct main" dependency: "direct main"
description: description:
name: cupertino_icons name: cupertino_icons
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0" version: "1.0.2"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0-nullsafety.3"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@@ -73,21 +73,21 @@ packages:
name: matcher name: matcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.12.10-nullsafety.1" version: "0.12.10-nullsafety.3"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0-nullsafety.6"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0-nullsafety.1" version: "1.8.0-nullsafety.3"
pedantic: pedantic:
dependency: "direct dev" dependency: "direct dev"
description: description:
@@ -106,55 +106,55 @@ packages:
name: source_span name: source_span
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0-nullsafety.2" version: "1.8.0-nullsafety.4"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.1" version: "1.10.0-nullsafety.6"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0-nullsafety.3"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0-nullsafety.3"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0-nullsafety.3"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.19-nullsafety.2" version: "0.2.19-nullsafety.6"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
name: typed_data name: typed_data
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0-nullsafety.5"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.3" version: "2.1.0-nullsafety.5"
sdks: sdks:
dart: ">=2.10.0-110 <2.11.0" dart: ">=2.12.0-0.0 <3.0.0"

View File

@@ -116,7 +116,7 @@ class _PlatformAdaptingHomePageState extends State<PlatformAdaptingHomePage> {
); );
default: default:
assert(false, 'Unexpected tab'); assert(false, 'Unexpected tab');
return null; return SizedBox.shrink();
} }
}, },
); );

View File

@@ -22,9 +22,9 @@ class NewsTab extends StatefulWidget {
class _NewsTabState extends State<NewsTab> { class _NewsTabState extends State<NewsTab> {
static const _itemsLength = 20; static const _itemsLength = 20;
List<Color> colors; late final List<Color> colors;
List<String> titles; late final List<String> titles;
List<String> contents; late final List<String> contents;
@override @override
void initState() { void initState() {
@@ -36,8 +36,6 @@ class _NewsTabState extends State<NewsTab> {
} }
Widget _listBuilder(BuildContext context, int index) { Widget _listBuilder(BuildContext context, int index) {
if (index >= _itemsLength) return null;
return SafeArea( return SafeArea(
top: false, top: false,
bottom: false, bottom: false,
@@ -101,6 +99,7 @@ class _NewsTabState extends State<NewsTab> {
), ),
body: Container( body: Container(
child: ListView.builder( child: ListView.builder(
itemCount: _itemsLength,
itemBuilder: _listBuilder, itemBuilder: _listBuilder,
), ),
), ),
@@ -111,6 +110,7 @@ class _NewsTabState extends State<NewsTab> {
return CupertinoPageScaffold( return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(), navigationBar: CupertinoNavigationBar(),
child: ListView.builder( child: ListView.builder(
itemCount: _itemsLength,
itemBuilder: _listBuilder, itemBuilder: _listBuilder,
), ),
); );

View File

@@ -109,7 +109,11 @@ class ProfileTab extends StatelessWidget {
} }
class PreferenceCard extends StatelessWidget { class PreferenceCard extends StatelessWidget {
const PreferenceCard({this.header, this.content, this.preferenceChoices}); const PreferenceCard({
required this.header,
required this.content,
required this.preferenceChoices,
});
final String header; final String header;
final String content; final String content;

View File

@@ -12,7 +12,11 @@ import 'widgets.dart';
/// On Android, this page sits at the top of your app. On iOS, this page is on /// On Android, this page sits at the top of your app. On iOS, this page is on
/// top of the songs tab's content but is below the tab bar itself. /// top of the songs tab's content but is below the tab bar itself.
class SongDetailTab extends StatelessWidget { class SongDetailTab extends StatelessWidget {
const SongDetailTab({this.id, this.song, this.color}); const SongDetailTab({
required this.id,
required this.song,
required this.color,
});
final int id; final int id;
final String song; final String song;

View File

@@ -15,9 +15,9 @@ class SongsTab extends StatefulWidget {
static const androidIcon = Icon(Icons.music_note); static const androidIcon = Icon(Icons.music_note);
static const iosIcon = Icon(CupertinoIcons.music_note); static const iosIcon = Icon(CupertinoIcons.music_note);
const SongsTab({Key key, this.androidDrawer}) : super(key: key); const SongsTab({Key? key, this.androidDrawer}) : super(key: key);
final Widget androidDrawer; final Widget? androidDrawer;
@override @override
_SongsTabState createState() => _SongsTabState(); _SongsTabState createState() => _SongsTabState();
@@ -28,8 +28,8 @@ class _SongsTabState extends State<SongsTab> {
final _androidRefreshKey = GlobalKey<RefreshIndicatorState>(); final _androidRefreshKey = GlobalKey<RefreshIndicatorState>();
List<MaterialColor> colors; late List<MaterialColor> colors;
List<String> songNames; late List<String> songNames;
@override @override
void initState() { void initState() {
@@ -51,7 +51,7 @@ class _SongsTabState extends State<SongsTab> {
} }
Widget _listBuilder(BuildContext context, int index) { Widget _listBuilder(BuildContext context, int index) {
if (index >= _itemsLength) return null; if (index >= _itemsLength) return Container();
// Show a slightly different color palette. Show poppy-ier colors on iOS // Show a slightly different color palette. Show poppy-ier colors on iOS
// due to lighter contrasting bars and tone it down on Android. // due to lighter contrasting bars and tone it down on Android.
@@ -96,7 +96,7 @@ class _SongsTabState extends State<SongsTab> {
// done in a real app but it's done here since this app // done in a real app but it's done here since this app
// unrealistically toggles the current platform for demonstration // unrealistically toggles the current platform for demonstration
// purposes. // purposes.
WidgetsBinding.instance.reassembleApplication(); WidgetsBinding.instance!.reassembleApplication();
} }
// =========================================================================== // ===========================================================================
@@ -117,7 +117,8 @@ class _SongsTabState extends State<SongsTab> {
actions: [ actions: [
IconButton( IconButton(
icon: Icon(Icons.refresh), icon: Icon(Icons.refresh),
onPressed: () async => await _androidRefreshKey.currentState.show(), onPressed: () async =>
await _androidRefreshKey.currentState!.show(),
), ),
IconButton( IconButton(
icon: Icon(Icons.shuffle), icon: Icon(Icons.shuffle),
@@ -131,6 +132,7 @@ class _SongsTabState extends State<SongsTab> {
onRefresh: _refreshData, onRefresh: _refreshData,
child: ListView.builder( child: ListView.builder(
padding: EdgeInsets.symmetric(vertical: 12), padding: EdgeInsets.symmetric(vertical: 12),
itemCount: _itemsLength,
itemBuilder: _listBuilder, itemBuilder: _listBuilder,
), ),
), ),
@@ -155,7 +157,10 @@ class _SongsTabState extends State<SongsTab> {
sliver: SliverPadding( sliver: SliverPadding(
padding: EdgeInsets.symmetric(vertical: 12), padding: EdgeInsets.symmetric(vertical: 12),
sliver: SliverList( sliver: SliverList(
delegate: SliverChildBuilderDelegate(_listBuilder), delegate: SliverChildBuilderDelegate(
_listBuilder,
childCount: _itemsLength,
),
), ),
), ),
), ),

View File

@@ -57,7 +57,7 @@ String generateRandomHeadline() {
} }
assert(false, 'Failed to generate news headline'); assert(false, 'Failed to generate news headline');
return null; return 'Failed to generate news headline';
} }
List<MaterialColor> getRandomColors(int amount) { List<MaterialColor> getRandomColors(int amount) {

View File

@@ -9,12 +9,10 @@ import 'package:flutter/material.dart';
/// A simple widget that builds different things on different platforms. /// A simple widget that builds different things on different platforms.
class PlatformWidget extends StatelessWidget { class PlatformWidget extends StatelessWidget {
const PlatformWidget({ const PlatformWidget({
Key key, Key? key,
@required this.androidBuilder, required this.androidBuilder,
@required this.iosBuilder, required this.iosBuilder,
}) : assert(androidBuilder != null), }) : super(key: key);
assert(iosBuilder != null),
super(key: key);
final WidgetBuilder androidBuilder; final WidgetBuilder androidBuilder;
final WidgetBuilder iosBuilder; final WidgetBuilder iosBuilder;
@@ -28,7 +26,7 @@ class PlatformWidget extends StatelessWidget {
return iosBuilder(context); return iosBuilder(context);
default: default:
assert(false, 'Unexpected platform $defaultTargetPlatform'); assert(false, 'Unexpected platform $defaultTargetPlatform');
return null; return SizedBox.shrink();
} }
} }
} }
@@ -40,15 +38,15 @@ class PlatformWidget extends StatelessWidget {
class PressableCard extends StatefulWidget { class PressableCard extends StatefulWidget {
const PressableCard({ const PressableCard({
this.onPressed, this.onPressed,
this.color, required this.color,
this.flattenAnimation, required this.flattenAnimation,
this.child, this.child,
}); });
final VoidCallback onPressed; final VoidCallback? onPressed;
final Color color; final Color color;
final Animation<double> flattenAnimation; final Animation<double> flattenAnimation;
final Widget child; final Widget? child;
@override @override
State<StatefulWidget> createState() => _PressableCardState(); State<StatefulWidget> createState() => _PressableCardState();
@@ -57,8 +55,8 @@ class PressableCard extends StatefulWidget {
class _PressableCardState extends State<PressableCard> class _PressableCardState extends State<PressableCard>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
bool pressed = false; bool pressed = false;
AnimationController controller; late final AnimationController controller;
Animation<double> elevationAnimation; late final Animation<double> elevationAnimation;
@override @override
void initState() { void initState() {
@@ -93,9 +91,7 @@ class _PressableCardState extends State<PressableCard>
child: GestureDetector( child: GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
if (widget.onPressed != null) { widget.onPressed?.call();
widget.onPressed();
}
}, },
// This widget both internally drives an animation when pressed and // This widget both internally drives an animation when pressed and
// responds to an external animation to flatten the card when in a // responds to an external animation to flatten the card when in a
@@ -138,13 +134,17 @@ class _PressableCardState extends State<PressableCard>
/// This is an example of a custom widget that an app developer might create for /// This is an example of a custom widget that an app developer might create for
/// use on both iOS and Android as part of their brand's unique design. /// use on both iOS and Android as part of their brand's unique design.
class HeroAnimatingSongCard extends StatelessWidget { class HeroAnimatingSongCard extends StatelessWidget {
HeroAnimatingSongCard( HeroAnimatingSongCard({
{this.song, this.color, this.heroAnimation, this.onPressed}); required this.song,
required this.color,
required this.heroAnimation,
this.onPressed,
});
final String song; final String song;
final Color color; final Color color;
final Animation<double> heroAnimation; final Animation<double> heroAnimation;
final VoidCallback onPressed; final VoidCallback? onPressed;
double get playButtonSize => 50 + 50 * heroAnimation.value; double get playButtonSize => 50 + 50 * heroAnimation.value;
@@ -226,7 +226,7 @@ class SongPlaceholderTile extends StatelessWidget {
child: Row( child: Row(
children: [ children: [
Container( Container(
color: Theme.of(context).textTheme.bodyText2.color, color: Theme.of(context).textTheme.bodyText2!.color,
width: 130, width: 130,
), ),
Padding( Padding(
@@ -239,27 +239,27 @@ class SongPlaceholderTile extends StatelessWidget {
Container( Container(
height: 9, height: 9,
margin: EdgeInsets.only(right: 60), margin: EdgeInsets.only(right: 60),
color: Theme.of(context).textTheme.bodyText2.color, color: Theme.of(context).textTheme.bodyText2!.color,
), ),
Container( Container(
height: 9, height: 9,
margin: EdgeInsets.only(right: 20, top: 8), margin: EdgeInsets.only(right: 20, top: 8),
color: Theme.of(context).textTheme.bodyText2.color, color: Theme.of(context).textTheme.bodyText2!.color,
), ),
Container( Container(
height: 9, height: 9,
margin: EdgeInsets.only(right: 40, top: 8), margin: EdgeInsets.only(right: 40, top: 8),
color: Theme.of(context).textTheme.bodyText2.color, color: Theme.of(context).textTheme.bodyText2!.color,
), ),
Container( Container(
height: 9, height: 9,
margin: EdgeInsets.only(right: 80, top: 8), margin: EdgeInsets.only(right: 80, top: 8),
color: Theme.of(context).textTheme.bodyText2.color, color: Theme.of(context).textTheme.bodyText2!.color,
), ),
Container( Container(
height: 9, height: 9,
margin: EdgeInsets.only(right: 50, top: 8), margin: EdgeInsets.only(right: 50, top: 8),
color: Theme.of(context).textTheme.bodyText2.color, color: Theme.of(context).textTheme.bodyText2!.color,
), ),
], ],
), ),
@@ -287,7 +287,7 @@ void showChoices(BuildContext context, List<String> choices) {
showDialog<void>( showDialog<void>(
context: context, context: context,
builder: (context) { builder: (context) {
var selectedRadio = 1; int? selectedRadio = 1;
return AlertDialog( return AlertDialog(
contentPadding: EdgeInsets.only(top: 12), contentPadding: EdgeInsets.only(top: 12),
content: StatefulBuilder( content: StatefulBuilder(
@@ -295,12 +295,11 @@ void showChoices(BuildContext context, List<String> choices) {
return Column( return Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: List<Widget>.generate(choices.length, (index) { children: List<Widget>.generate(choices.length, (index) {
return RadioListTile( return RadioListTile<int?>(
title: Text(choices[index]), title: Text(choices[index]),
value: index, value: index,
groupValue: selectedRadio, groupValue: selectedRadio,
// ignore: avoid_types_on_closure_parameters onChanged: (value) {
onChanged: (int value) {
setState(() => selectedRadio = value); setState(() => selectedRadio = value);
}, },
); );

View File

@@ -7,63 +7,63 @@ packages:
name: async name: async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.5.0-nullsafety.1" version: "2.5.0"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
name: boolean_selector name: boolean_selector
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.3" version: "1.1.0"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
name: charcode name: charcode
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.15.0-nullsafety.3" version: "1.15.0"
cupertino_icons: cupertino_icons:
dependency: "direct main" dependency: "direct main"
description: description:
name: cupertino_icons name: cupertino_icons
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.3" version: "1.0.2"
english_words: english_words:
dependency: "direct main" dependency: "direct main"
description: description:
name: english_words name: english_words
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.1.5" version: "4.0.0-nullsafety.0"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@@ -75,7 +75,7 @@ packages:
name: flutter_lorem name: flutter_lorem
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0" version: "2.0.0"
flutter_test: flutter_test:
dependency: "direct dev" dependency: "direct dev"
description: flutter description: flutter
@@ -87,28 +87,28 @@ packages:
name: matcher name: matcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.12.10-nullsafety.1" version: "0.12.10"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0-nullsafety.1" version: "1.8.0"
pedantic: pedantic:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: pedantic name: pedantic
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.9.2" version: "1.10.0"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@@ -120,55 +120,55 @@ packages:
name: source_span name: source_span
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0-nullsafety.2" version: "1.8.0"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.1" version: "1.10.0"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.19-nullsafety.2" version: "0.2.19"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
name: typed_data name: typed_data
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.3" version: "2.1.0"
sdks: sdks:
dart: ">=2.10.0-110 <2.11.0" dart: ">=2.12.0-259 <3.0.0"

View File

@@ -3,20 +3,20 @@ description: A project showcasing a Flutter app following different platform IA
version: 1.0.0+1 version: 1.0.0+1
environment: environment:
sdk: ">=2.5.0 <3.0.0" sdk: '>=2.12.0-0 <3.0.0'
dependencies: dependencies:
english_words: ^3.1.5 english_words: ^4.0.0-nullsafety.0
flutter_lorem: ^1.1.0 flutter_lorem: ^2.0.0
flutter: flutter:
sdk: flutter sdk: flutter
cupertino_icons: ^0.1.3 cupertino_icons: ^1.0.2
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
pedantic: ^1.9.0 pedantic: ^1.10.0
flutter: flutter:
uses-material-design: true uses-material-design: true

View File

@@ -7,42 +7,42 @@ packages:
name: async name: async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.5.0-nullsafety.1" version: "2.5.0-nullsafety.3"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
name: boolean_selector name: boolean_selector
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0-nullsafety.3"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.3" version: "1.1.0-nullsafety.5"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
name: charcode name: charcode
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0-nullsafety.3"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0-nullsafety.3"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.15.0-nullsafety.3" version: "1.15.0-nullsafety.5"
cupertino_icons: cupertino_icons:
dependency: "direct main" dependency: "direct main"
description: description:
@@ -56,7 +56,7 @@ packages:
name: fake_async name: fake_async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0-nullsafety.3"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@@ -73,21 +73,21 @@ packages:
name: matcher name: matcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.12.10-nullsafety.1" version: "0.12.10-nullsafety.3"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0-nullsafety.6"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0-nullsafety.1" version: "1.8.0-nullsafety.3"
pedantic: pedantic:
dependency: "direct dev" dependency: "direct dev"
description: description:
@@ -106,55 +106,55 @@ packages:
name: source_span name: source_span
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0-nullsafety.2" version: "1.8.0-nullsafety.4"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.1" version: "1.10.0-nullsafety.6"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0-nullsafety.3"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0-nullsafety.3"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0-nullsafety.3"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.19-nullsafety.2" version: "0.2.19-nullsafety.6"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
name: typed_data name: typed_data
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0-nullsafety.5"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.3" version: "2.1.0-nullsafety.5"
sdks: sdks:
dart: ">=2.10.0-110 <2.11.0" dart: ">=2.12.0-0.0 <3.0.0"

View File

@@ -7,56 +7,56 @@ packages:
name: async name: async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.5.0-nullsafety.1" version: "2.5.0"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
name: boolean_selector name: boolean_selector
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.3" version: "1.1.0"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
name: charcode name: charcode
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.15.0-nullsafety.3" version: "1.15.0"
cupertino_icons: cupertino_icons:
dependency: "direct main" dependency: "direct main"
description: description:
name: cupertino_icons name: cupertino_icons
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0" version: "1.0.2"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@@ -73,42 +73,42 @@ packages:
name: matcher name: matcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.12.10-nullsafety.1" version: "0.12.10"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0"
nested: nested:
dependency: transitive dependency: transitive
description: description:
name: nested name: nested
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.0.4" version: "1.0.0"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0-nullsafety.1" version: "1.8.0"
pedantic: pedantic:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: pedantic name: pedantic
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.9.2" version: "1.10.0"
provider: provider:
dependency: "direct main" dependency: "direct main"
description: description:
name: provider name: provider
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.3.2+3" version: "5.0.0-nullsafety.5"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@@ -120,56 +120,56 @@ packages:
name: source_span name: source_span
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0-nullsafety.2" version: "1.8.0"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.1" version: "1.10.0"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.19-nullsafety.2" version: "0.2.19"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
name: typed_data name: typed_data
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.3" version: "2.1.0"
sdks: sdks:
dart: ">=2.10.0 <2.11.0" dart: ">=2.12.0-0.0 <3.0.0"
flutter: ">=1.16.0" flutter: ">=1.16.0"

View File

@@ -5,20 +5,19 @@ description: >
version: 1.0.0 version: 1.0.0
environment: environment:
sdk: ">=2.10.0 <3.0.0" sdk: ">=2.12.0-0 <3.0.0"
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
provider: ^4.3.2 provider: ^5.0.0-nullsafety.5
cupertino_icons: ^1.0.0 cupertino_icons: ^1.0.2
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
pedantic: ^1.9.0 pedantic: ^1.10.0
flutter: flutter:
uses-material-design: true uses-material-design: true

View File

@@ -30,6 +30,7 @@ class MyApp extends StatelessWidget {
ChangeNotifierProxyProvider<CatalogModel, CartModel>( ChangeNotifierProxyProvider<CatalogModel, CartModel>(
create: (context) => CartModel(), create: (context) => CartModel(),
update: (context, catalog, cart) { update: (context, catalog, cart) {
if (cart == null) throw ArgumentError.notNull('cart');
cart.catalog = catalog; cart.catalog = catalog;
return cart; return cart;
}, },

View File

@@ -7,7 +7,7 @@ import 'package:provider_shopper/models/catalog.dart';
class CartModel extends ChangeNotifier { class CartModel extends ChangeNotifier {
/// The private field backing [catalog]. /// The private field backing [catalog].
CatalogModel _catalog; late CatalogModel _catalog;
/// Internal, private state of the cart. Stores the ids of each item. /// Internal, private state of the cart. Stores the ids of each item.
final List<int> _itemIds = []; final List<int> _itemIds = [];
@@ -16,9 +16,6 @@ class CartModel extends ChangeNotifier {
CatalogModel get catalog => _catalog; CatalogModel get catalog => _catalog;
set catalog(CatalogModel newCatalog) { set catalog(CatalogModel newCatalog) {
assert(newCatalog != null);
assert(_itemIds.every((id) => newCatalog.getById(id) != null),
'The catalog $newCatalog does not have one of $_itemIds in it.');
_catalog = newCatalog; _catalog = newCatalog;
// Notify listeners, in case the new catalog provides information // Notify listeners, in case the new catalog provides information
// different from the previous one. For example, availability of an item // different from the previous one. For example, availability of an item

View File

@@ -65,7 +65,7 @@ class _CartTotal extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var hugeStyle = var hugeStyle =
Theme.of(context).textTheme.headline1.copyWith(fontSize: 48); Theme.of(context).textTheme.headline1!.copyWith(fontSize: 48);
return SizedBox( return SizedBox(
height: 200, height: 200,
@@ -85,7 +85,7 @@ class _CartTotal extends StatelessWidget {
SizedBox(width: 24), SizedBox(width: 24),
TextButton( TextButton(
onPressed: () { onPressed: () {
Scaffold.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Buying not supported yet.'))); SnackBar(content: Text('Buying not supported yet.')));
}, },
style: TextButton.styleFrom(primary: Colors.white), style: TextButton.styleFrom(primary: Colors.white),

View File

@@ -28,7 +28,7 @@ class MyCatalog extends StatelessWidget {
class _AddButton extends StatelessWidget { class _AddButton extends StatelessWidget {
final Item item; final Item item;
const _AddButton({Key key, @required this.item}) : super(key: key); const _AddButton({required this.item, Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@@ -55,7 +55,7 @@ class _AddButton extends StatelessWidget {
cart.add(item); cart.add(item);
}, },
style: ButtonStyle( style: ButtonStyle(
overlayColor: MaterialStateProperty.resolveWith<Color>((states) { overlayColor: MaterialStateProperty.resolveWith<Color?>((states) {
if (states.contains(MaterialState.pressed)) { if (states.contains(MaterialState.pressed)) {
return Theme.of(context).primaryColor; return Theme.of(context).primaryColor;
} }
@@ -86,7 +86,7 @@ class _MyAppBar extends StatelessWidget {
class _MyListItem extends StatelessWidget { class _MyListItem extends StatelessWidget {
final int index; final int index;
_MyListItem(this.index, {Key key}) : super(key: key); _MyListItem(this.index, {Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

View File

@@ -7,49 +7,49 @@ packages:
name: async name: async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.5.0-nullsafety.3" version: "2.5.0"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
name: boolean_selector name: boolean_selector
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.3" version: "2.1.0"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.5" version: "1.1.0"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
name: charcode name: charcode
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.3" version: "1.2.0"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.3" version: "1.1.0"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.15.0-nullsafety.5" version: "1.15.0"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.3" version: "1.2.0"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@@ -66,42 +66,42 @@ packages:
name: matcher name: matcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.12.10-nullsafety.3" version: "0.12.10"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.6" version: "1.3.0"
nested: nested:
dependency: transitive dependency: transitive
description: description:
name: nested name: nested
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.0.4" version: "1.0.0"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0-nullsafety.3" version: "1.8.0"
pedantic: pedantic:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: pedantic name: pedantic
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.9.2" version: "1.10.0"
provider: provider:
dependency: "direct main" dependency: "direct main"
description: description:
name: provider name: provider
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.3.3" version: "5.0.0-nullsafety.5"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@@ -113,56 +113,56 @@ packages:
name: source_span name: source_span
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0-nullsafety.4" version: "1.8.0"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.6" version: "1.10.0"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.3" version: "2.1.0"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.3" version: "1.1.0"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.3" version: "1.2.0"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.19-nullsafety.6" version: "0.2.19"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
name: typed_data name: typed_data
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.5" version: "1.3.0"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.5" version: "2.1.0"
sdks: sdks:
dart: ">=2.12.0-0.0 <3.0.0" dart: ">=2.12.0-259.16.beta <3.0.0"
flutter: ">=1.16.0" flutter: ">=1.16.0"

View File

@@ -4,19 +4,19 @@ description: A shopping app sample that uses Provider for state management.
version: 1.0.0+1 version: 1.0.0+1
environment: environment:
sdk: ">=2.5.0 <3.0.0" sdk: '>=2.12.0-259.16.beta <3.0.0'
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
# Import the provider package. # Import the provider package.
provider: ^4.3.2 provider: '>=5.0.0-nullsafety.5 <6.0.0'
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
pedantic: ^1.9.0 pedantic: ^1.10.0
flutter: flutter:
uses-material-design: true uses-material-design: true

View File

@@ -9,8 +9,8 @@ import 'package:provider_shopper/models/cart.dart';
import 'package:provider_shopper/models/catalog.dart'; import 'package:provider_shopper/models/catalog.dart';
import 'package:provider_shopper/screens/cart.dart'; import 'package:provider_shopper/screens/cart.dart';
CartModel cartModel; CartModel? cartModel;
CatalogModel catalogModel; CatalogModel? catalogModel;
Widget createCartScreen() => MultiProvider( Widget createCartScreen() => MultiProvider(
providers: [ providers: [
Provider(create: (context) => CatalogModel()), Provider(create: (context) => CatalogModel()),
@@ -19,7 +19,7 @@ Widget createCartScreen() => MultiProvider(
update: (context, catalog, cart) { update: (context, catalog, cart) {
catalogModel = catalog; catalogModel = catalog;
cartModel = cart; cartModel = cart;
cart.catalog = catalogModel; cart!.catalog = catalogModel!;
return cart; return cart;
}, },
), ),
@@ -48,8 +48,8 @@ void main() {
// Adding five items in the cart and testing. // Adding five items in the cart and testing.
for (var i = 0; i < 5; i++) { for (var i = 0; i < 5; i++) {
var item = catalogModel.getByPosition(i); var item = catalogModel!.getByPosition(i);
cartModel.add(item); cartModel!.add(item);
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(find.text(item.name), findsOneWidget); expect(find.text(item.name), findsOneWidget);
} }

View File

@@ -16,7 +16,7 @@ Widget createCatalogScreen() => MultiProvider(
ChangeNotifierProxyProvider<CatalogModel, CartModel>( ChangeNotifierProxyProvider<CatalogModel, CartModel>(
create: (context) => CartModel(), create: (context) => CartModel(),
update: (context, catalog, cart) { update: (context, catalog, cart) {
cart.catalog = catalog; cart!.catalog = catalog;
return cart; return cart;
}, },
), ),

View File

@@ -18,7 +18,7 @@ void main() {
ChangeNotifierProxyProvider<CatalogModel, CartModel>( ChangeNotifierProxyProvider<CatalogModel, CartModel>(
create: (context) => CartModel(), create: (context) => CartModel(),
update: (context, catalog, cart) { update: (context, catalog, cart) {
cart.catalog = catalog; cart!.catalog = catalog;
return cart; return cart;
}, },
), ),

View File

@@ -1,2 +1,3 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig" #include "Generated.xcconfig"

View File

@@ -1,2 +1,3 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig" #include "Generated.xcconfig"

View File

@@ -55,7 +55,7 @@ class FavoriteItemTile extends StatelessWidget {
icon: Icon(Icons.close), icon: Icon(Icons.close),
onPressed: () { onPressed: () {
Provider.of<Favorites>(context, listen: false).remove(itemNo); Provider.of<Favorites>(context, listen: false).remove(itemNo);
Scaffold.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
content: Text('Removed from favorites.'), content: Text('Removed from favorites.'),
duration: Duration(seconds: 1), duration: Duration(seconds: 1),

View File

@@ -67,7 +67,7 @@ class ItemTile extends StatelessWidget {
!favoritesList.items.contains(itemNo) !favoritesList.items.contains(itemNo)
? favoritesList.add(itemNo) ? favoritesList.add(itemNo)
: favoritesList.remove(itemNo); : favoritesList.remove(itemNo);
Scaffold.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
content: Text(favoritesList.items.contains(itemNo) content: Text(favoritesList.items.contains(itemNo)
? 'Added to favorites.' ? 'Added to favorites.'

View File

@@ -7,14 +7,14 @@ packages:
name: _fe_analyzer_shared name: _fe_analyzer_shared
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "12.0.0" version: "14.0.0"
analyzer: analyzer:
dependency: transitive dependency: transitive
description: description:
name: analyzer name: analyzer
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.40.6" version: "0.41.2"
archive: archive:
dependency: transitive dependency: transitive
description: description:
@@ -35,28 +35,28 @@ packages:
name: async name: async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.5.0-nullsafety.1" version: "2.5.0-nullsafety.3"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
name: boolean_selector name: boolean_selector
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0-nullsafety.3"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.3" version: "1.1.0-nullsafety.5"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
name: charcode name: charcode
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0-nullsafety.3"
cli_util: cli_util:
dependency: transitive dependency: transitive
description: description:
@@ -70,14 +70,14 @@ packages:
name: clock name: clock
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0-nullsafety.3"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.15.0-nullsafety.3" version: "1.15.0-nullsafety.5"
convert: convert:
dependency: transitive dependency: transitive
description: description:
@@ -91,7 +91,7 @@ packages:
name: coverage name: coverage
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.14.2" version: "0.15.1"
crypto: crypto:
dependency: transitive dependency: transitive
description: description:
@@ -112,14 +112,14 @@ packages:
name: fake_async name: fake_async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0-nullsafety.3"
file: file:
dependency: transitive dependency: transitive
description: description:
name: file name: file
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.0.0-nullsafety.2" version: "6.0.0-nullsafety.4"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@@ -147,13 +147,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.2.0"
http:
dependency: transitive
description:
name: http
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.2"
http_multi_server: http_multi_server:
dependency: transitive dependency: transitive
description: description:
@@ -188,14 +181,7 @@ packages:
name: js name: js
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.6.3-nullsafety.2" version: "0.6.3-nullsafety.3"
json_rpc_2:
dependency: transitive
description:
name: json_rpc_2
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.2"
logging: logging:
dependency: transitive dependency: transitive
description: description:
@@ -209,14 +195,14 @@ packages:
name: matcher name: matcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.12.10-nullsafety.1" version: "0.12.10-nullsafety.3"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0-nullsafety.6"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@@ -251,7 +237,7 @@ packages:
name: node_preamble name: node_preamble
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.4.12" version: "1.4.13"
package_config: package_config:
dependency: transitive dependency: transitive
description: description:
@@ -265,42 +251,42 @@ packages:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0-nullsafety.1" version: "1.8.0-nullsafety.3"
pedantic: pedantic:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: pedantic name: pedantic
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.2" version: "1.10.0-nullsafety.3"
platform: platform:
dependency: transitive dependency: transitive
description: description:
name: platform name: platform
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.0-nullsafety.2" version: "3.0.0-nullsafety.4"
pool: pool:
dependency: transitive dependency: transitive
description: description:
name: pool name: pool
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.5.0-nullsafety.2" version: "1.5.0-nullsafety.3"
process: process:
dependency: transitive dependency: transitive
description: description:
name: process name: process
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.0.0-nullsafety.2" version: "4.0.0-nullsafety.4"
provider: provider:
dependency: "direct main" dependency: "direct main"
description: description:
name: provider name: provider
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.3.2+3" version: "4.3.3"
pub_semver: pub_semver:
dependency: transitive dependency: transitive
description: description:
@@ -321,21 +307,21 @@ packages:
name: shelf_packages_handler name: shelf_packages_handler
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0" version: "2.0.1"
shelf_static: shelf_static:
dependency: transitive dependency: transitive
description: description:
name: shelf_static name: shelf_static
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.9+1" version: "0.2.9+2"
shelf_web_socket: shelf_web_socket:
dependency: transitive dependency: transitive
description: description:
name: shelf_web_socket name: shelf_web_socket
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.3" version: "0.2.4"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@@ -347,42 +333,42 @@ packages:
name: source_map_stack_trace name: source_map_stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.3" version: "2.1.0-nullsafety.4"
source_maps: source_maps:
dependency: transitive dependency: transitive
description: description:
name: source_maps name: source_maps
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.10.10-nullsafety.2" version: "0.10.10-nullsafety.3"
source_span: source_span:
dependency: transitive dependency: transitive
description: description:
name: source_span name: source_span
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0-nullsafety.2" version: "1.8.0-nullsafety.4"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.1" version: "1.10.0-nullsafety.6"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0-nullsafety.3"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0-nullsafety.3"
sync_http: sync_http:
dependency: transitive dependency: transitive
description: description:
@@ -396,42 +382,42 @@ packages:
name: term_glyph name: term_glyph
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0-nullsafety.3"
test: test:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: test name: test
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.16.0-nullsafety.5" version: "1.16.0-nullsafety.17"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.19-nullsafety.2" version: "0.2.19-nullsafety.6"
test_core: test_core:
dependency: transitive dependency: transitive
description: description:
name: test_core name: test_core
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.3.12-nullsafety.5" version: "0.3.12-nullsafety.15"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
name: typed_data name: typed_data
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0-nullsafety.5"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0-nullsafety.3" version: "2.1.0-nullsafety.5"
vm_service: vm_service:
dependency: transitive dependency: transitive
description: description:
@@ -439,13 +425,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.5.0" version: "5.5.0"
vm_service_client:
dependency: transitive
description:
name: vm_service_client
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.6+2"
watcher: watcher:
dependency: transitive dependency: transitive
description: description:
@@ -459,7 +438,7 @@ packages:
name: web_socket_channel name: web_socket_channel
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0" version: "1.2.0"
webdriver: webdriver:
dependency: transitive dependency: transitive
description: description:
@@ -482,5 +461,5 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.10.0 <2.11.0" dart: ">=2.12.0-0.0 <3.0.0"
flutter: ">=1.16.0 <2.0.0" flutter: ">=1.16.0"

Some files were not shown because too many files have changed in this diff Show More