美文网首页Flutter
Flutter - 仿微信右上角pop弹框封装 - JhPopM

Flutter - 仿微信右上角pop弹框封装 - JhPopM

作者: 西半球_ | 来源:发表于2020-08-17 11:59 被阅读0次

demo 地址: https://github.com/iotjin/jh_flutter_demo

效果图:

JhPopMenus1.jpg JhPopMenus3.jpg JhPopMenus2.jpg

Examples

  • 样式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}');
    });

相关文章

网友评论

    本文标题:Flutter - 仿微信右上角pop弹框封装 - JhPopM

    本文链接:https://www.haomeiwen.com/subject/vkzfjktx.html