浏览代码

Show Bottom Sheet.

/main
Yuncong Zhang 6 年前
当前提交
9e2df4ba
共有 3 个文件被更改,包括 54 次插入9 次删除
  1. 18
      Samples/UIWidgetsGallery/gallery/demos.cs
  2. 42
      Samples/UIWidgetsGallery/demo/material/modal_bottom_sheet_demo.cs
  3. 3
      Samples/UIWidgetsGallery/demo/material/modal_bottom_sheet_demo.cs.meta

18
Samples/UIWidgetsGallery/gallery/demos.cs


documentationUrl: "https://docs.flutter.io/flutter/material/BottomNavigationBar-class.html",
buildRoute: (BuildContext context) => new BottomNavigationDemo()
),
// new GalleryDemo(
// title: "Bottom sheet: Modal",
// subtitle: "A dismissable bottom sheet",
// icon: GalleryIcons.bottom_sheets,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: ModalBottomSheetDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/showModalBottomSheet.html",
// buildRoute: (BuildContext context) => ModalBottomSheetDemo()
// ),
new GalleryDemo(
title: "Bottom sheet: Modal",
subtitle: "A dismissable bottom sheet",
icon: GalleryIcons.bottom_sheets,
category: _kMaterialComponents,
routeName: ModalBottomSheetDemo.routeName,
documentationUrl: "https://docs.flutter.io/flutter/material/showModalBottomSheet.html",
buildRoute: (BuildContext context) => new ModalBottomSheetDemo()
),
// new GalleryDemo(
// title: "Bottom sheet: Persistent",
// subtitle: "A bottom sheet that sticks around",

42
Samples/UIWidgetsGallery/demo/material/modal_bottom_sheet_demo.cs


using System.Collections.Generic;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
namespace UIWidgetsGallery.gallery {
public class ModalBottomSheetDemo : StatelessWidget {
public const string routeName = "/material/modal-bottom-sheet";
public override Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text("Modal bottom sheet"),
actions: new List<Widget> {new MaterialDemoDocumentationButton(routeName)}
),
body: new Center(
child: new RaisedButton(
child: new Text("SHOW BOTTOM SHEET"),
onPressed: () => {
BottomSheetUtils.showModalBottomSheet<object>(context: context,
builder: (BuildContext _context) => {
return new Container(
child: new Padding(
padding: EdgeInsets.all(32.0f),
child: new Text("This is the modal bottom sheet. Tap anywhere to dismiss.",
textAlign: TextAlign.center,
style: new TextStyle(
color: Theme.of(_context).accentColor,
fontSize: 24.0f
)
)
)
);
});
}
)
)
);
}
}
}

3
Samples/UIWidgetsGallery/demo/material/modal_bottom_sheet_demo.cs.meta


fileFormatVersion: 2
guid: 3c47b9e1a46e47858145acbe84590d05
timeCreated: 1555059325
正在加载...
取消
保存