当前位置:网站首页>Flutter simple and excellent open source dialog uses free_ dialog
Flutter simple and excellent open source dialog uses free_ dialog
2022-06-13 10:35:00 【Two eggs and his big flowers】
Preface
Today I'd like to introduce a simple , Easy-to-use dialog, The dialog Simple comparison , Can adapt to many app( There are no other animations or other pictures , Black and white style can adapt to a variety of styles app). If your app A good one is urgently needed dialog, And you're too lazy to develop , Then use this one .
Start
Integrate dialog
dependencies:
free_dialog: ^0.0.1
git Address :https://github.com/smartbackme/free_dialog
Easy to use
example 1( Input text box ):
FreeDialog(context: context,title: " Please enter text ",
iWidget: EditWidget(_controller!),
btnOkOnPress: (a){
print(a);
},
btnCancelOnPress: (){
},
onDissmissCallback: (DismissType type){
print(type);
}
).show();
}, child: const Text(" Input text box ")),
explain :free_dialog Provides a variety of Widget To configure ( There are ,list&edit Two kinds of ), Can integrate quickly .
The display effect is as follows :
example 2( Selection box ):
FreeDialog(context: context,title: " Please select ",
onDissmissCallback: (DismissType type){
print(type);
},
iWidget: ListWidget(["123","1233","12312","12312","12312","12312","12312","12312","12312","12312","12312","12312","12312"],(a){
print(a);
},)
).show();
}, child: const Text(" Selection box ")),
The display effect is as follows :
example 3( More content dialog):
FreeDialog(context: context,title: " Tips ",
desc: "123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321",
btnOkOnPress: (a){
print(a);
},
btnCancelOnPress: (){
},
onDissmissCallback: (DismissType type){
print(type);
}
).show();
The display effect is as follows :

example 4( More content dialog, Single button ):
FreeDialog(context: context,title: " Tips ",
desc: "123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321123123211231232112312321",
btnOkOnPress: (a){
print(a);
},
onDissmissCallback: (DismissType type){
print(type);
}
).show();
The display effect is as follows :

example 5( Less content dialog):
FreeDialog(context: context,title: " Tips ",
desc: "111",
btnOkOnPress: (a){
print(a);
},
onDissmissCallback: (DismissType type){
print(type);
}
).show();
The display effect is as shown in the picture :
example 6( Single prompt ):
FreeDialog(context: context,title: " Tips ",
desc: "12312",
onDissmissCallback: (DismissType type){
print(type);
}
).show();
The display effect is shown in the figure :
example 7( No exit dialog):
FreeDialog(context: context,title: " Tips ",
desc: "1111",
dismissOnTouchOutside: false,
dismissOnBackKeyPress: false,
btnCancelOnPress: (){
},
onDissmissCallback: (DismissType type){
print(type);
}
).show();
Supported customization
| attribute | type | describe | The default attribute |
|---|---|---|---|
| width | double | dialog Width | The narrow side of the screen 80% |
| title | String | Set up title | If you don't pass it on, the default is no title Of |
| desc | String | Set normal The text content of the box | If not, don't show , If there are settings body and iwidget It doesn't show |
| body | Widget | Customize widget | Null |
| context | BuildContext | @required | Null |
| btnOkText | String | ok written words | ‘Ok’ |
| btnOkOnPress | Function | Click on ok | Null ( If passed, it will show ok) |
| btnOkColor | Color | ok Color | Color(0xFF00CA71) |
| btnOk | Widget | Pass a ok Components | null |
| btnCancelText | String | Cancel | ‘Cancel’ |
| btnCancelOnPress | Function | Click Cancel | Null ( If passed, it will show cancle) |
| btnCancelColor | Color | Color Cancel | Colors.red |
| btnCancel | Widget | Pass a cancle Components | null |
| dismissOnTouchOutside | bool | Point external close | true |
| onDismissCallback | Function | Exit the pop-up callback | Null |
| animType | AnimType | Animation type | AnimType.SCALE |
| alignment | AlignmentGeometry | Typesetting | Alignment.center |
| useRootNavigator | bool | Whether to use useRootNavigator | false |
| autoHide | Duration | Auto disappear | null |
| keyboardAware | bool | Whether to move with the keyboard ( Fill the keyboard area ) | true |
| dismissOnBackKeyPress | bool | Return key exit | true |
| buttonsBorderRadius | BorderRadiusGeometry | Button Radius | BorderRadius.all(Radius.circular(100) |
| dialogBackgroundColor | Color | dialog background | Theme.of(context).cardColor |
| borderSide | BorderSide | The whole pop-up window shape | null |
| iWidget | IWidget | General definition widget( The source code contains edit and list) | null |
边栏推荐
猜你喜欢

【ELM分类】基于粒子群优化卷积神经网络CNN结合极限学习机ELM实现数据分类附matlab代码

聊聊 C# 方法重载的底层玩法

架构师必备:系统容量现状checklist

电解电容、钽电容、普通电容

Memory management -- Viewing memory space from the perspective of executing programs and processes

vivo大规模 Kubernetes 集群自动化运维实践

Cynthia项目缺陷管理系统

WIN7无法被远程桌面问题

Matlab hub motor analysis fuzzy PID control vertical vibration analysis

Electrolytic capacitor, tantalum capacitor, ordinary capacitor
随机推荐
Matplotlib 学习笔记
2022煤矿探放水特种作业证考试题库模拟考试平台操作
AcWing第 55 场周赛
Computing cyclic redundancy codes -- excerpts
五分钟内编写Pytorch模型
Brief request process
C 11 more practical NAMEOF
测试人员必须掌握的测试用例
Node-RED系列(二七):扩展节点之s7节点的使用说明
JS local storage
信息文档管理与配置管理
记一次水平越权漏洞的利用
Write pytoch model in five minutes
Information document management and configuration management
Go zero microservice Practice Series (III. API definition and table structure design)
Software testing often asks, do you really build a testing environment?
vivo大规模 Kubernetes 集群自动化运维实践
Electrolytic capacitor, tantalum capacitor, ordinary capacitor
vivo大规模 Kubernetes 集群自动化运维实践
Introduction to knowledge map