Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter 2 null safety migration #67

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions example/async_data/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class AsyncDataExampleHomePage extends StatefulWidget {

class _AsyncDataExampleHomePageState extends State<AsyncDataExampleHomePage>
with TickerProviderStateMixin {
StreamController<List<String>> _streamController;
late StreamController<List<String>> _streamController;

List<String> welcomeImages = [
"assets/welcome0.png",
Expand Down Expand Up @@ -64,7 +64,7 @@ class _AsyncDataExampleHomePageState extends State<AsyncDataExampleHomePage>
initialData: welcomeImages,
builder:
(BuildContext context, AsyncSnapshot<List<String>> snapshot) {
print('snapshot.data.length: ${snapshot.data.length}');
print('snapshot.data.length: ${snapshot.data!.length}');
if (snapshot.hasError) return Text('Error: ${snapshot.error}');
switch (snapshot.connectionState) {
case ConnectionState.none:
Expand All @@ -74,7 +74,7 @@ class _AsyncDataExampleHomePageState extends State<AsyncDataExampleHomePage>
case ConnectionState.active:
return _asyncDataExample(
context,
snapshot.data,
snapshot.data!,
(CardSwipeOrientation orientation) {
// welcomeImages[0] is the swiped card
// you can send to backend service in here
Expand Down
2 changes: 1 addition & 1 deletion example/async_data/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ publish_to: "none"
version: 1.0.0+1

environment:
sdk: ">=2.7.0 <3.0.0"
sdk: '>=2.12.0 <3.0.0'

dependencies:
flutter:
Expand Down
2 changes: 1 addition & 1 deletion example/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ publish_to: "none"
version: 1.0.0+1

environment:
sdk: ">=2.7.0 <3.0.0"
sdk: '>=2.12.0 <3.0.0'

dependencies:
flutter:
Expand Down
Loading