NextAccordion class
A single-line ListTile with an expansion arrow icon that expands or collapses the tile to reveal or hide the children.
This widget is typically used with ListView to create an "expand / collapse" list entry. When used with scrolling widgets like ListView, a unique PageStorageKey must be specified to enable the NextAccordion to save and restore its expanded state when it is scrolled in and out of view.
This class overrides the ListTileThemeData.iconColor and ListTileThemeData.textColor theme properties for its ListTile. These colors animate between values when the tile is expanded and collapsed: between iconColor, collapsedIconColor and between textColor and collapsedTextColor.
The expansion arrow icon is shown on the right by default in left-to-right languages (i.e. the trailing edge). This can be changed using controlAffinity. This maps to the leading and trailing properties of NextAccordion.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- NextAccordion
- Available extensions
Constructors
-
NextAccordion({Key? key, Widget? leading, required Widget title, Widget? subtitle, ValueChanged<
bool> ? onExpansionChanged, List<Widget> children = const <Widget>[], Widget? trailing(bool isExpanded)?, bool initiallyExpanded = false, bool maintainState = false, EdgeInsetsGeometry? tilePadding, double? horizontalTitleGap, Color? borderColor, CrossAxisAlignment? expandedCrossAxisAlignment, Alignment? expandedAlignment, EdgeInsetsGeometry? childrenPadding, Color? backgroundColor, Color? collapsedBackgroundColor, Color? textColor, Color? collapsedTextColor, Color? iconColor, Color? collapsedIconColor, ListTileControlAffinity? controlAffinity}) -
const
Properties
- backgroundColor → Color?
-
The color to display behind the sublist when expanded.
final
- borderColor → Color?
-
Border Color while expanded
final
-
children
→ List<
Widget> -
The widgets that are displayed when the tile expands.
final
- childrenPadding → EdgeInsetsGeometry?
-
Specifies padding for children.
final
- collapsedBackgroundColor → Color?
-
When not null, defines the background color of tile when the sublist is collapsed.
final
- collapsedIconColor → Color?
-
The icon color of tile's expansion arrow icon when the sublist is collapsed.
final
- collapsedTextColor → Color?
-
The color of the tile's titles when the sublist is collapsed.
final
- controlAffinity → ListTileControlAffinity?
-
Typically used to force the expansion arrow icon to the tile's leading or trailing edge.
final
- expandedAlignment → Alignment?
-
Specifies the alignment of children, which are arranged in a column when
the tile is expanded.
final
- expandedCrossAxisAlignment → CrossAxisAlignment?
-
Specifies the alignment of each child within children when the tile is expanded.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- horizontalTitleGap → double?
-
Provides gap between title and leading widget
final
- iconColor → Color?
-
The icon color of tile's expansion arrow icon when the sublist is expanded.
final
- initiallyExpanded → bool
-
Specifies if the list tile is initially expanded (true) or collapsed (false, the default).
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- leading → Widget?
-
A widget to display before the title.
final
- maintainState → bool
-
Specifies whether the state of the children is maintained when the tile expands and collapses.
final
-
onExpansionChanged
→ ValueChanged<
bool> ? -
Called when the tile expands or collapses.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- subtitle → Widget?
-
Additional content displayed below the title.
final
- textColor → Color?
-
The color of the tile's titles when the sublist is expanded.
final
- tilePadding → EdgeInsetsGeometry?
-
Specifies padding for the ListTile.
final
- title → Widget
-
The primary content of the list item.
final
- trailing → Widget? Function(bool isExpanded)?
-
A widget to display after the title.
final
Methods
-
addDecoration(
BoxDecoration decoration) → Widget -
Available on Widget, provided by the WidgetExtensions extension
-
aspectRatio(
{Key? key, required double aspectRatio}) → Widget -
Available on Widget, provided by the WidgetExtensions extension
-
bounce(
{Duration duration = const Duration(milliseconds: 350), Duration delay = Duration.zero, AnimationController? controller, bool startAnimation = true, double initialPosition = 100, bool loop = false, double viewPort = 0.1, NextBounceVariant variant = NextBounceVariant.bounceInLeft}) → Widget -
Available on Widget, provided by the AnimationExtension extension
-
boxShadow(
{Key? key, Color color = const Color(0xFF000000), Offset offset = Offset.zero, double blurRadius = 0.0, double spreadRadius = 0.0, bool animate = false}) → Widget -
Available on Widget, provided by the WidgetExtensions extension
-
center(
{Key? key, double? widthFactor, double? heightFactor}) → Widget -
Available on Widget, provided by the WidgetExtensions extension
-
clipOval(
{Key? key, CustomClipper< Rect> ? clipper, Clip clipBehavior = Clip.antiAlias}) → Widget -
Available on Widget, provided by the WidgetExtensions extension
-
clipRect(
{Key? key, CustomClipper< Rect> ? clipper, Clip clipBehavior = Clip.hardEdge}) → Widget -
Available on Widget, provided by the WidgetExtensions extension
-
clipRRect(
{Key? key, double? all, double? topLeft, double? topRight, double? bottomLeft, double? bottomRight, CustomClipper< RRect> ? clipper, Clip clipBehavior = Clip.antiAlias, bool animate = false}) → Widget -
Available on Widget, provided by the WidgetExtensions extension
-
container(
{Key? key, AlignmentGeometry? alignment, EdgeInsetsGeometry? padding, Color? color, Decoration? decoration, Decoration? foregroundDecoration, double? width, double? height, BoxConstraints? constraints, EdgeInsetsGeometry? margin, Matrix4? transform, AlignmentGeometry? transformAlignment, Clip clipBehavior = Clip.none, bool shouldAnimate = false, Duration animationDuration = const Duration(milliseconds: 450)}) → Widget -
Available on Widget, provided by the WidgetExtensions extension
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< NextAccordion> -
Creates the mutable state for this widget at a given location in the tree.
override
-
customPadding(
{Key? key, double left = 0.0, double top = 0.0, double right = 0.0, double bottom = 0.0}) → Widget -
Available on Widget, provided by the PaddingExtension extension
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
fadeIn(
{Duration duration = const Duration(milliseconds: 350), Duration delay = Duration.zero, AnimationController? controller, bool startAnimation = true, bool loop = false, double viewPort = 0.1, double initialPosition = 100, NextFadeInVariant variant = NextFadeInVariant.fadeInLeft}) → Widget -
Available on Widget, provided by the AnimationExtension extension
-
fadeOut(
{Duration duration = const Duration(milliseconds: 350), Duration delay = Duration.zero, AnimationController? controller, bool startAnimation = true, double initialPosition = 100, bool loop = false, double viewPort = 0.1, NextFadeOutVariant variant = NextFadeOutVariant.fadeOutLeft}) → Widget -
Available on Widget, provided by the AnimationExtension extension
-
fittedBox(
{Key? key, BoxFit fit = BoxFit.contain, AlignmentGeometry alignment = Alignment.center}) → Widget -
Available on Widget, provided by the WidgetExtensions extension
-
flexible(
{Key? key, int flex = 1, FlexFit fit = FlexFit.loose}) → Widget -
Available on Widget, provided by the WidgetExtensions extension
-
flip(
{Duration duration = const Duration(milliseconds: 350), Duration delay = Duration.zero, AnimationController? controller, bool startAnimation = true, bool loop = false, double viewPort = 0.1, NextFlipVariant variant = NextFlipVariant.flipX}) → Widget -
Available on Widget, provided by the AnimationExtension extension
-
fractionallySizedBox(
{Key? key, AlignmentGeometry alignment = Alignment.center, double? widthFactor, double? heightFactor}) → Widget -
Available on Widget, provided by the WidgetExtensions extension
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onDoubleTap(
void onDoubleTap(), {bool autoFocus = false}) → Widget -
Available on Widget, provided by the GestureExtension extension
-
onLongPress(
void onLongPress(), {bool autoFocus = false}) → Widget -
Available on Widget, provided by the GestureExtension extension
-
onTap(
void onTap(), {bool autoFocus = false}) → Widget -
Available on Widget, provided by the GestureExtension extension
-
pad(
double padding, {Key? key}) → Widget -
Available on Widget, provided by the PaddingExtension extension
-
paddingSymmetric(
{double horizontal = 0.0, double vertical = 0.0, Key? key}) → Widget -
Available on Widget, provided by the PaddingExtension extension
-
safeArea(
{Key? key, bool left = true, bool top = true, bool right = true, bool bottom = true, EdgeInsets minimum = EdgeInsets.zero, bool maintainBottomViewPadding = false}) → Widget -
Available on Widget, provided by the WidgetExtensions extension
-
sizedBox(
{Key? key, double? width, double? height}) → Widget -
Available on Widget, provided by the WidgetExtensions extension
-
slide(
{Duration duration = const Duration(milliseconds: 350), Duration delay = Duration.zero, AnimationController? controller, bool loop = false, double viewPort = 0.1, bool startAnimation = true, double initialPosition = 100, NextSlideVariant variant = NextSlideVariant.slideInLeft}) → Widget -
Available on Widget, provided by the AnimationExtension extension
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
-
zoom(
{Duration duration = const Duration(milliseconds: 350), Duration delay = Duration.zero, AnimationController? controller, bool startAnimation = true, bool loop = false, double viewPort = 0.1, double initialPosition = 1, NextZoomVariant variant = NextZoomVariant.zoomIn}) → Widget -
Available on Widget, provided by the AnimationExtension extension
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited