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
df1a957a
Commit
df1a957a
authored
Nov 24, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #560 from abarth/dropdown
Add drop down buttons to Material Gallery
parents
048400b3
1f1e0501
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
22 deletions
+12
-22
drop_down_demo.dart
examples/material_gallery/lib/drop_down_demo.dart
+10
-22
main.dart
examples/material_gallery/lib/main.dart
+2
-0
No files found.
examples/
widgets/dropdown
.dart
→
examples/
material_gallery/lib/drop_down_demo
.dart
View file @
df1a957a
...
...
@@ -4,11 +4,13 @@
import
'package:flutter/material.dart'
;
import
'widget_demo.dart'
;
class
DropDownDemo
extends
StatefulComponent
{
DropDownDemoState
createState
()
=>
new
DropDownDemoState
();
_DropDownDemoState
createState
()
=>
new
_
DropDownDemoState
();
}
class
DropDownDemoState
extends
State
<
DropDownDemo
>
{
class
_
DropDownDemoState
extends
State
<
DropDownDemo
>
{
String
_value
=
"Free"
;
List
<
DropDownMenuItem
<
String
>>
_buildItems
()
{
...
...
@@ -30,26 +32,12 @@ class DropDownDemoState extends State<DropDownDemo> {
}
);
return
new
Scaffold
(
toolBar:
new
ToolBar
(
center:
new
Text
(
'DropDownDemo Demo'
)),
body:
new
Container
(
decoration:
new
BoxDecoration
(
backgroundColor:
Theme
.
of
(
context
).
primarySwatch
[
50
]),
child:
new
Center
(
child:
dropdown
)
)
);
return
new
Center
(
child:
dropdown
);
}
}
void
main
(
)
{
runApp
(
new
MaterialApp
(
title:
'DropDownDemo'
,
theme:
new
ThemeData
(
brightness:
ThemeBrightness
.
light
,
primarySwatch:
Colors
.
blue
,
accentColor:
Colors
.
redAccent
[
200
]
),
routes:
<
String
,
RouteBuilder
>{
'/'
:
(
RouteArguments
args
)
=>
new
DropDownDemo
(),
}
));
}
final
WidgetDemo
kDropDownDemo
=
new
WidgetDemo
(
title:
'Drop Down Button'
,
routeName:
'/dropdown'
,
builder:
(
_
)
=>
new
DropDownDemo
()
);
examples/material_gallery/lib/main.dart
View file @
df1a957a
...
...
@@ -8,10 +8,12 @@ import 'chip_demo.dart';
import
'gallery_page.dart'
;
import
'date_picker_demo.dart'
;
import
'widget_demo.dart'
;
import
'drop_down_demo.dart'
;
final
List
<
WidgetDemo
>
_kDemos
=
<
WidgetDemo
>[
kChipDemo
,
kDatePickerDemo
,
kDropDownDemo
,
];
void
main
(
)
{
...
...
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