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.
ToggleButton
const ToggleButton({
super.key,
required this.onChanged,
this.label,
this.child,
this.leading,
this.trailing,
this.isSelected = false,
this.isDisabled = false,
this.isFullWidth = false,
this.variant = ToggleButtonVariant.defaultVariant,
this.size,
this.borderRadius,
this.borderShape,
this.backgroundColor,
this.foregroundColor,
this.selectedBackgroundColor,
this.selectedForegroundColor,
this.focusColor,
});| Parameter | Type | Required | Default |
|---|---|---|---|
key | Key? | No | null |
onChanged | ValueChanged<bool>? | Yes | — |
label | String? | No | null |
child | Widget? | No | null |
leading | Widget? | No | null |
trailing | Widget? | No | null |
isSelected | bool | No | false |
isDisabled | bool | No | false |
isFullWidth | bool | No | false |
variant | ToggleButtonVariant | No | ToggleButtonVariant.defaultVariant |
size | ToggleButtonSize? | No | null |
borderRadius | double? | No | null |
borderShape | BorderRadiusGeometry? | No | null |
backgroundColor | Color? | No | null |
foregroundColor | Color? | No | null |
selectedBackgroundColor | Color? | No | null |
selectedForegroundColor | Color? | No | null |
focusColor | Color? | No | null |
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/toggle_button/toggle_button.dart
This reference is generated from the ToggleButton declaration in the FluttyUI core checkout. The component catalog lists the other available building blocks.

