Skip to content
On this page

Carousel

A horizontally navigable collection of content panels.

Carousel in FluttyUICarousel 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.

const Carousel({
  super.key,
  required this.images,
  this.thumbnails,
  this.mode = CarouselMode.inPlace,
  this.initialIndex = 0,
  this.height = 360,
  this.thumbnailSize = 64,
  this.thumbnailSpacing = 8,
  this.borderRadius = 16,
  this.fit = BoxFit.cover,
  this.thumbnailFit = BoxFit.cover,
  this.backgroundColor = const Color(0xFFEAEAE7),
  this.controlColor = const Color(0xFF006FEE),
  this.controlBackgroundColor = const Color(0xE6FFFFFF),
  this.showThumbnails = true,
  this.showIndicators = true,
  this.showControls = true,
  this.onPageChanged,
  this.onClose,
});
ParameterTypeRequiredDefault
keyKey?Nonull
imagesList<ImageProvider<Object>>Yes—
thumbnailsList<ImageProvider<Object>>?Nonull
modeCarouselModeNoCarouselMode.inPlace
initialIndexintNo0
heightdoubleNo360
thumbnailSizedoubleNo64
thumbnailSpacingdoubleNo8
borderRadiusdoubleNo16
fitBoxFitNoBoxFit.cover
thumbnailFitBoxFitNoBoxFit.cover
backgroundColorColorNoconst Color(0xFFEAEAE7)
controlColorColorNoconst Color(0xFF006FEE)
controlBackgroundColorColorNoconst Color(0xE6FFFFFF)
showThumbnailsboolNotrue
showIndicatorsboolNotrue
showControlsboolNotrue
onPageChangedValueChanged<int>?Nonull
onCloseVoidCallback?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/data_display/carousel/carousel.dart

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

DartFlutter

Get started with FluttyUI