Button.fixed constructor

const Button.fixed({
  1. Key? key,
  2. WidgetStatesController? statesController,
  3. Widget? leading,
  4. Widget? trailing,
  5. double? leadingGap,
  6. double? trailingGap,
  7. required Widget child,
  8. VoidCallback? onPressed,
  9. FocusNode? focusNode,
  10. AlignmentGeometry? alignment,
  11. bool? enabled,
  12. AbstractButtonStyle style = ButtonVariance.fixed,
  13. bool disableTransition = false,
  14. ValueChanged<bool>? onFocus,
  15. ValueChanged<bool>? onHover,
  16. bool disableHoverEffect = false,
  17. bool? enableFeedback,
  18. GestureTapDownCallback? onTapDown,
  19. GestureTapUpCallback? onTapUp,
  20. GestureTapCancelCallback? onTapCancel,
  21. GestureTapDownCallback? onSecondaryTapDown,
  22. GestureTapUpCallback? onSecondaryTapUp,
  23. GestureTapCancelCallback? onSecondaryTapCancel,
  24. GestureTapDownCallback? onTertiaryTapDown,
  25. GestureTapUpCallback? onTertiaryTapUp,
  26. GestureTapCancelCallback? onTertiaryTapCancel,
  27. GestureLongPressStartCallback? onLongPressStart,
  28. GestureLongPressUpCallback? onLongPressUp,
  29. GestureLongPressMoveUpdateCallback? onLongPressMoveUpdate,
  30. GestureLongPressEndCallback? onLongPressEnd,
  31. GestureLongPressUpCallback? onSecondaryLongPress,
  32. GestureLongPressUpCallback? onTertiaryLongPress,
  33. AlignmentGeometry? marginAlignment,
  34. bool disableFocusOutline = false,
})

Creates a fixed-style button with consistent dimensions.

Fixed buttons maintain specific dimensions regardless of content, making them ideal for grids, toolbars, or layouts where uniform button sizing is required. They're commonly used in icon-heavy interfaces or when precise spacing matters.

Example:

Button.fixed(
  onPressed: () => performAction(),
  child: Icon(Icons.add),
);

Implementation

const Button.fixed({
  super.key,
  this.statesController,
  this.leading,
  this.trailing,
  this.leadingGap,
  this.trailingGap,
  required this.child,
  this.onPressed,
  this.focusNode,
  this.alignment,
  this.enabled,
  this.style = ButtonVariance.fixed,
  this.disableTransition = false,
  this.onFocus,
  this.onHover,
  this.disableHoverEffect = false,
  this.enableFeedback,
  this.onTapDown,
  this.onTapUp,
  this.onTapCancel,
  this.onSecondaryTapDown,
  this.onSecondaryTapUp,
  this.onSecondaryTapCancel,
  this.onTertiaryTapDown,
  this.onTertiaryTapUp,
  this.onTertiaryTapCancel,
  this.onLongPressStart,
  this.onLongPressUp,
  this.onLongPressMoveUpdate,
  this.onLongPressEnd,
  this.onSecondaryLongPress,
  this.onTertiaryLongPress,
  this.marginAlignment,
  this.disableFocusOutline = false,
});