Exemplo n.º 1
0
 public static CustomDismissible builder(
     Key key,
     Widget child,
     CustomDismissibleDelegate dismissibleDelegate,
     List <Widget> actions          = null,
     List <Widget> secondaryActions = null,
     float showAllActionsThreshold  = 0.5f,
     float?actionExtentRatio        = null,
     TimeSpan?movementDuration      = null,
     Axis direction     = Axis.horizontal,
     bool closeOnScroll = true,
     bool enabled       = true,
     SlideToDismissDelegate slideToDismissDelegate = null,
     CustomDismissibleController controller        = null
     )
 {
     return(new CustomDismissible(
                key,
                child,
                dismissibleDelegate,
                new SlideActionListDelegate(actions),
                new SlideActionListDelegate(secondaryActions),
                showAllActionsThreshold,
                actionExtentRatio ?? CustomDismissibleUtil.ActionsExtentRatio,
                movementDuration,
                direction,
                closeOnScroll,
                enabled,
                slideToDismissDelegate,
                controller
                ));
 }
Exemplo n.º 2
0
 CustomDismissible(
     Key key,
     Widget child,
     CustomDismissibleDelegate dismissibleDelegate,
     SlideActionDelegate actionDelegate          = null,
     SlideActionDelegate secondaryActionDelegate = null,
     float showAllActionsThreshold = 0.5f,
     float?actionExtentRatio       = null,
     TimeSpan?movementDuration     = null,
     Axis direction     = Axis.horizontal,
     bool closeOnScroll = true,
     bool enabled       = true,
     SlideToDismissDelegate slideToDismissDelegate = null,
     CustomDismissibleController controller        = null
     ) : base(key)
 {
     D.assert(dismissibleDelegate != null);
     this.child = child;
     this.dismissibleDelegate     = dismissibleDelegate;
     this.actionDelegate          = actionDelegate;
     this.secondaryActionDelegate = secondaryActionDelegate;
     this.showAllActionsThreshold = showAllActionsThreshold;
     this.actionExtentRatio       = actionExtentRatio ?? CustomDismissibleUtil.ActionsExtentRatio;
     this.movementDuration        = movementDuration ?? CustomDismissibleUtil.MovementDuration;
     this.direction              = direction;
     this.closeOnScroll          = closeOnScroll;
     this.enabled                = enabled;
     this.slideToDismissDelegate = slideToDismissDelegate;
     this.controller             = controller;
 }