Dismissable({@required Key key, Widget child, Widget background, Widget secondaryBackground, VoidCallback onResize, DismissDirectionCallback onDismissed, DismissDirection direction: DismissDirection.horizontal, Duration resizeDuration: const Duration(milliseconds: 300) })

Creates a widget that can be dismissed.

The key argument must not be null because Dismissables are commonly used in lists and removed from the list when dismissed. Without keys, the default behavior is to sync widgets based on their index in the list, which means the item after the dismissed item would be synced with the state of the dismissed item. Using keys causes the widgets to sync according to their keys and avoids this pitfall.

Source

Dismissable({
  @required Key key,
  this.child,
  this.background,
  this.secondaryBackground,
  this.onResize,
  this.onDismissed,
  this.direction: DismissDirection.horizontal,
  this.resizeDuration: const Duration(milliseconds: 300)
}) : super(key: key) {
  assert(key != null);
  assert(secondaryBackground != null ? background != null : true);
}