Skip to content
On this page

SnapList

A scrolling collection that snaps items into alignment.

SnapList in FluttyUISnapList 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.

SnapList

const SnapList({
  super.key,
  required List<Widget> children,
  this.controller,
  this.initialIndex = 0,
  this.onPageChanged,
  this.scrollDirection = Axis.vertical,
  this.reverse = false,
  this.physics,
  this.allowImplicitScrolling = false,
  this.clipBehavior = Clip.hardEdge,
});
ParameterTypeRequiredDefault
keyKey?Nonull
childrenList<Widget>Yes—
controllerPageController?Nonull
initialIndexintNo0
onPageChangedValueChanged<int>?Nonull
scrollDirectionAxisNoAxis.vertical
reverseboolNofalse
physicsScrollPhysics?Nonull
allowImplicitScrollingboolNofalse
clipBehaviorClipNoClip.hardEdge

SnapList.builder

const SnapList.builder({
  super.key,
  required this.itemBuilder,
  required this.itemCount,
  this.findChildIndexCallback,
  this.controller,
  this.initialIndex = 0,
  this.onPageChanged,
  this.scrollDirection = Axis.vertical,
  this.reverse = false,
  this.physics,
  this.allowImplicitScrolling = false,
  this.clipBehavior = Clip.hardEdge,
});

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/collections/snap_list/snap_list.dart

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

DartFlutter

Get started with FluttyUI