@@ -132,8 +132,8 @@ class CustomExpansionTileController {
132132 /// populated by instances of your new inner widgets, and then in
133133 /// these inner widgets you would use [CustomExpansionTileController.of] .
134134 static CustomExpansionTileController of (BuildContext context) {
135- final _ExpansionTileState ? result =
136- context .findAncestorStateOfType <_ExpansionTileState >();
135+ final _ExpansionTileState ? result = context
136+ .findAncestorStateOfType <_ExpansionTileState >();
137137 if (result != null ) {
138138 return result._tileController;
139139 }
@@ -251,10 +251,10 @@ class CustomExpansionTile extends StatefulWidget {
251251 this .controlAffinity,
252252 this .controller,
253253 }) : assert (
254- expandedCrossAxisAlignment != CrossAxisAlignment .baseline,
255- 'CrossAxisAlignment.baseline is not supported since the expanded children '
256- 'are aligned in a column, not a row. Try to use another constant.' ,
257- );
254+ expandedCrossAxisAlignment != CrossAxisAlignment .baseline,
255+ 'CrossAxisAlignment.baseline is not supported since the expanded children '
256+ 'are aligned in a column, not a row. Try to use another constant.' ,
257+ );
258258
259259 /// A widget to display before the title.
260260 ///
@@ -498,10 +498,12 @@ class CustomExpansionTile extends StatefulWidget {
498498
499499class _ExpansionTileState extends State <CustomExpansionTile >
500500 with SingleTickerProviderStateMixin {
501- static final Animatable <double > _easeOutTween =
502- CurveTween (curve: Curves .easeOut);
503- static final Animatable <double > _easeInTween =
504- CurveTween (curve: Curves .easeIn);
501+ static final Animatable <double > _easeOutTween = CurveTween (
502+ curve: Curves .easeOut,
503+ );
504+ static final Animatable <double > _easeInTween = CurveTween (
505+ curve: Curves .easeIn,
506+ );
505507 // static final Animatable<double> _halfTween =
506508 // Tween<double>(begin: 0.0, end: 0.5);
507509
@@ -528,14 +530,18 @@ class _ExpansionTileState extends State<CustomExpansionTile>
528530 _heightFactor = _animationController.drive (_easeInTween);
529531 //_iconTurns = _animationController.drive(_halfTween.chain(_easeInTween));
530532 _border = _animationController.drive (_borderTween.chain (_easeOutTween));
531- _headerColor =
532- _animationController.drive (_headerColorTween.chain (_easeInTween));
533- _iconColor =
534- _animationController.drive (_iconColorTween.chain (_easeInTween));
535- _backgroundColor =
536- _animationController.drive (_backgroundColorTween.chain (_easeOutTween));
537-
538- _isExpanded = PageStorage .maybeOf (context)? .readState (context) as bool ? ??
533+ _headerColor = _animationController.drive (
534+ _headerColorTween.chain (_easeInTween),
535+ );
536+ _iconColor = _animationController.drive (
537+ _iconColorTween.chain (_easeInTween),
538+ );
539+ _backgroundColor = _animationController.drive (
540+ _backgroundColorTween.chain (_easeOutTween),
541+ );
542+
543+ _isExpanded =
544+ PageStorage .maybeOf (context)? .readState (context) as bool ? ??
539545 widget.initiallyExpanded;
540546 if (_isExpanded) {
541547 _animationController.value = 1.0 ;
@@ -631,9 +637,11 @@ class _ExpansionTileState extends State<CustomExpansionTile>
631637 // }
632638
633639 Widget _buildChildren (BuildContext context, Widget ? child) {
634- final ExpansionTileThemeData expansionTileTheme =
635- ExpansionTileTheme .of (context);
636- final ShapeBorder expansionTileBorder = _border.value ??
640+ final ExpansionTileThemeData expansionTileTheme = ExpansionTileTheme .of (
641+ context,
642+ );
643+ final ShapeBorder expansionTileBorder =
644+ _border.value ??
637645 const Border (
638646 top: BorderSide (color: Colors .transparent),
639647 bottom: BorderSide (color: Colors .transparent),
@@ -644,7 +652,8 @@ class _ExpansionTileState extends State<CustomExpansionTile>
644652 return Container (
645653 clipBehavior: clipBehavior,
646654 decoration: ShapeDecoration (
647- color: _backgroundColor.value ??
655+ color:
656+ _backgroundColor.value ??
648657 expansionTileTheme.backgroundColor ??
649658 Colors .transparent,
650659 shape: expansionTileBorder,
@@ -653,22 +662,23 @@ class _ExpansionTileState extends State<CustomExpansionTile>
653662 mainAxisSize: MainAxisSize .min,
654663 children: < Widget > [
655664 ListTileTheme .merge (
656- iconColor: _iconColor.value ?? expansionTileTheme.iconColor,
657- textColor: _headerColor.value,
658- child: const SizedBox .shrink ()
659- // ListTile(
660- // onTap: _handleTap,
661- // contentPadding:
662- // widget.tilePadding ?? expansionTileTheme.tilePadding,
663- // leading: widget.leading ?? _buildLeadingIcon(context),
664- // title: widget.title,
665- // subtitle: widget.subtitle,
666- // trailing: widget.trailing ?? _buildTrailingIcon(context),
667- // ),
668- ),
665+ iconColor: _iconColor.value ?? expansionTileTheme.iconColor,
666+ textColor: _headerColor.value,
667+ child: const SizedBox .shrink (),
668+ // ListTile(
669+ // onTap: _handleTap,
670+ // contentPadding:
671+ // widget.tilePadding ?? expansionTileTheme.tilePadding,
672+ // leading: widget.leading ?? _buildLeadingIcon(context),
673+ // title: widget.title,
674+ // subtitle: widget.subtitle,
675+ // trailing: widget.trailing ?? _buildTrailingIcon(context),
676+ // ),
677+ ),
669678 ClipRect (
670679 child: Align (
671- alignment: widget.expandedAlignment ??
680+ alignment:
681+ widget.expandedAlignment ??
672682 expansionTileTheme.expandedAlignment ??
673683 Alignment .center,
674684 heightFactor: _heightFactor.value,
@@ -683,49 +693,58 @@ class _ExpansionTileState extends State<CustomExpansionTile>
683693 @override
684694 void didChangeDependencies () {
685695 final ThemeData theme = Theme .of (context);
686- final ExpansionTileThemeData expansionTileTheme =
687- ExpansionTileTheme .of (context);
696+ final ExpansionTileThemeData expansionTileTheme = ExpansionTileTheme .of (
697+ context,
698+ );
688699 final ExpansionTileThemeData defaults = theme.useMaterial3
689700 ? _ExpansionTileDefaultsM3 (context)
690701 : _ExpansionTileDefaultsM2 (context);
691702 _borderTween
692- ..begin = widget.collapsedShape ??
703+ ..begin =
704+ widget.collapsedShape ??
693705 expansionTileTheme.collapsedShape ??
694706 const Border (
695707 top: BorderSide (color: Colors .transparent),
696708 bottom: BorderSide (color: Colors .transparent),
697709 )
698- ..end = widget.shape ??
710+ ..end =
711+ widget.shape ??
699712 expansionTileTheme.collapsedShape ??
700713 Border (
701714 top: BorderSide (color: theme.dividerColor),
702715 bottom: BorderSide (color: theme.dividerColor),
703716 );
704717 _headerColorTween
705- ..begin = widget.collapsedTextColor ??
718+ ..begin =
719+ widget.collapsedTextColor ??
706720 expansionTileTheme.collapsedTextColor ??
707721 defaults.collapsedTextColor
708- ..end = widget.textColor ??
722+ ..end =
723+ widget.textColor ??
709724 expansionTileTheme.textColor ??
710725 defaults.textColor;
711726 _iconColorTween
712- ..begin = widget.collapsedIconColor ??
727+ ..begin =
728+ widget.collapsedIconColor ??
713729 expansionTileTheme.collapsedIconColor ??
714730 defaults.collapsedIconColor
715- ..end = widget.iconColor ??
731+ ..end =
732+ widget.iconColor ??
716733 expansionTileTheme.iconColor ??
717734 defaults.iconColor;
718735 _backgroundColorTween
719- ..begin = widget.collapsedBackgroundColor ??
736+ ..begin =
737+ widget.collapsedBackgroundColor ??
720738 expansionTileTheme.collapsedBackgroundColor
721739 ..end = widget.backgroundColor ?? expansionTileTheme.backgroundColor;
722740 super .didChangeDependencies ();
723741 }
724742
725743 @override
726744 Widget build (BuildContext context) {
727- final ExpansionTileThemeData expansionTileTheme =
728- ExpansionTileTheme .of (context);
745+ final ExpansionTileThemeData expansionTileTheme = ExpansionTileTheme .of (
746+ context,
747+ );
729748 final bool closed = ! _isExpanded && _animationController.isDismissed;
730749 final bool shouldRemoveChildren = closed && ! widget.maintainState;
731750
@@ -734,7 +753,8 @@ class _ExpansionTileState extends State<CustomExpansionTile>
734753 child: TickerMode (
735754 enabled: ! closed,
736755 child: Padding (
737- padding: widget.childrenPadding ??
756+ padding:
757+ widget.childrenPadding ??
738758 expansionTileTheme.childrenPadding ??
739759 EdgeInsets .zero,
740760 child: Column (
0 commit comments