Skip to content

Button

A versatile button component with multiple variants, sizes, and states.

Installation

bash
flutter_studio add button
bash
flutter pub add flutter_studio

Usage

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

PropertyTypeDefaultDescription
textString?nullButton text label
onPressedVoidCallback?nullCallback when button is pressed
variantButtonVariantprimaryVisual style variant