Flutter - 仿微信右上角pop弹框封装 - JhPopM
2020-08-17 本文已影响0人
西半球_
demo 地址: https://github.com/iotjin/jh_flutter_demo
效果图:
JhPopMenus1.jpg JhPopMenus3.jpg JhPopMenus2.jpgExamples
- 样式1 - 带分隔线
// 带分割线不带背景
JhPopMenus.showLinePop(context, clickCallback: (index, selText) {
print('选中index: ${index}');
print('选中text: ${selText}');
if (selText == '扫一扫') {
// 延时执行
Future.delayed(Duration(milliseconds: 400), () {
JhQrCodeUtils.scan().then((value) => () {
print(value);
});
});
}
});
- 样式2 - 不带分割线
JhPopMenus.show(context, clickCallback: (index, selText) {
print('选中index: ${index}');
print('选中text: ${selText}');
});
- 样式3 - 带背景
JhPopMenus.showLinePop(context, isShowBg: true,
clickCallback: (index, selText) {
print('选中index: ${index}');
print('选中text: ${selText}');
});