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
d227788a
Unverified
Commit
d227788a
authored
Sep 29, 2020
by
Konstantin Scheglov
Committed by
GitHub
Sep 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move assert(s) that reference 'this' to the constructor bodies. (#66914)
parent
5f76bfb4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
19 deletions
+24
-19
route.dart
packages/flutter/lib/src/cupertino/route.dart
+6
-4
page.dart
packages/flutter/lib/src/material/page.dart
+6
-4
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+12
-11
No files found.
packages/flutter/lib/src/cupertino/route.dart
View file @
d227788a
...
@@ -349,8 +349,9 @@ class CupertinoPageRoute<T> extends PageRoute<T> with CupertinoRouteTransitionMi
...
@@ -349,8 +349,9 @@ class CupertinoPageRoute<T> extends PageRoute<T> with CupertinoRouteTransitionMi
})
:
assert
(
builder
!=
null
),
})
:
assert
(
builder
!=
null
),
assert
(
maintainState
!=
null
),
assert
(
maintainState
!=
null
),
assert
(
fullscreenDialog
!=
null
),
assert
(
fullscreenDialog
!=
null
),
assert
(
opaque
),
super
(
settings:
settings
,
fullscreenDialog:
fullscreenDialog
)
{
super
(
settings:
settings
,
fullscreenDialog:
fullscreenDialog
);
assert
(
opaque
);
}
/// Builds the primary contents of the route.
/// Builds the primary contents of the route.
final
WidgetBuilder
builder
;
final
WidgetBuilder
builder
;
...
@@ -376,8 +377,9 @@ class _PageBasedCupertinoPageRoute<T> extends PageRoute<T> with CupertinoRouteTr
...
@@ -376,8 +377,9 @@ class _PageBasedCupertinoPageRoute<T> extends PageRoute<T> with CupertinoRouteTr
_PageBasedCupertinoPageRoute
({
_PageBasedCupertinoPageRoute
({
required
CupertinoPage
<
T
>
page
,
required
CupertinoPage
<
T
>
page
,
})
:
assert
(
page
!=
null
),
})
:
assert
(
page
!=
null
),
assert
(
opaque
),
super
(
settings:
page
)
{
super
(
settings:
page
);
assert
(
opaque
);
}
CupertinoPage
<
T
>
get
_page
=>
settings
as
CupertinoPage
<
T
>;
CupertinoPage
<
T
>
get
_page
=>
settings
as
CupertinoPage
<
T
>;
...
...
packages/flutter/lib/src/material/page.dart
View file @
d227788a
...
@@ -45,8 +45,9 @@ class MaterialPageRoute<T> extends PageRoute<T> with MaterialRouteTransitionMixi
...
@@ -45,8 +45,9 @@ class MaterialPageRoute<T> extends PageRoute<T> with MaterialRouteTransitionMixi
})
:
assert
(
builder
!=
null
),
})
:
assert
(
builder
!=
null
),
assert
(
maintainState
!=
null
),
assert
(
maintainState
!=
null
),
assert
(
fullscreenDialog
!=
null
),
assert
(
fullscreenDialog
!=
null
),
assert
(
opaque
),
super
(
settings:
settings
,
fullscreenDialog:
fullscreenDialog
)
{
super
(
settings:
settings
,
fullscreenDialog:
fullscreenDialog
);
assert
(
opaque
);
}
/// Builds the primary contents of the route.
/// Builds the primary contents of the route.
final
WidgetBuilder
builder
;
final
WidgetBuilder
builder
;
...
@@ -186,8 +187,9 @@ class _PageBasedMaterialPageRoute<T> extends PageRoute<T> with MaterialRouteTran
...
@@ -186,8 +187,9 @@ class _PageBasedMaterialPageRoute<T> extends PageRoute<T> with MaterialRouteTran
_PageBasedMaterialPageRoute
({
_PageBasedMaterialPageRoute
({
@required
MaterialPage
<
T
>
page
,
@required
MaterialPage
<
T
>
page
,
})
:
assert
(
page
!=
null
),
})
:
assert
(
page
!=
null
),
assert
(
opaque
),
super
(
settings:
page
)
{
super
(
settings:
page
);
assert
(
opaque
);
}
MaterialPage
<
T
>
get
_page
=>
settings
as
MaterialPage
<
T
>;
MaterialPage
<
T
>
get
_page
=>
settings
as
MaterialPage
<
T
>;
...
...
packages/flutter/lib/src/widgets/framework.dart
View file @
d227788a
...
@@ -1918,19 +1918,20 @@ abstract class MultiChildRenderObjectWidget extends RenderObjectWidget {
...
@@ -1918,19 +1918,20 @@ abstract class MultiChildRenderObjectWidget extends RenderObjectWidget {
/// objects.
/// objects.
MultiChildRenderObjectWidget
({
Key
?
key
,
this
.
children
=
const
<
Widget
>[]
})
MultiChildRenderObjectWidget
({
Key
?
key
,
this
.
children
=
const
<
Widget
>[]
})
:
assert
(
children
!=
null
),
:
assert
(
children
!=
null
),
assert
(()
{
super
(
key:
key
)
{
for
(
int
index
=
0
;
index
<
children
.
length
;
index
++)
{
assert
(()
{
// TODO(a14n): remove this check to have a lot more const widget
for
(
int
index
=
0
;
index
<
children
.
length
;
index
++)
{
if
(
children
[
index
]
==
null
)
{
// ignore: dead_code
// TODO(a14n): remove this check to have a lot more const widget
throw
FlutterError
(
if
(
children
[
index
]
==
null
)
{
// ignore: dead_code
throw
FlutterError
(
"
$runtimeType
's children must not contain any null values, "
"
$runtimeType
's children must not contain any null values, "
'but a null value was found at index
$index
'
'but a null value was found at index
$index
'
);
);
}
}
}
return
true
;
}
}()),
// https://github.com/dart-lang/sdk/issues/29276
return
true
;
super
(
key:
key
);
}());
// https://github.com/dart-lang/sdk/issues/29276
}
/// The widgets below this widget in the tree.
/// The widgets below this widget in the tree.
///
///
...
...
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