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
ec0842e0
Unverified
Commit
ec0842e0
authored
Dec 05, 2019
by
Alexandre Ardhuin
Committed by
GitHub
Dec 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implicit-casts:false in examples (#45805)
parent
c6fe7bb9
Changes
40
Hide whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
110 additions
and
107 deletions
+110
-107
animated_list.dart
examples/catalog/lib/animated_list.dart
+1
-1
home.dart
examples/flutter_gallery/lib/demo/animation/home.dart
+3
-3
sections.dart
examples/flutter_gallery/lib/demo/animation/sections.dart
+2
-4
logic.dart
examples/flutter_gallery/lib/demo/calculator/logic.dart
+4
-4
cupertino_navigation_demo.dart
...gallery/lib/demo/cupertino/cupertino_navigation_demo.dart
+6
-6
backdrop_demo.dart
...ples/flutter_gallery/lib/demo/material/backdrop_demo.dart
+3
-3
grid_list_demo.dart
...les/flutter_gallery/lib/demo/material/grid_list_demo.dart
+5
-2
page_selector_demo.dart
...flutter_gallery/lib/demo/material/page_selector_demo.dart
+1
-1
slider_demo.dart
examples/flutter_gallery/lib/demo/material/slider_demo.dart
+1
-1
pesto_demo.dart
examples/flutter_gallery/lib/demo/pesto_demo.dart
+1
-1
backdrop.dart
examples/flutter_gallery/lib/demo/shrine/backdrop.dart
+3
-3
expanding_bottom_sheet.dart
...utter_gallery/lib/demo/shrine/expanding_bottom_sheet.dart
+1
-1
transformations_demo_board.dart
.../lib/demo/transformations/transformations_demo_board.dart
+3
-2
transformations_demo_gesture_transformable.dart
...ormations/transformations_demo_gesture_transformable.dart
+2
-2
video_demo.dart
examples/flutter_gallery/lib/demo/video_demo.dart
+1
-1
app.dart
examples/flutter_gallery/lib/gallery/app.dart
+2
-2
backdrop.dart
examples/flutter_gallery/lib/gallery/backdrop.dart
+2
-2
demo.dart
examples/flutter_gallery/lib/gallery/demo.dart
+4
-4
demos.dart
examples/flutter_gallery/lib/gallery/demos.dart
+4
-4
home.dart
examples/flutter_gallery/lib/gallery/home.dart
+1
-1
options.dart
examples/flutter_gallery/lib/gallery/options.dart
+8
-8
scales.dart
examples/flutter_gallery/lib/gallery/scales.dart
+3
-2
smoke_test.dart
examples/flutter_gallery/test/calculator/smoke_test.dart
+1
-1
drawer_test.dart
examples/flutter_gallery/test/drawer_test.dart
+6
-6
example_code_display_test.dart
examples/flutter_gallery/test/example_code_display_test.dart
+1
-1
pesto_test.dart
examples/flutter_gallery/test/pesto_test.dart
+1
-1
simple_smoke_test.dart
examples/flutter_gallery/test/simple_smoke_test.dart
+1
-1
update_test.dart
examples/flutter_gallery/test/update_test.dart
+1
-1
transitions_perf_test.dart
...es/flutter_gallery/test_driver/transitions_perf_test.dart
+8
-8
flex_layout.dart
examples/layers/rendering/flex_layout.dart
+2
-2
sector_layout.dart
examples/layers/rendering/src/sector_layout.dart
+13
-13
touch_input.dart
examples/layers/rendering/touch_input.dart
+2
-2
isolate.dart
examples/layers/services/isolate.dart
+1
-1
sectors.dart
examples/layers/widgets/sectors.dart
+3
-3
spinning_mixed.dart
examples/layers/widgets/spinning_mixed.dart
+1
-1
main.dart
examples/stocks/lib/main.dart
+1
-1
stock_data.dart
examples/stocks/lib/stock_data.dart
+3
-3
stock_home.dart
examples/stocks/lib/stock_home.dart
+2
-2
stock_settings.dart
examples/stocks/lib/stock_settings.dart
+1
-1
icon_color_test.dart
examples/stocks/test/icon_color_test.dart
+1
-1
No files found.
examples/catalog/lib/animated_list.dart
View file @
ec0842e0
...
...
@@ -122,7 +122,7 @@ class ListModel<E> {
_items
=
initialItems
?.
toList
()
??
<
E
>[];
final
GlobalKey
<
AnimatedListState
>
listKey
;
final
dynamic
removedItemBuilder
;
final
Widget
Function
(
E
item
,
BuildContext
context
,
Animation
<
double
>
animation
)
removedItemBuilder
;
final
List
<
E
>
_items
;
AnimatedListState
get
_animatedList
=>
listKey
.
currentState
;
...
...
examples/flutter_gallery/lib/demo/animation/home.dart
View file @
ec0842e0
...
...
@@ -64,7 +64,7 @@ class _RenderStatusBarPaddingSliver extends RenderSliver {
@override
void
performLayout
()
{
final
double
height
=
(
maxHeight
-
constraints
.
scrollOffset
/
scrollFactor
).
clamp
(
0.0
,
maxHeight
);
final
double
height
=
(
maxHeight
-
constraints
.
scrollOffset
/
scrollFactor
).
clamp
(
0.0
,
maxHeight
)
as
double
;
geometry
=
SliverGeometry
(
paintExtent:
math
.
min
(
height
,
constraints
.
remainingPaintExtent
),
scrollExtent:
maxHeight
,
...
...
@@ -285,7 +285,7 @@ class _AllSectionsView extends AnimatedWidget {
final
List
<
Widget
>
sectionCards
;
double
_selectedIndexDelta
(
int
index
)
{
return
(
index
.
toDouble
()
-
selectedIndex
.
value
).
abs
().
clamp
(
0.0
,
1.0
);
return
(
index
.
toDouble
()
-
selectedIndex
.
value
).
abs
().
clamp
(
0.0
,
1.0
)
as
double
;
}
Widget
_build
(
BuildContext
context
,
BoxConstraints
constraints
)
{
...
...
@@ -498,7 +498,7 @@ class _AnimationDemoHomeState extends State<AnimationDemoHome> {
return
ListTile
.
divideTiles
(
context:
context
,
tiles:
detailItems
);
}
Iterable
<
Widget
>
_allHeadingItems
(
double
maxHeight
,
double
midScrollOffset
)
{
List
<
Widget
>
_allHeadingItems
(
double
maxHeight
,
double
midScrollOffset
)
{
final
List
<
Widget
>
sectionCards
=
<
Widget
>[];
for
(
int
index
=
0
;
index
<
allSections
.
length
;
index
++)
{
sectionCards
.
add
(
LayoutId
(
...
...
examples/flutter_gallery/lib/demo/animation/sections.dart
View file @
ec0842e0
...
...
@@ -44,10 +44,8 @@ class Section {
@override
bool
operator
==(
Object
other
)
{
if
(
other
is
!
Section
)
return
false
;
final
Section
otherSection
=
other
;
return
title
==
otherSection
.
title
;
return
other
is
Section
&&
other
.
title
==
title
;
}
@override
...
...
examples/flutter_gallery/lib/demo/calculator/logic.dart
View file @
ec0842e0
...
...
@@ -287,7 +287,7 @@ class CalcExpression {
// multiplication or division symbols.
num
currentTermValue
=
removeNextTerm
(
list
);
while
(
list
.
isNotEmpty
)
{
final
OperationToken
opToken
=
list
.
removeAt
(
0
);
final
OperationToken
opToken
=
list
.
removeAt
(
0
)
as
OperationToken
;
final
num
nextTermValue
=
removeNextTerm
(
list
);
switch
(
opToken
.
operation
)
{
case
Operation
.
Addition
:
...
...
@@ -313,11 +313,11 @@ class CalcExpression {
/// and division symbols.
static
num
removeNextTerm
(
List
<
ExpressionToken
>
list
)
{
assert
(
list
!=
null
&&
list
.
isNotEmpty
);
final
NumberToken
firstNumToken
=
list
.
removeAt
(
0
);
final
NumberToken
firstNumToken
=
list
.
removeAt
(
0
)
as
NumberToken
;
num
currentValue
=
firstNumToken
.
number
;
while
(
list
.
isNotEmpty
)
{
bool
isDivision
=
false
;
final
OperationToken
nextOpToken
=
list
.
first
;
final
OperationToken
nextOpToken
=
list
.
first
as
OperationToken
;
switch
(
nextOpToken
.
operation
)
{
case
Operation
.
Addition
:
case
Operation
.
Subtraction
:
...
...
@@ -331,7 +331,7 @@ class CalcExpression {
// Remove the operation token.
list
.
removeAt
(
0
);
// Remove the next number token.
final
NumberToken
nextNumToken
=
list
.
removeAt
(
0
);
final
NumberToken
nextNumToken
=
list
.
removeAt
(
0
)
as
NumberToken
;
final
num
nextNumber
=
nextNumToken
.
number
;
if
(
isDivision
)
currentValue
/=
nextNumber
;
...
...
examples/flutter_gallery/lib/demo/cupertino/cupertino_navigation_demo.dart
View file @
ec0842e0
...
...
@@ -293,9 +293,9 @@ class Tab1ItemPageState extends State<Tab1ItemPage> {
final
math
.
Random
random
=
math
.
Random
();
return
Color
.
fromARGB
(
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
),
(
widget
.
color
.
red
+
random
.
nextInt
(
100
)
-
50
).
clamp
(
0
,
255
)
as
int
,
(
widget
.
color
.
green
+
random
.
nextInt
(
100
)
-
50
).
clamp
(
0
,
255
)
as
int
,
(
widget
.
color
.
blue
+
random
.
nextInt
(
100
)
-
50
).
clamp
(
0
,
255
)
as
int
,
);
});
}
...
...
@@ -635,9 +635,9 @@ class Tab2ConversationAvatar extends StatelessWidget {
color
,
Color
.
fromARGB
(
color
.
alpha
,
(
color
.
red
-
60
).
clamp
(
0
,
255
),
(
color
.
green
-
60
).
clamp
(
0
,
255
),
(
color
.
blue
-
60
).
clamp
(
0
,
255
),
(
color
.
red
-
60
).
clamp
(
0
,
255
)
as
int
,
(
color
.
green
-
60
).
clamp
(
0
,
255
)
as
int
,
(
color
.
blue
-
60
).
clamp
(
0
,
255
)
as
int
,
),
],
),
...
...
examples/flutter_gallery/lib/demo/material/backdrop_demo.dart
View file @
ec0842e0
...
...
@@ -205,12 +205,12 @@ class BackdropPanel extends StatelessWidget {
class
BackdropTitle
extends
AnimatedWidget
{
const
BackdropTitle
({
Key
key
,
Listenable
listenable
,
Animation
<
double
>
listenable
,
})
:
super
(
key:
key
,
listenable:
listenable
);
@override
Widget
build
(
BuildContext
context
)
{
final
Animation
<
double
>
animation
=
listenable
;
final
Animation
<
double
>
animation
=
listenable
as
Animation
<
double
>
;
return
DefaultTextStyle
(
style:
Theme
.
of
(
context
).
primaryTextTheme
.
title
,
softWrap:
false
,
...
...
@@ -283,7 +283,7 @@ class _BackdropDemoState extends State<BackdropDemo> with SingleTickerProviderSt
}
double
get
_backdropHeight
{
final
RenderBox
renderBox
=
_backdropKey
.
currentContext
.
findRenderObject
();
final
RenderBox
renderBox
=
_backdropKey
.
currentContext
.
findRenderObject
()
as
RenderBox
;
return
renderBox
.
size
.
height
;
}
...
...
examples/flutter_gallery/lib/demo/material/grid_list_demo.dart
View file @
ec0842e0
...
...
@@ -87,7 +87,10 @@ class _GridPhotoViewerState extends State<GridPhotoViewer> with SingleTickerProv
Offset
_clampOffset
(
Offset
offset
)
{
final
Size
size
=
context
.
size
;
final
Offset
minOffset
=
Offset
(
size
.
width
,
size
.
height
)
*
(
1.0
-
_scale
);
return
Offset
(
offset
.
dx
.
clamp
(
minOffset
.
dx
,
0.0
),
offset
.
dy
.
clamp
(
minOffset
.
dy
,
0.0
));
return
Offset
(
offset
.
dx
.
clamp
(
minOffset
.
dx
,
0.0
)
as
double
,
offset
.
dy
.
clamp
(
minOffset
.
dy
,
0.0
)
as
double
,
);
}
void
_handleFlingAnimation
()
{
...
...
@@ -107,7 +110,7 @@ class _GridPhotoViewerState extends State<GridPhotoViewer> with SingleTickerProv
void
_handleOnScaleUpdate
(
ScaleUpdateDetails
details
)
{
setState
(()
{
_scale
=
(
_previousScale
*
details
.
scale
).
clamp
(
1.0
,
4.0
);
_scale
=
(
_previousScale
*
details
.
scale
).
clamp
(
1.0
,
4.0
)
as
double
;
// Ensure that image location under the focal point stays in the same place despite scaling.
_offset
=
_clampOffset
(
details
.
focalPoint
-
_normalizedOffset
*
_scale
);
});
...
...
examples/flutter_gallery/lib/demo/material/page_selector_demo.dart
View file @
ec0842e0
...
...
@@ -14,7 +14,7 @@ class _PageSelector extends StatelessWidget {
void
_handleArrowButtonPress
(
BuildContext
context
,
int
delta
)
{
final
TabController
controller
=
DefaultTabController
.
of
(
context
);
if
(!
controller
.
indexIsChanging
)
controller
.
animateTo
((
controller
.
index
+
delta
).
clamp
(
0
,
icons
.
length
-
1
));
controller
.
animateTo
((
controller
.
index
+
delta
).
clamp
(
0
,
icons
.
length
-
1
)
as
int
);
}
@override
...
...
examples/flutter_gallery/lib/demo/material/slider_demo.dart
View file @
ec0842e0
...
...
@@ -257,7 +257,7 @@ class _SlidersState extends State<_Sliders> {
final
double
newValue
=
double
.
tryParse
(
value
);
if
(
newValue
!=
null
&&
newValue
!=
_continuousValue
)
{
setState
(()
{
_continuousValue
=
newValue
.
clamp
(
0
,
100
)
;
_continuousValue
=
newValue
.
clamp
(
0
.0
,
100.0
)
as
double
;
});
}
},
...
...
examples/flutter_gallery/lib/demo/pesto_demo.dart
View file @
ec0842e0
...
...
@@ -129,7 +129,7 @@ class _RecipeGridPageState extends State<RecipeGridPage> {
bottom:
extraPadding
,
),
child:
Center
(
child:
PestoLogo
(
height:
logoHeight
,
t:
t
.
clamp
(
0.0
,
1.0
)),
child:
PestoLogo
(
height:
logoHeight
,
t:
t
.
clamp
(
0.0
,
1.0
)
as
double
),
),
);
},
...
...
examples/flutter_gallery/lib/demo/shrine/backdrop.dart
View file @
ec0842e0
...
...
@@ -111,7 +111,7 @@ class _FrontLayer extends StatelessWidget {
class
_BackdropTitle
extends
AnimatedWidget
{
const
_BackdropTitle
({
Key
key
,
Listenable
listenable
,
Animation
<
double
>
listenable
,
this
.
onPress
,
@required
this
.
frontTitle
,
@required
this
.
backTitle
,
...
...
@@ -119,14 +119,14 @@ class _BackdropTitle extends AnimatedWidget {
assert
(
backTitle
!=
null
),
super
(
key:
key
,
listenable:
listenable
);
final
Function
onPress
;
final
void
Function
()
onPress
;
final
Widget
frontTitle
;
final
Widget
backTitle
;
@override
Widget
build
(
BuildContext
context
)
{
final
Animation
<
double
>
animation
=
CurvedAnimation
(
parent:
listenable
,
parent:
listenable
as
Animation
<
double
>
,
curve:
const
Interval
(
0.0
,
0.78
),
);
...
...
examples/flutter_gallery/lib/demo/shrine/expanding_bottom_sheet.dart
View file @
ec0842e0
...
...
@@ -604,7 +604,7 @@ class _ListModel {
_items
=
initialItems
?.
toList
()
??
<
int
>[];
final
GlobalKey
<
AnimatedListState
>
listKey
;
final
dynamic
removedItemBuilder
;
final
Widget
Function
(
int
item
,
BuildContext
context
,
Animation
<
double
>
animation
)
removedItemBuilder
;
final
List
<
int
>
_items
;
AnimatedListState
get
_animatedList
=>
listKey
.
currentState
;
...
...
examples/flutter_gallery/lib/demo/transformations/transformations_demo_board.dart
View file @
ec0842e0
...
...
@@ -270,8 +270,9 @@ class BoardPoint {
if
(
other
.
runtimeType
!=
runtimeType
)
{
return
false
;
}
final
BoardPoint
boardPoint
=
other
;
return
boardPoint
.
q
==
q
&&
boardPoint
.
r
==
r
;
return
other
is
BoardPoint
&&
other
.
q
==
q
&&
other
.
r
==
r
;
}
@override
...
...
examples/flutter_gallery/lib/demo/transformations/transformations_demo_gesture_transformable.dart
View file @
ec0842e0
...
...
@@ -183,7 +183,7 @@ class _GestureTransformableState extends State<GestureTransformable> with Ticker
// Get the offset of the current widget from the global screen coordinates.
// TODO(justinmc): Protect against calling this during first build.
static
Offset
getOffset
(
BuildContext
context
)
{
final
RenderBox
renderObject
=
context
.
findRenderObject
();
final
RenderBox
renderObject
=
context
.
findRenderObject
()
as
RenderBox
;
return
renderObject
.
localToGlobal
(
Offset
.
zero
);
}
...
...
@@ -377,7 +377,7 @@ class _GestureTransformableState extends State<GestureTransformable> with Ticker
final
double
clampedTotalScale
=
totalScale
.
clamp
(
widget
.
minScale
,
widget
.
maxScale
,
);
)
as
double
;
final
double
clampedScale
=
clampedTotalScale
/
currentScale
;
return
matrix
..
scale
(
clampedScale
);
}
...
...
examples/flutter_gallery/lib/demo/video_demo.dart
View file @
ec0842e0
...
...
@@ -280,7 +280,7 @@ class _ConnectivityOverlayState extends State<ConnectivityOverlay> {
StreamSubscription
<
ConnectivityResult
>
connectivitySubscription
;
bool
connected
=
true
;
static
const
Widget
errorSnackBar
=
SnackBar
(
static
const
SnackBar
errorSnackBar
=
SnackBar
(
backgroundColor:
Colors
.
red
,
content:
ListTile
(
title:
Text
(
'No network'
),
...
...
examples/flutter_gallery/lib/gallery/app.dart
View file @
ec0842e0
...
...
@@ -53,8 +53,8 @@ class _GalleryAppState extends State<GalleryApp> {
// https://docs.flutter.io/flutter/widgets/Navigator-class.html
return
Map
<
String
,
WidgetBuilder
>.
fromIterable
(
kAllGalleryDemos
,
key:
(
dynamic
demo
)
=>
'
${
demo
.routeName}
'
,
value:
(
dynamic
demo
)
=>
demo
.
buildRoute
,
key:
(
dynamic
demo
)
=>
'
${
(demo as GalleryDemo)
.routeName}
'
,
value:
(
dynamic
demo
)
=>
(
demo
as
GalleryDemo
)
.
buildRoute
,
);
}
...
...
examples/flutter_gallery/lib/gallery/backdrop.dart
View file @
ec0842e0
...
...
@@ -97,7 +97,7 @@ class _CrossFadeTransition extends AnimatedWidget {
@override
Widget
build
(
BuildContext
context
)
{
final
Animation
<
double
>
progress
=
listenable
;
final
Animation
<
double
>
progress
=
listenable
as
Animation
<
double
>
;
final
double
opacity1
=
CurvedAnimation
(
parent:
ReverseAnimation
(
progress
),
...
...
@@ -227,7 +227,7 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin
double
get
_backdropHeight
{
// Warning: this can be safely called from the event handlers but it may
// not be called at build time.
final
RenderBox
renderBox
=
_backdropKey
.
currentContext
.
findRenderObject
();
final
RenderBox
renderBox
=
_backdropKey
.
currentContext
.
findRenderObject
()
as
RenderBox
;
return
math
.
max
(
0.0
,
renderBox
.
size
.
height
-
_kBackAppBarHeight
-
_kFrontClosedHeight
);
}
...
...
examples/flutter_gallery/lib/gallery/demo.dart
View file @
ec0842e0
...
...
@@ -31,10 +31,10 @@ class ComponentDemoTabData {
bool
operator
==(
Object
other
)
{
if
(
other
.
runtimeType
!=
runtimeType
)
return
false
;
final
ComponentDemoTabData
typedOther
=
other
;
return
typedO
ther
.
tabName
==
tabName
&&
typedO
ther
.
description
==
description
&&
typedO
ther
.
documentationUrl
==
documentationUrl
;
return
other
is
ComponentDemoTabData
&&
o
ther
.
tabName
==
tabName
&&
o
ther
.
description
==
description
&&
o
ther
.
documentationUrl
==
documentationUrl
;
}
@override
...
...
examples/flutter_gallery/lib/gallery/demos.dart
View file @
ec0842e0
...
...
@@ -22,8 +22,8 @@ class GalleryDemoCategory {
return
true
;
if
(
runtimeType
!=
other
.
runtimeType
)
return
false
;
final
GalleryDemoCategory
typedOther
=
other
;
return
typedOther
.
name
==
name
&&
typedO
ther
.
icon
==
icon
;
return
other
is
GalleryDemoCategory
&&
other
.
name
==
name
&&
o
ther
.
icon
==
icon
;
}
@override
...
...
@@ -582,6 +582,6 @@ final Map<GalleryDemoCategory, List<GalleryDemo>> kGalleryCategoryToDemos =
final
Map
<
String
,
String
>
kDemoDocumentationUrl
=
Map
<
String
,
String
>.
fromIterable
(
kAllGalleryDemos
.
where
((
GalleryDemo
demo
)
=>
demo
.
documentationUrl
!=
null
),
key:
(
dynamic
demo
)
=>
demo
.
routeName
,
value:
(
dynamic
demo
)
=>
demo
.
documentationUrl
,
key:
(
dynamic
demo
)
=>
(
demo
as
GalleryDemo
)
.
routeName
,
value:
(
dynamic
demo
)
=>
(
demo
as
GalleryDemo
)
.
documentationUrl
,
);
examples/flutter_gallery/lib/gallery/home.dart
View file @
ec0842e0
...
...
@@ -134,7 +134,7 @@ class _CategoriesPage extends StatelessWidget {
crossAxisAlignment:
CrossAxisAlignment
.
stretch
,
children:
List
<
Widget
>.
generate
(
rowCount
,
(
int
rowIndex
)
{
final
int
columnCountForRow
=
rowIndex
==
rowCount
-
1
?
categories
.
length
-
columnCount
*
math
.
max
(
0
,
rowCount
-
1
)
?
categories
.
length
-
columnCount
*
math
.
max
<
int
>
(
0
,
rowCount
-
1
)
:
columnCount
;
return
Row
(
...
...
examples/flutter_gallery/lib/gallery/options.dart
View file @
ec0842e0
...
...
@@ -54,14 +54,14 @@ class GalleryOptions {
bool
operator
==(
dynamic
other
)
{
if
(
runtimeType
!=
other
.
runtimeType
)
return
false
;
final
GalleryOptions
typedOther
=
other
;
return
themeMode
==
typedOther
.
themeMode
&&
textScaleFactor
==
typedOther
.
textScaleFactor
&&
textDirection
==
typedOther
.
textDirection
&&
platform
==
typedOther
.
platform
&&
showPerformanceOverlay
==
typedOther
.
showPerformanceOverlay
&&
showRasterCacheImagesCheckerboard
==
typedOther
.
showRasterCacheImagesCheckerboard
&&
showOffscreenLayersCheckerboard
==
typedOther
.
showRasterCacheImagesCheckerboard
;
return
other
is
GalleryOptions
&&
other
.
themeMode
==
themeMode
&&
other
.
textScaleFactor
==
textScaleFactor
&&
other
.
textDirection
==
textDirection
&&
other
.
platform
==
platform
&&
other
.
showPerformanceOverlay
==
showPerformanceOverlay
&&
other
.
showRasterCacheImagesCheckerboard
==
showRasterCacheImagesCheckerboard
&&
other
.
showOffscreenLayersCheckerboard
==
showRasterCacheImagesCheckerboard
;
}
@override
...
...
examples/flutter_gallery/lib/gallery/scales.dart
View file @
ec0842e0
...
...
@@ -14,8 +14,9 @@ class GalleryTextScaleValue {
bool
operator
==(
dynamic
other
)
{
if
(
runtimeType
!=
other
.
runtimeType
)
return
false
;
final
GalleryTextScaleValue
typedOther
=
other
;
return
scale
==
typedOther
.
scale
&&
label
==
typedOther
.
label
;
return
other
is
GalleryTextScaleValue
&&
other
.
scale
==
scale
&&
other
.
label
==
label
;
}
@override
...
...
examples/flutter_gallery/test/calculator/smoke_test.dart
View file @
ec0842e0
...
...
@@ -7,7 +7,7 @@ import 'package:flutter_gallery/demo/calculator_demo.dart';
import
'package:flutter_test/flutter_test.dart'
;
void
main
(
)
{
final
TestWidgetsFlutterBinding
binding
=
TestWidgetsFlutterBinding
.
ensureInitialized
();
final
TestWidgetsFlutterBinding
binding
=
TestWidgetsFlutterBinding
.
ensureInitialized
()
as
TestWidgetsFlutterBinding
;
if
(
binding
is
LiveTestWidgetsFlutterBinding
)
binding
.
framePolicy
=
LiveTestWidgetsFlutterBindingFramePolicy
.
fullyLive
;
...
...
examples/flutter_gallery/test/drawer_test.dart
View file @
ec0842e0
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_test/flutter_test.dart';
import
'package:flutter_gallery/gallery/app.dart'
;
void
main
(
)
{
final
TestWidgetsFlutterBinding
binding
=
TestWidgetsFlutterBinding
.
ensureInitialized
();
final
TestWidgetsFlutterBinding
binding
=
TestWidgetsFlutterBinding
.
ensureInitialized
()
as
TestWidgetsFlutterBinding
;
if
(
binding
is
LiveTestWidgetsFlutterBinding
)
binding
.
framePolicy
=
LiveTestWidgetsFlutterBindingFramePolicy
.
fullyLive
;
...
...
@@ -31,7 +31,7 @@ void main() {
await
tester
.
pumpAndSettle
();
// Verify theme settings
MaterialApp
app
=
find
.
byType
(
MaterialApp
).
evaluate
().
first
.
widget
;
MaterialApp
app
=
find
.
byType
(
MaterialApp
).
evaluate
().
first
.
widget
as
MaterialApp
;
expect
(
app
.
theme
.
brightness
,
equals
(
Brightness
.
light
));
expect
(
app
.
darkTheme
.
brightness
,
equals
(
Brightness
.
dark
));
...
...
@@ -40,7 +40,7 @@ void main() {
await
tester
.
pumpAndSettle
();
await
tester
.
tap
(
find
.
text
(
'Dark'
));
await
tester
.
pumpAndSettle
();
app
=
find
.
byType
(
MaterialApp
).
evaluate
().
first
.
widget
;
app
=
find
.
byType
(
MaterialApp
).
evaluate
().
first
.
widget
as
MaterialApp
;
expect
(
app
.
themeMode
,
ThemeMode
.
dark
);
// Switch to the light theme: first menu button, choose 'Light'
...
...
@@ -48,7 +48,7 @@ void main() {
await
tester
.
pumpAndSettle
();
await
tester
.
tap
(
find
.
text
(
'Light'
));
await
tester
.
pumpAndSettle
();
app
=
find
.
byType
(
MaterialApp
).
evaluate
().
first
.
widget
;
app
=
find
.
byType
(
MaterialApp
).
evaluate
().
first
.
widget
as
MaterialApp
;
expect
(
app
.
themeMode
,
ThemeMode
.
light
);
// Switch back to system theme setting: first menu button, choose 'System Default'
...
...
@@ -56,7 +56,7 @@ void main() {
await
tester
.
pumpAndSettle
();
await
tester
.
tap
(
find
.
text
(
'System Default'
).
at
(
1
));
await
tester
.
pumpAndSettle
();
app
=
find
.
byType
(
MaterialApp
).
evaluate
().
first
.
widget
;
app
=
find
.
byType
(
MaterialApp
).
evaluate
().
first
.
widget
as
MaterialApp
;
expect
(
app
.
themeMode
,
ThemeMode
.
system
);
// Verify platform settings
...
...
@@ -67,7 +67,7 @@ void main() {
await
tester
.
pumpAndSettle
();
await
tester
.
tap
(
find
.
text
(
'Cupertino'
).
at
(
1
));
await
tester
.
pumpAndSettle
();
app
=
find
.
byType
(
MaterialApp
).
evaluate
().
first
.
widget
;
app
=
find
.
byType
(
MaterialApp
).
evaluate
().
first
.
widget
as
MaterialApp
;
expect
(
app
.
theme
.
platform
,
equals
(
TargetPlatform
.
iOS
));
// Verify the font scale.
...
...
examples/flutter_gallery/test/example_code_display_test.dart
View file @
ec0842e0
...
...
@@ -7,7 +7,7 @@ import 'package:flutter_gallery/gallery/app.dart';
import
'package:flutter_test/flutter_test.dart'
;
void
main
(
)
{
final
TestWidgetsFlutterBinding
binding
=
TestWidgetsFlutterBinding
.
ensureInitialized
();
final
TestWidgetsFlutterBinding
binding
=
TestWidgetsFlutterBinding
.
ensureInitialized
()
as
TestWidgetsFlutterBinding
;
if
(
binding
is
LiveTestWidgetsFlutterBinding
)
binding
.
framePolicy
=
LiveTestWidgetsFlutterBindingFramePolicy
.
fullyLive
;
...
...
examples/flutter_gallery/test/pesto_test.dart
View file @
ec0842e0
...
...
@@ -7,7 +7,7 @@ import 'package:flutter_test/flutter_test.dart';
import
'package:flutter_gallery/gallery/app.dart'
;
void
main
(
)
{
final
TestWidgetsFlutterBinding
binding
=
TestWidgetsFlutterBinding
.
ensureInitialized
();
final
TestWidgetsFlutterBinding
binding
=
TestWidgetsFlutterBinding
.
ensureInitialized
()
as
TestWidgetsFlutterBinding
;
if
(
binding
is
LiveTestWidgetsFlutterBinding
)
binding
.
framePolicy
=
LiveTestWidgetsFlutterBindingFramePolicy
.
fullyLive
;
...
...
examples/flutter_gallery/test/simple_smoke_test.dart
View file @
ec0842e0
...
...
@@ -7,7 +7,7 @@ import 'package:flutter_test/flutter_test.dart';
import
'package:flutter_gallery/gallery/app.dart'
show
GalleryApp
;
void
main
(
)
{
final
TestWidgetsFlutterBinding
binding
=
TestWidgetsFlutterBinding
.
ensureInitialized
();
final
TestWidgetsFlutterBinding
binding
=
TestWidgetsFlutterBinding
.
ensureInitialized
()
as
TestWidgetsFlutterBinding
;
if
(
binding
is
LiveTestWidgetsFlutterBinding
)
binding
.
framePolicy
=
LiveTestWidgetsFlutterBindingFramePolicy
.
fullyLive
;
...
...
examples/flutter_gallery/test/update_test.dart
View file @
ec0842e0
...
...
@@ -11,7 +11,7 @@ Future<String> mockUpdateUrlFetcher() {
}
void
main
(
)
{
final
TestWidgetsFlutterBinding
binding
=
TestWidgetsFlutterBinding
.
ensureInitialized
();
final
TestWidgetsFlutterBinding
binding
=
TestWidgetsFlutterBinding
.
ensureInitialized
()
as
TestWidgetsFlutterBinding
;
if
(
binding
is
LiveTestWidgetsFlutterBinding
)
binding
.
framePolicy
=
LiveTestWidgetsFlutterBindingFramePolicy
.
fullyLive
;
...
...
examples/flutter_gallery/test_driver/transitions_perf_test.dart
View file @
ec0842e0
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'dart:async'
;
import
'dart:convert'
show
JsonEncoder
,
JsonDecoder
;
import
'dart:convert'
show
JsonEncoder
,
json
;
import
'package:file/file.dart'
;
import
'package:file/local.dart'
;
...
...
@@ -69,14 +69,14 @@ Future<void> saveDurationsHistogram(List<Map<String, dynamic>> events, String ou
// Save the duration of the first frame after each 'Start Transition' event.
for
(
Map
<
String
,
dynamic
>
event
in
events
)
{
final
String
eventName
=
event
[
'name'
];
final
String
eventName
=
event
[
'name'
]
as
String
;
if
(
eventName
==
'Start Transition'
)
{
assert
(
startEvent
==
null
);
startEvent
=
event
;
}
else
if
(
startEvent
!=
null
&&
eventName
==
'Frame'
)
{
final
String
routeName
=
startEvent
[
'args'
][
'to'
];
final
String
routeName
=
startEvent
[
'args'
][
'to'
]
as
String
;
durations
[
routeName
]
??=
<
int
>[];
durations
[
routeName
].
add
(
event
[
'dur'
]);
durations
[
routeName
].
add
(
event
[
'dur'
]
as
int
);
startEvent
=
null
;
}
}
...
...
@@ -101,13 +101,13 @@ Future<void> saveDurationsHistogram(List<Map<String, dynamic>> events, String ou
String
lastEventName
=
''
;
String
lastRouteName
=
''
;
while
(
eventIter
.
moveNext
())
{
final
String
eventName
=
eventIter
.
current
[
'name'
];
final
String
eventName
=
eventIter
.
current
[
'name'
]
as
String
;
if
(!<
String
>[
'Start Transition'
,
'Frame'
].
contains
(
eventName
))
continue
;
final
String
routeName
=
eventName
==
'Start Transition'
?
eventIter
.
current
[
'args'
][
'to'
]
?
eventIter
.
current
[
'args'
][
'to'
]
as
String
:
''
;
if
(
eventName
==
lastEventName
&&
routeName
==
lastRouteName
)
{
...
...
@@ -192,7 +192,7 @@ void main([List<String> args = const <String>[]]) {
}
// See _handleMessages() in transitions_perf.dart.
_allDemos
=
List
<
String
>.
from
(
const
JsonDecoder
().
convert
(
await
driver
.
requestData
(
'demoNames'
))
);
_allDemos
=
List
<
String
>.
from
(
json
.
decode
(
await
driver
.
requestData
(
'demoNames'
))
as
List
<
dynamic
>
);
if
(
_allDemos
.
isEmpty
)
throw
'no demo names found'
;
});
...
...
@@ -221,7 +221,7 @@ void main([List<String> args = const <String>[]]) {
await
summary
.
writeSummaryToFile
(
'transitions'
,
pretty:
true
);
final
String
histogramPath
=
path
.
join
(
testOutputsDirectory
,
'transition_durations.timeline.json'
);
await
saveDurationsHistogram
(
List
<
Map
<
String
,
dynamic
>>.
from
(
timeline
.
json
[
'traceEvents'
]),
List
<
Map
<
String
,
dynamic
>>.
from
(
timeline
.
json
[
'traceEvents'
]
as
List
<
dynamic
>
),
histogramPath
);
// Execute the remaining tests.
...
...
examples/layers/rendering/flex_layout.dart
View file @
ec0842e0
...
...
@@ -48,7 +48,7 @@ void main() {
subrow
.
add
(
RenderSolidColorBox
(
const
Color
(
0x7FCCFFFF
),
desiredSize:
const
Size
(
30.0
,
40.0
)));
row
.
add
(
subrow
);
table
.
add
(
row
);
final
FlexParentData
rowParentData
=
row
.
parentData
;
final
FlexParentData
rowParentData
=
row
.
parentData
as
FlexParentData
;
rowParentData
.
flex
=
1
;
}
...
...
@@ -71,7 +71,7 @@ void main() {
row
.
add
(
RenderSolidColorBox
(
const
Color
(
0xFFCCCCFF
),
desiredSize:
const
Size
(
160.0
,
60.0
)));
row
.
mainAxisAlignment
=
justify
;
table
.
add
(
row
);
final
FlexParentData
rowParentData
=
row
.
parentData
;
final
FlexParentData
rowParentData
=
row
.
parentData
as
FlexParentData
;
rowParentData
.
flex
=
1
;
}
...
...
examples/layers/rendering/src/sector_layout.dart
View file @
ec0842e0
...
...
@@ -31,11 +31,11 @@ class SectorConstraints extends Constraints {
final
double
maxDeltaTheta
;
double
constrainDeltaRadius
(
double
deltaRadius
)
{
return
deltaRadius
.
clamp
(
minDeltaRadius
,
maxDeltaRadius
);
return
deltaRadius
.
clamp
(
minDeltaRadius
,
maxDeltaRadius
)
as
double
;
}
double
constrainDeltaTheta
(
double
deltaTheta
)
{
return
deltaTheta
.
clamp
(
minDeltaTheta
,
maxDeltaTheta
);
return
deltaTheta
.
clamp
(
minDeltaTheta
,
maxDeltaTheta
)
as
double
;
}
@override
...
...
@@ -100,14 +100,14 @@ abstract class RenderSector extends RenderObject {
// RenderSectors always use SectorParentData subclasses, as they need to be
// able to read their position information for painting and hit testing.
@override
SectorParentData
get
parentData
=>
super
.
parentData
;
SectorParentData
get
parentData
=>
super
.
parentData
as
SectorParentData
;
SectorDimensions
getIntrinsicDimensions
(
SectorConstraints
constraints
,
double
radius
)
{
return
SectorDimensions
.
withConstraints
(
constraints
);
}
@override
SectorConstraints
get
constraints
=>
super
.
constraints
;
SectorConstraints
get
constraints
=>
super
.
constraints
as
SectorConstraints
;
@override
void
debugAssertDoesMeetConstraints
()
{
...
...
@@ -208,7 +208,7 @@ class RenderSectorWithChildren extends RenderDecoratedSector with ContainerRende
while
(
child
!=
null
)
{
if
(
child
.
hitTest
(
result
,
radius:
radius
,
theta:
theta
))
return
;
final
SectorChildListParentData
childParentData
=
child
.
parentData
;
final
SectorChildListParentData
childParentData
=
child
.
parentData
as
SectorChildListParentData
;
child
=
childParentData
.
previousSibling
;
}
}
...
...
@@ -218,7 +218,7 @@ class RenderSectorWithChildren extends RenderDecoratedSector with ContainerRende
RenderSector
child
=
lastChild
;
while
(
child
!=
null
)
{
visitor
(
child
);
final
SectorChildListParentData
childParentData
=
child
.
parentData
;
final
SectorChildListParentData
childParentData
=
child
.
parentData
as
SectorChildListParentData
;
child
=
childParentData
.
previousSibling
;
}
}
...
...
@@ -282,7 +282,7 @@ class RenderSectorRing extends RenderSectorWithChildren {
final
SectorDimensions
childDimensions
=
child
.
getIntrinsicDimensions
(
innerConstraints
,
childRadius
);
innerTheta
+=
childDimensions
.
deltaTheta
;
remainingDeltaTheta
-=
childDimensions
.
deltaTheta
;
final
SectorChildListParentData
childParentData
=
child
.
parentData
;
final
SectorChildListParentData
childParentData
=
child
.
parentData
as
SectorChildListParentData
;
child
=
childParentData
.
nextSibling
;
if
(
child
!=
null
)
{
innerTheta
+=
paddingTheta
;
...
...
@@ -316,7 +316,7 @@ class RenderSectorRing extends RenderSectorWithChildren {
child
.
layout
(
innerConstraints
,
parentUsesSize:
true
);
innerTheta
+=
child
.
deltaTheta
;
remainingDeltaTheta
-=
child
.
deltaTheta
;
final
SectorChildListParentData
childParentData
=
child
.
parentData
;
final
SectorChildListParentData
childParentData
=
child
.
parentData
as
SectorChildListParentData
;
child
=
childParentData
.
nextSibling
;
if
(
child
!=
null
)
{
innerTheta
+=
paddingTheta
;
...
...
@@ -335,7 +335,7 @@ class RenderSectorRing extends RenderSectorWithChildren {
RenderSector
child
=
firstChild
;
while
(
child
!=
null
)
{
context
.
paintChild
(
child
,
offset
);
final
SectorChildListParentData
childParentData
=
child
.
parentData
;
final
SectorChildListParentData
childParentData
=
child
.
parentData
as
SectorChildListParentData
;
child
=
childParentData
.
nextSibling
;
}
}
...
...
@@ -396,7 +396,7 @@ class RenderSectorSlice extends RenderSectorWithChildren {
final
SectorDimensions
childDimensions
=
child
.
getIntrinsicDimensions
(
innerConstraints
,
childRadius
);
childRadius
+=
childDimensions
.
deltaRadius
;
remainingDeltaRadius
-=
childDimensions
.
deltaRadius
;
final
SectorChildListParentData
childParentData
=
child
.
parentData
;
final
SectorChildListParentData
childParentData
=
child
.
parentData
as
SectorChildListParentData
;
child
=
childParentData
.
nextSibling
;
childRadius
+=
padding
;
remainingDeltaRadius
-=
padding
;
...
...
@@ -427,7 +427,7 @@ class RenderSectorSlice extends RenderSectorWithChildren {
child
.
layout
(
innerConstraints
,
parentUsesSize:
true
);
childRadius
+=
child
.
deltaRadius
;
remainingDeltaRadius
-=
child
.
deltaRadius
;
final
SectorChildListParentData
childParentData
=
child
.
parentData
;
final
SectorChildListParentData
childParentData
=
child
.
parentData
as
SectorChildListParentData
;
child
=
childParentData
.
nextSibling
;
childRadius
+=
padding
;
remainingDeltaRadius
-=
padding
;
...
...
@@ -445,7 +445,7 @@ class RenderSectorSlice extends RenderSectorWithChildren {
while
(
child
!=
null
)
{
assert
(
child
.
parentData
is
SectorChildListParentData
);
context
.
paintChild
(
child
,
offset
);
final
SectorChildListParentData
childParentData
=
child
.
parentData
;
final
SectorChildListParentData
childParentData
=
child
.
parentData
as
SectorChildListParentData
;
child
=
childParentData
.
nextSibling
;
}
}
...
...
@@ -638,7 +638,7 @@ class SectorHitTestEntry extends HitTestEntry {
super
(
target
);
@override
RenderSector
get
target
=>
super
.
target
;
RenderSector
get
target
=>
super
.
target
as
RenderSector
;
/// The radius component of the hit test position in the local coordinates of
/// [target].
...
...
examples/layers/rendering/touch_input.dart
View file @
ec0842e0
...
...
@@ -65,7 +65,7 @@ class RenderDots extends RenderBox {
@override
void
handleEvent
(
PointerEvent
event
,
BoxHitTestEntry
entry
)
{
if
(
event
is
PointerDownEvent
)
{
final
Color
color
=
_kColors
[
event
.
pointer
.
remainder
(
_kColors
.
length
)];
final
Color
color
=
_kColors
[
event
.
pointer
.
remainder
(
_kColors
.
length
)
as
int
];
_dots
[
event
.
pointer
]
=
Dot
(
color:
color
)..
update
(
event
);
// We call markNeedsPaint to indicate that our painting commands have
// changed and that paint needs to be called before displaying a new frame
...
...
@@ -126,7 +126,7 @@ void main() {
//
// We use the StackParentData of the paragraph to position the text in the top
// left corner of the screen.
final
StackParentData
paragraphParentData
=
paragraph
.
parentData
;
final
StackParentData
paragraphParentData
=
paragraph
.
parentData
as
StackParentData
;
paragraphParentData
..
top
=
40.0
..
left
=
20.0
;
...
...
examples/layers/services/isolate.dart
View file @
ec0842e0
...
...
@@ -44,7 +44,7 @@ class Calculator {
}
);
try
{
final
List
<
dynamic
>
result
=
decoder
.
convert
(
_data
);
final
List
<
dynamic
>
result
=
decoder
.
convert
(
_data
)
as
List
<
dynamic
>
;
final
int
n
=
result
.
length
;
onResultListener
(
'Decoded
$n
results'
);
}
catch
(
e
,
stack
)
{
...
...
examples/layers/widgets/sectors.dart
View file @
ec0842e0
...
...
@@ -9,7 +9,7 @@ import 'package:flutter/rendering.dart';
import
'../rendering/src/sector_layout.dart'
;
RenderBox
initCircle
(
)
{
RenderBox
ToRenderSectorAdapter
initCircle
(
)
{
return
RenderBoxToRenderSectorAdapter
(
innerRadius:
25.0
,
child:
RenderSectorRing
(
padding:
0.0
),
...
...
@@ -54,7 +54,7 @@ class SectorAppState extends State<SectorApp> {
int
index
=
0
;
while
(
index
<
actualSectorSizes
.
length
&&
index
<
wantedSectorSizes
.
length
&&
actualSectorSizes
[
index
]
==
wantedSectorSizes
[
index
])
index
+=
1
;
final
RenderSectorRing
ring
=
sectors
.
child
;
final
RenderSectorRing
ring
=
sectors
.
child
as
RenderSectorRing
;
while
(
index
<
actualSectorSizes
.
length
)
{
ring
.
remove
(
ring
.
lastChild
);
actualSectorSizes
.
removeLast
();
...
...
@@ -67,7 +67,7 @@ class SectorAppState extends State<SectorApp> {
}
}
static
RenderBox
initSector
(
Color
color
)
{
static
RenderBox
ToRenderSectorAdapter
initSector
(
Color
color
)
{
final
RenderSectorRing
ring
=
RenderSectorRing
(
padding:
1.0
);
ring
.
add
(
RenderSolidColor
(
const
Color
(
0xFF909090
),
desiredDeltaTheta:
kTwoPi
*
0.15
));
ring
.
add
(
RenderSolidColor
(
const
Color
(
0xFF909090
),
desiredDeltaTheta:
kTwoPi
*
0.15
));
...
...
examples/layers/widgets/spinning_mixed.dart
View file @
ec0842e0
...
...
@@ -11,7 +11,7 @@ import '../rendering/src/solid_color_box.dart';
void
addFlexChildSolidColor
(
RenderFlex
parent
,
Color
backgroundColor
,
{
int
flex
=
0
})
{
final
RenderSolidColorBox
child
=
RenderSolidColorBox
(
backgroundColor
);
parent
.
add
(
child
);
final
FlexParentData
childParentData
=
child
.
parentData
;
final
FlexParentData
childParentData
=
child
.
parentData
as
FlexParentData
;
childParentData
.
flex
=
flex
;
}
...
...
examples/stocks/lib/main.dart
View file @
ec0842e0
...
...
@@ -71,7 +71,7 @@ class StocksAppState extends State<StocksApp> {
Route
<
dynamic
>
_getRoute
(
RouteSettings
settings
)
{
if
(
settings
.
name
==
'/stock'
)
{
final
String
symbol
=
settings
.
arguments
;
final
String
symbol
=
settings
.
arguments
as
String
;
return
MaterialPageRoute
<
void
>(
settings:
settings
,
builder:
(
BuildContext
context
)
=>
StockSymbolPage
(
symbol:
symbol
,
stocks:
stocks
),
...
...
examples/stocks/lib/stock_data.dart
View file @
ec0842e0
...
...
@@ -49,14 +49,14 @@ class StockData extends ChangeNotifier {
final
List
<
String
>
_symbols
=
<
String
>[];
final
Map
<
String
,
Stock
>
_stocks
=
<
String
,
Stock
>{};
Iterable
<
String
>
get
allSymbols
=>
_symbols
;
List
<
String
>
get
allSymbols
=>
_symbols
;
Stock
operator
[](
String
symbol
)
=>
_stocks
[
symbol
];
bool
get
loading
=>
_httpClient
!=
null
;
void
add
(
List
<
dynamic
>
data
)
{
for
(
List
<
dynamic
>
fields
in
data
)
{
for
(
List
<
dynamic
>
fields
in
data
.
cast
<
List
<
dynamic
>>()
)
{
final
Stock
stock
=
Stock
.
fromFields
(
fields
.
cast
<
String
>());
_symbols
.
add
(
stock
.
symbol
);
_stocks
[
stock
.
symbol
]
=
stock
;
...
...
@@ -85,7 +85,7 @@ class StockData extends ChangeNotifier {
return
;
}
const
JsonDecoder
decoder
=
JsonDecoder
();
add
(
decoder
.
convert
(
json
));
add
(
decoder
.
convert
(
json
)
as
List
<
dynamic
>
);
if
(
_nextChunk
<
_chunkCount
)
{
_fetchNextChunk
();
}
else
{
...
...
examples/stocks/lib/stock_home.dart
View file @
ec0842e0
...
...
@@ -188,7 +188,7 @@ class StockHomeState extends State<StockHome> {
showAboutDialog
(
context:
context
);
}
Widget
buildAppBar
()
{
AppBar
buildAppBar
()
{
return
AppBar
(
elevation:
0.0
,
title:
Text
(
StockStrings
.
of
(
context
).
title
),
...
...
@@ -283,7 +283,7 @@ class StockHomeState extends State<StockHome> {
static
const
List
<
String
>
portfolioSymbols
=
<
String
>[
'AAPL'
,
'FIZZ'
,
'FIVE'
,
'FLAT'
,
'ZINC'
,
'ZNGA'
];
Widget
buildSearchBar
()
{
AppBar
buildSearchBar
()
{
return
AppBar
(
leading:
BackButton
(
color:
Theme
.
of
(
context
).
accentColor
,
...
...
examples/stocks/lib/stock_settings.dart
View file @
ec0842e0
...
...
@@ -97,7 +97,7 @@ class StockSettingsState extends State<StockSettings> {
widget
.
updater
(
value
);
}
Widget
buildAppBar
(
BuildContext
context
)
{
AppBar
buildAppBar
(
BuildContext
context
)
{
return
AppBar
(
title:
const
Text
(
'Settings'
),
);
...
...
examples/stocks/test/icon_color_test.dart
View file @
ec0842e0
...
...
@@ -41,7 +41,7 @@ void checkIconColor(WidgetTester tester, String label, Color color) {
final
Element
listTile
=
findElementOfExactWidgetTypeGoingUp
(
tester
.
element
(
find
.
text
(
label
)),
ListTile
);
expect
(
listTile
,
isNotNull
);
final
Element
asset
=
findElementOfExactWidgetTypeGoingDown
(
listTile
,
RichText
);
final
RichText
richText
=
asset
.
widget
;
final
RichText
richText
=
asset
.
widget
as
RichText
;
expect
(
richText
.
text
.
style
.
color
,
equals
(
color
));
}
...
...
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