zoukankan      html  css  js  c++  java
  • 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:
    ),
  • 相关阅读:
    dom4j 解析 xml文件1
    java 简单的动态代理例子
    标识接口的作用 (转)
    JAVA servlet输出IE6下乱码
    java时间操作函数汇总
    IE支持getElementsByClassName方法
    女朋友问我 LB 是谁?
    人类高质量 Java 学习路线【一条龙版】
    程序员作图工具和技巧,你 get 了么?
    3 分钟了解 JSON Schema
  • 原文地址:https://www.cnblogs.com/zhaofeis/p/12849890.html
Copyright © 2011-2022 走看看