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
79cfe1e0
Commit
79cfe1e0
authored
Apr 03, 2016
by
Ian Hickson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make a variety of private State members actually private.
parent
7f2efb2c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
50 deletions
+50
-50
buttons_demo.dart
examples/material_gallery/lib/demo/buttons_demo.dart
+5
-5
dialog_demo.dart
examples/material_gallery/lib/demo/dialog_demo.dart
+4
-4
drop_down_demo.dart
examples/material_gallery/lib/demo/drop_down_demo.dart
+3
-3
fitness_demo.dart
examples/material_gallery/lib/demo/fitness_demo.dart
+14
-14
flexible_space_demo.dart
examples/material_gallery/lib/demo/flexible_space_demo.dart
+10
-10
full_screen_dialog_demo.dart
...es/material_gallery/lib/demo/full_screen_dialog_demo.dart
+14
-14
No files found.
examples/material_gallery/lib/demo/buttons_demo.dart
View file @
79cfe1e0
...
...
@@ -63,12 +63,12 @@ class ButtonsDemo extends StatefulWidget {
}
class
_ButtonsDemoState
extends
State
<
ButtonsDemo
>
{
List
<
_ButtonDemo
>
demos
;
List
<
_ButtonDemo
>
_
demos
;
@override
void
initState
()
{
super
.
initState
();
demos
=
<
_ButtonDemo
>[
_
demos
=
<
_ButtonDemo
>[
new
_ButtonDemo
(
title:
'FLOATING'
,
text:
_floatingText
,
builder:
buildFloatingButton
),
new
_ButtonDemo
(
title:
'RAISED'
,
text:
_raisedText
,
builder:
buildRaisedButton
),
new
_ButtonDemo
(
title:
'FLAT'
,
text:
_flatText
,
builder:
buildFlatButton
),
...
...
@@ -198,17 +198,17 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
@override
Widget
build
(
BuildContext
context
)
{
return
new
TabBarSelection
<
_ButtonDemo
>(
values:
demos
,
values:
_
demos
,
child:
new
Scaffold
(
appBar:
new
AppBar
(
title:
new
Text
(
"Buttons"
),
tabBar:
new
TabBar
<
_ButtonDemo
>(
isScrollable:
true
,
labels:
new
Map
<
_ButtonDemo
,
TabLabel
>.
fromIterable
(
demos
,
value:
(
_ButtonDemo
demo
)
=>
demo
.
tabLabel
)
labels:
new
Map
<
_ButtonDemo
,
TabLabel
>.
fromIterable
(
_
demos
,
value:
(
_ButtonDemo
demo
)
=>
demo
.
tabLabel
)
)
),
body:
new
TabBarView
<
_ButtonDemo
>(
children:
demos
.
map
(
buildTabView
).
toList
()
children:
_
demos
.
map
(
buildTabView
).
toList
()
)
)
);
...
...
examples/material_gallery/lib/demo/dialog_demo.dart
View file @
79cfe1e0
...
...
@@ -60,7 +60,7 @@ class DialogDemo extends StatefulWidget {
}
class
DialogDemoState
extends
State
<
DialogDemo
>
{
final
GlobalKey
<
ScaffoldState
>
scaffoldKey
=
new
GlobalKey
<
ScaffoldState
>();
final
GlobalKey
<
ScaffoldState
>
_
scaffoldKey
=
new
GlobalKey
<
ScaffoldState
>();
void
showDemoDialog
/*<T>*/
({
BuildContext
context
,
Dialog
dialog
})
{
showDialog
/*<T>*/
(
...
...
@@ -69,7 +69,7 @@ class DialogDemoState extends State<DialogDemo> {
)
.
then
((
dynamic
/*=T*/
value
)
{
// The value passed to Navigator.pop() or null.
if
(
value
!=
null
)
{
scaffoldKey
.
currentState
.
showSnackBar
(
new
SnackBar
(
_
scaffoldKey
.
currentState
.
showSnackBar
(
new
SnackBar
(
content:
new
Text
(
'You selected:
$value
'
)
));
}
...
...
@@ -82,7 +82,7 @@ class DialogDemoState extends State<DialogDemo> {
final
TextStyle
dialogTextStyle
=
theme
.
textTheme
.
subhead
.
copyWith
(
color:
theme
.
textTheme
.
caption
.
color
);
return
new
Scaffold
(
key:
scaffoldKey
,
key:
_
scaffoldKey
,
appBar:
new
AppBar
(
title:
new
Text
(
'Dialogs'
)
),
...
...
@@ -179,7 +179,7 @@ class DialogDemoState extends State<DialogDemo> {
)
.
then
((
TimeOfDay
value
)
{
// The value passed to Navigator.pop() or null.
if
(
value
!=
null
)
{
scaffoldKey
.
currentState
.
showSnackBar
(
new
SnackBar
(
_
scaffoldKey
.
currentState
.
showSnackBar
(
new
SnackBar
(
content:
new
Text
(
'You selected:
$value
'
)
));
}
...
...
examples/material_gallery/lib/demo/drop_down_demo.dart
View file @
79cfe1e0
...
...
@@ -10,7 +10,7 @@ class DropDownDemo extends StatefulWidget {
}
class
_DropDownDemoState
extends
State
<
DropDownDemo
>
{
String
value
=
"Free"
;
String
_
value
=
"Free"
;
List
<
DropDownMenuItem
<
String
>>
buildItems
()
{
return
<
String
>[
"One"
,
"Two"
,
"Free"
,
"Four"
].
map
((
String
value
)
{
...
...
@@ -26,11 +26,11 @@ class _DropDownDemoState extends State<DropDownDemo> {
body:
new
Center
(
child:
new
DropDownButton
<
String
>(
items:
buildItems
(),
value:
value
,
value:
_
value
,
onChanged:
(
String
newValue
)
{
setState
(()
{
if
(
newValue
!=
null
)
value
=
newValue
;
_
value
=
newValue
;
});
}
)
...
...
examples/material_gallery/lib/demo/fitness_demo.dart
View file @
79cfe1e0
...
...
@@ -53,16 +53,16 @@ class _FitnessDemoContentsState extends State<_FitnessDemoContents> {
AssetBundle
bundle
=
DefaultAssetBundle
.
of
(
context
);
_loadAssets
(
bundle
).
then
((
_
)
{
setState
(()
{
assetsLoaded
=
true
;
_
assetsLoaded
=
true
;
workoutAnimation
=
new
_WorkoutAnimationNode
(
onPerformedJumpingJack:
()
{
setState
(()
{
count
+=
1
;
_
count
+=
1
;
});
},
onSecondPassed:
(
int
seconds
)
{
setState
(()
{
time
=
seconds
;
_
time
=
seconds
;
});
}
);
...
...
@@ -70,16 +70,16 @@ class _FitnessDemoContentsState extends State<_FitnessDemoContents> {
});
}
bool
assetsLoaded
=
false
;
int
count
=
0
;
int
time
=
0
;
int
get
kcal
=>
(
count
*
0.2
).
toInt
();
bool
_
assetsLoaded
=
false
;
int
_
count
=
0
;
int
_
time
=
0
;
int
get
kcal
=>
(
_
count
*
0.2
).
toInt
();
_WorkoutAnimationNode
workoutAnimation
;
@override
Widget
build
(
BuildContext
context
)
{
if
(!
assetsLoaded
)
if
(!
_
assetsLoaded
)
return
new
Container
();
Color
buttonColor
;
...
...
@@ -115,8 +115,8 @@ class _FitnessDemoContentsState extends State<_FitnessDemoContents> {
child:
new
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
_createInfoPanelCell
(
Icons
.
accessibility
,
'
$count
'
,
'COUNT'
),
_createInfoPanelCell
(
Icons
.
timer
,
_formatSeconds
(
time
),
'TIME'
),
_createInfoPanelCell
(
Icons
.
accessibility
,
'
$
_
count
'
,
'COUNT'
),
_createInfoPanelCell
(
Icons
.
timer
,
_formatSeconds
(
_
time
),
'TIME'
),
_createInfoPanelCell
(
Icons
.
flash_on
,
'
$kcal
'
,
'KCAL'
)
]
)
...
...
@@ -170,8 +170,8 @@ class _FitnessDemoContentsState extends State<_FitnessDemoContents> {
void
startWorkout
()
{
setState
(()
{
count
=
0
;
time
=
0
;
_
count
=
0
;
_
time
=
0
;
workoutAnimation
.
start
();
});
}
...
...
@@ -180,14 +180,14 @@ class _FitnessDemoContentsState extends State<_FitnessDemoContents> {
setState
(()
{
workoutAnimation
.
stop
();
if
(
count
>=
3
)
{
if
(
_
count
>=
3
)
{
showDialog
(
context:
context
,
child:
new
Stack
(
children:
<
Widget
>[
new
_Fireworks
(),
new
Dialog
(
title:
new
Text
(
"Awesome workout"
),
content:
new
Text
(
"You have completed
$count
jumping jacks. Good going!"
),
content:
new
Text
(
"You have completed
$
_
count
jumping jacks. Good going!"
),
actions:
<
Widget
>[
new
FlatButton
(
child:
new
Text
(
"SWEET"
),
...
...
examples/material_gallery/lib/demo/flexible_space_demo.dart
View file @
79cfe1e0
...
...
@@ -75,9 +75,9 @@ class FlexibleSpaceDemo extends StatefulWidget {
}
class
FlexibleSpaceDemoState
extends
State
<
FlexibleSpaceDemo
>
{
final
GlobalKey
<
ScaffoldState
>
scaffoldKey
=
new
GlobalKey
<
ScaffoldState
>();
final
double
appBarHeight
=
256.0
;
final
Key
scrollableKey
=
new
UniqueKey
();
final
GlobalKey
<
ScaffoldState
>
_
scaffoldKey
=
new
GlobalKey
<
ScaffoldState
>();
final
double
_
appBarHeight
=
256.0
;
final
Key
_
scrollableKey
=
new
UniqueKey
();
AppBarBehavior
_appBarBehavior
=
AppBarBehavior
.
scroll
;
@override
...
...
@@ -89,17 +89,17 @@ class FlexibleSpaceDemoState extends State<FlexibleSpaceDemo> {
primarySwatch:
Colors
.
indigo
),
child:
new
Scaffold
(
key:
scaffoldKey
,
scrollableKey:
scrollableKey
,
key:
_
scaffoldKey
,
scrollableKey:
_
scrollableKey
,
appBarBehavior:
_appBarBehavior
,
appBar:
new
AppBar
(
expandedHeight:
appBarHeight
,
expandedHeight:
_
appBarHeight
,
actions:
<
Widget
>[
new
IconButton
(
icon:
Icons
.
create
,
tooltip:
'Search'
,
onPressed:
()
{
scaffoldKey
.
currentState
.
showSnackBar
(
new
SnackBar
(
_
scaffoldKey
.
currentState
.
showSnackBar
(
new
SnackBar
(
content:
new
Text
(
'Not supported.'
)
));
}
...
...
@@ -128,14 +128,14 @@ class FlexibleSpaceDemoState extends State<FlexibleSpaceDemo> {
image:
new
AssetImage
(
name:
'packages/flutter_gallery_assets/ali_connors.png'
,
fit:
ImageFit
.
cover
,
height:
appBarHeight
height:
_
appBarHeight
)
);
}
),
body:
new
Block
(
scrollableKey:
scrollableKey
,
padding:
new
EdgeInsets
.
only
(
top:
appBarHeight
+
statusBarHeight
),
scrollableKey:
_
scrollableKey
,
padding:
new
EdgeInsets
.
only
(
top:
_
appBarHeight
+
statusBarHeight
),
children:
<
Widget
>[
new
_ContactCategory
(
icon:
Icons
.
call
,
...
...
examples/material_gallery/lib/demo/full_screen_dialog_demo.dart
View file @
79cfe1e0
...
...
@@ -99,13 +99,13 @@ class FullScreenDialogDemo extends StatefulWidget {
}
class
FullScreenDialogDemoState
extends
State
<
FullScreenDialogDemo
>
{
DateTime
fromDateTime
=
new
DateTime
.
now
();
DateTime
toDateTime
=
new
DateTime
.
now
();
bool
allDayValue
=
false
;
bool
saveNeeded
=
false
;
DateTime
_
fromDateTime
=
new
DateTime
.
now
();
DateTime
_
toDateTime
=
new
DateTime
.
now
();
bool
_
allDayValue
=
false
;
bool
_
saveNeeded
=
false
;
void
handleDismissButton
(
BuildContext
context
)
{
if
(!
saveNeeded
)
{
if
(!
_
saveNeeded
)
{
Navigator
.
pop
(
context
,
null
);
return
;
}
...
...
@@ -192,11 +192,11 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
children:
<
Widget
>[
new
Text
(
'From'
,
style:
theme
.
textTheme
.
caption
),
new
DateTimeItem
(
dateTime:
fromDateTime
,
dateTime:
_
fromDateTime
,
onChanged:
(
DateTime
value
)
{
setState
(()
{
fromDateTime
=
value
;
saveNeeded
=
true
;
_
fromDateTime
=
value
;
_
saveNeeded
=
true
;
});
}
)
...
...
@@ -208,11 +208,11 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
children:
<
Widget
>[
new
Text
(
'To'
,
style:
theme
.
textTheme
.
caption
),
new
DateTimeItem
(
dateTime:
toDateTime
,
dateTime:
_
toDateTime
,
onChanged:
(
DateTime
value
)
{
setState
(()
{
toDateTime
=
value
;
saveNeeded
=
true
;
_
toDateTime
=
value
;
_
saveNeeded
=
true
;
});
}
)
...
...
@@ -225,11 +225,11 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
child:
new
Row
(
children:
<
Widget
>
[
new
Checkbox
(
value:
allDayValue
,
value:
_
allDayValue
,
onChanged:
(
bool
value
)
{
setState
(()
{
allDayValue
=
value
;
saveNeeded
=
true
;
_
allDayValue
=
value
;
_
saveNeeded
=
true
;
});
}
),
...
...
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