buildExpansionPanelPreview function

Widget buildExpansionPanelPreview(
  1. ExpansionPanelState state,
  2. AnimationController? borderAnimationController
)

Expansion Panel preview builder Builds preview widgets for expansion panel component with animated border support

Implementation

Widget buildExpansionPanelPreview(
  ExpansionPanelState state,
  AnimationController? borderAnimationController,
) {
  return StateVariantsWrapper(
    componentName: 'Expansion Panel',
    buildRestState: () => _buildInteractiveExpansionPanel(state, borderAnimationController),
    buildPressedState: () => _buildForcedStateExpansionPanel(state, borderAnimationController, 'pressed'),
    buildHoverState: () => _buildForcedStateExpansionPanel(state, borderAnimationController, 'hover'),
    buildDisabledState: () => _buildDisabledExpansionPanel(state, borderAnimationController),
    buildCyclingState: (stateIndex) => _buildCyclingExpansionPanel(state, borderAnimationController, stateIndex),
    cycleDuration: const Duration(milliseconds: 2000),
  );
}