update ui example

null_safety
小赖 4 years ago
parent fee8376942
commit 5872efdbb1

@ -21,7 +21,7 @@ class _MainExtentionState extends State<MainExtention> {
onPressed: onPressed, onPressed: onPressed,
child: Row( child: Row(
children: [ children: [
Expanded(child: icon), Expanded(child: icon ?? SizedBox()),
child, child,
Spacer(), Spacer(),
], ],

@ -25,6 +25,23 @@ class MainHome extends StatefulWidget {
} }
class _MainHomeState extends State<MainHome> { class _MainHomeState extends State<MainHome> {
_innerButton({
VoidCallback onPressed,
String title,
IconData icon,
}) {
return TextButton(
onPressed: onPressed,
child: Row(
children: [
Expanded(child: Icon(icon) ?? SizedBox()),
Text(title),
Spacer(),
],
),
);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ListView( return ListView(
@ -32,49 +49,53 @@ class _MainHomeState extends State<MainHome> {
children: [ children: [
Image.asset('assets/logo.webp', height: 50), Image.asset('assets/logo.webp', height: 50),
SizedBox(height: 16.w), SizedBox(height: 16.w),
ASButton.info( _innerButton(
title: '颜色 Style Color', title: '颜色 Style Color',
onPressed: () => Get.to(ExampleStyleColor())), onPressed: () => Get.to(ExampleStyleColor()),
ASButton.info( icon: Icons.colorize,
title: '按钮 Button', onPressed: () => Get.to(ExampleButton())), ),
ASButton.info( _innerButton(
title: '按钮 Button',
onPressed: () => Get.to(ExampleButton()),
),
_innerButton(
title: '框架 Scaffold', onPressed: () => Get.to(ExampleScaffold())), title: '框架 Scaffold', onPressed: () => Get.to(ExampleScaffold())),
ASButton.info( _innerButton(
title: '选项卡 Tabbar', onPressed: () => Get.to(ExampleTabBar())), title: '选项卡 Tabbar', onPressed: () => Get.to(ExampleTabBar())),
ASButton.info( _innerButton(
title: '数量选择器NumericButton', title: '数量选择器NumericButton',
onPressed: () => Get.to(ExampleNumericButton())), onPressed: () => Get.to(ExampleNumericButton())),
ASButton.info( _innerButton(
title: '选择器 Pickers', onPressed: () => Get.to(ExamplePicker())), title: '选择器 Pickers', onPressed: () => Get.to(ExamplePicker())),
ASButton.info( _innerButton(
title: '底部按钮 BottomButton', title: '底部按钮 BottomButton',
onPressed: () => Get.to(ExampleBottomButton()), onPressed: () => Get.to(ExampleBottomButton()),
), ),
ASButton.info( _innerButton(
title: '标签 TAG', title: '标签 TAG',
onPressed: () => Get.to(ExampleTag()), onPressed: () => Get.to(ExampleTag()),
), ),
ASButton.info( _innerButton(
title: '抽屉 DRAWER', title: '抽屉 DRAWER',
onPressed: () => Get.to(ExampleDrawer()), onPressed: () => Get.to(ExampleDrawer()),
), ),
ASButton.info( _innerButton(
title: '对话框 Dialog', title: '对话框 Dialog',
onPressed: () => Get.to(ExampleDialog()), onPressed: () => Get.to(ExampleDialog()),
), ),
ASButton.info( _innerButton(
title: '列表内容项 ListTile', title: '列表内容项 ListTile',
onPressed: () => Get.to(ExampleListTile()), onPressed: () => Get.to(ExampleListTile()),
), ),
ASButton.info( _innerButton(
title: '文本框 TextField', title: '文本框 TextField',
onPressed: () => Get.to(ExampleTextFiled()), onPressed: () => Get.to(ExampleTextFiled()),
), ),
ASButton.info( _innerButton(
title: '刷新组件 Refresh', title: '刷新组件 Refresh',
onPressed: () => Get.to(ExampleRefresh()), onPressed: () => Get.to(ExampleRefresh()),
), ),
ASButton.info( _innerButton(
title: '选框 Box', title: '选框 Box',
onPressed: () => Get.to(ExampleBox()), onPressed: () => Get.to(ExampleBox()),
), ),

Loading…
Cancel
Save