Skip to content
On this page

MorphButton

An action button that animates between its supported presentation states.

MorphButton in FluttyUIMorphButton in FluttyUI dark theme

Import

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

API Reference

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

MorphButton

const MorphButton({
  super.key,
  required this.label,
  required this.panelBuilder,
  this.leading,
  this.size,
  this.isOpen,
  this.onOpenChanged,
  this.enabled = true,
  this.variant = MorphButtonVariant.primary,
  this.direction = MorphButtonDirection.top,
  this.expandedWidth,
  this.expandedHeight,
  this.height,
  this.panelPadding,
  this.borderRadius,
  this.duration,
  this.animate = true,
  this.dismissOnOutsideTap = true,
  this.backgroundColor,
  this.foregroundColor,
});
ParameterTypeRequiredDefault
keyKey?Nonull
labelStringYes—
panelBuilderWidget Function(BuildContext context, VoidCallback close)Yes—
leadingWidget?Nonull
sizeComponentSize?Nonull
isOpenbool?Nonull
onOpenChangedValueChanged<bool>?Nonull
enabledboolNotrue
variantMorphButtonVariantNoMorphButtonVariant.primary
directionMorphButtonDirectionNoMorphButtonDirection.top
expandedWidthdouble?Nonull
expandedHeightdouble?Nonull
heightdouble?Nonull
panelPaddingEdgeInsetsGeometry?Nonull
borderRadiusdouble?Nonull
durationDuration?Nonull
animateboolNotrue
dismissOnOutsideTapboolNotrue
backgroundColorColor?Nonull
foregroundColorColor?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/morph_button/morph_button.dart

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

DartFlutter

Get started with FluttyUI