cashumit/PRINTING_CARD_IMPLEMENTATIO...

1.2 KiB

Printing Status Card Implementation

I've successfully implemented a floating card with animations that shows the printing status when the user presses the print button.

Features

  1. Animated Appearance/Disappearance:

    • Smooth scale and fade animations when showing/hiding
    • Elastic entrance animation for a polished feel
  2. Visual Design:

    • Beautiful gradient background (purple to blue)
    • Clear icon and text indicators
    • Indeterminate progress bar
    • Rounded corners and shadow for depth
  3. Functionality:

    • Automatically appears when printing starts
    • Automatically disappears when printing completes
    • Manual dismiss option with the close button

Files Modified

  1. Created new widget: lib/widgets/printing_status_card.dart
  2. Modified: lib/screens/receipt_screen.dart to integrate the widget

How It Works

When the user presses the "Cetak Struk" button in the speed dial:

  1. The _isPrinting state is set to true
  2. The PrintingStatusCard becomes visible with animations
  3. The printing process begins
  4. When printing completes (success or failure), _isPrinting is set to false
  5. The card smoothly animates out of view

The card also allows manual dismissal by the user if needed.