数十亿的 UI 组件
此软件包目前处于 Beta 版
函数
警报
alert(
'Title here',
'Description here',
type: 'warning',
)
- 类型
success, waring, danger, info
Toast
toast('Confirmed', type: 'success');
- 类型
success, waring, danger, info
确认对话框
confirm(ConfirmDialog(
'Are you sure?',
confirmed: () {
// do something here
},
),
)
图片选择器
openUploader(context, (FileInfo file) {
console.log(file.path);
});
- 在
ios->Runner->info.plist中添加以下行
<key>NSPhotoLibraryUsageDescription</key>
<string>Allow Image access to upload your profile image</string>
<key>NSCameraUsageDescription</key>
<string>Allow Image access to upload your profile image</string>
图片预览
preview([
'https://picsum.photos/id/237/536/354',
'https://picsum.photos/id/238/536/354',
'https://picsum.photos/id/239/536/354',
])
菜单
menu(
MenuList([
MenuListItem(
Icon(
Icons.edit,
size: 20,
),
title: 'Edit',
onPressed: () {
// do something
},
),
])
)
组件小部件
头像图片
Avatar(
'https://i.pravatar.cc/150?img=3',
title: 'Zin Kyaw Kyaw',
subTitle: '[email protected]',
)
图片滑块
ImageSlider([
'https://picsum.photos/id/237/536/354',
'https://picsum.photos/id/238/536/354',
'https://picsum.photos/id/239/536/354',
])
主要按钮
PrimaryButton(
'Button Title',
onPressed: () {
// do something
},
)
次要按钮
SecondaryButton(
'Button Title',
onPressed: () {
// do something
},
)
Card
CardWidget(
header: const Avatar(
'https://i.pravatar.cc/150?img=3',
title: 'Zin Kyaw Kyaw',
subTitle: '[email protected]',
),
body: Column(
children: const [
Span(
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
)
],
),
footer: const Text('This is footer'),
)
