mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
Landing beta changes in master for the new stable release (#747)
This commit is contained in:
@@ -28,14 +28,14 @@ packages:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.5.0-nullsafety.1"
|
||||
version: "2.5.0-nullsafety.3"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.1"
|
||||
version: "2.1.0-nullsafety.3"
|
||||
build:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -63,14 +63,14 @@ packages:
|
||||
name: characters
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.3"
|
||||
version: "1.1.0-nullsafety.5"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0-nullsafety.3"
|
||||
cli_util:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -84,7 +84,7 @@ packages:
|
||||
name: clock
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.1"
|
||||
version: "1.1.0-nullsafety.3"
|
||||
code_builder:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -98,7 +98,7 @@ packages:
|
||||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.15.0-nullsafety.3"
|
||||
version: "1.15.0-nullsafety.5"
|
||||
convert:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -126,7 +126,7 @@ packages:
|
||||
name: fake_async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0-nullsafety.3"
|
||||
file:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -185,14 +185,14 @@ packages:
|
||||
name: matcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.10-nullsafety.1"
|
||||
version: "0.12.10-nullsafety.3"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.3"
|
||||
version: "1.3.0-nullsafety.6"
|
||||
mockito:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
@@ -227,7 +227,7 @@ packages:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.1"
|
||||
version: "1.8.0-nullsafety.3"
|
||||
pedantic:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -274,56 +274,56 @@ packages:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.2"
|
||||
version: "1.8.0-nullsafety.4"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.10.0-nullsafety.1"
|
||||
version: "1.10.0-nullsafety.6"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.1"
|
||||
version: "2.1.0-nullsafety.3"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.1"
|
||||
version: "1.1.0-nullsafety.3"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0-nullsafety.3"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.19-nullsafety.2"
|
||||
version: "0.2.19-nullsafety.6"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.3"
|
||||
version: "1.3.0-nullsafety.5"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.3"
|
||||
version: "2.1.0-nullsafety.5"
|
||||
watcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -339,4 +339,4 @@ packages:
|
||||
source: hosted
|
||||
version: "2.2.1"
|
||||
sdks:
|
||||
dart: ">=2.10.0 <2.11.0"
|
||||
dart: ">=2.12.0-0.0 <3.0.0"
|
||||
|
||||
@@ -9,11 +9,7 @@
|
||||
/* Begin PBXBuildFile section */
|
||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||
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 */; };
|
||||
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 */; };
|
||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
||||
@@ -26,8 +22,6 @@
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
|
||||
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -38,13 +32,11 @@
|
||||
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>"; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
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; };
|
||||
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>"; };
|
||||
@@ -57,8 +49,6 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
|
||||
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -68,9 +58,7 @@
|
||||
9740EEB11CF90186004384FC /* Flutter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3B80C3931E831B6300D905FE /* App.framework */,
|
||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
|
||||
9740EEBA1CF902C7004384FC /* Flutter.framework */,
|
||||
9740EEB21CF90195004384FC /* Debug.xcconfig */,
|
||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
|
||||
9740EEB31CF90195004384FC /* Generated.xcconfig */,
|
||||
@@ -201,7 +189,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
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 */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
@@ -253,7 +241,6 @@
|
||||
/* Begin XCBuildConfiguration section */
|
||||
249021D3217E4FDB00AE95B9 /* Profile */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
@@ -330,7 +317,6 @@
|
||||
};
|
||||
97C147031CF9000F007C117D /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
@@ -386,7 +372,6 @@
|
||||
};
|
||||
97C147041CF9000F007C117D /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:Runner.xcodeproj">
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
||||
@@ -31,7 +31,11 @@ class Demo {
|
||||
final String route;
|
||||
final WidgetBuilder builder;
|
||||
|
||||
const Demo({this.name, this.route, this.builder});
|
||||
const Demo({
|
||||
required this.name,
|
||||
required this.route,
|
||||
required this.builder,
|
||||
});
|
||||
}
|
||||
|
||||
final basicDemos = [
|
||||
|
||||
@@ -18,9 +18,9 @@ class AnimatedContainerDemo extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _AnimatedContainerDemoState extends State<AnimatedContainerDemo> {
|
||||
Color color;
|
||||
double borderRadius;
|
||||
double margin;
|
||||
late Color color;
|
||||
late double borderRadius;
|
||||
late double margin;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
||||
@@ -20,7 +20,7 @@ class _AnimationControllerDemoState extends State<AnimationControllerDemo>
|
||||
// Widget is not visible.
|
||||
|
||||
static const Duration _duration = Duration(seconds: 1);
|
||||
AnimationController controller;
|
||||
late final AnimationController controller;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
||||
@@ -15,8 +15,8 @@ class _TweenDemoState extends State<TweenDemo>
|
||||
with SingleTickerProviderStateMixin {
|
||||
static const Duration _duration = Duration(seconds: 1);
|
||||
static const double accountBalance = 1000000;
|
||||
AnimationController controller;
|
||||
Animation<double> animation;
|
||||
late final AnimationController controller;
|
||||
late final Animation<double> animation;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
||||
@@ -16,8 +16,8 @@ class _AnimatedBuilderDemoState extends State<AnimatedBuilderDemo>
|
||||
static const Color beginColor = Colors.deepPurple;
|
||||
static const Color endColor = Colors.deepOrange;
|
||||
Duration duration = Duration(milliseconds: 800);
|
||||
AnimationController controller;
|
||||
Animation<Color> animation;
|
||||
late AnimationController controller;
|
||||
late Animation<Color?> animation;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TypewriterTween extends Tween<String> {
|
||||
TypewriterTween({String begin = '', String end})
|
||||
TypewriterTween({String begin = '', String end = ''})
|
||||
: super(begin: begin, end: end);
|
||||
|
||||
@override
|
||||
String lerp(double t) {
|
||||
var cutoff = (end.length * t).round();
|
||||
return end.substring(0, cutoff);
|
||||
var cutoff = (end!.length * t).round();
|
||||
return end!.substring(0, cutoff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,8 +26,8 @@ class _CustomTweenDemoState extends State<CustomTweenDemo>
|
||||
with SingleTickerProviderStateMixin {
|
||||
static const Duration _duration = Duration(seconds: 3);
|
||||
static const String message = loremIpsum;
|
||||
AnimationController controller;
|
||||
Animation<String> animation;
|
||||
late final AnimationController controller;
|
||||
late final Animation<String> animation;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
||||
@@ -14,8 +14,8 @@ class TweenSequenceDemo extends StatefulWidget {
|
||||
class _TweenSequenceDemoState extends State<TweenSequenceDemo>
|
||||
with SingleTickerProviderStateMixin {
|
||||
static const Duration duration = Duration(seconds: 3);
|
||||
AnimationController controller;
|
||||
Animation<Color> animation;
|
||||
late final AnimationController controller;
|
||||
late final Animation<Color?> animation;
|
||||
|
||||
static final colors = [
|
||||
Colors.red,
|
||||
@@ -31,7 +31,7 @@ class _TweenSequenceDemoState extends State<TweenSequenceDemo>
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
final sequenceItems = <TweenSequenceItem<Color>>[];
|
||||
final sequenceItems = <TweenSequenceItem<Color?>>[];
|
||||
|
||||
for (var i = 0; i < colors.length; i++) {
|
||||
final beginColor = colors[i];
|
||||
@@ -39,7 +39,7 @@ class _TweenSequenceDemoState extends State<TweenSequenceDemo>
|
||||
final weight = 1 / colors.length;
|
||||
|
||||
sequenceItems.add(
|
||||
TweenSequenceItem<Color>(
|
||||
TweenSequenceItem<Color?>(
|
||||
tween: ColorTween(begin: beginColor, end: endColor),
|
||||
weight: weight,
|
||||
),
|
||||
@@ -47,7 +47,7 @@ class _TweenSequenceDemoState extends State<TweenSequenceDemo>
|
||||
}
|
||||
|
||||
controller = AnimationController(duration: duration, vsync: this);
|
||||
animation = TweenSequence<Color>(sequenceItems).animate(controller);
|
||||
animation = TweenSequence<Color?>(sequenceItems).animate(controller);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -15,9 +15,9 @@ class FadeTransitionDemo extends StatefulWidget {
|
||||
|
||||
class _FadeTransitionDemoState extends State<FadeTransitionDemo>
|
||||
with SingleTickerProviderStateMixin {
|
||||
AnimationController _controller;
|
||||
Animation<double> _animation;
|
||||
CurvedAnimation _curve;
|
||||
late final AnimationController _controller;
|
||||
late final Animation<double> _animation;
|
||||
late final CurvedAnimation _curve;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
||||
@@ -14,23 +14,31 @@ class AnimatedListDemo extends StatefulWidget {
|
||||
|
||||
class _AnimatedListDemoState extends State<AnimatedListDemo> {
|
||||
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() {
|
||||
setState(() {
|
||||
var index = listData.length;
|
||||
listData.add(
|
||||
UserModel(firstName: 'New', lastName: 'Person'),
|
||||
UserModel(++_maxIdValue, 'New', 'Person'),
|
||||
);
|
||||
_listKey.currentState
|
||||
_listKey.currentState!
|
||||
.insertItem(index, duration: Duration(milliseconds: 300));
|
||||
});
|
||||
}
|
||||
|
||||
void deleteUser(int index) {
|
||||
void deleteUser(int id) {
|
||||
setState(() {
|
||||
final index = listData.indexWhere((u) => u.id == id);
|
||||
var user = listData.removeAt(index);
|
||||
_listKey.currentState.removeItem(
|
||||
_listKey.currentState!.removeItem(
|
||||
index,
|
||||
(context, animation) {
|
||||
return FadeTransition(
|
||||
@@ -49,7 +57,7 @@ class _AnimatedListDemoState extends State<AnimatedListDemo> {
|
||||
});
|
||||
}
|
||||
|
||||
Widget _buildItem(UserModel user, [int index]) {
|
||||
Widget _buildItem(UserModel user) {
|
||||
return ListTile(
|
||||
key: ValueKey<UserModel>(user),
|
||||
title: Text(user.firstName),
|
||||
@@ -59,7 +67,7 @@ class _AnimatedListDemoState extends State<AnimatedListDemo> {
|
||||
),
|
||||
trailing: IconButton(
|
||||
icon: Icon(Icons.delete),
|
||||
onPressed: () => deleteUser(index),
|
||||
onPressed: () => deleteUser(user.id),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -79,11 +87,11 @@ class _AnimatedListDemoState extends State<AnimatedListDemo> {
|
||||
body: SafeArea(
|
||||
child: AnimatedList(
|
||||
key: _listKey,
|
||||
initialItemCount: initialListData.length,
|
||||
initialItemCount: 5,
|
||||
itemBuilder: (context, index, animation) {
|
||||
return FadeTransition(
|
||||
opacity: animation,
|
||||
child: _buildItem(listData[index], index),
|
||||
child: _buildItem(listData[index]),
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -93,31 +101,15 @@ class _AnimatedListDemoState extends State<AnimatedListDemo> {
|
||||
}
|
||||
|
||||
class UserModel {
|
||||
const UserModel({this.firstName, this.lastName});
|
||||
UserModel(
|
||||
this.id,
|
||||
this.firstName,
|
||||
this.lastName,
|
||||
);
|
||||
|
||||
final int id;
|
||||
final String firstName;
|
||||
final String lastName;
|
||||
}
|
||||
|
||||
List<UserModel> initialListData = [
|
||||
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',
|
||||
),
|
||||
];
|
||||
int _maxIdValue = 4;
|
||||
|
||||
@@ -14,8 +14,8 @@ class AnimatedPositionedDemo extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _AnimatedPositionedDemoState extends State<AnimatedPositionedDemo> {
|
||||
double topPosition;
|
||||
double leftPosition;
|
||||
late double topPosition;
|
||||
late double leftPosition;
|
||||
|
||||
double generateTopPosition(double top) => Random().nextDouble() * top;
|
||||
|
||||
@@ -41,40 +41,38 @@ class _AnimatedPositionedDemoState extends State<AnimatedPositionedDemo> {
|
||||
final appBar = AppBar(title: Text('AnimatedPositioned'));
|
||||
final topPadding = MediaQuery.of(context).padding.top;
|
||||
// AnimatedPositioned animates changes to a widget's position within a Stack
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: appBar,
|
||||
body: Container(
|
||||
height: size.height,
|
||||
width: size.width,
|
||||
child: Stack(
|
||||
children: [
|
||||
AnimatedPositioned(
|
||||
top: topPosition,
|
||||
left: leftPosition,
|
||||
duration: Duration(seconds: 1),
|
||||
child: InkWell(
|
||||
onTap: () => changePosition(
|
||||
size.height -
|
||||
(appBar.preferredSize.height + topPadding + 50),
|
||||
size.width - 150),
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: 150,
|
||||
height: 50,
|
||||
child: Text(
|
||||
'Click Me',
|
||||
style: TextStyle(
|
||||
color:
|
||||
Theme.of(context).buttonTheme.colorScheme.onPrimary,
|
||||
),
|
||||
return Scaffold(
|
||||
appBar: appBar,
|
||||
body: Container(
|
||||
height: size.height,
|
||||
width: size.width,
|
||||
child: Stack(
|
||||
children: [
|
||||
AnimatedPositioned(
|
||||
top: topPosition,
|
||||
left: leftPosition,
|
||||
duration: Duration(seconds: 1),
|
||||
child: InkWell(
|
||||
onTap: () => changePosition(
|
||||
size.height -
|
||||
(appBar.preferredSize.height + topPadding + 50),
|
||||
size.width - 150),
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: 150,
|
||||
height: 50,
|
||||
child: Text(
|
||||
'Click Me',
|
||||
style: TextStyle(
|
||||
color:
|
||||
Theme.of(context).buttonTheme.colorScheme!.onPrimary,
|
||||
),
|
||||
color: Theme.of(context).primaryColor,
|
||||
),
|
||||
color: Theme.of(context).primaryColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -30,8 +30,8 @@ class AnimatedSwitcherDemo extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _AnimatedSwitcherDemoState extends State<AnimatedSwitcherDemo> {
|
||||
Widget container;
|
||||
int keyCount;
|
||||
late Widget container;
|
||||
late int keyCount;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -53,7 +53,7 @@ class _AnimatedSwitcherDemoState extends State<AnimatedSwitcherDemo> {
|
||||
child: Text(
|
||||
'Change Widget',
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).buttonTheme.colorScheme.onPrimary),
|
||||
color: Theme.of(context).buttonTheme.colorScheme!.onPrimary),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -15,7 +15,7 @@ class CardSwipeDemo extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _CardSwipeDemoState extends State<CardSwipeDemo> {
|
||||
List<String> fileNames;
|
||||
late List<String> fileNames;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -102,8 +102,8 @@ class SwipeableCard extends StatefulWidget {
|
||||
final VoidCallback onSwiped;
|
||||
|
||||
SwipeableCard({
|
||||
this.onSwiped,
|
||||
this.imageAssetName,
|
||||
required this.onSwiped,
|
||||
required this.imageAssetName,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -112,9 +112,9 @@ class SwipeableCard extends StatefulWidget {
|
||||
|
||||
class _SwipeableCardState extends State<SwipeableCard>
|
||||
with SingleTickerProviderStateMixin {
|
||||
AnimationController _controller;
|
||||
Animation<Offset> _animation;
|
||||
double _dragStartX;
|
||||
late AnimationController _controller;
|
||||
late Animation<Offset> _animation;
|
||||
late double _dragStartX;
|
||||
bool _isSwipingLeft = false;
|
||||
|
||||
@override
|
||||
@@ -155,18 +155,29 @@ class _SwipeableCardState extends State<SwipeableCard>
|
||||
}
|
||||
|
||||
setState(() {
|
||||
final size = context.size;
|
||||
|
||||
if (size == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Calculate the amount dragged in unit coordinates (between 0 and 1)
|
||||
// using this widgets width.
|
||||
_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
|
||||
/// gesture.
|
||||
void _dragEnd(DragEndDetails details) {
|
||||
var velocity =
|
||||
(details.velocity.pixelsPerSecond.dx / context.size.width).abs();
|
||||
final size = context.size;
|
||||
|
||||
if (size == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var velocity = (details.velocity.pixelsPerSecond.dx / size.width).abs();
|
||||
_animate(velocity: velocity);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,15 +46,15 @@ typedef OnCurrentItemChangedCallback = void Function(int currentItem);
|
||||
class Carousel extends StatefulWidget {
|
||||
final IndexedWidgetBuilder itemBuilder;
|
||||
|
||||
const Carousel({Key key, @required this.itemBuilder});
|
||||
const Carousel({Key? key, required this.itemBuilder}) : super(key: key);
|
||||
|
||||
@override
|
||||
_CarouselState createState() => _CarouselState();
|
||||
}
|
||||
|
||||
class _CarouselState extends State<Carousel> {
|
||||
PageController _controller;
|
||||
int _currentPage;
|
||||
late final PageController _controller;
|
||||
late int _currentPage;
|
||||
bool _pageHasChanged = false;
|
||||
|
||||
@override
|
||||
@@ -81,11 +81,11 @@ class _CarouselState extends State<Carousel> {
|
||||
itemBuilder: (context, index) => AnimatedBuilder(
|
||||
animation: _controller,
|
||||
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
|
||||
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(
|
||||
child: SizedBox(
|
||||
|
||||
@@ -15,14 +15,15 @@ class CurvedAnimationDemo extends StatefulWidget {
|
||||
class CurveChoice {
|
||||
final Curve curve;
|
||||
final String name;
|
||||
const CurveChoice({this.curve, this.name});
|
||||
|
||||
const CurveChoice({required this.curve, required this.name});
|
||||
}
|
||||
|
||||
class _CurvedAnimationDemoState extends State<CurvedAnimationDemo>
|
||||
with SingleTickerProviderStateMixin {
|
||||
AnimationController controller;
|
||||
Animation<double> animationRotation;
|
||||
Animation<Offset> animationTranslation;
|
||||
late final AnimationController controller;
|
||||
late final Animation<double> animationRotation;
|
||||
late final Animation<Offset> animationTranslation;
|
||||
static const _duration = Duration(seconds: 4);
|
||||
List<CurveChoice> curves = [
|
||||
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.easeOutCirc, name: 'Ease Out Circle'),
|
||||
];
|
||||
CurveChoice selectedForwardCurve, selectedReverseCurve;
|
||||
CurvedAnimation curvedAnimation;
|
||||
late CurveChoice selectedForwardCurve, selectedReverseCurve;
|
||||
late final CurvedAnimation curvedAnimation;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -100,10 +101,12 @@ class _CurvedAnimationDemoState extends State<CurvedAnimationDemo>
|
||||
value: curve, child: Text(curve.name));
|
||||
}).toList(),
|
||||
onChanged: (newCurve) {
|
||||
setState(() {
|
||||
selectedForwardCurve = newCurve;
|
||||
curvedAnimation.curve = selectedForwardCurve.curve;
|
||||
});
|
||||
if (newCurve != null) {
|
||||
setState(() {
|
||||
selectedForwardCurve = newCurve;
|
||||
curvedAnimation.curve = selectedForwardCurve.curve;
|
||||
});
|
||||
}
|
||||
},
|
||||
value: selectedForwardCurve,
|
||||
),
|
||||
@@ -118,10 +121,12 @@ class _CurvedAnimationDemoState extends State<CurvedAnimationDemo>
|
||||
value: curve, child: Text(curve.name));
|
||||
}).toList(),
|
||||
onChanged: (newCurve) {
|
||||
setState(() {
|
||||
selectedReverseCurve = newCurve;
|
||||
curvedAnimation.reverseCurve = selectedReverseCurve.curve;
|
||||
});
|
||||
if (newCurve != null) {
|
||||
setState(() {
|
||||
selectedReverseCurve = newCurve;
|
||||
curvedAnimation.reverseCurve = selectedReverseCurve.curve;
|
||||
});
|
||||
}
|
||||
},
|
||||
value: selectedReverseCurve,
|
||||
),
|
||||
|
||||
@@ -18,7 +18,7 @@ class HeroAnimationDemo extends StatelessWidget {
|
||||
tag: 'hero-page-child',
|
||||
child: _createHeroContainer(
|
||||
size: 50.0,
|
||||
color: Colors.grey[300],
|
||||
color: Colors.grey.shade300,
|
||||
),
|
||||
),
|
||||
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(
|
||||
height: size,
|
||||
width: size,
|
||||
|
||||
@@ -27,7 +27,7 @@ class PhysicsCardDragDemo extends StatelessWidget {
|
||||
/// released.
|
||||
class DraggableCard extends StatefulWidget {
|
||||
final Widget child;
|
||||
DraggableCard({this.child});
|
||||
DraggableCard({required this.child});
|
||||
|
||||
@override
|
||||
_DraggableCardState createState() => _DraggableCardState();
|
||||
@@ -35,7 +35,7 @@ class DraggableCard extends StatefulWidget {
|
||||
|
||||
class _DraggableCardState extends State<DraggableCard>
|
||||
with SingleTickerProviderStateMixin {
|
||||
AnimationController _controller;
|
||||
late final AnimationController _controller;
|
||||
|
||||
/// 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].
|
||||
var _dragAlignment = Alignment.center;
|
||||
|
||||
Animation<Alignment> _animation;
|
||||
late Animation<Alignment> _animation;
|
||||
|
||||
final _spring = const SpringDescription(
|
||||
mass: 10,
|
||||
|
||||
@@ -13,8 +13,8 @@ class RepeatingAnimationDemo extends StatefulWidget {
|
||||
|
||||
class RepeatingAnimationDemoState extends State<RepeatingAnimationDemo>
|
||||
with SingleTickerProviderStateMixin {
|
||||
AnimationController _controller;
|
||||
Animation<BorderRadius> _borderRadius;
|
||||
late final AnimationController _controller;
|
||||
late final Animation<BorderRadius> _borderRadius;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
||||
@@ -94,7 +94,7 @@ packages:
|
||||
name: pedantic
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.9.2"
|
||||
version: "1.10.0"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
|
||||
@@ -3,12 +3,12 @@ description: A new Flutter project.
|
||||
version: 1.0.0+1
|
||||
|
||||
environment:
|
||||
sdk: ">=2.10.0 <3.0.0"
|
||||
sdk: ">=2.12.0-0 <3.0.0"
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
cupertino_icons: ^1.0.0
|
||||
cupertino_icons: ^1.0.2
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
@@ -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 "Generated.xcconfig"
|
||||
|
||||
@@ -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 "Generated.xcconfig"
|
||||
|
||||
@@ -373,4 +373,4 @@ packages:
|
||||
version: "2.2.1"
|
||||
sdks:
|
||||
dart: ">=2.12.0-0.0 <3.0.0"
|
||||
flutter: ">=1.16.0 <2.0.0"
|
||||
flutter: ">=1.16.0"
|
||||
|
||||
@@ -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 "Generated.xcconfig"
|
||||
|
||||
@@ -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 "Generated.xcconfig"
|
||||
|
||||
@@ -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 "Generated.xcconfig"
|
||||
|
||||
@@ -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 "Generated.xcconfig"
|
||||
|
||||
@@ -38,7 +38,7 @@ class App extends StatelessWidget {
|
||||
}
|
||||
|
||||
class HomePage extends StatefulWidget {
|
||||
const HomePage({@required this.title});
|
||||
const HomePage({required this.title});
|
||||
|
||||
final String title;
|
||||
|
||||
@@ -49,7 +49,7 @@ class HomePage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _HomePageState extends State<HomePage> {
|
||||
Stream<QuerySnapshot> _iceCreamStores;
|
||||
late Stream<QuerySnapshot> _iceCreamStores;
|
||||
final Completer<GoogleMapController> _mapController = Completer();
|
||||
|
||||
@override
|
||||
@@ -80,13 +80,13 @@ class _HomePageState extends State<HomePage> {
|
||||
return Stack(
|
||||
children: [
|
||||
StoreMap(
|
||||
documents: snapshot.data.docs,
|
||||
documents: snapshot.data!.docs,
|
||||
initialPosition: initialPosition,
|
||||
mapController: _mapController,
|
||||
),
|
||||
StoreCarousel(
|
||||
mapController: _mapController,
|
||||
documents: snapshot.data.docs,
|
||||
documents: snapshot.data!.docs,
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -98,9 +98,9 @@ class _HomePageState extends State<HomePage> {
|
||||
|
||||
class StoreCarousel extends StatelessWidget {
|
||||
const StoreCarousel({
|
||||
Key key,
|
||||
@required this.documents,
|
||||
@required this.mapController,
|
||||
Key? key,
|
||||
required this.documents,
|
||||
required this.mapController,
|
||||
}) : super(key: key);
|
||||
|
||||
final List<DocumentSnapshot> documents;
|
||||
@@ -126,9 +126,9 @@ class StoreCarousel extends StatelessWidget {
|
||||
|
||||
class StoreCarouselList extends StatelessWidget {
|
||||
const StoreCarouselList({
|
||||
Key key,
|
||||
@required this.documents,
|
||||
@required this.mapController,
|
||||
Key? key,
|
||||
required this.documents,
|
||||
required this.mapController,
|
||||
}) : super(key: key);
|
||||
|
||||
final List<DocumentSnapshot> documents;
|
||||
@@ -161,9 +161,9 @@ class StoreCarouselList extends StatelessWidget {
|
||||
|
||||
class StoreListTile extends StatefulWidget {
|
||||
const StoreListTile({
|
||||
Key key,
|
||||
@required this.document,
|
||||
@required this.mapController,
|
||||
Key? key,
|
||||
required this.document,
|
||||
required this.mapController,
|
||||
}) : super(key: key);
|
||||
|
||||
final DocumentSnapshot document;
|
||||
@@ -239,10 +239,10 @@ class _StoreListTileState extends State<StoreListTile> {
|
||||
|
||||
class StoreMap extends StatelessWidget {
|
||||
const StoreMap({
|
||||
Key key,
|
||||
@required this.documents,
|
||||
@required this.initialPosition,
|
||||
@required this.mapController,
|
||||
Key? key,
|
||||
required this.documents,
|
||||
required this.initialPosition,
|
||||
required this.mapController,
|
||||
}) : super(key: key);
|
||||
|
||||
final List<DocumentSnapshot> documents;
|
||||
@@ -265,8 +265,8 @@ class StoreMap extends StatelessWidget {
|
||||
document['location'].longitude as double,
|
||||
),
|
||||
infoWindow: InfoWindow(
|
||||
title: document['name'] as String,
|
||||
snippet: document['address'] as String,
|
||||
title: document['name'] as String?,
|
||||
snippet: document['address'] as String?,
|
||||
),
|
||||
))
|
||||
.toSet(),
|
||||
|
||||
@@ -3,21 +3,21 @@ description: A new Flutter project.
|
||||
version: 1.0.0+1
|
||||
|
||||
environment:
|
||||
sdk: ">=2.10.0 <3.0.0"
|
||||
sdk: ">=2.12.0-0 <3.0.0"
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
cloud_firestore: ^0.16.0
|
||||
firebase_core: ^0.7.0
|
||||
google_maps_flutter: ^1.2.0
|
||||
google_maps_webservice: ^0.0.19
|
||||
location: ^3.0.2
|
||||
cloud_firestore: ^0.17.0-1.0.nullsafety.2
|
||||
firebase_core: ^0.8.0-1.0.nullsafety.2
|
||||
google_maps_flutter: ^2.0.0
|
||||
google_maps_webservice: ^0.0.20-nullsafety.0
|
||||
location: ^4.0.0-nullsafety.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
pedantic: ^1.9.0
|
||||
pedantic: ^1.10.0
|
||||
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
@@ -32,7 +32,7 @@ class MyHomePage extends StatelessWidget {
|
||||
appBar: AppBar(
|
||||
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
|
||||
// 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
|
||||
|
||||
@@ -12,9 +12,9 @@ class Item {
|
||||
final String name;
|
||||
|
||||
Item({
|
||||
@required this.color,
|
||||
@required this.name,
|
||||
@required this.price,
|
||||
required this.color,
|
||||
required this.name,
|
||||
required this.price,
|
||||
});
|
||||
|
||||
Item.loading() : this(color: Colors.grey, name: '...', price: 0);
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
import 'item.dart';
|
||||
|
||||
const int itemsPerPage = 20;
|
||||
@@ -17,8 +14,8 @@ class ItemPage {
|
||||
final bool hasNext;
|
||||
|
||||
ItemPage({
|
||||
@required this.items,
|
||||
@required this.startingIndex,
|
||||
@required this.hasNext,
|
||||
required this.items,
|
||||
required this.startingIndex,
|
||||
required this.hasNext,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class Catalog extends ChangeNotifier {
|
||||
|
||||
/// 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.
|
||||
int itemCount;
|
||||
int? itemCount;
|
||||
|
||||
/// After the catalog is disposed, we don't allow it to call
|
||||
/// [notifyListeners].
|
||||
@@ -62,7 +62,7 @@ class Catalog extends ChangeNotifier {
|
||||
|
||||
// If the corresponding page is already in memory, return immediately.
|
||||
if (_pages.containsKey(startingIndex)) {
|
||||
var item = _pages[startingIndex].items[index - startingIndex];
|
||||
var item = _pages[startingIndex]!.items[index - startingIndex];
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import 'api/item.dart';
|
||||
class ItemTile extends StatelessWidget {
|
||||
final Item item;
|
||||
|
||||
ItemTile({@required this.item, Key key}) : super(key: key);
|
||||
ItemTile({required this.item, Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -34,7 +34,7 @@ class ItemTile extends StatelessWidget {
|
||||
/// This is the widget responsible for building the "still loading" item
|
||||
/// in the list (represented with "..." and a crossed square).
|
||||
class LoadingItemTile extends StatelessWidget {
|
||||
const LoadingItemTile({Key key}) : super(key: key);
|
||||
const LoadingItemTile({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@@ -7,56 +7,56 @@ packages:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.5.0-nullsafety.1"
|
||||
version: "2.5.0"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.1"
|
||||
version: "2.1.0"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.3"
|
||||
version: "1.1.0"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: clock
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.1"
|
||||
version: "1.1.0"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.15.0-nullsafety.3"
|
||||
version: "1.15.0"
|
||||
cupertino_icons:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: cupertino_icons
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
version: "1.0.2"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fake_async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@@ -73,42 +73,42 @@ packages:
|
||||
name: matcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.10-nullsafety.1"
|
||||
version: "0.12.10"
|
||||
meta:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: meta
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.3"
|
||||
version: "1.3.0"
|
||||
nested:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: nested
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.0.4"
|
||||
version: "0.0.5-nullsafety.1"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.1"
|
||||
version: "1.8.0"
|
||||
pedantic:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: pedantic
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.9.2"
|
||||
version: "1.10.0"
|
||||
provider:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: provider
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.3.2+3"
|
||||
version: "5.0.0-nullsafety.3"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
@@ -120,56 +120,56 @@ packages:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.2"
|
||||
version: "1.8.0"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.10.0-nullsafety.1"
|
||||
version: "1.10.0"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.1"
|
||||
version: "2.1.0"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.1"
|
||||
version: "1.1.0"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.19-nullsafety.2"
|
||||
version: "0.2.19"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.3"
|
||||
version: "1.3.0"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.3"
|
||||
version: "2.1.0"
|
||||
sdks:
|
||||
dart: ">=2.10.0 <2.11.0"
|
||||
dart: ">=2.12.0-0.0 <3.0.0"
|
||||
flutter: ">=1.16.0"
|
||||
|
||||
@@ -5,21 +5,21 @@ description: >
|
||||
version: 1.0.0+1
|
||||
|
||||
environment:
|
||||
sdk: ">=2.10.0 <3.0.0"
|
||||
sdk: '>=2.12.0-0 <3.0.0'
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
|
||||
cupertino_icons: ^1.0.0
|
||||
meta: ^1.1.8
|
||||
provider: ^4.0.0
|
||||
cupertino_icons: ^1.0.2
|
||||
meta: ^1.3.0
|
||||
provider: ^5.0.0-nullsafety.3
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
|
||||
pedantic: ^1.9.0
|
||||
pedantic: ^1.10.0
|
||||
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
@@ -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 "Generated.xcconfig"
|
||||
|
||||
|
||||
@@ -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 "Generated.xcconfig"
|
||||
|
||||
@@ -7,42 +7,42 @@ packages:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.5.0-nullsafety.1"
|
||||
version: "2.5.0-nullsafety.3"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.1"
|
||||
version: "2.1.0-nullsafety.3"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.3"
|
||||
version: "1.1.0-nullsafety.5"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0-nullsafety.3"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: clock
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.1"
|
||||
version: "1.1.0-nullsafety.3"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.15.0-nullsafety.3"
|
||||
version: "1.15.0-nullsafety.5"
|
||||
cupertino_icons:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -70,7 +70,7 @@ packages:
|
||||
name: fake_async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0-nullsafety.3"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@@ -87,21 +87,21 @@ packages:
|
||||
name: matcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.10-nullsafety.1"
|
||||
version: "0.12.10-nullsafety.3"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.3"
|
||||
version: "1.3.0-nullsafety.6"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.1"
|
||||
version: "1.8.0-nullsafety.3"
|
||||
plugin_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -120,56 +120,56 @@ packages:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.2"
|
||||
version: "1.8.0-nullsafety.4"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.10.0-nullsafety.1"
|
||||
version: "1.10.0-nullsafety.6"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.1"
|
||||
version: "2.1.0-nullsafety.3"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.1"
|
||||
version: "1.1.0-nullsafety.3"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0-nullsafety.3"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.19-nullsafety.2"
|
||||
version: "0.2.19-nullsafety.6"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.3"
|
||||
version: "1.3.0-nullsafety.5"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.3"
|
||||
version: "2.1.0-nullsafety.5"
|
||||
sdks:
|
||||
dart: ">=2.10.0-110 <2.11.0"
|
||||
flutter: ">=1.12.13+hotfix.5 <2.0.0"
|
||||
dart: ">=2.12.0-0.0 <3.0.0"
|
||||
flutter: ">=1.12.13+hotfix.5"
|
||||
|
||||
@@ -9,11 +9,7 @@
|
||||
/* Begin PBXBuildFile section */
|
||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||
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 */; };
|
||||
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 */; };
|
||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
||||
@@ -26,8 +22,6 @@
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
|
||||
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -38,13 +32,11 @@
|
||||
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>"; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
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; };
|
||||
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>"; };
|
||||
@@ -57,8 +49,6 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
|
||||
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -68,9 +58,7 @@
|
||||
9740EEB11CF90186004384FC /* Flutter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3B80C3931E831B6300D905FE /* App.framework */,
|
||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
|
||||
9740EEBA1CF902C7004384FC /* Flutter.framework */,
|
||||
9740EEB21CF90195004384FC /* Debug.xcconfig */,
|
||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
|
||||
9740EEB31CF90195004384FC /* Generated.xcconfig */,
|
||||
@@ -201,7 +189,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
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 */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
@@ -253,7 +241,6 @@
|
||||
/* Begin XCBuildConfiguration section */
|
||||
249021D3217E4FDB00AE95B9 /* Profile */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
@@ -330,7 +317,6 @@
|
||||
};
|
||||
97C147031CF9000F007C117D /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
@@ -386,7 +372,6 @@
|
||||
};
|
||||
97C147041CF9000F007C117D /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:Runner.xcodeproj">
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
||||
@@ -87,17 +87,15 @@ class DataTransferPage extends StatelessWidget {
|
||||
}
|
||||
|
||||
class DataTransferIsolateController extends ChangeNotifier {
|
||||
Isolate _isolate;
|
||||
ReceivePort _incomingReceivePort;
|
||||
SendPort _outgoingSendPort;
|
||||
Isolate? _isolate;
|
||||
late ReceivePort _incomingReceivePort;
|
||||
late SendPort _outgoingSendPort;
|
||||
|
||||
final currentProgress = <String>[];
|
||||
int runningTest = 0;
|
||||
Stopwatch _timer = Stopwatch();
|
||||
double progressPercent = 0;
|
||||
|
||||
Isolate get newIsolate => _isolate;
|
||||
|
||||
bool get running => runningTest != 0;
|
||||
|
||||
DataTransferIsolateController() {
|
||||
@@ -262,7 +260,7 @@ Iterable<int> createNums() sync* {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> generateAndSum(
|
||||
Future<int> generateAndSum(
|
||||
SendPort callerSP,
|
||||
Iterable<int> iter,
|
||||
int length,
|
||||
|
||||
@@ -86,7 +86,7 @@ class InfiniteProcessPage extends StatelessWidget {
|
||||
Radio<int>(
|
||||
value: i,
|
||||
groupValue: controller.currentMultiplier,
|
||||
onChanged: (val) => controller.setMultiplier(val),
|
||||
onChanged: (val) => controller.setMultiplier(val!),
|
||||
),
|
||||
Text('${i}x')
|
||||
],
|
||||
@@ -101,10 +101,10 @@ class InfiniteProcessPage extends StatelessWidget {
|
||||
}
|
||||
|
||||
class InfiniteProcessIsolateController extends ChangeNotifier {
|
||||
Isolate newIsolate;
|
||||
ReceivePort receivePort;
|
||||
SendPort newIceSP;
|
||||
Capability capability;
|
||||
Isolate? newIsolate;
|
||||
late ReceivePort receivePort;
|
||||
late SendPort newIceSP;
|
||||
Capability? capability;
|
||||
|
||||
int _currentMultiplier = 1;
|
||||
final List<int> _currentResults = [];
|
||||
@@ -146,17 +146,17 @@ class InfiniteProcessIsolateController extends ChangeNotifier {
|
||||
}
|
||||
|
||||
void terminate() {
|
||||
newIsolate.kill();
|
||||
newIsolate?.kill();
|
||||
_created = false;
|
||||
_currentResults.clear();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void pausedSwitch() {
|
||||
if (_paused) {
|
||||
newIsolate.resume(capability);
|
||||
if (_paused && capability != null) {
|
||||
newIsolate?.resume(capability!);
|
||||
} else {
|
||||
capability = newIsolate.pause();
|
||||
capability = newIsolate?.pause();
|
||||
}
|
||||
|
||||
_paused = !_paused;
|
||||
|
||||
@@ -88,7 +88,7 @@ class _PerformancePageState extends State<PerformancePage> {
|
||||
var snackBar = SnackBar(
|
||||
content: Text('Main Isolate Done!'),
|
||||
);
|
||||
Scaffold.of(context).showSnackBar(snackBar);
|
||||
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
||||
});
|
||||
|
||||
setState(() {
|
||||
@@ -102,7 +102,7 @@ class _PerformancePageState extends State<PerformancePage> {
|
||||
var snackBar = SnackBar(
|
||||
content: Text('Secondary Isolate Done!'),
|
||||
);
|
||||
Scaffold.of(context).showSnackBar(snackBar);
|
||||
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
||||
});
|
||||
|
||||
setState(() {
|
||||
@@ -131,8 +131,8 @@ class SmoothAnimationWidget extends StatefulWidget {
|
||||
|
||||
class SmoothAnimationWidgetState extends State<SmoothAnimationWidget>
|
||||
with TickerProviderStateMixin {
|
||||
AnimationController _animationController;
|
||||
Animation<BorderRadius> _borderAnimation;
|
||||
late final AnimationController _animationController;
|
||||
late final Animation<BorderRadius> _borderAnimation;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
||||
@@ -7,49 +7,49 @@ packages:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.5.0-nullsafety.1"
|
||||
version: "2.5.0"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.1"
|
||||
version: "2.1.0"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.3"
|
||||
version: "1.1.0"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: clock
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.1"
|
||||
version: "1.1.0"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.15.0-nullsafety.3"
|
||||
version: "1.15.0"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fake_async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@@ -66,42 +66,42 @@ packages:
|
||||
name: matcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.10-nullsafety.1"
|
||||
version: "0.12.10"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.3"
|
||||
version: "1.3.0"
|
||||
nested:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: nested
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.0.4"
|
||||
version: "1.0.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.1"
|
||||
version: "1.8.0"
|
||||
pedantic:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: pedantic
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.9.2"
|
||||
version: "1.10.0"
|
||||
provider:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: provider
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.3.2+3"
|
||||
version: "5.0.0-nullsafety.5"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
@@ -113,56 +113,56 @@ packages:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.2"
|
||||
version: "1.8.0"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.10.0-nullsafety.1"
|
||||
version: "1.10.0"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.1"
|
||||
version: "2.1.0"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.1"
|
||||
version: "1.1.0"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.19-nullsafety.2"
|
||||
version: "0.2.19"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.3"
|
||||
version: "1.3.0"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.3"
|
||||
version: "2.1.0"
|
||||
sdks:
|
||||
dart: ">=2.10.0-110 <2.11.0"
|
||||
dart: ">=2.12.0-0.0 <3.0.0"
|
||||
flutter: ">=1.16.0"
|
||||
|
||||
@@ -3,17 +3,17 @@ description: A Flutter sample to demonstrate isolates
|
||||
version: 1.0.0+1
|
||||
|
||||
environment:
|
||||
sdk: ">=2.5.0 <3.0.0"
|
||||
sdk: ">=2.12.0-0 <3.0.0"
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
provider: ^4.0.5
|
||||
provider: ^5.0.0-0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
pedantic: ^1.9.0
|
||||
pedantic: ^1.10.0
|
||||
|
||||
|
||||
flutter:
|
||||
|
||||
@@ -15,7 +15,5 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('This test will always pass', (tester) async {
|
||||
return true;
|
||||
});
|
||||
testWidgets('This test will always pass', (tester) async {});
|
||||
}
|
||||
|
||||
@@ -9,11 +9,7 @@
|
||||
/* Begin PBXBuildFile section */
|
||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||
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 */; };
|
||||
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 */; };
|
||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
||||
@@ -26,8 +22,6 @@
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
|
||||
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -38,13 +32,11 @@
|
||||
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>"; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
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; };
|
||||
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>"; };
|
||||
@@ -57,8 +49,6 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
|
||||
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -68,9 +58,7 @@
|
||||
9740EEB11CF90186004384FC /* Flutter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3B80C3931E831B6300D905FE /* App.framework */,
|
||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
|
||||
9740EEBA1CF902C7004384FC /* Flutter.framework */,
|
||||
9740EEB21CF90195004384FC /* Debug.xcconfig */,
|
||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
|
||||
9740EEB31CF90195004384FC /* Generated.xcconfig */,
|
||||
@@ -201,7 +189,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
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 */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
@@ -253,7 +241,6 @@
|
||||
/* Begin XCBuildConfiguration section */
|
||||
249021D3217E4FDB00AE95B9 /* Profile */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
@@ -330,7 +317,6 @@
|
||||
};
|
||||
97C147031CF9000F007C117D /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
@@ -386,7 +372,6 @@
|
||||
};
|
||||
97C147041CF9000F007C117D /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:Runner.xcodeproj">
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
||||
@@ -14,29 +14,21 @@ abstract class BuiltComplexObject
|
||||
static Serializer<BuiltComplexObject> get serializer =>
|
||||
_$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._();
|
||||
|
||||
|
||||
@@ -20,55 +20,63 @@ class _$BuiltComplexObjectSerializer
|
||||
Iterable<Object> serialize(Serializers serializers, BuiltComplexObject object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object>[];
|
||||
if (object.aString != null) {
|
||||
Object? value;
|
||||
value = object.aString;
|
||||
if (value != null) {
|
||||
result
|
||||
..add('aString')
|
||||
..add(serializers.serialize(object.aString,
|
||||
..add(serializers.serialize(value,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.anInt != null) {
|
||||
value = object.anInt;
|
||||
if (value != null) {
|
||||
result
|
||||
..add('anInt')
|
||||
..add(serializers.serialize(object.anInt,
|
||||
specifiedType: const FullType(int)));
|
||||
..add(serializers.serialize(value, specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.aDouble != null) {
|
||||
value = object.aDouble;
|
||||
if (value != null) {
|
||||
result
|
||||
..add('aDouble')
|
||||
..add(serializers.serialize(object.aDouble,
|
||||
..add(serializers.serialize(value,
|
||||
specifiedType: const FullType(double)));
|
||||
}
|
||||
if (object.anObject != null) {
|
||||
value = object.anObject;
|
||||
if (value != null) {
|
||||
result
|
||||
..add('anObject')
|
||||
..add(serializers.serialize(object.anObject,
|
||||
..add(serializers.serialize(value,
|
||||
specifiedType: const FullType(BuiltSimpleObject)));
|
||||
}
|
||||
if (object.aListOfStrings != null) {
|
||||
value = object.aListOfStrings;
|
||||
if (value != null) {
|
||||
result
|
||||
..add('aListOfStrings')
|
||||
..add(serializers.serialize(object.aListOfStrings,
|
||||
..add(serializers.serialize(value,
|
||||
specifiedType:
|
||||
const FullType(BuiltList, const [const FullType(String)])));
|
||||
}
|
||||
if (object.aListOfInts != null) {
|
||||
value = object.aListOfInts;
|
||||
if (value != null) {
|
||||
result
|
||||
..add('aListOfInts')
|
||||
..add(serializers.serialize(object.aListOfInts,
|
||||
..add(serializers.serialize(value,
|
||||
specifiedType:
|
||||
const FullType(BuiltList, const [const FullType(int)])));
|
||||
}
|
||||
if (object.aListOfDoubles != null) {
|
||||
value = object.aListOfDoubles;
|
||||
if (value != null) {
|
||||
result
|
||||
..add('aListOfDoubles')
|
||||
..add(serializers.serialize(object.aListOfDoubles,
|
||||
..add(serializers.serialize(value,
|
||||
specifiedType:
|
||||
const FullType(BuiltList, const [const FullType(double)])));
|
||||
}
|
||||
if (object.aListOfObjects != null) {
|
||||
value = object.aListOfObjects;
|
||||
if (value != null) {
|
||||
result
|
||||
..add('aListOfObjects')
|
||||
..add(serializers.serialize(object.aListOfObjects,
|
||||
..add(serializers.serialize(value,
|
||||
specifiedType: const FullType(
|
||||
BuiltList, const [const FullType(BuiltSimpleObject)])));
|
||||
}
|
||||
@@ -85,7 +93,7 @@ class _$BuiltComplexObjectSerializer
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final dynamic value = iterator.current;
|
||||
final Object value = iterator.current;
|
||||
switch (key) {
|
||||
case 'aString':
|
||||
result.aString = serializers.deserialize(value,
|
||||
@@ -137,24 +145,24 @@ class _$BuiltComplexObjectSerializer
|
||||
|
||||
class _$BuiltComplexObject extends BuiltComplexObject {
|
||||
@override
|
||||
final String aString;
|
||||
final String? aString;
|
||||
@override
|
||||
final int anInt;
|
||||
final int? anInt;
|
||||
@override
|
||||
final double aDouble;
|
||||
final double? aDouble;
|
||||
@override
|
||||
final BuiltSimpleObject anObject;
|
||||
final BuiltSimpleObject? anObject;
|
||||
@override
|
||||
final BuiltList<String> aListOfStrings;
|
||||
final BuiltList<String>? aListOfStrings;
|
||||
@override
|
||||
final BuiltList<int> aListOfInts;
|
||||
final BuiltList<int>? aListOfInts;
|
||||
@override
|
||||
final BuiltList<double> aListOfDoubles;
|
||||
final BuiltList<double>? aListOfDoubles;
|
||||
@override
|
||||
final BuiltList<BuiltSimpleObject> aListOfObjects;
|
||||
final BuiltList<BuiltSimpleObject>? aListOfObjects;
|
||||
|
||||
factory _$BuiltComplexObject(
|
||||
[void Function(BuiltComplexObjectBuilder) updates]) =>
|
||||
[void Function(BuiltComplexObjectBuilder)? updates]) =>
|
||||
(new BuiltComplexObjectBuilder()..update(updates)).build();
|
||||
|
||||
_$BuiltComplexObject._(
|
||||
@@ -224,62 +232,63 @@ class _$BuiltComplexObject extends BuiltComplexObject {
|
||||
|
||||
class BuiltComplexObjectBuilder
|
||||
implements Builder<BuiltComplexObject, BuiltComplexObjectBuilder> {
|
||||
_$BuiltComplexObject _$v;
|
||||
_$BuiltComplexObject? _$v;
|
||||
|
||||
String _aString;
|
||||
String get aString => _$this._aString;
|
||||
set aString(String aString) => _$this._aString = aString;
|
||||
String? _aString;
|
||||
String? get aString => _$this._aString;
|
||||
set aString(String? aString) => _$this._aString = aString;
|
||||
|
||||
int _anInt;
|
||||
int get anInt => _$this._anInt;
|
||||
set anInt(int anInt) => _$this._anInt = anInt;
|
||||
int? _anInt;
|
||||
int? get anInt => _$this._anInt;
|
||||
set anInt(int? anInt) => _$this._anInt = anInt;
|
||||
|
||||
double _aDouble;
|
||||
double get aDouble => _$this._aDouble;
|
||||
set aDouble(double aDouble) => _$this._aDouble = aDouble;
|
||||
double? _aDouble;
|
||||
double? get aDouble => _$this._aDouble;
|
||||
set aDouble(double? aDouble) => _$this._aDouble = aDouble;
|
||||
|
||||
BuiltSimpleObjectBuilder _anObject;
|
||||
BuiltSimpleObjectBuilder? _anObject;
|
||||
BuiltSimpleObjectBuilder get anObject =>
|
||||
_$this._anObject ??= new BuiltSimpleObjectBuilder();
|
||||
set anObject(BuiltSimpleObjectBuilder anObject) =>
|
||||
set anObject(BuiltSimpleObjectBuilder? anObject) =>
|
||||
_$this._anObject = anObject;
|
||||
|
||||
ListBuilder<String> _aListOfStrings;
|
||||
ListBuilder<String>? _aListOfStrings;
|
||||
ListBuilder<String> get aListOfStrings =>
|
||||
_$this._aListOfStrings ??= new ListBuilder<String>();
|
||||
set aListOfStrings(ListBuilder<String> aListOfStrings) =>
|
||||
set aListOfStrings(ListBuilder<String>? aListOfStrings) =>
|
||||
_$this._aListOfStrings = aListOfStrings;
|
||||
|
||||
ListBuilder<int> _aListOfInts;
|
||||
ListBuilder<int>? _aListOfInts;
|
||||
ListBuilder<int> get aListOfInts =>
|
||||
_$this._aListOfInts ??= new ListBuilder<int>();
|
||||
set aListOfInts(ListBuilder<int> aListOfInts) =>
|
||||
set aListOfInts(ListBuilder<int>? aListOfInts) =>
|
||||
_$this._aListOfInts = aListOfInts;
|
||||
|
||||
ListBuilder<double> _aListOfDoubles;
|
||||
ListBuilder<double>? _aListOfDoubles;
|
||||
ListBuilder<double> get aListOfDoubles =>
|
||||
_$this._aListOfDoubles ??= new ListBuilder<double>();
|
||||
set aListOfDoubles(ListBuilder<double> aListOfDoubles) =>
|
||||
set aListOfDoubles(ListBuilder<double>? aListOfDoubles) =>
|
||||
_$this._aListOfDoubles = aListOfDoubles;
|
||||
|
||||
ListBuilder<BuiltSimpleObject> _aListOfObjects;
|
||||
ListBuilder<BuiltSimpleObject>? _aListOfObjects;
|
||||
ListBuilder<BuiltSimpleObject> get aListOfObjects =>
|
||||
_$this._aListOfObjects ??= new ListBuilder<BuiltSimpleObject>();
|
||||
set aListOfObjects(ListBuilder<BuiltSimpleObject> aListOfObjects) =>
|
||||
set aListOfObjects(ListBuilder<BuiltSimpleObject>? aListOfObjects) =>
|
||||
_$this._aListOfObjects = aListOfObjects;
|
||||
|
||||
BuiltComplexObjectBuilder();
|
||||
|
||||
BuiltComplexObjectBuilder get _$this {
|
||||
if (_$v != null) {
|
||||
_aString = _$v.aString;
|
||||
_anInt = _$v.anInt;
|
||||
_aDouble = _$v.aDouble;
|
||||
_anObject = _$v.anObject?.toBuilder();
|
||||
_aListOfStrings = _$v.aListOfStrings?.toBuilder();
|
||||
_aListOfInts = _$v.aListOfInts?.toBuilder();
|
||||
_aListOfDoubles = _$v.aListOfDoubles?.toBuilder();
|
||||
_aListOfObjects = _$v.aListOfObjects?.toBuilder();
|
||||
final $v = _$v;
|
||||
if ($v != null) {
|
||||
_aString = $v.aString;
|
||||
_anInt = $v.anInt;
|
||||
_aDouble = $v.aDouble;
|
||||
_anObject = $v.anObject?.toBuilder();
|
||||
_aListOfStrings = $v.aListOfStrings?.toBuilder();
|
||||
_aListOfInts = $v.aListOfInts?.toBuilder();
|
||||
_aListOfDoubles = $v.aListOfDoubles?.toBuilder();
|
||||
_aListOfObjects = $v.aListOfObjects?.toBuilder();
|
||||
_$v = null;
|
||||
}
|
||||
return this;
|
||||
@@ -287,14 +296,12 @@ class BuiltComplexObjectBuilder
|
||||
|
||||
@override
|
||||
void replace(BuiltComplexObject other) {
|
||||
if (other == null) {
|
||||
throw new ArgumentError.notNull('other');
|
||||
}
|
||||
ArgumentError.checkNotNull(other, 'other');
|
||||
_$v = other as _$BuiltComplexObject;
|
||||
}
|
||||
|
||||
@override
|
||||
void update(void Function(BuiltComplexObjectBuilder) updates) {
|
||||
void update(void Function(BuiltComplexObjectBuilder)? updates) {
|
||||
if (updates != null) updates(this);
|
||||
}
|
||||
|
||||
@@ -313,7 +320,7 @@ class BuiltComplexObjectBuilder
|
||||
aListOfDoubles: _aListOfDoubles?.build(),
|
||||
aListOfObjects: _aListOfObjects?.build());
|
||||
} catch (_) {
|
||||
String _$failedField;
|
||||
late String _$failedField;
|
||||
try {
|
||||
_$failedField = 'anObject';
|
||||
_anObject?.build();
|
||||
|
||||
@@ -13,23 +13,17 @@ abstract class BuiltSimpleObject
|
||||
static Serializer<BuiltSimpleObject> get serializer =>
|
||||
_$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._();
|
||||
|
||||
|
||||
@@ -20,42 +20,48 @@ class _$BuiltSimpleObjectSerializer
|
||||
Iterable<Object> serialize(Serializers serializers, BuiltSimpleObject object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object>[];
|
||||
if (object.aString != null) {
|
||||
Object? value;
|
||||
value = object.aString;
|
||||
if (value != null) {
|
||||
result
|
||||
..add('aString')
|
||||
..add(serializers.serialize(object.aString,
|
||||
..add(serializers.serialize(value,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.anInt != null) {
|
||||
value = object.anInt;
|
||||
if (value != null) {
|
||||
result
|
||||
..add('anInt')
|
||||
..add(serializers.serialize(object.anInt,
|
||||
specifiedType: const FullType(int)));
|
||||
..add(serializers.serialize(value, specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.aDouble != null) {
|
||||
value = object.aDouble;
|
||||
if (value != null) {
|
||||
result
|
||||
..add('aDouble')
|
||||
..add(serializers.serialize(object.aDouble,
|
||||
..add(serializers.serialize(value,
|
||||
specifiedType: const FullType(double)));
|
||||
}
|
||||
if (object.aListOfStrings != null) {
|
||||
value = object.aListOfStrings;
|
||||
if (value != null) {
|
||||
result
|
||||
..add('aListOfStrings')
|
||||
..add(serializers.serialize(object.aListOfStrings,
|
||||
..add(serializers.serialize(value,
|
||||
specifiedType:
|
||||
const FullType(BuiltList, const [const FullType(String)])));
|
||||
}
|
||||
if (object.aListOfInts != null) {
|
||||
value = object.aListOfInts;
|
||||
if (value != null) {
|
||||
result
|
||||
..add('aListOfInts')
|
||||
..add(serializers.serialize(object.aListOfInts,
|
||||
..add(serializers.serialize(value,
|
||||
specifiedType:
|
||||
const FullType(BuiltList, const [const FullType(int)])));
|
||||
}
|
||||
if (object.aListOfDoubles != null) {
|
||||
value = object.aListOfDoubles;
|
||||
if (value != null) {
|
||||
result
|
||||
..add('aListOfDoubles')
|
||||
..add(serializers.serialize(object.aListOfDoubles,
|
||||
..add(serializers.serialize(value,
|
||||
specifiedType:
|
||||
const FullType(BuiltList, const [const FullType(double)])));
|
||||
}
|
||||
@@ -72,7 +78,7 @@ class _$BuiltSimpleObjectSerializer
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final dynamic value = iterator.current;
|
||||
final Object value = iterator.current;
|
||||
switch (key) {
|
||||
case 'aString':
|
||||
result.aString = serializers.deserialize(value,
|
||||
@@ -113,20 +119,20 @@ class _$BuiltSimpleObjectSerializer
|
||||
|
||||
class _$BuiltSimpleObject extends BuiltSimpleObject {
|
||||
@override
|
||||
final String aString;
|
||||
final String? aString;
|
||||
@override
|
||||
final int anInt;
|
||||
final int? anInt;
|
||||
@override
|
||||
final double aDouble;
|
||||
final double? aDouble;
|
||||
@override
|
||||
final BuiltList<String> aListOfStrings;
|
||||
final BuiltList<String>? aListOfStrings;
|
||||
@override
|
||||
final BuiltList<int> aListOfInts;
|
||||
final BuiltList<int>? aListOfInts;
|
||||
@override
|
||||
final BuiltList<double> aListOfDoubles;
|
||||
final BuiltList<double>? aListOfDoubles;
|
||||
|
||||
factory _$BuiltSimpleObject(
|
||||
[void Function(BuiltSimpleObjectBuilder) updates]) =>
|
||||
[void Function(BuiltSimpleObjectBuilder)? updates]) =>
|
||||
(new BuiltSimpleObjectBuilder()..update(updates)).build();
|
||||
|
||||
_$BuiltSimpleObject._(
|
||||
@@ -185,48 +191,49 @@ class _$BuiltSimpleObject extends BuiltSimpleObject {
|
||||
|
||||
class BuiltSimpleObjectBuilder
|
||||
implements Builder<BuiltSimpleObject, BuiltSimpleObjectBuilder> {
|
||||
_$BuiltSimpleObject _$v;
|
||||
_$BuiltSimpleObject? _$v;
|
||||
|
||||
String _aString;
|
||||
String get aString => _$this._aString;
|
||||
set aString(String aString) => _$this._aString = aString;
|
||||
String? _aString;
|
||||
String? get aString => _$this._aString;
|
||||
set aString(String? aString) => _$this._aString = aString;
|
||||
|
||||
int _anInt;
|
||||
int get anInt => _$this._anInt;
|
||||
set anInt(int anInt) => _$this._anInt = anInt;
|
||||
int? _anInt;
|
||||
int? get anInt => _$this._anInt;
|
||||
set anInt(int? anInt) => _$this._anInt = anInt;
|
||||
|
||||
double _aDouble;
|
||||
double get aDouble => _$this._aDouble;
|
||||
set aDouble(double aDouble) => _$this._aDouble = aDouble;
|
||||
double? _aDouble;
|
||||
double? get aDouble => _$this._aDouble;
|
||||
set aDouble(double? aDouble) => _$this._aDouble = aDouble;
|
||||
|
||||
ListBuilder<String> _aListOfStrings;
|
||||
ListBuilder<String>? _aListOfStrings;
|
||||
ListBuilder<String> get aListOfStrings =>
|
||||
_$this._aListOfStrings ??= new ListBuilder<String>();
|
||||
set aListOfStrings(ListBuilder<String> aListOfStrings) =>
|
||||
set aListOfStrings(ListBuilder<String>? aListOfStrings) =>
|
||||
_$this._aListOfStrings = aListOfStrings;
|
||||
|
||||
ListBuilder<int> _aListOfInts;
|
||||
ListBuilder<int>? _aListOfInts;
|
||||
ListBuilder<int> get aListOfInts =>
|
||||
_$this._aListOfInts ??= new ListBuilder<int>();
|
||||
set aListOfInts(ListBuilder<int> aListOfInts) =>
|
||||
set aListOfInts(ListBuilder<int>? aListOfInts) =>
|
||||
_$this._aListOfInts = aListOfInts;
|
||||
|
||||
ListBuilder<double> _aListOfDoubles;
|
||||
ListBuilder<double>? _aListOfDoubles;
|
||||
ListBuilder<double> get aListOfDoubles =>
|
||||
_$this._aListOfDoubles ??= new ListBuilder<double>();
|
||||
set aListOfDoubles(ListBuilder<double> aListOfDoubles) =>
|
||||
set aListOfDoubles(ListBuilder<double>? aListOfDoubles) =>
|
||||
_$this._aListOfDoubles = aListOfDoubles;
|
||||
|
||||
BuiltSimpleObjectBuilder();
|
||||
|
||||
BuiltSimpleObjectBuilder get _$this {
|
||||
if (_$v != null) {
|
||||
_aString = _$v.aString;
|
||||
_anInt = _$v.anInt;
|
||||
_aDouble = _$v.aDouble;
|
||||
_aListOfStrings = _$v.aListOfStrings?.toBuilder();
|
||||
_aListOfInts = _$v.aListOfInts?.toBuilder();
|
||||
_aListOfDoubles = _$v.aListOfDoubles?.toBuilder();
|
||||
final $v = _$v;
|
||||
if ($v != null) {
|
||||
_aString = $v.aString;
|
||||
_anInt = $v.anInt;
|
||||
_aDouble = $v.aDouble;
|
||||
_aListOfStrings = $v.aListOfStrings?.toBuilder();
|
||||
_aListOfInts = $v.aListOfInts?.toBuilder();
|
||||
_aListOfDoubles = $v.aListOfDoubles?.toBuilder();
|
||||
_$v = null;
|
||||
}
|
||||
return this;
|
||||
@@ -234,14 +241,12 @@ class BuiltSimpleObjectBuilder
|
||||
|
||||
@override
|
||||
void replace(BuiltSimpleObject other) {
|
||||
if (other == null) {
|
||||
throw new ArgumentError.notNull('other');
|
||||
}
|
||||
ArgumentError.checkNotNull(other, 'other');
|
||||
_$v = other as _$BuiltSimpleObject;
|
||||
}
|
||||
|
||||
@override
|
||||
void update(void Function(BuiltSimpleObjectBuilder) updates) {
|
||||
void update(void Function(BuiltSimpleObjectBuilder)? updates) {
|
||||
if (updates != null) updates(this);
|
||||
}
|
||||
|
||||
@@ -258,7 +263,7 @@ class BuiltSimpleObjectBuilder
|
||||
aListOfInts: _aListOfInts?.build(),
|
||||
aListOfDoubles: _aListOfDoubles?.build());
|
||||
} catch (_) {
|
||||
String _$failedField;
|
||||
late String _$failedField;
|
||||
try {
|
||||
_$failedField = 'aListOfStrings';
|
||||
_aListOfStrings?.build();
|
||||
|
||||
@@ -16,22 +16,20 @@ class ConvertedComplexObject {
|
||||
this.aListOfObjects,
|
||||
});
|
||||
|
||||
final String aString;
|
||||
final int anInt;
|
||||
final double aDouble;
|
||||
final ConvertedSimpleObject anObject;
|
||||
final List<String> aListOfStrings;
|
||||
final List<int> aListOfInts;
|
||||
final List<double> aListOfDoubles;
|
||||
final List<ConvertedSimpleObject> aListOfObjects;
|
||||
final String? aString;
|
||||
final int? anInt;
|
||||
final double? aDouble;
|
||||
final ConvertedSimpleObject? anObject;
|
||||
final List<String>? aListOfStrings;
|
||||
final List<int>? aListOfInts;
|
||||
final List<double>? aListOfDoubles;
|
||||
final List<ConvertedSimpleObject>? aListOfObjects;
|
||||
|
||||
factory ConvertedComplexObject.fromJson(Map<String, dynamic> json) {
|
||||
if (json == null) return null;
|
||||
|
||||
return ConvertedComplexObject(
|
||||
aString: json['aString'] as String,
|
||||
anInt: json['anInt'] as int,
|
||||
aDouble: json['aDouble'] as double,
|
||||
aString: json['aString'] as String?,
|
||||
anInt: json['anInt'] as int?,
|
||||
aDouble: json['aDouble'] as double?,
|
||||
anObject: json['anObject'] != null
|
||||
? ConvertedSimpleObject.fromJson(
|
||||
json['anObject'] as Map<String, dynamic>)
|
||||
|
||||
@@ -12,20 +12,18 @@ class ConvertedSimpleObject {
|
||||
this.aListOfDoubles,
|
||||
});
|
||||
|
||||
final String aString;
|
||||
final int anInt;
|
||||
final double aDouble;
|
||||
final List<String> aListOfStrings;
|
||||
final List<int> aListOfInts;
|
||||
final List<double> aListOfDoubles;
|
||||
final String? aString;
|
||||
final int? anInt;
|
||||
final double? aDouble;
|
||||
final List<String>? aListOfStrings;
|
||||
final List<int>? aListOfInts;
|
||||
final List<double>? aListOfDoubles;
|
||||
|
||||
factory ConvertedSimpleObject.fromJson(Map<String, dynamic> json) {
|
||||
if (json == null) return null;
|
||||
|
||||
return ConvertedSimpleObject(
|
||||
aString: json['aString'] as String,
|
||||
anInt: json['anInt'] as int,
|
||||
aDouble: json['aDouble'] as double,
|
||||
aString: json['aString'] as String?,
|
||||
anInt: json['anInt'] as int?,
|
||||
aDouble: json['aDouble'] as double?,
|
||||
aListOfStrings: json['aListOfStrings'] != null
|
||||
? List<String>.from(json['aListOfStrings'] as Iterable<dynamic>)
|
||||
: null,
|
||||
|
||||
@@ -20,14 +20,14 @@ class SerializableComplexObject {
|
||||
this.aListOfObjects,
|
||||
});
|
||||
|
||||
final String aString;
|
||||
final int anInt;
|
||||
final double aDouble;
|
||||
final SerializableSimpleObject anObject;
|
||||
final List<String> aListOfStrings;
|
||||
final List<int> aListOfInts;
|
||||
final List<double> aListOfDoubles;
|
||||
final List<SerializableSimpleObject> aListOfObjects;
|
||||
final String? aString;
|
||||
final int? anInt;
|
||||
final double? aDouble;
|
||||
final SerializableSimpleObject? anObject;
|
||||
final List<String>? aListOfStrings;
|
||||
final List<int>? aListOfInts;
|
||||
final List<double>? aListOfDoubles;
|
||||
final List<SerializableSimpleObject>? aListOfObjects;
|
||||
|
||||
factory SerializableComplexObject.fromJson(Map<String, dynamic> json) =>
|
||||
_$SerializableComplexObjectFromJson(json);
|
||||
|
||||
@@ -9,24 +9,25 @@ part of 'serializable_complex_object.dart';
|
||||
SerializableComplexObject _$SerializableComplexObjectFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return SerializableComplexObject(
|
||||
aString: json['aString'] as String,
|
||||
anInt: json['anInt'] as int,
|
||||
aDouble: (json['aDouble'] as num)?.toDouble(),
|
||||
aString: json['aString'] as String?,
|
||||
anInt: json['anInt'] as int?,
|
||||
aDouble: (json['aDouble'] as num?)?.toDouble(),
|
||||
anObject: json['anObject'] == null
|
||||
? null
|
||||
: SerializableSimpleObject.fromJson(
|
||||
json['anObject'] as Map<String, dynamic>),
|
||||
aListOfStrings:
|
||||
(json['aListOfStrings'] as List)?.map((e) => e as String)?.toList(),
|
||||
aListOfInts: (json['aListOfInts'] as List)?.map((e) => e as int)?.toList(),
|
||||
aListOfDoubles: (json['aListOfDoubles'] as List)
|
||||
?.map((e) => (e as num)?.toDouble())
|
||||
?.toList(),
|
||||
aListOfObjects: (json['aListOfObjects'] as List)
|
||||
?.map((e) => e == null
|
||||
? null
|
||||
: SerializableSimpleObject.fromJson(e as Map<String, dynamic>))
|
||||
?.toList(),
|
||||
aListOfStrings: (json['aListOfStrings'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList(),
|
||||
aListOfInts:
|
||||
(json['aListOfInts'] as List<dynamic>?)?.map((e) => e as int).toList(),
|
||||
aListOfDoubles: (json['aListOfDoubles'] as List<dynamic>?)
|
||||
?.map((e) => (e as num).toDouble())
|
||||
.toList(),
|
||||
aListOfObjects: (json['aListOfObjects'] as List<dynamic>?)
|
||||
?.map(
|
||||
(e) => SerializableSimpleObject.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,12 +19,12 @@ class SerializableSimpleObject {
|
||||
this.aListOfDoubles,
|
||||
});
|
||||
|
||||
final String aString;
|
||||
final int anInt;
|
||||
final double aDouble;
|
||||
final List<String> aListOfStrings;
|
||||
final List<int> aListOfInts;
|
||||
final List<double> aListOfDoubles;
|
||||
final String? aString;
|
||||
final int? anInt;
|
||||
final double? aDouble;
|
||||
final List<String>? aListOfStrings;
|
||||
final List<int>? aListOfInts;
|
||||
final List<double>? aListOfDoubles;
|
||||
|
||||
factory SerializableSimpleObject.fromJson(Map<String, dynamic> json) =>
|
||||
_$SerializableSimpleObjectFromJson(json);
|
||||
|
||||
@@ -9,15 +9,17 @@ part of 'serializable_simple_object.dart';
|
||||
SerializableSimpleObject _$SerializableSimpleObjectFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return SerializableSimpleObject(
|
||||
aString: json['aString'] as String,
|
||||
anInt: json['anInt'] as int,
|
||||
aDouble: (json['aDouble'] as num)?.toDouble(),
|
||||
aListOfStrings:
|
||||
(json['aListOfStrings'] as List)?.map((e) => e as String)?.toList(),
|
||||
aListOfInts: (json['aListOfInts'] as List)?.map((e) => e as int)?.toList(),
|
||||
aListOfDoubles: (json['aListOfDoubles'] as List)
|
||||
?.map((e) => (e as num)?.toDouble())
|
||||
?.toList(),
|
||||
aString: json['aString'] as String?,
|
||||
anInt: json['anInt'] as int?,
|
||||
aDouble: (json['aDouble'] as num?)?.toDouble(),
|
||||
aListOfStrings: (json['aListOfStrings'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList(),
|
||||
aListOfInts:
|
||||
(json['aListOfInts'] as List<dynamic>?)?.map((e) => e as int).toList(),
|
||||
aListOfDoubles: (json['aListOfDoubles'] as List<dynamic>?)
|
||||
?.map((e) => (e as num).toDouble())
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class MyApp extends StatelessWidget {
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget {
|
||||
MyHomePage({Key key}) : super(key: key);
|
||||
MyHomePage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@@ -39,7 +39,7 @@ class BasicsPage extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final localTheme = Theme.of(context).textTheme;
|
||||
final boldStyle =
|
||||
localTheme.bodyText2.copyWith(fontWeight: FontWeight.w600);
|
||||
localTheme.bodyText2!.copyWith(fontWeight: FontWeight.w600);
|
||||
|
||||
final dynamicListOfInts = json.decode(JsonStrings.listOfInts) as List;
|
||||
final strongListOfInts = List<int>.from(dynamicListOfInts);
|
||||
@@ -134,7 +134,7 @@ class BasicsPage extends StatelessWidget {
|
||||
},
|
||||
children: createMapRows(
|
||||
strongMapOfDynamics,
|
||||
localTheme.bodyText2,
|
||||
localTheme.bodyText2!,
|
||||
boldStyle,
|
||||
),
|
||||
),
|
||||
@@ -275,7 +275,7 @@ class BuiltSimplePage extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
var objects = JsonStrings.simpleObjects.map(
|
||||
(jsonString) {
|
||||
final dynamic parsedJson = json.decode(jsonString);
|
||||
final parsedJson = json.decode(jsonString) as Object;
|
||||
return serializers.deserializeWith(
|
||||
BuiltSimpleObject.serializer, parsedJson);
|
||||
},
|
||||
@@ -297,7 +297,7 @@ class BuiltComplexPage extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
var objects = JsonStrings.complexObjects.map(
|
||||
(jsonString) {
|
||||
final dynamic parsedJson = json.decode(jsonString);
|
||||
final parsedJson = json.decode(jsonString) as Object;
|
||||
return serializers.deserializeWith(
|
||||
BuiltComplexObject.serializer, parsedJson);
|
||||
},
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
String prettyPrintList(Iterable iter) {
|
||||
String prettyPrintList(Iterable? iter) {
|
||||
if (iter == null) return 'NULL';
|
||||
|
||||
final buff = StringBuffer();
|
||||
|
||||
@@ -14,7 +14,7 @@ class SimpleObjectView extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final localTheme = Theme.of(context).textTheme;
|
||||
final boldStyle =
|
||||
localTheme.bodyText2.copyWith(fontWeight: FontWeight.w600);
|
||||
localTheme.bodyText2!.copyWith(fontWeight: FontWeight.w600);
|
||||
|
||||
if (simpleObject == null) return Text('NULL', style: localTheme.bodyText2);
|
||||
|
||||
@@ -59,7 +59,7 @@ class SimpleObjectView extends StatelessWidget {
|
||||
Text('aListOfStrings:', style: boldStyle),
|
||||
Text(
|
||||
prettyPrintList(
|
||||
simpleObject.aListOfStrings as Iterable<dynamic>,
|
||||
simpleObject.aListOfStrings as Iterable<dynamic>?,
|
||||
),
|
||||
style: localTheme.bodyText2,
|
||||
),
|
||||
@@ -69,7 +69,7 @@ class SimpleObjectView extends StatelessWidget {
|
||||
children: [
|
||||
Text('aListOfInts:', style: boldStyle),
|
||||
Text(
|
||||
prettyPrintList(simpleObject.aListOfInts as Iterable<dynamic>),
|
||||
prettyPrintList(simpleObject.aListOfInts as Iterable<dynamic>?),
|
||||
style: localTheme.bodyText2,
|
||||
),
|
||||
],
|
||||
@@ -81,7 +81,8 @@ class SimpleObjectView extends StatelessWidget {
|
||||
child: Text('aListOfDoubles:', style: boldStyle),
|
||||
),
|
||||
Text(
|
||||
prettyPrintList(simpleObject.aListOfDoubles as Iterable<dynamic>),
|
||||
prettyPrintList(
|
||||
simpleObject.aListOfDoubles as Iterable<dynamic>?),
|
||||
style: localTheme.bodyText2,
|
||||
),
|
||||
],
|
||||
@@ -126,7 +127,7 @@ class ComplexObjectView extends StatelessWidget {
|
||||
|
||||
ComplexObjectView(dynamic obj) : complexObject = obj;
|
||||
|
||||
List<Widget> _generateSimpleObjectWidgets(Iterable<dynamic> simpleObjects) {
|
||||
List<Widget> _generateSimpleObjectWidgets(Iterable<dynamic>? simpleObjects) {
|
||||
if (simpleObjects == null) {
|
||||
return [
|
||||
const Padding(
|
||||
@@ -158,7 +159,7 @@ class ComplexObjectView extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final localTheme = Theme.of(context).textTheme;
|
||||
final boldStyle =
|
||||
localTheme.bodyText2.copyWith(fontWeight: FontWeight.w600);
|
||||
localTheme.bodyText2!.copyWith(fontWeight: FontWeight.w600);
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -216,7 +217,7 @@ class ComplexObjectView extends StatelessWidget {
|
||||
Text('aListOfStrings:', style: boldStyle),
|
||||
Text(
|
||||
prettyPrintList(
|
||||
complexObject.aListOfStrings as Iterable<dynamic>),
|
||||
complexObject.aListOfStrings as Iterable<dynamic>?),
|
||||
style: localTheme.bodyText2,
|
||||
),
|
||||
],
|
||||
@@ -226,7 +227,7 @@ class ComplexObjectView extends StatelessWidget {
|
||||
Text('aListOfInts:', style: boldStyle),
|
||||
Text(
|
||||
prettyPrintList(
|
||||
complexObject.aListOfInts as Iterable<dynamic>),
|
||||
complexObject.aListOfInts as Iterable<dynamic>?),
|
||||
style: localTheme.bodyText2,
|
||||
),
|
||||
],
|
||||
@@ -239,7 +240,7 @@ class ComplexObjectView extends StatelessWidget {
|
||||
),
|
||||
Text(
|
||||
prettyPrintList(
|
||||
complexObject.aListOfDoubles as Iterable<dynamic>),
|
||||
complexObject.aListOfDoubles as Iterable<dynamic>?),
|
||||
style: localTheme.bodyText2,
|
||||
),
|
||||
],
|
||||
@@ -257,7 +258,7 @@ class ComplexObjectView extends StatelessWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: _generateSimpleObjectWidgets(
|
||||
complexObject.aListOfObjects as Iterable<dynamic>),
|
||||
complexObject.aListOfObjects as Iterable<dynamic>?),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -7,14 +7,14 @@ packages:
|
||||
name: _fe_analyzer_shared
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "7.0.0"
|
||||
version: "12.0.0"
|
||||
analyzer:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: analyzer
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.39.17"
|
||||
version: "0.40.6"
|
||||
args:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -28,91 +28,91 @@ packages:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.5.0-nullsafety.1"
|
||||
version: "2.5.0-nullsafety.3"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.1"
|
||||
version: "2.1.0-nullsafety.3"
|
||||
build:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
version: "1.6.2"
|
||||
build_config:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_config
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.4.2"
|
||||
version: "0.4.5"
|
||||
build_daemon:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_daemon
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.4"
|
||||
version: "2.1.7"
|
||||
build_resolvers:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_resolvers
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.11"
|
||||
version: "1.5.3"
|
||||
build_runner:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: build_runner
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.10.2"
|
||||
version: "1.11.1"
|
||||
build_runner_core:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_runner_core
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "6.0.1"
|
||||
version: "6.1.7"
|
||||
built_collection:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: built_collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.3.2"
|
||||
version: "5.0.0-nullsafety.0"
|
||||
built_value:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: built_value
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "7.1.0"
|
||||
version: "8.0.0-nullsafety.0"
|
||||
built_value_generator:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: built_value_generator
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "7.1.0"
|
||||
version: "8.0.0-nullsafety.0"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.3"
|
||||
version: "1.1.0-nullsafety.5"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0-nullsafety.3"
|
||||
checked_yaml:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -133,21 +133,21 @@ packages:
|
||||
name: clock
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.1"
|
||||
version: "1.1.0-nullsafety.3"
|
||||
code_builder:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: code_builder
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.5.0"
|
||||
version: "3.6.0"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.15.0-nullsafety.3"
|
||||
version: "1.15.0-nullsafety.5"
|
||||
convert:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -162,27 +162,20 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.5"
|
||||
csslib:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: csslib
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.16.2"
|
||||
dart_style:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: dart_style
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.6"
|
||||
version: "1.3.10"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fake_async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0-nullsafety.3"
|
||||
file:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -196,7 +189,7 @@ packages:
|
||||
name: fixnum
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.10.11"
|
||||
version: "1.0.0"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@@ -221,13 +214,6 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
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:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -262,49 +248,49 @@ packages:
|
||||
name: js
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.6.2"
|
||||
version: "0.6.3"
|
||||
json_annotation:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: json_annotation
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.1.1"
|
||||
version: "4.0.0-nullsafety.0"
|
||||
json_serializable:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: json_serializable
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.5.1"
|
||||
version: "4.0.0-nullsafety.0"
|
||||
logging:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: logging
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.11.4"
|
||||
version: "1.0.0"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: matcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.10-nullsafety.1"
|
||||
version: "0.12.10-nullsafety.3"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.3"
|
||||
version: "1.3.0-nullsafety.6"
|
||||
mime:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: mime
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.9.7"
|
||||
version: "1.0.0"
|
||||
node_interop:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -332,14 +318,14 @@ packages:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.1"
|
||||
version: "1.8.0-nullsafety.3"
|
||||
pedantic:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: pedantic
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.9.2"
|
||||
version: "1.10.0"
|
||||
pool:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -381,7 +367,7 @@ packages:
|
||||
name: shelf_web_socket
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.3"
|
||||
version: "0.2.4"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
@@ -393,28 +379,28 @@ packages:
|
||||
name: source_gen
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.9.7+1"
|
||||
version: "0.9.10+1"
|
||||
source_span:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.2"
|
||||
version: "1.8.0-nullsafety.4"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.10.0-nullsafety.1"
|
||||
version: "1.10.0-nullsafety.6"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.1"
|
||||
version: "2.1.0-nullsafety.3"
|
||||
stream_transform:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -428,21 +414,21 @@ packages:
|
||||
name: string_scanner
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.1"
|
||||
version: "1.1.0-nullsafety.3"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0-nullsafety.3"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.19-nullsafety.2"
|
||||
version: "0.2.19-nullsafety.6"
|
||||
timing:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -456,14 +442,14 @@ packages:
|
||||
name: typed_data
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.3"
|
||||
version: "1.3.0-nullsafety.5"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.3"
|
||||
version: "2.1.0-nullsafety.5"
|
||||
watcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -477,7 +463,7 @@ packages:
|
||||
name: web_socket_channel
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "1.2.0"
|
||||
yaml:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -486,4 +472,4 @@ packages:
|
||||
source: hosted
|
||||
version: "2.2.1"
|
||||
sdks:
|
||||
dart: ">=2.10.0-110 <2.11.0"
|
||||
dart: ">=2.12.0-0.0 <3.0.0"
|
||||
|
||||
@@ -2,12 +2,12 @@ name: jsonexample
|
||||
description: A demonstration of JSON parsing
|
||||
|
||||
environment:
|
||||
sdk: '>=2.5.0 <3.0.0'
|
||||
sdk: '>=2.12.0-0 <3.0.0'
|
||||
|
||||
dependencies:
|
||||
json_annotation: ^3.0.1
|
||||
built_collection: ^4.3.2
|
||||
built_value: ^7.0.4
|
||||
json_annotation: ^4.0.0-0
|
||||
built_collection: ^5.0.0-0
|
||||
built_value: ^8.0.0-0
|
||||
|
||||
flutter:
|
||||
sdk: flutter
|
||||
@@ -15,9 +15,9 @@ dependencies:
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
build_runner: ^1.7.2
|
||||
built_value_generator: ^7.0.4
|
||||
json_serializable: ^3.2.5
|
||||
build_runner: ^1.11.1
|
||||
built_value_generator: ^8.0.0-0
|
||||
json_serializable: ^4.0.0-0
|
||||
pedantic: ^1.9.0
|
||||
|
||||
flutter:
|
||||
|
||||
@@ -127,22 +127,23 @@ void main() {
|
||||
expect(complexObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
expect(complexObject.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.anObject.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anObject.anInt, 1);
|
||||
expect(complexObject.anObject.aDouble, 1.0);
|
||||
expect(complexObject.anObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
expect(complexObject.anObject.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.anObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.aListOfObjects.length, 3);
|
||||
expect(complexObject.anObject?.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anObject?.anInt, 1);
|
||||
expect(complexObject.anObject?.aDouble, 1.0);
|
||||
expect(complexObject.anObject?.aListOfStrings, ['one', 'two', 'three']);
|
||||
expect(complexObject.anObject?.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.anObject?.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.aListOfObjects?.length, 3);
|
||||
|
||||
for (var i = 0; i < 3; i++) {
|
||||
expect(complexObject.aListOfObjects[i].aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.aListOfObjects[i].anInt, i + 1);
|
||||
expect(complexObject.aListOfObjects[i].aDouble, 1.0);
|
||||
expect(complexObject.aListOfObjects[i].aListOfStrings,
|
||||
expect(complexObject.aListOfObjects?[i].aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.aListOfObjects?[i].anInt, i + 1);
|
||||
expect(complexObject.aListOfObjects?[i].aDouble, 1.0);
|
||||
expect(complexObject.aListOfObjects?[i].aListOfStrings,
|
||||
['one', 'two', 'three']);
|
||||
expect(complexObject.aListOfObjects[i].aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.aListOfObjects[i].aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.aListOfObjects?[i].aListOfInts, [1, 2, 3]);
|
||||
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.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.anObject.aString, isNull);
|
||||
expect(complexObject.anObject.anInt, isNull);
|
||||
expect(complexObject.anObject.aDouble, isNull);
|
||||
expect(complexObject.anObject.aListOfStrings, isNull);
|
||||
expect(complexObject.anObject.aListOfInts, isNull);
|
||||
expect(complexObject.anObject.aListOfDoubles, isNull);
|
||||
expect(complexObject.aListOfObjects.length, 3);
|
||||
expect(complexObject.anObject?.aString, isNull);
|
||||
expect(complexObject.anObject?.anInt, isNull);
|
||||
expect(complexObject.anObject?.aDouble, isNull);
|
||||
expect(complexObject.anObject?.aListOfStrings, isNull);
|
||||
expect(complexObject.anObject?.aListOfInts, isNull);
|
||||
expect(complexObject.anObject?.aListOfDoubles, isNull);
|
||||
expect(complexObject.aListOfObjects?.length, 3);
|
||||
|
||||
for (var i = 0; i < 3; i++) {
|
||||
expect(complexObject.aListOfObjects[i].aString, isNull);
|
||||
expect(complexObject.aListOfObjects[i].anInt, isNull);
|
||||
expect(complexObject.aListOfObjects[i].aDouble, isNull);
|
||||
expect(complexObject.aListOfObjects[i].aListOfStrings, isNull);
|
||||
expect(complexObject.aListOfObjects[i].aListOfInts, isNull);
|
||||
expect(complexObject.aListOfObjects[i].aListOfDoubles, isNull);
|
||||
expect(complexObject.aListOfObjects?[i].aString, isNull);
|
||||
expect(complexObject.aListOfObjects?[i].anInt, isNull);
|
||||
expect(complexObject.aListOfObjects?[i].aDouble, isNull);
|
||||
expect(complexObject.aListOfObjects?[i].aListOfStrings, isNull);
|
||||
expect(complexObject.aListOfObjects?[i].aListOfInts, isNull);
|
||||
expect(complexObject.aListOfObjects?[i].aListOfDoubles, isNull);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -197,22 +198,23 @@ void main() {
|
||||
expect(complexObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
expect(complexObject.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.anObject.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anObject.anInt, 1);
|
||||
expect(complexObject.anObject.aDouble, 1.0);
|
||||
expect(complexObject.anObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
expect(complexObject.anObject.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.anObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.aListOfObjects.length, 3);
|
||||
expect(complexObject.anObject?.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anObject?.anInt, 1);
|
||||
expect(complexObject.anObject?.aDouble, 1.0);
|
||||
expect(complexObject.anObject?.aListOfStrings, ['one', 'two', 'three']);
|
||||
expect(complexObject.anObject?.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.anObject?.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.aListOfObjects?.length, 3);
|
||||
|
||||
for (var i = 0; i < 3; i++) {
|
||||
expect(complexObject.aListOfObjects[i].aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.aListOfObjects[i].anInt, i + 1);
|
||||
expect(complexObject.aListOfObjects[i].aDouble, 1.0);
|
||||
expect(complexObject.aListOfObjects[i].aListOfStrings,
|
||||
expect(complexObject.aListOfObjects?[i].aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.aListOfObjects?[i].anInt, i + 1);
|
||||
expect(complexObject.aListOfObjects?[i].aDouble, 1.0);
|
||||
expect(complexObject.aListOfObjects?[i].aListOfStrings,
|
||||
['one', 'two', 'three']);
|
||||
expect(complexObject.aListOfObjects[i].aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.aListOfObjects[i].aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.aListOfObjects?[i].aListOfInts, [1, 2, 3]);
|
||||
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.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.anObject.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anObject.anInt, 1);
|
||||
expect(complexObject.anObject.aDouble, 1.0);
|
||||
expect(complexObject.anObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
expect(complexObject.anObject.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.anObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.aListOfObjects.length, 3);
|
||||
expect(complexObject.anObject?.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anObject?.anInt, 1);
|
||||
expect(complexObject.anObject?.aDouble, 1.0);
|
||||
expect(complexObject.anObject?.aListOfStrings, ['one', 'two', 'three']);
|
||||
expect(complexObject.anObject?.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.anObject?.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.aListOfObjects?.length, 3);
|
||||
|
||||
for (var i = 0; i < 3; i++) {
|
||||
expect(complexObject.aListOfObjects[i].aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.aListOfObjects[i].anInt, i + 1);
|
||||
expect(complexObject.aListOfObjects[i].aDouble, 1.0);
|
||||
expect(complexObject.aListOfObjects[i].aListOfStrings,
|
||||
expect(complexObject.aListOfObjects?[i].aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.aListOfObjects?[i].anInt, i + 1);
|
||||
expect(complexObject.aListOfObjects?[i].aDouble, 1.0);
|
||||
expect(complexObject.aListOfObjects?[i].aListOfStrings,
|
||||
['one', 'two', 'three']);
|
||||
expect(complexObject.aListOfObjects[i].aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.aListOfObjects[i].aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.aListOfObjects?[i].aListOfInts, [1, 2, 3]);
|
||||
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.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.anObject.aString, isNull);
|
||||
expect(complexObject.anObject.anInt, isNull);
|
||||
expect(complexObject.anObject.aDouble, isNull);
|
||||
expect(complexObject.anObject.aListOfStrings, isNull);
|
||||
expect(complexObject.anObject.aListOfInts, isNull);
|
||||
expect(complexObject.anObject.aListOfDoubles, isNull);
|
||||
expect(complexObject.aListOfObjects.length, 3);
|
||||
expect(complexObject.anObject?.aString, isNull);
|
||||
expect(complexObject.anObject?.anInt, isNull);
|
||||
expect(complexObject.anObject?.aDouble, isNull);
|
||||
expect(complexObject.anObject?.aListOfStrings, isNull);
|
||||
expect(complexObject.anObject?.aListOfInts, isNull);
|
||||
expect(complexObject.anObject?.aListOfDoubles, isNull);
|
||||
expect(complexObject.aListOfObjects?.length, 3);
|
||||
|
||||
for (var i = 0; i < 3; i++) {
|
||||
expect(complexObject.aListOfObjects[i].aString, isNull);
|
||||
expect(complexObject.aListOfObjects[i].anInt, isNull);
|
||||
expect(complexObject.aListOfObjects[i].aDouble, isNull);
|
||||
expect(complexObject.aListOfObjects[i].aListOfStrings, isNull);
|
||||
expect(complexObject.aListOfObjects[i].aListOfInts, isNull);
|
||||
expect(complexObject.aListOfObjects[i].aListOfDoubles, isNull);
|
||||
expect(complexObject.aListOfObjects?[i].aString, isNull);
|
||||
expect(complexObject.aListOfObjects?[i].anInt, isNull);
|
||||
expect(complexObject.aListOfObjects?[i].aDouble, isNull);
|
||||
expect(complexObject.aListOfObjects?[i].aListOfStrings, isNull);
|
||||
expect(complexObject.aListOfObjects?[i].aListOfInts, isNull);
|
||||
expect(complexObject.aListOfObjects?[i].aListOfDoubles, isNull);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -298,22 +301,23 @@ void main() {
|
||||
expect(complexObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
expect(complexObject.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.anObject.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anObject.anInt, 1);
|
||||
expect(complexObject.anObject.aDouble, 1.0);
|
||||
expect(complexObject.anObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
expect(complexObject.anObject.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.anObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.aListOfObjects.length, 3);
|
||||
expect(complexObject.anObject?.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anObject?.anInt, 1);
|
||||
expect(complexObject.anObject?.aDouble, 1.0);
|
||||
expect(complexObject.anObject?.aListOfStrings, ['one', 'two', 'three']);
|
||||
expect(complexObject.anObject?.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.anObject?.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.aListOfObjects?.length, 3);
|
||||
|
||||
for (var i = 0; i < 3; i++) {
|
||||
expect(complexObject.aListOfObjects[i].aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.aListOfObjects[i].anInt, i + 1);
|
||||
expect(complexObject.aListOfObjects[i].aDouble, 1.0);
|
||||
expect(complexObject.aListOfObjects[i].aListOfStrings,
|
||||
expect(complexObject.aListOfObjects?[i].aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.aListOfObjects?[i].anInt, i + 1);
|
||||
expect(complexObject.aListOfObjects?[i].aDouble, 1.0);
|
||||
expect(complexObject.aListOfObjects?[i].aListOfStrings,
|
||||
['one', 'two', 'three']);
|
||||
expect(complexObject.aListOfObjects[i].aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.aListOfObjects[i].aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.aListOfObjects?[i].aListOfInts, [1, 2, 3]);
|
||||
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.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.anObject.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anObject.anInt, 1);
|
||||
expect(complexObject.anObject.aDouble, 1.0);
|
||||
expect(complexObject.anObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
expect(complexObject.anObject.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.anObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.aListOfObjects.length, 3);
|
||||
expect(complexObject.anObject?.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anObject?.anInt, 1);
|
||||
expect(complexObject.anObject?.aDouble, 1.0);
|
||||
expect(complexObject.anObject?.aListOfStrings, ['one', 'two', 'three']);
|
||||
expect(complexObject.anObject?.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.anObject?.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.aListOfObjects?.length, 3);
|
||||
|
||||
for (var i = 0; i < 3; i++) {
|
||||
expect(complexObject.aListOfObjects[i].aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.aListOfObjects[i].anInt, i + 1);
|
||||
expect(complexObject.aListOfObjects[i].aDouble, 1.0);
|
||||
expect(complexObject.aListOfObjects[i].aListOfStrings,
|
||||
expect(complexObject.aListOfObjects?[i].aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.aListOfObjects?[i].anInt, i + 1);
|
||||
expect(complexObject.aListOfObjects?[i].aDouble, 1.0);
|
||||
expect(complexObject.aListOfObjects?[i].aListOfStrings,
|
||||
['one', 'two', 'three']);
|
||||
expect(complexObject.aListOfObjects[i].aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.aListOfObjects[i].aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.aListOfObjects?[i].aListOfInts, [1, 2, 3]);
|
||||
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.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.anObject.aString, isNull);
|
||||
expect(complexObject.anObject.anInt, isNull);
|
||||
expect(complexObject.anObject.aDouble, isNull);
|
||||
expect(complexObject.anObject.aListOfStrings, isNull);
|
||||
expect(complexObject.anObject.aListOfInts, isNull);
|
||||
expect(complexObject.anObject.aListOfDoubles, isNull);
|
||||
expect(complexObject.aListOfObjects.length, 3);
|
||||
expect(complexObject.anObject?.aString, isNull);
|
||||
expect(complexObject.anObject?.anInt, isNull);
|
||||
expect(complexObject.anObject?.aDouble, isNull);
|
||||
expect(complexObject.anObject?.aListOfStrings, isNull);
|
||||
expect(complexObject.anObject?.aListOfInts, isNull);
|
||||
expect(complexObject.anObject?.aListOfDoubles, isNull);
|
||||
expect(complexObject.aListOfObjects?.length, 3);
|
||||
|
||||
for (var i = 0; i < 3; i++) {
|
||||
expect(complexObject.aListOfObjects[i].aString, isNull);
|
||||
expect(complexObject.aListOfObjects[i].anInt, isNull);
|
||||
expect(complexObject.aListOfObjects[i].aDouble, isNull);
|
||||
expect(complexObject.aListOfObjects[i].aListOfStrings, isNull);
|
||||
expect(complexObject.aListOfObjects[i].aListOfInts, isNull);
|
||||
expect(complexObject.aListOfObjects[i].aListOfDoubles, isNull);
|
||||
expect(complexObject.aListOfObjects?[i].aString, isNull);
|
||||
expect(complexObject.aListOfObjects?[i].anInt, isNull);
|
||||
expect(complexObject.aListOfObjects?[i].aDouble, isNull);
|
||||
expect(complexObject.aListOfObjects?[i].aListOfStrings, isNull);
|
||||
expect(complexObject.aListOfObjects?[i].aListOfInts, isNull);
|
||||
expect(complexObject.aListOfObjects?[i].aListOfDoubles, isNull);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -400,22 +405,23 @@ void main() {
|
||||
expect(complexObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
expect(complexObject.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.anObject.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anObject.anInt, 1);
|
||||
expect(complexObject.anObject.aDouble, 1.0);
|
||||
expect(complexObject.anObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
expect(complexObject.anObject.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.anObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.aListOfObjects.length, 3);
|
||||
expect(complexObject.anObject?.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anObject?.anInt, 1);
|
||||
expect(complexObject.anObject?.aDouble, 1.0);
|
||||
expect(complexObject.anObject?.aListOfStrings, ['one', 'two', 'three']);
|
||||
expect(complexObject.anObject?.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.anObject?.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.aListOfObjects?.length, 3);
|
||||
|
||||
for (var i = 0; i < 3; i++) {
|
||||
expect(complexObject.aListOfObjects[i].aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.aListOfObjects[i].anInt, i + 1);
|
||||
expect(complexObject.aListOfObjects[i].aDouble, 1.0);
|
||||
expect(complexObject.aListOfObjects[i].aListOfStrings,
|
||||
expect(complexObject.aListOfObjects?[i].aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.aListOfObjects?[i].anInt, i + 1);
|
||||
expect(complexObject.aListOfObjects?[i].aDouble, 1.0);
|
||||
expect(complexObject.aListOfObjects?[i].aListOfStrings,
|
||||
['one', 'two', 'three']);
|
||||
expect(complexObject.aListOfObjects[i].aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.aListOfObjects[i].aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.aListOfObjects?[i].aListOfInts, [1, 2, 3]);
|
||||
expect(
|
||||
complexObject.aListOfObjects?[i].aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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 "Generated.xcconfig"
|
||||
|
||||
@@ -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 "Generated.xcconfig"
|
||||
|
||||
@@ -204,7 +204,7 @@ class PlaceMapState extends State<PlaceMap> {
|
||||
});
|
||||
|
||||
// Show a confirmation snackbar that has an action to edit the new place.
|
||||
Scaffold.of(context).showSnackBar(
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
duration: Duration(seconds: 3),
|
||||
content:
|
||||
|
||||
@@ -22,70 +22,66 @@ class _MethodChannelDemoState extends State<MethodChannelDemo> {
|
||||
appBar: AppBar(
|
||||
title: const Text('MethodChannel Demo'),
|
||||
),
|
||||
body: Builder(
|
||||
builder: (context) {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
body: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'Value of count is $count',
|
||||
style: Theme.of(context).textTheme.headline5,
|
||||
),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
'Value of count is $count',
|
||||
style: Theme.of(context).textTheme.headline5,
|
||||
// Whenever users press the ElevatedButton, it invokes
|
||||
// Counter.increment method to increment the value of count.
|
||||
ElevatedButton.icon(
|
||||
onPressed: () async {
|
||||
try {
|
||||
final value = await Counter.increment(counterValue: count);
|
||||
setState(() => count = value);
|
||||
} catch (error) {
|
||||
showErrorMessage(
|
||||
context,
|
||||
error.message as String,
|
||||
);
|
||||
}
|
||||
},
|
||||
icon: Icon(Icons.add),
|
||||
label: Text('Increment'),
|
||||
),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
// Whenever users press the ElevatedButton, it invokes
|
||||
// Counter.increment method to increment the value of count.
|
||||
ElevatedButton.icon(
|
||||
onPressed: () async {
|
||||
try {
|
||||
final value =
|
||||
await Counter.increment(counterValue: count);
|
||||
setState(() => count = value);
|
||||
} catch (error) {
|
||||
showErrorMessage(
|
||||
context,
|
||||
error.message as String,
|
||||
);
|
||||
}
|
||||
},
|
||||
icon: Icon(Icons.add),
|
||||
label: Text('Increment'),
|
||||
),
|
||||
|
||||
// Whenever users press the ElevatedButton, it invokes
|
||||
// Counter.decrement method to decrement the value of count.
|
||||
ElevatedButton.icon(
|
||||
onPressed: () async {
|
||||
try {
|
||||
final value =
|
||||
await Counter.decrement(counterValue: count);
|
||||
setState(() => count = value);
|
||||
} catch (error) {
|
||||
showErrorMessage(
|
||||
context,
|
||||
error.message as String,
|
||||
);
|
||||
}
|
||||
},
|
||||
icon: Icon(Icons.remove),
|
||||
label: Text('Decrement'),
|
||||
)
|
||||
],
|
||||
// Whenever users press the ElevatedButton, it invokes
|
||||
// Counter.decrement method to decrement the value of count.
|
||||
ElevatedButton.icon(
|
||||
onPressed: () async {
|
||||
try {
|
||||
final value = await Counter.decrement(counterValue: count);
|
||||
setState(() => count = value);
|
||||
} catch (error) {
|
||||
showErrorMessage(
|
||||
context,
|
||||
error.message as String,
|
||||
);
|
||||
}
|
||||
},
|
||||
icon: Icon(Icons.remove),
|
||||
label: Text('Decrement'),
|
||||
)
|
||||
],
|
||||
);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void showErrorMessage(BuildContext context, String errorMessage) {
|
||||
Scaffold.of(context).showSnackBar(SnackBar(
|
||||
content: Text(errorMessage),
|
||||
));
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(errorMessage),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,11 +25,7 @@ class _PetListScreenState extends State<PetListScreen> {
|
||||
BasicMessageChannel('stringCodecDemo', StringCodec())
|
||||
.setMessageHandler((message) async {
|
||||
if (message == null) {
|
||||
scaffoldKey.currentState.showSnackBar(
|
||||
SnackBar(
|
||||
content:
|
||||
const Text('An error occurred while adding pet details.')),
|
||||
);
|
||||
showSnackBar('An error occurred while adding pet details.', context);
|
||||
} else {
|
||||
setState(() {
|
||||
petListModel = PetListModel.fromJson(message);
|
||||
@@ -91,10 +87,10 @@ class BuildPetList extends StatelessWidget {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
void showSnackBar(String message, BuildContext context) {
|
||||
Scaffold.of(context).showSnackBar(SnackBar(
|
||||
content: Text(message),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
void showSnackBar(String message, BuildContext context) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
|
||||
content: Text(message),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -7,56 +7,56 @@ packages:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.5.0-nullsafety.1"
|
||||
version: "2.5.0-nullsafety.3"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.1"
|
||||
version: "2.1.0-nullsafety.3"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.3"
|
||||
version: "1.1.0-nullsafety.5"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0-nullsafety.3"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: clock
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.1"
|
||||
version: "1.1.0-nullsafety.3"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.15.0-nullsafety.3"
|
||||
version: "1.15.0-nullsafety.5"
|
||||
cupertino_icons:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: cupertino_icons
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
version: "1.0.2"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fake_async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0-nullsafety.3"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@@ -73,21 +73,21 @@ packages:
|
||||
name: matcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.10-nullsafety.1"
|
||||
version: "0.12.10-nullsafety.3"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.3"
|
||||
version: "1.3.0-nullsafety.6"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.1"
|
||||
version: "1.8.0-nullsafety.3"
|
||||
pedantic:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
@@ -106,55 +106,55 @@ packages:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.2"
|
||||
version: "1.8.0-nullsafety.4"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.10.0-nullsafety.1"
|
||||
version: "1.10.0-nullsafety.6"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.1"
|
||||
version: "2.1.0-nullsafety.3"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.1"
|
||||
version: "1.1.0-nullsafety.3"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0-nullsafety.3"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.19-nullsafety.2"
|
||||
version: "0.2.19-nullsafety.6"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.3"
|
||||
version: "1.3.0-nullsafety.5"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.3"
|
||||
version: "2.1.0-nullsafety.5"
|
||||
sdks:
|
||||
dart: ">=2.10.0-110 <2.11.0"
|
||||
dart: ">=2.12.0-0.0 <3.0.0"
|
||||
|
||||
@@ -116,7 +116,7 @@ class _PlatformAdaptingHomePageState extends State<PlatformAdaptingHomePage> {
|
||||
);
|
||||
default:
|
||||
assert(false, 'Unexpected tab');
|
||||
return null;
|
||||
return SizedBox.shrink();
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
@@ -22,9 +22,9 @@ class NewsTab extends StatefulWidget {
|
||||
class _NewsTabState extends State<NewsTab> {
|
||||
static const _itemsLength = 20;
|
||||
|
||||
List<Color> colors;
|
||||
List<String> titles;
|
||||
List<String> contents;
|
||||
late final List<Color> colors;
|
||||
late final List<String> titles;
|
||||
late final List<String> contents;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -36,8 +36,6 @@ class _NewsTabState extends State<NewsTab> {
|
||||
}
|
||||
|
||||
Widget _listBuilder(BuildContext context, int index) {
|
||||
if (index >= _itemsLength) return null;
|
||||
|
||||
return SafeArea(
|
||||
top: false,
|
||||
bottom: false,
|
||||
@@ -101,6 +99,7 @@ class _NewsTabState extends State<NewsTab> {
|
||||
),
|
||||
body: Container(
|
||||
child: ListView.builder(
|
||||
itemCount: _itemsLength,
|
||||
itemBuilder: _listBuilder,
|
||||
),
|
||||
),
|
||||
@@ -111,6 +110,7 @@ class _NewsTabState extends State<NewsTab> {
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: CupertinoNavigationBar(),
|
||||
child: ListView.builder(
|
||||
itemCount: _itemsLength,
|
||||
itemBuilder: _listBuilder,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -109,7 +109,11 @@ class ProfileTab 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 content;
|
||||
|
||||
@@ -12,7 +12,11 @@ import 'widgets.dart';
|
||||
/// 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.
|
||||
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 String song;
|
||||
|
||||
@@ -15,9 +15,9 @@ class SongsTab extends StatefulWidget {
|
||||
static const androidIcon = Icon(Icons.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
|
||||
_SongsTabState createState() => _SongsTabState();
|
||||
@@ -28,8 +28,8 @@ class _SongsTabState extends State<SongsTab> {
|
||||
|
||||
final _androidRefreshKey = GlobalKey<RefreshIndicatorState>();
|
||||
|
||||
List<MaterialColor> colors;
|
||||
List<String> songNames;
|
||||
late List<MaterialColor> colors;
|
||||
late List<String> songNames;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -51,7 +51,7 @@ class _SongsTabState extends State<SongsTab> {
|
||||
}
|
||||
|
||||
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
|
||||
// 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
|
||||
// unrealistically toggles the current platform for demonstration
|
||||
// purposes.
|
||||
WidgetsBinding.instance.reassembleApplication();
|
||||
WidgetsBinding.instance!.reassembleApplication();
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -117,7 +117,8 @@ class _SongsTabState extends State<SongsTab> {
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: Icon(Icons.refresh),
|
||||
onPressed: () async => await _androidRefreshKey.currentState.show(),
|
||||
onPressed: () async =>
|
||||
await _androidRefreshKey.currentState!.show(),
|
||||
),
|
||||
IconButton(
|
||||
icon: Icon(Icons.shuffle),
|
||||
@@ -131,6 +132,7 @@ class _SongsTabState extends State<SongsTab> {
|
||||
onRefresh: _refreshData,
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.symmetric(vertical: 12),
|
||||
itemCount: _itemsLength,
|
||||
itemBuilder: _listBuilder,
|
||||
),
|
||||
),
|
||||
@@ -155,7 +157,10 @@ class _SongsTabState extends State<SongsTab> {
|
||||
sliver: SliverPadding(
|
||||
padding: EdgeInsets.symmetric(vertical: 12),
|
||||
sliver: SliverList(
|
||||
delegate: SliverChildBuilderDelegate(_listBuilder),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
_listBuilder,
|
||||
childCount: _itemsLength,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -57,7 +57,7 @@ String generateRandomHeadline() {
|
||||
}
|
||||
|
||||
assert(false, 'Failed to generate news headline');
|
||||
return null;
|
||||
return 'Failed to generate news headline';
|
||||
}
|
||||
|
||||
List<MaterialColor> getRandomColors(int amount) {
|
||||
|
||||
@@ -9,12 +9,10 @@ import 'package:flutter/material.dart';
|
||||
/// A simple widget that builds different things on different platforms.
|
||||
class PlatformWidget extends StatelessWidget {
|
||||
const PlatformWidget({
|
||||
Key key,
|
||||
@required this.androidBuilder,
|
||||
@required this.iosBuilder,
|
||||
}) : assert(androidBuilder != null),
|
||||
assert(iosBuilder != null),
|
||||
super(key: key);
|
||||
Key? key,
|
||||
required this.androidBuilder,
|
||||
required this.iosBuilder,
|
||||
}) : super(key: key);
|
||||
|
||||
final WidgetBuilder androidBuilder;
|
||||
final WidgetBuilder iosBuilder;
|
||||
@@ -28,7 +26,7 @@ class PlatformWidget extends StatelessWidget {
|
||||
return iosBuilder(context);
|
||||
default:
|
||||
assert(false, 'Unexpected platform $defaultTargetPlatform');
|
||||
return null;
|
||||
return SizedBox.shrink();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,15 +38,15 @@ class PlatformWidget extends StatelessWidget {
|
||||
class PressableCard extends StatefulWidget {
|
||||
const PressableCard({
|
||||
this.onPressed,
|
||||
this.color,
|
||||
this.flattenAnimation,
|
||||
required this.color,
|
||||
required this.flattenAnimation,
|
||||
this.child,
|
||||
});
|
||||
|
||||
final VoidCallback onPressed;
|
||||
final VoidCallback? onPressed;
|
||||
final Color color;
|
||||
final Animation<double> flattenAnimation;
|
||||
final Widget child;
|
||||
final Widget? child;
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => _PressableCardState();
|
||||
@@ -57,8 +55,8 @@ class PressableCard extends StatefulWidget {
|
||||
class _PressableCardState extends State<PressableCard>
|
||||
with SingleTickerProviderStateMixin {
|
||||
bool pressed = false;
|
||||
AnimationController controller;
|
||||
Animation<double> elevationAnimation;
|
||||
late final AnimationController controller;
|
||||
late final Animation<double> elevationAnimation;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -93,9 +91,7 @@ class _PressableCardState extends State<PressableCard>
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {
|
||||
if (widget.onPressed != null) {
|
||||
widget.onPressed();
|
||||
}
|
||||
widget.onPressed?.call();
|
||||
},
|
||||
// This widget both internally drives an animation when pressed and
|
||||
// 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
|
||||
/// use on both iOS and Android as part of their brand's unique design.
|
||||
class HeroAnimatingSongCard extends StatelessWidget {
|
||||
HeroAnimatingSongCard(
|
||||
{this.song, this.color, this.heroAnimation, this.onPressed});
|
||||
HeroAnimatingSongCard({
|
||||
required this.song,
|
||||
required this.color,
|
||||
required this.heroAnimation,
|
||||
this.onPressed,
|
||||
});
|
||||
|
||||
final String song;
|
||||
final Color color;
|
||||
final Animation<double> heroAnimation;
|
||||
final VoidCallback onPressed;
|
||||
final VoidCallback? onPressed;
|
||||
|
||||
double get playButtonSize => 50 + 50 * heroAnimation.value;
|
||||
|
||||
@@ -226,7 +226,7 @@ class SongPlaceholderTile extends StatelessWidget {
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
color: Theme.of(context).textTheme.bodyText2.color,
|
||||
color: Theme.of(context).textTheme.bodyText2!.color,
|
||||
width: 130,
|
||||
),
|
||||
Padding(
|
||||
@@ -239,27 +239,27 @@ class SongPlaceholderTile extends StatelessWidget {
|
||||
Container(
|
||||
height: 9,
|
||||
margin: EdgeInsets.only(right: 60),
|
||||
color: Theme.of(context).textTheme.bodyText2.color,
|
||||
color: Theme.of(context).textTheme.bodyText2!.color,
|
||||
),
|
||||
Container(
|
||||
height: 9,
|
||||
margin: EdgeInsets.only(right: 20, top: 8),
|
||||
color: Theme.of(context).textTheme.bodyText2.color,
|
||||
color: Theme.of(context).textTheme.bodyText2!.color,
|
||||
),
|
||||
Container(
|
||||
height: 9,
|
||||
margin: EdgeInsets.only(right: 40, top: 8),
|
||||
color: Theme.of(context).textTheme.bodyText2.color,
|
||||
color: Theme.of(context).textTheme.bodyText2!.color,
|
||||
),
|
||||
Container(
|
||||
height: 9,
|
||||
margin: EdgeInsets.only(right: 80, top: 8),
|
||||
color: Theme.of(context).textTheme.bodyText2.color,
|
||||
color: Theme.of(context).textTheme.bodyText2!.color,
|
||||
),
|
||||
Container(
|
||||
height: 9,
|
||||
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>(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
var selectedRadio = 1;
|
||||
int? selectedRadio = 1;
|
||||
return AlertDialog(
|
||||
contentPadding: EdgeInsets.only(top: 12),
|
||||
content: StatefulBuilder(
|
||||
@@ -295,12 +295,11 @@ void showChoices(BuildContext context, List<String> choices) {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: List<Widget>.generate(choices.length, (index) {
|
||||
return RadioListTile(
|
||||
return RadioListTile<int?>(
|
||||
title: Text(choices[index]),
|
||||
value: index,
|
||||
groupValue: selectedRadio,
|
||||
// ignore: avoid_types_on_closure_parameters
|
||||
onChanged: (int value) {
|
||||
onChanged: (value) {
|
||||
setState(() => selectedRadio = value);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -7,63 +7,63 @@ packages:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.5.0-nullsafety.1"
|
||||
version: "2.5.0"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.1"
|
||||
version: "2.1.0"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.3"
|
||||
version: "1.1.0"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: clock
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.1"
|
||||
version: "1.1.0"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.15.0-nullsafety.3"
|
||||
version: "1.15.0"
|
||||
cupertino_icons:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: cupertino_icons
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.3"
|
||||
version: "1.0.2"
|
||||
english_words:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: english_words
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.1.5"
|
||||
version: "4.0.0-nullsafety.0"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fake_async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@@ -75,7 +75,7 @@ packages:
|
||||
name: flutter_lorem
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "2.0.0"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
@@ -87,28 +87,28 @@ packages:
|
||||
name: matcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.10-nullsafety.1"
|
||||
version: "0.12.10"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.3"
|
||||
version: "1.3.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.1"
|
||||
version: "1.8.0"
|
||||
pedantic:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: pedantic
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.9.2"
|
||||
version: "1.10.0"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
@@ -120,55 +120,55 @@ packages:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.2"
|
||||
version: "1.8.0"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.10.0-nullsafety.1"
|
||||
version: "1.10.0"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.1"
|
||||
version: "2.1.0"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.1"
|
||||
version: "1.1.0"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.19-nullsafety.2"
|
||||
version: "0.2.19"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.3"
|
||||
version: "1.3.0"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.3"
|
||||
version: "2.1.0"
|
||||
sdks:
|
||||
dart: ">=2.10.0-110 <2.11.0"
|
||||
dart: ">=2.12.0-259 <3.0.0"
|
||||
|
||||
@@ -3,20 +3,20 @@ description: A project showcasing a Flutter app following different platform IA
|
||||
version: 1.0.0+1
|
||||
|
||||
environment:
|
||||
sdk: ">=2.5.0 <3.0.0"
|
||||
sdk: '>=2.12.0-0 <3.0.0'
|
||||
|
||||
dependencies:
|
||||
english_words: ^3.1.5
|
||||
flutter_lorem: ^1.1.0
|
||||
english_words: ^4.0.0-nullsafety.0
|
||||
flutter_lorem: ^2.0.0
|
||||
flutter:
|
||||
sdk: flutter
|
||||
|
||||
cupertino_icons: ^0.1.3
|
||||
cupertino_icons: ^1.0.2
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
pedantic: ^1.9.0
|
||||
pedantic: ^1.10.0
|
||||
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
@@ -7,42 +7,42 @@ packages:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.5.0-nullsafety.1"
|
||||
version: "2.5.0-nullsafety.3"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.1"
|
||||
version: "2.1.0-nullsafety.3"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.3"
|
||||
version: "1.1.0-nullsafety.5"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0-nullsafety.3"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: clock
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.1"
|
||||
version: "1.1.0-nullsafety.3"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.15.0-nullsafety.3"
|
||||
version: "1.15.0-nullsafety.5"
|
||||
cupertino_icons:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -56,7 +56,7 @@ packages:
|
||||
name: fake_async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0-nullsafety.3"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@@ -73,21 +73,21 @@ packages:
|
||||
name: matcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.10-nullsafety.1"
|
||||
version: "0.12.10-nullsafety.3"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.3"
|
||||
version: "1.3.0-nullsafety.6"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.1"
|
||||
version: "1.8.0-nullsafety.3"
|
||||
pedantic:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
@@ -106,55 +106,55 @@ packages:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.2"
|
||||
version: "1.8.0-nullsafety.4"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.10.0-nullsafety.1"
|
||||
version: "1.10.0-nullsafety.6"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.1"
|
||||
version: "2.1.0-nullsafety.3"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.1"
|
||||
version: "1.1.0-nullsafety.3"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0-nullsafety.3"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.19-nullsafety.2"
|
||||
version: "0.2.19-nullsafety.6"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.3"
|
||||
version: "1.3.0-nullsafety.5"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.3"
|
||||
version: "2.1.0-nullsafety.5"
|
||||
sdks:
|
||||
dart: ">=2.10.0-110 <2.11.0"
|
||||
dart: ">=2.12.0-0.0 <3.0.0"
|
||||
|
||||
@@ -7,56 +7,56 @@ packages:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.5.0-nullsafety.1"
|
||||
version: "2.5.0"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.1"
|
||||
version: "2.1.0"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.3"
|
||||
version: "1.1.0"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: clock
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.1"
|
||||
version: "1.1.0"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.15.0-nullsafety.3"
|
||||
version: "1.15.0"
|
||||
cupertino_icons:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: cupertino_icons
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
version: "1.0.2"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fake_async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@@ -73,42 +73,42 @@ packages:
|
||||
name: matcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.10-nullsafety.1"
|
||||
version: "0.12.10"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.3"
|
||||
version: "1.3.0"
|
||||
nested:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: nested
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.0.4"
|
||||
version: "1.0.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.1"
|
||||
version: "1.8.0"
|
||||
pedantic:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: pedantic
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.9.2"
|
||||
version: "1.10.0"
|
||||
provider:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: provider
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.3.2+3"
|
||||
version: "5.0.0-nullsafety.5"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
@@ -120,56 +120,56 @@ packages:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.2"
|
||||
version: "1.8.0"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.10.0-nullsafety.1"
|
||||
version: "1.10.0"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.1"
|
||||
version: "2.1.0"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.1"
|
||||
version: "1.1.0"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.19-nullsafety.2"
|
||||
version: "0.2.19"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.3"
|
||||
version: "1.3.0"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.3"
|
||||
version: "2.1.0"
|
||||
sdks:
|
||||
dart: ">=2.10.0 <2.11.0"
|
||||
dart: ">=2.12.0-0.0 <3.0.0"
|
||||
flutter: ">=1.16.0"
|
||||
|
||||
@@ -5,20 +5,19 @@ description: >
|
||||
version: 1.0.0
|
||||
|
||||
environment:
|
||||
sdk: ">=2.10.0 <3.0.0"
|
||||
sdk: ">=2.12.0-0 <3.0.0"
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
|
||||
provider: ^4.3.2
|
||||
cupertino_icons: ^1.0.0
|
||||
provider: ^5.0.0-nullsafety.5
|
||||
cupertino_icons: ^1.0.2
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
pedantic: ^1.9.0
|
||||
|
||||
pedantic: ^1.10.0
|
||||
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
@@ -30,6 +30,7 @@ class MyApp extends StatelessWidget {
|
||||
ChangeNotifierProxyProvider<CatalogModel, CartModel>(
|
||||
create: (context) => CartModel(),
|
||||
update: (context, catalog, cart) {
|
||||
if (cart == null) throw ArgumentError.notNull('cart');
|
||||
cart.catalog = catalog;
|
||||
return cart;
|
||||
},
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'package:provider_shopper/models/catalog.dart';
|
||||
|
||||
class CartModel extends ChangeNotifier {
|
||||
/// The private field backing [catalog].
|
||||
CatalogModel _catalog;
|
||||
late CatalogModel _catalog;
|
||||
|
||||
/// Internal, private state of the cart. Stores the ids of each item.
|
||||
final List<int> _itemIds = [];
|
||||
@@ -16,9 +16,6 @@ class CartModel extends ChangeNotifier {
|
||||
CatalogModel get catalog => _catalog;
|
||||
|
||||
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;
|
||||
// Notify listeners, in case the new catalog provides information
|
||||
// different from the previous one. For example, availability of an item
|
||||
|
||||
@@ -65,7 +65,7 @@ class _CartTotal extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var hugeStyle =
|
||||
Theme.of(context).textTheme.headline1.copyWith(fontSize: 48);
|
||||
Theme.of(context).textTheme.headline1!.copyWith(fontSize: 48);
|
||||
|
||||
return SizedBox(
|
||||
height: 200,
|
||||
@@ -85,7 +85,7 @@ class _CartTotal extends StatelessWidget {
|
||||
SizedBox(width: 24),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Scaffold.of(context).showSnackBar(
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('Buying not supported yet.')));
|
||||
},
|
||||
style: TextButton.styleFrom(primary: Colors.white),
|
||||
|
||||
@@ -28,7 +28,7 @@ class MyCatalog extends StatelessWidget {
|
||||
class _AddButton extends StatelessWidget {
|
||||
final Item item;
|
||||
|
||||
const _AddButton({Key key, @required this.item}) : super(key: key);
|
||||
const _AddButton({required this.item, Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -55,7 +55,7 @@ class _AddButton extends StatelessWidget {
|
||||
cart.add(item);
|
||||
},
|
||||
style: ButtonStyle(
|
||||
overlayColor: MaterialStateProperty.resolveWith<Color>((states) {
|
||||
overlayColor: MaterialStateProperty.resolveWith<Color?>((states) {
|
||||
if (states.contains(MaterialState.pressed)) {
|
||||
return Theme.of(context).primaryColor;
|
||||
}
|
||||
@@ -86,7 +86,7 @@ class _MyAppBar extends StatelessWidget {
|
||||
class _MyListItem extends StatelessWidget {
|
||||
final int index;
|
||||
|
||||
_MyListItem(this.index, {Key key}) : super(key: key);
|
||||
_MyListItem(this.index, {Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@@ -7,49 +7,49 @@ packages:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.5.0-nullsafety.3"
|
||||
version: "2.5.0"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.3"
|
||||
version: "2.1.0"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.5"
|
||||
version: "1.1.0"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.3"
|
||||
version: "1.2.0"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: clock
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.3"
|
||||
version: "1.1.0"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.15.0-nullsafety.5"
|
||||
version: "1.15.0"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fake_async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.3"
|
||||
version: "1.2.0"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@@ -66,42 +66,42 @@ packages:
|
||||
name: matcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.10-nullsafety.3"
|
||||
version: "0.12.10"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.6"
|
||||
version: "1.3.0"
|
||||
nested:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: nested
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.0.4"
|
||||
version: "1.0.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.3"
|
||||
version: "1.8.0"
|
||||
pedantic:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: pedantic
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.9.2"
|
||||
version: "1.10.0"
|
||||
provider:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: provider
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.3.3"
|
||||
version: "5.0.0-nullsafety.5"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
@@ -113,56 +113,56 @@ packages:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.4"
|
||||
version: "1.8.0"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.10.0-nullsafety.6"
|
||||
version: "1.10.0"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.3"
|
||||
version: "2.1.0"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.3"
|
||||
version: "1.1.0"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.3"
|
||||
version: "1.2.0"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.19-nullsafety.6"
|
||||
version: "0.2.19"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.5"
|
||||
version: "1.3.0"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.5"
|
||||
version: "2.1.0"
|
||||
sdks:
|
||||
dart: ">=2.12.0-0.0 <3.0.0"
|
||||
dart: ">=2.12.0-259.16.beta <3.0.0"
|
||||
flutter: ">=1.16.0"
|
||||
|
||||
@@ -4,19 +4,19 @@ description: A shopping app sample that uses Provider for state management.
|
||||
version: 1.0.0+1
|
||||
|
||||
environment:
|
||||
sdk: ">=2.5.0 <3.0.0"
|
||||
sdk: '>=2.12.0-259.16.beta <3.0.0'
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
|
||||
# Import the provider package.
|
||||
provider: ^4.3.2
|
||||
provider: '>=5.0.0-nullsafety.5 <6.0.0'
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
pedantic: ^1.9.0
|
||||
pedantic: ^1.10.0
|
||||
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
@@ -9,8 +9,8 @@ import 'package:provider_shopper/models/cart.dart';
|
||||
import 'package:provider_shopper/models/catalog.dart';
|
||||
import 'package:provider_shopper/screens/cart.dart';
|
||||
|
||||
CartModel cartModel;
|
||||
CatalogModel catalogModel;
|
||||
CartModel? cartModel;
|
||||
CatalogModel? catalogModel;
|
||||
Widget createCartScreen() => MultiProvider(
|
||||
providers: [
|
||||
Provider(create: (context) => CatalogModel()),
|
||||
@@ -19,7 +19,7 @@ Widget createCartScreen() => MultiProvider(
|
||||
update: (context, catalog, cart) {
|
||||
catalogModel = catalog;
|
||||
cartModel = cart;
|
||||
cart.catalog = catalogModel;
|
||||
cart!.catalog = catalogModel!;
|
||||
return cart;
|
||||
},
|
||||
),
|
||||
@@ -48,8 +48,8 @@ void main() {
|
||||
|
||||
// Adding five items in the cart and testing.
|
||||
for (var i = 0; i < 5; i++) {
|
||||
var item = catalogModel.getByPosition(i);
|
||||
cartModel.add(item);
|
||||
var item = catalogModel!.getByPosition(i);
|
||||
cartModel!.add(item);
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text(item.name), findsOneWidget);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ Widget createCatalogScreen() => MultiProvider(
|
||||
ChangeNotifierProxyProvider<CatalogModel, CartModel>(
|
||||
create: (context) => CartModel(),
|
||||
update: (context, catalog, cart) {
|
||||
cart.catalog = catalog;
|
||||
cart!.catalog = catalog;
|
||||
return cart;
|
||||
},
|
||||
),
|
||||
|
||||
@@ -18,7 +18,7 @@ void main() {
|
||||
ChangeNotifierProxyProvider<CatalogModel, CartModel>(
|
||||
create: (context) => CartModel(),
|
||||
update: (context, catalog, cart) {
|
||||
cart.catalog = catalog;
|
||||
cart!.catalog = catalog;
|
||||
return cart;
|
||||
},
|
||||
),
|
||||
|
||||
@@ -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 "Generated.xcconfig"
|
||||
|
||||
@@ -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 "Generated.xcconfig"
|
||||
|
||||
@@ -55,7 +55,7 @@ class FavoriteItemTile extends StatelessWidget {
|
||||
icon: Icon(Icons.close),
|
||||
onPressed: () {
|
||||
Provider.of<Favorites>(context, listen: false).remove(itemNo);
|
||||
Scaffold.of(context).showSnackBar(
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text('Removed from favorites.'),
|
||||
duration: Duration(seconds: 1),
|
||||
|
||||
@@ -67,7 +67,7 @@ class ItemTile extends StatelessWidget {
|
||||
!favoritesList.items.contains(itemNo)
|
||||
? favoritesList.add(itemNo)
|
||||
: favoritesList.remove(itemNo);
|
||||
Scaffold.of(context).showSnackBar(
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(favoritesList.items.contains(itemNo)
|
||||
? 'Added to favorites.'
|
||||
|
||||
@@ -7,14 +7,14 @@ packages:
|
||||
name: _fe_analyzer_shared
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "12.0.0"
|
||||
version: "14.0.0"
|
||||
analyzer:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: analyzer
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.40.6"
|
||||
version: "0.41.2"
|
||||
archive:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -35,28 +35,28 @@ packages:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.5.0-nullsafety.1"
|
||||
version: "2.5.0-nullsafety.3"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.1"
|
||||
version: "2.1.0-nullsafety.3"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.3"
|
||||
version: "1.1.0-nullsafety.5"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0-nullsafety.3"
|
||||
cli_util:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -70,14 +70,14 @@ packages:
|
||||
name: clock
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.1"
|
||||
version: "1.1.0-nullsafety.3"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.15.0-nullsafety.3"
|
||||
version: "1.15.0-nullsafety.5"
|
||||
convert:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -91,7 +91,7 @@ packages:
|
||||
name: coverage
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.14.2"
|
||||
version: "0.15.1"
|
||||
crypto:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -112,14 +112,14 @@ packages:
|
||||
name: fake_async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0-nullsafety.3"
|
||||
file:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: file
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "6.0.0-nullsafety.2"
|
||||
version: "6.0.0-nullsafety.4"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@@ -147,13 +147,6 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
http:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: http
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.2"
|
||||
http_multi_server:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -188,14 +181,7 @@ packages:
|
||||
name: js
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.6.3-nullsafety.2"
|
||||
json_rpc_2:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: json_rpc_2
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.2.2"
|
||||
version: "0.6.3-nullsafety.3"
|
||||
logging:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -209,14 +195,14 @@ packages:
|
||||
name: matcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.10-nullsafety.1"
|
||||
version: "0.12.10-nullsafety.3"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.3"
|
||||
version: "1.3.0-nullsafety.6"
|
||||
mime:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -251,7 +237,7 @@ packages:
|
||||
name: node_preamble
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.4.12"
|
||||
version: "1.4.13"
|
||||
package_config:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -265,42 +251,42 @@ packages:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.1"
|
||||
version: "1.8.0-nullsafety.3"
|
||||
pedantic:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: pedantic
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.10.0-nullsafety.2"
|
||||
version: "1.10.0-nullsafety.3"
|
||||
platform:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: platform
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.0-nullsafety.2"
|
||||
version: "3.0.0-nullsafety.4"
|
||||
pool:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pool
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.5.0-nullsafety.2"
|
||||
version: "1.5.0-nullsafety.3"
|
||||
process:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: process
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.0.0-nullsafety.2"
|
||||
version: "4.0.0-nullsafety.4"
|
||||
provider:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: provider
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.3.2+3"
|
||||
version: "4.3.3"
|
||||
pub_semver:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -321,21 +307,21 @@ packages:
|
||||
name: shelf_packages_handler
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
version: "2.0.1"
|
||||
shelf_static:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shelf_static
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.9+1"
|
||||
version: "0.2.9+2"
|
||||
shelf_web_socket:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shelf_web_socket
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.3"
|
||||
version: "0.2.4"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
@@ -347,42 +333,42 @@ packages:
|
||||
name: source_map_stack_trace
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.3"
|
||||
version: "2.1.0-nullsafety.4"
|
||||
source_maps:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_maps
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.10.10-nullsafety.2"
|
||||
version: "0.10.10-nullsafety.3"
|
||||
source_span:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.2"
|
||||
version: "1.8.0-nullsafety.4"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.10.0-nullsafety.1"
|
||||
version: "1.10.0-nullsafety.6"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.1"
|
||||
version: "2.1.0-nullsafety.3"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.1"
|
||||
version: "1.1.0-nullsafety.3"
|
||||
sync_http:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -396,42 +382,42 @@ packages:
|
||||
name: term_glyph
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0-nullsafety.3"
|
||||
test:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: test
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.16.0-nullsafety.5"
|
||||
version: "1.16.0-nullsafety.17"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.19-nullsafety.2"
|
||||
version: "0.2.19-nullsafety.6"
|
||||
test_core:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_core
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.3.12-nullsafety.5"
|
||||
version: "0.3.12-nullsafety.15"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.3"
|
||||
version: "1.3.0-nullsafety.5"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.3"
|
||||
version: "2.1.0-nullsafety.5"
|
||||
vm_service:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -439,13 +425,6 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
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:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -459,7 +438,7 @@ packages:
|
||||
name: web_socket_channel
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "1.2.0"
|
||||
webdriver:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -482,5 +461,5 @@ packages:
|
||||
source: hosted
|
||||
version: "2.2.1"
|
||||
sdks:
|
||||
dart: ">=2.10.0 <2.11.0"
|
||||
flutter: ">=1.16.0 <2.0.0"
|
||||
dart: ">=2.12.0-0.0 <3.0.0"
|
||||
flutter: ">=1.16.0"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user