buildScamAlertCardPreview function
Widget
buildScamAlertCardPreview(
- ScamAlertCardState state,
- AnimationController? borderAnimationController
Scam Alert Card preview builder Category 3: Complex/Composite - Container is static, action buttons are interactive Preserves UX elements from temp_demo:
- Severity levels with color-coded warnings
- Voice hint: "Say 'Tell me more about this scam'"
- Three action buttons: Verify, Report, Dismiss
- Severity badge with colored background
- Time ago display
Implementation
Widget buildScamAlertCardPreview(
ScamAlertCardState state,
AnimationController? borderAnimationController,
) {
return StateVariantsWrapper(
componentName: 'Scam Alert Card',
// Rest state shows interactive buttons
buildRestState: () => _buildInteractiveCard(state, borderAnimationController),
// For forced states, we show buttons in specific state
buildPressedState: () => _buildCardWithButtonState(state, borderAnimationController, buttonState: 'pressed'),
buildHoverState: () => _buildCardWithButtonState(state, borderAnimationController, buttonState: 'hover'),
buildDisabledState: () => _buildDisabledCard(state, borderAnimationController),
buildCyclingState: (stateIndex) => _buildCyclingCard(state, borderAnimationController, stateIndex),
cycleDuration: const Duration(milliseconds: 2000),
);
}