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
506998cf
Unverified
Commit
506998cf
authored
Sep 24, 2020
by
Michael Goderbauer
Committed by
GitHub
Sep 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow futures that resolve to null in Future/StreamBuilder (#66506)
parent
2adb9189
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
async.dart
packages/flutter/lib/src/widgets/async.dart
+3
-5
No files found.
packages/flutter/lib/src/widgets/async.dart
View file @
506998cf
...
...
@@ -201,8 +201,6 @@ enum ConnectionState {
/// with a [Stream].
/// * [FutureBuilder], which builds itself based on a snapshot from interacting
/// with a [Future].
// TODO(a14n): the type parameter should be <T extends Object> to enforce that retrieved data must not be null.
// But it breaks a lot of code in google3. See https://github.com/flutter/flutter/pull/64672#pullrequestreview-485199027
@immutable
class
AsyncSnapshot
<
T
>
{
/// Creates an [AsyncSnapshot] with the specified [connectionState],
...
...
@@ -467,7 +465,7 @@ typedef AsyncWidgetBuilder<T> = Widget Function(BuildContext context, AsyncSnaps
/// * [StreamBuilderBase], which supports widget building based on a computation
/// that spans all interactions made with the stream.
// TODO(ianh): remove unreachable code above once https://github.com/dart-lang/linter/issues/1139 is fixed
class
StreamBuilder
<
T
extends
Object
>
extends
StreamBuilderBase
<
T
,
AsyncSnapshot
<
T
>>
{
class
StreamBuilder
<
T
>
extends
StreamBuilderBase
<
T
,
AsyncSnapshot
<
T
>>
{
/// Creates a new [StreamBuilder] that builds itself based on the latest
/// snapshot of interaction with the specified [stream] and whose build
/// strategy is given by [builder].
...
...
@@ -664,7 +662,7 @@ class StreamBuilder<T extends Object> extends StreamBuilderBase<T, AsyncSnapshot
/// ```
/// {@end-tool}
// TODO(ianh): remove unreachable code above once https://github.com/dart-lang/sdk/issues/35520 is fixed
class
FutureBuilder
<
T
extends
Object
>
extends
StatefulWidget
{
class
FutureBuilder
<
T
>
extends
StatefulWidget
{
/// Creates a widget that builds itself based on the latest snapshot of
/// interaction with a [Future].
///
...
...
@@ -723,7 +721,7 @@ class FutureBuilder<T extends Object> extends StatefulWidget {
}
/// State for [FutureBuilder].
class
_FutureBuilderState
<
T
extends
Object
>
extends
State
<
FutureBuilder
<
T
>>
{
class
_FutureBuilderState
<
T
>
extends
State
<
FutureBuilder
<
T
>>
{
/// An object that identifies the currently active callbacks. Used to avoid
/// calling setState from stale callbacks, e.g. after disposal of this state,
/// or after widget reconfiguration to a new Future.
...
...
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