Skip to content
On this page

Button

A rounded action button with loading, disabled, icon, and size options.

Button in FluttyUIButton in FluttyUI dark theme

Import

import 'package:flutter/widgets.dart';
import 'package:fluttyui/fluttyui.dart' as ui;

Usage

ui.Button(
  text: 'Continue',
  onPressed: () {},
)

API Reference

The declarations below match the current FluttyUI source. Types are shown without the optional ui. import prefix.

Button

const Button({
  super.key,
  this.motion,
  required this.text,
  required this.onPressed,
  this.child,
  this.leading,
  this.trailing,
  this.isLoading = false,
  this.isDisabled = false,
  this.isFullWidth = false,
  this.size,
  this.backgroundColor,
  this.foregroundColor,
  this.padding,
  this.borderRadius,
  this.height,
  this.fontSize,
  this.iconSize,
});
ParameterTypeRequiredDefault
keyKey?Nonull
motionComponentMotion?Nonull
textStringYes—
onPressedVoidCallback?Yes—
childWidget?Nonull
leadingWidget?Nonull
trailingWidget?Nonull
isLoadingboolNofalse
isDisabledboolNofalse
isFullWidthboolNofalse
sizeButtonSize?Nonull
backgroundColorColor?Nonull
foregroundColorColor?Nonull
paddingEdgeInsetsGeometry?Nonull
borderRadiusdouble?Nonull
heightdouble?Nonull
fontSizedouble?Nonull
iconSizedouble?Nonull

Application Setup

Place components under FluttyApp to provide theme, navigation, localization, and overlay defaults. Use theme tokens for shared appearance settings.

Source

lib/src/widgets/buttons/button/button.dart

This reference is generated from the Button declaration in the FluttyUI core checkout. The component catalog lists the other available building blocks.

DartFlutter

Get started with FluttyUI