fl_drag_picture 1.0.1 copy "fl_drag_picture: ^1.0.1" to clipboard
fl_drag_picture: ^1.0.1 copied to clipboard

用Flutter实现的多图片拖动,上传至网络, 开箱即用.

fl_drag_picture #

As shown in the figure below:

Alt

图片地址:https://i.ibb.co/82XfyCN/20230318-180943.jpg

Welcome to my personal website:https://www.sshlearning.cn

Welcome to my github and invite you to build more:https://github.com/ssh199956

Welcome to my personal blog:https://blog.sshlearning.cn

Welcome to follow my document content:https://data.sshlearning.cn

Welcome to the static e-commerce website made during my study:https://shenfeng.sshlearning.cn

Getting started #

A Flutter plugin that supports drag picture for Image dragging, support data interface upload, request permission, network data interaction, etc.

Usage #

class _MyAppState extends State<MyApp> {

  @override
  void initState() {
    super.initState();
  }

  List<String> x = [
    "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS2zFG-Cy6Jg2GBcZrK-se70-cUMGL2lkqNqYCWhrCW&s",
    "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRD7uzo6K_z3e5vsNk-J7W-OoSSfNCVCMCN5yH4c1KA&s",
    "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTDLG1rePq00VAg7LohNQTGpl3cQkZLUz6NWyHwUJ12&s",
    "https://static.wikia.nocookie.net/starwars/images/1/1c/CT5385Tup-TCWCEJtB.png/revision/latest?cb=20221005011539",
    "https://5.imimg.com/data5/ANDROID/Default/2020/8/RU/EX/EI/112326264/product-jpeg-500x500.jpg",
    "https://www.tupcavite.edu.ph/images/TUPSeal2.png"
  ];

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('fl_drag_picture example app'),
        ),
        body: Center(
          child: FlDragPicture(maxSelect: 5, picList: x, isShowBigPic: true),
        ),
      ),
    );
  }
}

Property #

  • mode:
/// 选择模式
/// maxSelect:最大选择数
final int maxSelect;
final List<String>? picList;
bool? isCanDrag;
bool? isShowBigPic; //打开是否展示大图
//方法
final Function? onTapPic; //点击图片功能操作
final Function? uploadPic; //上传图片到服务器
final Function? lookBigPic; //查看大图功能
final Function? openPic; //打开图片功能