浏览代码

Finish buttons_demo

/main
Yuncong Zhang 6 年前
当前提交
b5e22ca9
共有 4 个文件被更改,包括 16 次插入16 次删除
  1. 2
      Runtime/material/tab_controller.cs
  2. 10
      Samples/UIWidgetsGallery/demo/material/buttons_demo.cs
  3. 4
      Samples/UIWidgetsGallery/gallery/demo.cs
  4. 16
      Samples/UIWidgetsGallery/gallery/demos.cs

2
Runtime/material/tab_controller.cs


}
}
class DefaultTabController : StatefulWidget {
public class DefaultTabController : StatefulWidget {
public DefaultTabController(
Key key = null,
int? length = null,

10
Samples/UIWidgetsGallery/demo/material/buttons_demo.cs


namespace UIWidgetsGallery.gallery {
class ButtonsDemo : StatefulWidget {
const String routeName = "/material/buttons";
public const String routeName = "/material/buttons";
public ButtonsDemo(Key key = null) : base(key: key) {

this.dropdown1Value = newValue;
});
},
items: new List<string> {"One", "Two", "Free", "Four"}.map<DropdownMenuItem<String>>((string value) => {
items: new List<string> {"One", "Two", "Free", "Four"}.Select((string value) => {
}).toList()
}).ToList()
)
),
new SizedBox (

this.dropdown2Value = newValue;
});
},
items: new List<String >{"One", "Two", "Free", "Four"}.map<DropdownMenuItem<String>>((string value) => {
items: new List<String >{"One", "Two", "Free", "Four"}.Select((string value) => {
}).toList()
}).ToList()
)
),
new SizedBox (

4
Samples/UIWidgetsGallery/gallery/demo.cs


string _exampleCode;
public override void didChangeDependencies() {
ExampleCodeParser.getExampleCode(this.widget.exampleCodeTag, DefaultAssetBundle.of(this.context)).Then(
new ExampleCodeParser().getExampleCode(this.widget.exampleCodeTag, DefaultAssetBundle.of(this.context)).Then(
(string code) => {
if (this.mounted) {
this.setState(() => { this._exampleCode = code ?? "Example code not found"; });

Widget body;
if (this._exampleCode == null) {
body = new Center(
child: CircularProgressIndicator()
child: new CircularProgressIndicator()
);
}
else {

16
Samples/UIWidgetsGallery/gallery/demos.cs


// documentationUrl: "https://docs.flutter.io/flutter/material/ScaffoldState/showBottomSheet.html",
// buildRoute: (BuildContext context) => PersistentBottomSheetDemo()
// ),
// new GalleryDemo(
// title: "Buttons",
// subtitle: "Flat, raised, dropdown, and more",
// icon: GalleryIcons.generic_buttons,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: ButtonsDemo.routeName,
// buildRoute: (BuildContext context) => ButtonsDemo()
// ),
new GalleryDemo(
title: "Buttons",
subtitle: "Flat, raised, dropdown, and more",
icon: GalleryIcons.generic_buttons,
category: DemoUtils._kMaterialComponents,
routeName: ButtonsDemo.routeName,
buildRoute: (BuildContext context) => new ButtonsDemo()
),
// new GalleryDemo(
// title: "Buttons: Floating Action Button",
// subtitle: "FAB with transitions",

正在加载...
取消
保存