Button
A versatile button component with multiple variants, sizes, and states.
Installation
bash
flutter_studio add buttonbash
flutter pub add flutter_studioUsage
Basic Button
dart
import 'package:your_app/components/custom_button.dart';
CustomButton(
text: 'Click Me',
onPressed: () {
print('Button pressed!');
},
)Button Variants
dart
// Primary button (default)
CustomButton(
text: 'Primary',
variant: ButtonVariant.primary,
onPressed: () {},
)
// Secondary button
CustomButton(
text: 'Secondary',
variant: ButtonVariant.secondary,
onPressed: () {},
)
// Outlined button
CustomButton(
text: 'Outlined',
variant: ButtonVariant.outlined,
onPressed: () {},
)API Reference
Properties
| Property | Type | Default | Description |
|---|---|---|---|
text | String? | null | Button text label |
onPressed | VoidCallback? | null | Callback when button is pressed |
variant | ButtonVariant | primary | Visual style variant |
