1.2 KiB
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
-
Animated Appearance/Disappearance:
- Smooth scale and fade animations when showing/hiding
- Elastic entrance animation for a polished feel
-
Visual Design:
- Beautiful gradient background (purple to blue)
- Clear icon and text indicators
- Indeterminate progress bar
- Rounded corners and shadow for depth
-
Functionality:
- Automatically appears when printing starts
- Automatically disappears when printing completes
- Manual dismiss option with the close button
Files Modified
- Created new widget:
lib/widgets/printing_status_card.dart
- 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:
- The
_isPrinting
state is set totrue
- The
PrintingStatusCard
becomes visible with animations - The printing process begins
- When printing completes (success or failure),
_isPrinting
is set tofalse
- The card smoothly animates out of view
The card also allows manual dismissal by the user if needed.