vant 1.0.1 vant: ^1.0.1 copied to clipboard
flutter vant ui
import 'package:example/pages/demo_pages.dart';
import 'package:example/theme/theme.dart';
import 'package:flutter/material.dart';
import 'package:vant/vant.dart';
void main() {
// runApp(VantUI( child: MyApp(), theme: theme1));
runApp(VantUI( child: MyApp()));
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: HomePage(),
);
}
}
class HomePage extends StatefulWidget {
HomePage({Key key}) : super(key: key);
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Example"),
),
body: Scrollbar(
child: ListView(
children: <Widget>[
VanCellGroup(title: "基础组件", children: <Widget>[
VanCell(
title: "Button 按钮",
onPressed: () => Navigator.of(context).push(MaterialPageRoute(builder: (_) => DemoButton())),
clickable: true,
),
VanCell(
title: "Cell 单元格",
onPressed: () => Navigator.of(context).push(MaterialPageRoute(builder: (_) => DemoCell())),
clickable: true,
),
VanCell(
title: "Toast 轻提示",
onPressed: () => Navigator.of(context).push(MaterialPageRoute(builder: (_) => DemoField())),
clickable: true,
),
]),
VanCellGroup(
title: "表单组件",
children: <Widget>[
VanCell(
title: "Field 输入框",
onPressed: () => Navigator.of(context).push(MaterialPageRoute(builder: (_) => DemoField())),
clickable: true,
),
VanCell(title: "Search 搜索", onPressed: () {},clickable: true),
],
),
VanCellGroup(
title: "反馈组件",
children: <Widget>[
VanCell(title: "Loading 加载", onPressed: () {},clickable: true,),
VanCell(title: "Notify 消息通知", onPressed: () {},clickable: true,),
VanCell(title: "Overlay 遮罩层", onPressed: () {},clickable: true,),
],
),
VanCellGroup(title: "展示组件", children: <Widget>[
VanCell(title: "Circle 环形进度条", onPressed: () {},clickable: true,),
VanCell(title: "Divider 分割线", onPressed: () {},clickable: true,),
VanCell(title: "Empty 空状态", onPressed: () {},clickable: true,),
VanCell(title: "countDown 倒计时", onPressed: () {},clickable: true,),
VanCell(title: "NoticeBar 通知栏", onPressed: () {},clickable: true,),
VanCell(title: "Progress 进度条", onPressed: () {},clickable: true,),
VanCell(title: "Sticky 粘性布局", onPressed: () {},clickable: true,),
VanCell(
title: "Tag 标记",
onPressed: () => Navigator.of(context).push(MaterialPageRoute(builder: (_) => DemoTag())),
clickable: true,
),
]),
VanCellGroup(
title: "导航组件",
children: <Widget>[
VanCell(title: "Pagination 分页", onPressed: () {},clickable: true,),
VanCell(title: "Card 卡片", onPressed: () {},clickable: true,),
],
)
],
),
),
);
}
}