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
a5299065
Unverified
Commit
a5299065
authored
Aug 19, 2018
by
Mehmet Fidanboylu
Committed by
GitHub
Aug 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow option switches to have keys in Gallery (#20740)
* Allow option switches to have keys * Review comments
parent
f688b0d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
options.dart
examples/flutter_gallery/lib/gallery/options.dart
+7
-1
No files found.
examples/flutter_gallery/lib/gallery/options.dart
View file @
a5299065
...
...
@@ -115,11 +115,13 @@ class _OptionsItem extends StatelessWidget {
}
class
_BooleanItem
extends
StatelessWidget
{
const
_BooleanItem
(
this
.
title
,
this
.
value
,
this
.
onChanged
);
const
_BooleanItem
(
this
.
title
,
this
.
value
,
this
.
onChanged
,
{
this
.
switchKey
}
);
final
String
title
;
final
bool
value
;
final
ValueChanged
<
bool
>
onChanged
;
// [switchKey] is used for accessing the switch from driver tests.
final
Key
switchKey
;
@override
Widget
build
(
BuildContext
context
)
{
...
...
@@ -129,6 +131,7 @@ class _BooleanItem extends StatelessWidget {
children:
<
Widget
>[
new
Expanded
(
child:
new
Text
(
title
)),
new
Switch
(
key:
switchKey
,
value:
value
,
onChanged:
onChanged
,
activeColor:
const
Color
(
0xFF39CEFD
),
...
...
@@ -217,6 +220,7 @@ class _ThemeItem extends StatelessWidget {
),
);
},
switchKey:
const
Key
(
'dark_theme'
),
);
}
}
...
...
@@ -285,6 +289,7 @@ class _TextDirectionItem extends StatelessWidget {
),
);
},
switchKey:
const
Key
(
'text_direction'
),
);
}
}
...
...
@@ -307,6 +312,7 @@ class _TimeDilationItem extends StatelessWidget {
),
);
},
switchKey:
const
Key
(
'slow_motion'
),
);
}
}
...
...
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