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
e989d6b1
Unverified
Commit
e989d6b1
authored
May 25, 2021
by
Abhishek Ghaskata
Committed by
GitHub
May 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Assign late variable without initstate in flutter_gallery (#83020)
parent
a8ec7646
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
17 deletions
+10
-17
cupertino_navigation_demo.dart
...gallery/lib/demo/cupertino/cupertino_navigation_demo.dart
+9
-15
app.dart
dev/integration_tests/flutter_gallery/lib/gallery/app.dart
+1
-2
No files found.
dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_navigation_demo.dart
View file @
e989d6b1
...
@@ -302,21 +302,15 @@ class Tab1ItemPage extends StatefulWidget {
...
@@ -302,21 +302,15 @@ class Tab1ItemPage extends StatefulWidget {
}
}
class
Tab1ItemPageState
extends
State
<
Tab1ItemPage
>
{
class
Tab1ItemPageState
extends
State
<
Tab1ItemPage
>
{
@override
late
final
List
<
Color
>
relatedColors
=
List
<
Color
>.
generate
(
10
,
(
int
index
)
{
void
initState
()
{
final
math
.
Random
random
=
math
.
Random
(
widget
.
randomSeed
);
super
.
initState
();
return
Color
.
fromARGB
(
relatedColors
=
List
<
Color
>.
generate
(
10
,
(
int
index
)
{
255
,
final
math
.
Random
random
=
math
.
Random
(
widget
.
randomSeed
);
(
widget
.
color
!.
red
+
random
.
nextInt
(
100
)
-
50
).
clamp
(
0
,
255
),
return
Color
.
fromARGB
(
(
widget
.
color
!.
green
+
random
.
nextInt
(
100
)
-
50
).
clamp
(
0
,
255
),
255
,
(
widget
.
color
!.
blue
+
random
.
nextInt
(
100
)
-
50
).
clamp
(
0
,
255
),
(
widget
.
color
!.
red
+
random
.
nextInt
(
100
)
-
50
).
clamp
(
0
,
255
),
);
(
widget
.
color
!.
green
+
random
.
nextInt
(
100
)
-
50
).
clamp
(
0
,
255
),
});
(
widget
.
color
!.
blue
+
random
.
nextInt
(
100
)
-
50
).
clamp
(
0
,
255
),
);
});
}
late
List
<
Color
>
relatedColors
;
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
...
...
dev/integration_tests/flutter_gallery/lib/gallery/app.dart
View file @
e989d6b1
...
@@ -45,7 +45,7 @@ class GalleryApp extends StatefulWidget {
...
@@ -45,7 +45,7 @@ class GalleryApp extends StatefulWidget {
class
_GalleryAppState
extends
State
<
GalleryApp
>
{
class
_GalleryAppState
extends
State
<
GalleryApp
>
{
GalleryOptions
?
_options
;
GalleryOptions
?
_options
;
Timer
?
_timeDilationTimer
;
Timer
?
_timeDilationTimer
;
late
AppStateModel
model
;
late
final
AppStateModel
model
=
AppStateModel
()..
loadProducts
()
;
Map
<
String
,
WidgetBuilder
>
_buildRoutes
()
{
Map
<
String
,
WidgetBuilder
>
_buildRoutes
()
{
// For a different example of how to set up an application routing table
// For a different example of how to set up an application routing table
...
@@ -66,7 +66,6 @@ class _GalleryAppState extends State<GalleryApp> {
...
@@ -66,7 +66,6 @@ class _GalleryAppState extends State<GalleryApp> {
timeDilation:
timeDilation
,
timeDilation:
timeDilation
,
platform:
defaultTargetPlatform
,
platform:
defaultTargetPlatform
,
);
);
model
=
AppStateModel
()..
loadProducts
();
}
}
@override
@override
...
...
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