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
04162cff
Commit
04162cff
authored
Dec 15, 2015
by
Hans Muller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added bottom sheet demos to the Material gallery
parent
fce3a244
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
113 additions
and
1 deletion
+113
-1
flutter.yaml
examples/material_gallery/flutter.yaml
+1
-0
modal_bottom_sheet_demo.dart
...es/material_gallery/lib/demo/modal_bottom_sheet_demo.dart
+45
-0
persistent_bottom_sheet_demo.dart
...terial_gallery/lib/demo/persistent_bottom_sheet_demo.dart
+55
-0
widget_demo.dart
examples/material_gallery/lib/demo/widget_demo.dart
+2
-1
gallery_page.dart
examples/material_gallery/lib/gallery_page.dart
+6
-0
main.dart
examples/material_gallery/lib/main.dart
+4
-0
No files found.
examples/material_gallery/flutter.yaml
View file @
04162cff
...
...
@@ -9,3 +9,4 @@ material-design-icons:
-
name
:
action/alarm
-
name
:
action/face
-
name
:
action/language
-
name
:
content/add
examples/material_gallery/lib/demo/modal_bottom_sheet_demo.dart
0 → 100644
View file @
04162cff
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/material.dart'
;
import
'widget_demo.dart'
;
class
ModalBottomSheetDemo
extends
StatelessComponent
{
final
TextStyle
textStyle
=
new
TextStyle
(
color:
Colors
.
indigo
[
400
],
fontSize:
24.0
,
textAlign:
TextAlign
.
center
);
void
_showModalBottomSheet
(
BuildContext
context
)
{
showModalBottomSheet
(
context:
context
,
builder:
(
_
)
{
return
new
Container
(
child:
new
Padding
(
padding:
const
EdgeDims
.
all
(
32.0
),
child:
new
Text
(
"This is the modal bottom sheet. Click anywhere to dismiss."
,
style:
textStyle
)
)
);
});
}
Widget
build
(
BuildContext
context
)
{
return
new
Center
(
child:
new
Container
(
width:
200.0
,
height:
200.0
,
child:
new
RaisedButton
(
onPressed:
()
{
_showModalBottomSheet
(
context
);
},
child:
new
Text
(
'Show the modal bottom sheet'
,
style:
textStyle
)
)
)
);
}
}
final
WidgetDemo
kModalBottomSheetDemo
=
new
WidgetDemo
(
title:
'Modal Bottom Sheet'
,
routeName:
'/modalBottomSheet'
,
builder:
(
_
)
=>
new
ModalBottomSheetDemo
()
);
examples/material_gallery/lib/demo/persistent_bottom_sheet_demo.dart
0 → 100644
View file @
04162cff
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/material.dart'
;
import
'widget_demo.dart'
;
class
PersistentBottomSheetDemo
extends
StatelessComponent
{
final
TextStyle
textStyle
=
new
TextStyle
(
color:
Colors
.
indigo
[
400
],
fontSize:
24.0
,
textAlign:
TextAlign
.
center
);
void
_showBottomSheet
(
BuildContext
context
)
{
Scaffold
.
of
(
context
).
showBottomSheet
((
_
)
{
return
new
Container
(
decoration:
new
BoxDecoration
(
border:
new
Border
(
top:
new
BorderSide
(
color:
Colors
.
black26
,
width:
1.0
))
),
child:
new
Padding
(
padding:
const
EdgeDims
.
all
(
32.0
),
child:
new
Text
(
"This is a Material persistent bottom sheet. Drag downwards to dismiss it."
,
style:
textStyle
)
)
);
});
}
Widget
build
(
BuildContext
context
)
{
return
new
Center
(
child:
new
Container
(
width:
200.0
,
height:
200.0
,
child:
new
RaisedButton
(
onPressed:
()
{
_showBottomSheet
(
context
);
},
child:
new
Text
(
'Show the persistent bottom sheet'
,
style:
textStyle
)
)
)
);
}
}
final
WidgetDemo
kPersistentBottomSheetDemo
=
new
WidgetDemo
(
title:
'Persistent Bottom Sheet'
,
routeName:
'/persistentBottomSheet'
,
builder:
(
_
)
=>
new
PersistentBottomSheetDemo
(),
floatingActionButtonBuilder:
(
_
)
{
return
new
FloatingActionButton
(
child:
new
Icon
(
icon:
'content/add'
),
backgroundColor:
Colors
.
redAccent
[
200
]
);
}
);
examples/material_gallery/lib/demo/widget_demo.dart
View file @
04162cff
...
...
@@ -5,10 +5,11 @@
import
'package:flutter/material.dart'
;
class
WidgetDemo
{
WidgetDemo
({
this
.
title
,
this
.
routeName
,
this
.
tabBarBuilder
,
this
.
builder
});
WidgetDemo
({
this
.
title
,
this
.
routeName
,
this
.
tabBarBuilder
,
this
.
floatingActionButtonBuilder
,
this
.
builder
});
final
String
title
;
final
String
routeName
;
final
WidgetBuilder
tabBarBuilder
;
final
WidgetBuilder
floatingActionButtonBuilder
;
final
WidgetBuilder
builder
;
}
examples/material_gallery/lib/gallery_page.dart
View file @
04162cff
...
...
@@ -49,6 +49,11 @@ class _GalleryPageState extends State<GalleryPage> {
return
builder
!=
null
?
builder
(
context
)
:
null
;
}
Widget
_buildFloatingActionButton
()
{
final
WidgetBuilder
builder
=
config
.
active
?.
floatingActionButtonBuilder
;
return
builder
!=
null
?
builder
(
context
)
:
null
;
}
Widget
build
(
BuildContext
context
)
{
return
new
Scaffold
(
toolBar:
new
ToolBar
(
...
...
@@ -56,6 +61,7 @@ class _GalleryPageState extends State<GalleryPage> {
tabBar:
_buildTabBar
()
),
drawer:
_buildDrawer
(),
floatingActionButton:
_buildFloatingActionButton
(),
body:
_buildBody
()
);
}
...
...
examples/material_gallery/lib/main.dart
View file @
04162cff
...
...
@@ -7,6 +7,8 @@ import 'package:flutter/material.dart';
import
'demo/chip_demo.dart'
;
import
'demo/date_picker_demo.dart'
;
import
'demo/drop_down_demo.dart'
;
import
'demo/modal_bottom_sheet_demo.dart'
;
import
'demo/persistent_bottom_sheet_demo.dart'
;
import
'demo/selection_controls_demo.dart'
;
import
'demo/slider_demo.dart'
;
import
'demo/tabs_demo.dart'
;
...
...
@@ -22,6 +24,8 @@ final List<WidgetDemo> _kDemos = <WidgetDemo>[
kTabsDemo
,
kTimePickerDemo
,
kDropDownDemo
,
kModalBottomSheetDemo
,
kPersistentBottomSheetDemo
,
];
class
_MaterialGallery
extends
StatefulComponent
{
...
...
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