Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
0436886e
Unverified
Commit
0436886e
authored
Nov 12, 2020
by
Emmanuel Garcia
Committed by
GitHub
Nov 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Future can return null (#70324)
parent
0937207f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
updater.dart
...ntegration_tests/flutter_gallery/lib/gallery/updater.dart
+3
-3
No files found.
dev/integration_tests/flutter_gallery/lib/gallery/updater.dart
View file @
0436886e
...
@@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
...
@@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
import
'package:url_launcher/url_launcher.dart'
;
import
'package:url_launcher/url_launcher.dart'
;
typedef
UpdateUrlFetcher
=
Future
<
String
>
Function
();
typedef
UpdateUrlFetcher
=
Future
<
String
?
>
Function
();
class
Updater
extends
StatefulWidget
{
class
Updater
extends
StatefulWidget
{
const
Updater
({
required
this
.
updateUrlFetcher
,
this
.
child
,
Key
?
key
})
const
Updater
({
required
this
.
updateUrlFetcher
,
this
.
child
,
Key
?
key
})
...
@@ -35,9 +35,9 @@ class UpdaterState extends State<Updater> {
...
@@ -35,9 +35,9 @@ class UpdaterState extends State<Updater> {
}
}
_lastUpdateCheck
=
DateTime
.
now
();
_lastUpdateCheck
=
DateTime
.
now
();
final
String
updateUrl
=
await
widget
.
updateUrlFetcher
();
final
String
?
updateUrl
=
await
widget
.
updateUrlFetcher
();
final
bool
?
wantsUpdate
=
await
showDialog
<
bool
>(
context:
context
,
builder:
_buildDialog
);
final
bool
?
wantsUpdate
=
await
showDialog
<
bool
>(
context:
context
,
builder:
_buildDialog
);
if
(
wantsUpdate
!=
null
&&
wantsUpdate
)
if
(
wantsUpdate
!=
null
&&
updateUrl
!=
null
&&
wantsUpdate
)
launch
(
updateUrl
);
launch
(
updateUrl
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment