Skip to content
On this page

CloseButton

A compact dismiss button for dialogs, panels, and transient content.

CloseButton in FluttyUICloseButton in FluttyUI dark theme

Import

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

Usage

ui.CloseButton(onPressed: () => Navigator.of(context).pop())

API Reference

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

CloseButton

const CloseButton({
  super.key,
  required this.onPressed,
  this.size,
  this.dimension,
  this.iconSize,
  this.color,
  this.hoverColor,
  this.pressedColor,
  this.backgroundColor,
  this.hoverBackgroundColor,
  this.borderRadius = 999,
  this.enabled = true,
});
ParameterTypeRequiredDefault
keyKey?Nonull
onPressedVoidCallback?Yes—
sizeComponentSize?Nonull
dimensiondouble?Nonull
iconSizedouble?Nonull
colorColor?Nonull
hoverColorColor?Nonull
pressedColorColor?Nonull
backgroundColorColor?Nonull
hoverBackgroundColorColor?Nonull
borderRadiusdoubleNo999
enabledboolNotrue

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/close_button/close_button.dart

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

DartFlutter

Get started with FluttyUI