• flutter之Dismissible组件


    /**
    * 滑动删除
    *
    * const Dismissible({
    @required Key key,//
    @required this.child,//
    this.background,
    //滑动时组件下一层显示的内容,没有设置secondaryBackground时,从右往左或者从左往右滑动都显示该内容,设置了secondaryBackground后,从左往右滑动显示该内容,从右往左滑动显示secondaryBackground的内容
    //secondaryBackground不能单独设置,只能在已经设置了background后才能设置,从右往左滑动时显示
    this.secondaryBackground,//
    this.onResize,//组件大小改变时回调
    this.onDismissed,//组件消失后回调
    this.direction = DismissDirection.horizontal,//
    this.resizeDuration = const Duration(milliseconds: 300),//组件大小改变的时长
    this.dismissThresholds = const <DismissDirection, double>{},//
    this.movementDuration = const Duration(milliseconds: 200),//组件消失的时长
    this.crossAxisEndOffset = 0.0,//
    })
    */


    Dismissible(
    key: Key('a${index}'),
    secondaryBackground: Container(
    child: Text('左滑删除', style: TextStyle(fontSize: Screen.width(32), color: Colors.white)),
    color: Colors.red,
    padding: EdgeInsets.only(right: Screen.width(10)),
    alignment: Alignment.centerRight,
    ),
    background: Container(
    child: Text('右滑删除', style: TextStyle(fontSize: Screen.width(32), color: Colors.white)),
    color: Colors.red,
    padding: EdgeInsets.only(left: Screen.width(10)),
    alignment: Alignment.centerLeft,
    ),
    onDismissed: (direction) {
    print('onDismissed');
    },
    child:
    ),
  • 相关阅读:
    【学习笔记/题解】树上启发式合并/CF600E Lomsat gelral
    【学习笔记/题解】虚树/[SDOI2011]消耗战
    【题解】 [GZOI2017]小z玩游戏
    【题解】CF1426E Rock, Paper, Scissors
    【题解】CF1426D Non-zero Segments
    【题解】NOIP2018 填数游戏
    【题解】NOIP2018 旅行
    【题解】NOIP2018 赛道修建
    【题解】时间复杂度
    【题解】「MCOI-02」Convex Hull 凸包
  • 原文地址:https://www.cnblogs.com/zhaofeis/p/12849890.html
Copyright © 2020-2023  润新知