当前位置:网站首页>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 |
边栏推荐
- 23. Lottery
- Install Kubernetes 1.24
- Oracle自定义数据类型Type疑问
- On the exploitation of a horizontal ultra vires vulnerability
- Electrolytic capacitor, tantalum capacitor, ordinary capacitor
- Spark source code (I) how spark submit submits jars and configuration parameters to spark server
- 测试人员必须掌握的测试用例
- Thingsboard tutorial (21): save data after processing using message types and data processing nodes
- deepin系统中Qt5.12无法输入中文(无法切换中文输入法)解决办法
- Webrtc server engineering practice and optimization exploration
猜你喜欢
五分钟内编写Pytorch模型
Talk about the bottom playing method of C # method overloading
Actual combat simulation │ real time error alarm of enterprise wechat robot
Blue Bridge Cup group 2021a - two way sorting
首个Laravel工作流引擎发布 V1.0正式版
Computing cyclic redundancy codes -- excerpts
实战模拟│企业微信机器人实时报错预警
Apple zoom! It's done so well
Node red series (24): use MySQL nodes in node red to add, delete, modify and query databases
How to optimize MySQL?
随机推荐
IDEA 续命插件
Write pytoch model in five minutes
一文读懂pgstat【这次高斯不是数学家】
上周热点回顾(6.6-6.12)
ADG备库MRP0状态WAIT_FOR_GAP
go path包
Cynthia项目缺陷管理系统
Classical convolutional neural network model
Actual combat simulation │ real time error alarm of enterprise wechat robot
Docker deployment MySQL
vivo大规模 Kubernetes 集群自动化运维实践
关于#数据库#的问题:反复检查过了查不出来
了解RPC和REST
实战模拟│企业微信机器人实时报错预警
About instruction set bits and instruction architecture bits
一文读懂简单查询代价估算【这次高斯不是数学家】
Introduction to knowledge map
知识图谱入门
Pytorch basis (II) -- tensor and gradient
2022年劳务员-通用基础(劳务员)上岗证题目及答案