当前位置:网站首页>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 |
边栏推荐
猜你喜欢

Knowledge points of silicon steel sheet

Docker部署Mysql

China SaaS industry panorama

Brief introduction to memory structure of virtual machine

Go zero microservice Practice Series (III. API definition and table structure design)

WebRTC服务端工程实践和优化探索

C 11 more practical NAMEOF

Webrtc server engineering practice and optimization exploration

go-zero微服务实战系列(三、API定义和表结构设计)

Actual combat simulation │ real time error alarm of enterprise wechat robot
随机推荐
of_find_compatible_node查找出所有的节点
Initial installation and use of redis [play with Huawei cloud]
Go path package
EasyClick 运行代码片段出Null
Idea life extension plug-in
首个Laravel工作流引擎发布 V1.0正式版
Information document management and configuration management
Design of simple electronic clock based on single chip microcomputer
一文读懂pgstat【这次高斯不是数学家】
Actual combat simulation │ real time error alarm of enterprise wechat robot
Wait for someone with "source" | openharmony growth plan student challenge registration to start
Computing cyclic redundancy codes -- excerpts
Thingsboard tutorial (21): save data after processing using message types and data processing nodes
SQL Server创建windows登录账户找不到用户或组
[image denoising] image denoising based on MATLAB Gaussian + mean + median + bilateral filtering [including Matlab source code 1872]
IDEA 续命插件
Cynthia项目缺陷管理系统
AcWing第 55 场周赛
Docker部署Mysql
Software testing often asks, do you really build a testing environment?