Foundations
Buttons
Primary button (orange gradient) and secondary (ghost).
App · Flutter · macromath_mobile
The MacroMath button has two variants: primary (orange gradient, for the main action) and ghost (outlined, for secondary actions).
Variants
SavePrimary
CancelGhost
SaveWith icon
SaveDisabled
Sizes
SmallSmall
MediumMedium
LargeLarge
Properties
| Property | Type | Default | Description |
|---|---|---|---|
label | String | — | Button text. |
onPressed | VoidCallback? | null | Tap action. |
variant | MmButtonVariant | primary | primary or ghost. |
icon | IconData? | null | Optional leading icon. |
Usage
// Primary — main action
MmButton(
label: 'Save',
icon: Icons.check_rounded,
onPressed: () {},
);
// Secondary (ghost)
MmButton(
label: 'Cancel',
variant: MmButtonVariant.ghost,
onPressed: () {},
);Try it live in the Widgetbook → Foundations › Button.