DynamicButton constructor

DynamicButton({
  1. Key? key,
  2. required VoidCallback? onPressed,
  3. VoidCallback? onLongPress,
  4. ValueChanged<bool>? onHover,
  5. ValueChanged<bool>? onFocusChange,
  6. ButtonStyle? style,
  7. FocusNode? focusNode,
  8. bool autofocus = false,
  9. Clip clipBehavior = Clip.none,
  10. required Widget child,
  11. EdgeInsetsGeometry? padding,
  12. Color? color,
  13. Color disabledColor = CupertinoColors.quaternarySystemFill,
  14. double? minSize = kMinInteractiveDimensionCupertino,
  15. double? pressedOpacity = 0.4,
  16. BorderRadius? borderRadius = const BorderRadius.all(Radius.circular(8.0)),
  17. AlignmentGeometry alignment = Alignment.center,
})

Implementation

DynamicButton({
  Key? key,
  required this.onPressed, // android and ios
  VoidCallback? onLongPress,
  ValueChanged<bool>? onHover,
  ValueChanged<bool>? onFocusChange,
  ButtonStyle? style,
  FocusNode? focusNode,
  bool autofocus = false,
  Clip clipBehavior = Clip.none,
  //ios
  required this.child, // android and ios
  this.padding,
  this.color,
  this.disabledColor = CupertinoColors.quaternarySystemFill,
  this.minSize = kMinInteractiveDimensionCupertino,
  this.pressedOpacity = 0.4,
  this.borderRadius = const BorderRadius.all(Radius.circular(8.0)),
  this.alignment = Alignment.center,
})  : assert(pressedOpacity == null || (pressedOpacity >= 0.0 && pressedOpacity <= 1.0)),
      filled = false,
      super(key: key);