update example

null_safety
小赖 4 years ago
parent 3d27f334aa
commit 716db3e047

@ -0,0 +1,29 @@
import 'package:ansu_ui/ansu_ui.dart';
import 'package:flutter/material.dart';
class ExampleButton extends StatefulWidget {
ExampleButton({Key key}) : super(key: key);
@override
_ExampleButtonState createState() => _ExampleButtonState();
}
class _ExampleButtonState extends State<ExampleButton> {
@override
Widget build(BuildContext context) {
return ASScaffold(
title: 'Button',
body: ListView(
children: [
ASButton.delete('删除 DELETE', () {}),
ASButton.info('信息 INFO', () {}),
ASButton.warn('警告 WARNING', () {}),
ASButton.opration('操作 OPERATION', () {}),
SizedBox(height: 12.w),
ASLongButton.solid('确认', () {}),
ASLongButton.hollow('确认', () {}),
],
),
);
}
}

@ -1,10 +1,9 @@
import 'package:ansu_ui/ansu_ui.dart';
import 'package:ansu_ui/buttons/as_button.dart';
import 'package:ansu_ui/buttons/as_longbutton.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'example_scaffold.dart';
import 'example_button.dart';
void main() {
runApp(MyApp());
@ -39,24 +38,12 @@ class MyHomePage extends StatefulWidget {
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('title'),
),
return ASScaffold(
title: '安速组件',
body: ListView(
children: [
ASButton.delete('删除订单', () {}),
ASButton.info('删除订单', () {}),
ASButton.warn('删除订单', () {}),
ASButton.opration('删除订单', (){}),
SizedBox(height: 12.w),
ASLongButton.solid('确认', () {}),
ASLongButton.hollow('确认', () {}),
TextButton(
onPressed: () {
Get.to(ExampleScaffold());
},
child: Text('SCAFFOLD')),
ASButton.info('Button', () => Get.to(ExampleButton())),
ASButton.info('Scaffold', () => Get.to(ExampleScaffold())),
],
),
);

@ -1,6 +1,8 @@
library ansu_ui;
export 'buttons/as_button.dart';
export 'buttons/as_longbutton.dart';
export 'buttons/as_back_button.dart';
export 'scaffold/as_scaffold.dart';
export 'styles/as_colors.dart';
export 'bar/as_tabbar.dart';

Loading…
Cancel
Save