Skip to content
On this page

Surface

A themed background container for nested content.

Surface in FluttyUISurface 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.

Surface

const Surface({
  super.key,
  required this.child,
  this.variant = SurfaceVariant.defaultVariant,
  this.color,
  this.padding = EdgeInsets.zero,
  this.margin = EdgeInsets.zero,
  this.width,
  this.height,
  this.borderRadius,
  this.border,
  this.elevation,
  this.clipBehavior,
});
ParameterTypeRequiredDefault
keyKey?Nonull
childWidgetYes—
variantSurfaceVariantNoSurfaceVariant.defaultVariant
colorColor?Nonull
paddingEdgeInsetsGeometryNoEdgeInsets.zero
marginEdgeInsetsGeometryNoEdgeInsets.zero
widthdouble?Nonull
heightdouble?Nonull
borderRadiusdouble?Nonull
borderBoxBorder?Nonull
elevationdouble?Nonull
clipBehaviorClip?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/layouts/surface/surface.dart

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

DartFlutter

Get started with FluttyUI