2026-06-10 13:29:04 +05:30
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import '../theme.dart';
|
2026-06-10 13:48:06 +05:30
|
|
|
import '../route_transitions.dart';
|
2026-06-10 13:29:04 +05:30
|
|
|
import 'billing_dashboard_screen.dart';
|
|
|
|
|
|
2026-06-10 14:08:47 +05:30
|
|
|
class SetupCompleteScreen extends StatefulWidget {
|
2026-06-10 13:29:04 +05:30
|
|
|
final String businessName;
|
|
|
|
|
final String businessType;
|
|
|
|
|
final String gstin;
|
|
|
|
|
final bool barcodeScanner;
|
|
|
|
|
final bool kotManagement;
|
|
|
|
|
final bool inventoryAlerts;
|
|
|
|
|
|
|
|
|
|
const SetupCompleteScreen({
|
|
|
|
|
super.key,
|
|
|
|
|
required this.businessName,
|
|
|
|
|
required this.businessType,
|
|
|
|
|
this.gstin = '',
|
|
|
|
|
this.barcodeScanner = false,
|
|
|
|
|
this.kotManagement = false,
|
|
|
|
|
this.inventoryAlerts = true,
|
|
|
|
|
});
|
|
|
|
|
|
2026-06-10 14:08:47 +05:30
|
|
|
@override
|
|
|
|
|
State<SetupCompleteScreen> createState() => _SetupCompleteScreenState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _SetupCompleteScreenState extends State<SetupCompleteScreen> with SingleTickerProviderStateMixin {
|
|
|
|
|
late AnimationController _controller;
|
|
|
|
|
late Animation<double> _checkScaleAnimation;
|
|
|
|
|
late Animation<double> _cardSlideAnimation;
|
|
|
|
|
late Animation<double> _cardOpacityAnimation;
|
|
|
|
|
late Animation<double> _btnSlideAnimation;
|
|
|
|
|
late Animation<double> _btnOpacityAnimation;
|
|
|
|
|
double _btnScale = 1.0;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
|
_controller = AnimationController(
|
|
|
|
|
vsync: this,
|
|
|
|
|
duration: const Duration(milliseconds: 1400),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
_checkScaleAnimation = Tween<double>(begin: 0.0, end: 1.0).animate(
|
|
|
|
|
CurvedAnimation(
|
|
|
|
|
parent: _controller,
|
|
|
|
|
curve: const Interval(0.0, 0.45, curve: Curves.elasticOut),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
_cardSlideAnimation = Tween<double>(begin: 32.0, end: 0.0).animate(
|
|
|
|
|
CurvedAnimation(
|
|
|
|
|
parent: _controller,
|
|
|
|
|
curve: const Interval(0.25, 0.75, curve: Curves.easeOutCubic),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
_cardOpacityAnimation = Tween<double>(begin: 0.0, end: 1.0).animate(
|
|
|
|
|
CurvedAnimation(
|
|
|
|
|
parent: _controller,
|
|
|
|
|
curve: const Interval(0.25, 0.65, curve: Curves.easeIn),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
_btnSlideAnimation = Tween<double>(begin: 24.0, end: 0.0).animate(
|
|
|
|
|
CurvedAnimation(
|
|
|
|
|
parent: _controller,
|
|
|
|
|
curve: const Interval(0.55, 1.0, curve: Curves.easeOutCubic),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
_btnOpacityAnimation = Tween<double>(begin: 0.0, end: 1.0).animate(
|
|
|
|
|
CurvedAnimation(
|
|
|
|
|
parent: _controller,
|
|
|
|
|
curve: const Interval(0.55, 0.85, curve: Curves.easeIn),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
_controller.forward();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void dispose() {
|
|
|
|
|
_controller.dispose();
|
|
|
|
|
super.dispose();
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-10 13:29:04 +05:30
|
|
|
String _getCategoryDisplayName(String id) {
|
|
|
|
|
final cleanId = id.replaceAll('category/', '').trim().toLowerCase();
|
|
|
|
|
switch (cleanId) {
|
|
|
|
|
case 'supermarket':
|
|
|
|
|
return 'Supermarket';
|
|
|
|
|
case 'restaurant':
|
|
|
|
|
return 'Restaurant';
|
|
|
|
|
case 'clothing':
|
|
|
|
|
return 'Clothing / Boutique';
|
|
|
|
|
case 'kirana':
|
|
|
|
|
return 'Retail / Grocery (Kirana)';
|
|
|
|
|
case 'others':
|
|
|
|
|
default:
|
|
|
|
|
return 'Retail / Others';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
final theme = Theme.of(context);
|
2026-06-10 14:08:47 +05:30
|
|
|
final categoryText = _getCategoryDisplayName(widget.businessType);
|
2026-06-10 13:29:04 +05:30
|
|
|
final gap = context.responsiveGap;
|
|
|
|
|
|
|
|
|
|
return Scaffold(
|
|
|
|
|
appBar: AppBar(
|
|
|
|
|
automaticallyImplyLeading: false,
|
|
|
|
|
title: Row(
|
|
|
|
|
children: const [
|
|
|
|
|
Icon(Icons.check_circle, color: Colors.green, size: 18),
|
|
|
|
|
SizedBox(width: 6),
|
|
|
|
|
Text(
|
|
|
|
|
'Step 5 of 5 Completed',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
bottom: PreferredSize(
|
|
|
|
|
preferredSize: const Size.fromHeight(6),
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 6,
|
|
|
|
|
color: theme.colorScheme.primary,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
body: SafeArea(
|
|
|
|
|
child: Center(
|
|
|
|
|
child: ConstrainedBox(
|
|
|
|
|
constraints: const BoxConstraints(maxWidth: 600),
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
physics: const BouncingScrollPhysics(),
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
const SizedBox(height: 24),
|
|
|
|
|
|
2026-06-10 14:08:47 +05:30
|
|
|
// Circular Green Check badge with Elastic Entrance Animation
|
|
|
|
|
ScaleTransition(
|
|
|
|
|
scale: _checkScaleAnimation,
|
2026-06-10 13:29:04 +05:30
|
|
|
child: Container(
|
2026-06-10 14:08:47 +05:30
|
|
|
width: 96,
|
|
|
|
|
height: 96,
|
2026-06-10 13:29:04 +05:30
|
|
|
decoration: const BoxDecoration(
|
2026-06-10 14:08:47 +05:30
|
|
|
color: Colors.white,
|
2026-06-10 13:29:04 +05:30
|
|
|
shape: BoxShape.circle,
|
2026-06-10 14:08:47 +05:30
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: Colors.black12,
|
|
|
|
|
blurRadius: 16,
|
|
|
|
|
offset: Offset(0, 8),
|
|
|
|
|
)
|
|
|
|
|
],
|
2026-06-10 13:29:04 +05:30
|
|
|
),
|
2026-06-10 14:08:47 +05:30
|
|
|
child: Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
width: 72,
|
|
|
|
|
height: 72,
|
|
|
|
|
decoration: const BoxDecoration(
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
|
),
|
|
|
|
|
child: const Icon(
|
|
|
|
|
Icons.check,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
size: 40,
|
|
|
|
|
),
|
|
|
|
|
),
|
2026-06-10 13:29:04 +05:30
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|
2026-06-10 14:08:47 +05:30
|
|
|
SizedBox(height: gap),
|
|
|
|
|
Text(
|
|
|
|
|
'Setup Complete! 🎉',
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: theme.textTheme.headlineLarge?.copyWith(
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
|
Text(
|
|
|
|
|
'Your billing dashboard is ready for action.',
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: theme.textTheme.bodyMedium,
|
2026-06-10 13:29:04 +05:30
|
|
|
),
|
|
|
|
|
|
2026-06-10 14:08:47 +05:30
|
|
|
SizedBox(height: gap * 1.5),
|
2026-06-10 13:29:04 +05:30
|
|
|
|
2026-06-10 14:08:47 +05:30
|
|
|
// Glassmorphism summary Card with Fade + Slide Transition
|
|
|
|
|
AnimatedBuilder(
|
|
|
|
|
animation: _controller,
|
|
|
|
|
builder: (context, child) {
|
|
|
|
|
return Transform.translate(
|
|
|
|
|
offset: Offset(0.0, _cardSlideAnimation.value),
|
|
|
|
|
child: Opacity(
|
|
|
|
|
opacity: _cardOpacityAnimation.value,
|
|
|
|
|
child: child,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
padding: const EdgeInsets.all(20),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(20),
|
|
|
|
|
border: Border.all(color: Colors.grey[200]!),
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: Colors.black.withOpacity(0.04),
|
|
|
|
|
blurRadius: 20,
|
|
|
|
|
offset: const Offset(0, 8),
|
2026-06-10 13:29:04 +05:30
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
2026-06-10 14:08:47 +05:30
|
|
|
child: Column(
|
2026-06-10 13:29:04 +05:30
|
|
|
children: [
|
2026-06-10 14:08:47 +05:30
|
|
|
// Row 1: Store name
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
width: 44,
|
|
|
|
|
height: 44,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.grey[100],
|
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
|
),
|
|
|
|
|
child: const Icon(Icons.storefront, color: Colors.black87),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(width: 14),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
const Text(
|
|
|
|
|
'BUSINESS NAME',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
letterSpacing: 1.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
|
Text(
|
|
|
|
|
widget.businessName,
|
|
|
|
|
style: const TextStyle(
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Colors.black87,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
2026-06-10 13:29:04 +05:30
|
|
|
),
|
2026-06-10 14:08:47 +05:30
|
|
|
|
|
|
|
|
// Divider line
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 16.0),
|
|
|
|
|
child: Divider(color: Colors.grey[200]),
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
// Row 2: Category type
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
width: 44,
|
|
|
|
|
height: 44,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.grey[100],
|
|
|
|
|
shape: BoxShape.circle,
|
2026-06-10 13:29:04 +05:30
|
|
|
),
|
2026-06-10 14:08:47 +05:30
|
|
|
child: const Icon(Icons.category, color: Colors.black87),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(width: 14),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
const Text(
|
|
|
|
|
'BUSINESS TYPE',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
letterSpacing: 1.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
|
Text(
|
|
|
|
|
categoryText,
|
|
|
|
|
style: const TextStyle(
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Colors.black87,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
2026-06-10 13:29:04 +05:30
|
|
|
),
|
2026-06-10 14:08:47 +05:30
|
|
|
)
|
|
|
|
|
],
|
2026-06-10 13:29:04 +05:30
|
|
|
),
|
2026-06-10 14:08:47 +05:30
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 16.0),
|
|
|
|
|
child: Divider(color: Colors.grey[200]),
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
width: 44,
|
|
|
|
|
height: 44,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.grey[100],
|
|
|
|
|
shape: BoxShape.circle,
|
2026-06-10 13:29:04 +05:30
|
|
|
),
|
2026-06-10 14:08:47 +05:30
|
|
|
child: const Icon(Icons.settings, color: Colors.black87),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(width: 14),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
const Text(
|
|
|
|
|
'ACTIVE CONFIGURATIONS',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
letterSpacing: 1.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
|
Text(
|
|
|
|
|
[
|
|
|
|
|
if (widget.barcodeScanner) 'Barcode Enabled',
|
|
|
|
|
if (widget.kotManagement) 'KOT/Kitchen Order',
|
|
|
|
|
if (widget.inventoryAlerts) 'Low Stock Warnings',
|
|
|
|
|
if (!widget.barcodeScanner && !widget.kotManagement && !widget.inventoryAlerts) 'Standard Register',
|
|
|
|
|
].join(', '),
|
|
|
|
|
style: const TextStyle(
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Colors.black87,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
2026-06-10 13:29:04 +05:30
|
|
|
),
|
2026-06-10 14:08:47 +05:30
|
|
|
)
|
|
|
|
|
],
|
2026-06-10 13:29:04 +05:30
|
|
|
)
|
|
|
|
|
],
|
2026-06-10 14:08:47 +05:30
|
|
|
),
|
|
|
|
|
),
|
2026-06-10 13:29:04 +05:30
|
|
|
),
|
|
|
|
|
|
2026-06-10 14:08:47 +05:30
|
|
|
const SizedBox(height: 24),
|
2026-06-10 13:29:04 +05:30
|
|
|
|
2026-06-10 14:08:47 +05:30
|
|
|
// Primary Launcher CTA with Slide + Fade + Hover/Tap Scale micro-animations
|
|
|
|
|
AnimatedBuilder(
|
|
|
|
|
animation: _controller,
|
|
|
|
|
builder: (context, child) {
|
|
|
|
|
return Transform.translate(
|
|
|
|
|
offset: Offset(0.0, _btnSlideAnimation.value),
|
|
|
|
|
child: Opacity(
|
|
|
|
|
opacity: _btnOpacityAnimation.value,
|
|
|
|
|
child: child,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
child: MouseRegion(
|
|
|
|
|
onEnter: (_) => setState(() => _btnScale = 1.03),
|
|
|
|
|
onExit: (_) => setState(() => _btnScale = 1.0),
|
|
|
|
|
child: AnimatedScale(
|
|
|
|
|
scale: _btnScale,
|
|
|
|
|
duration: const Duration(milliseconds: 150),
|
|
|
|
|
child: GestureDetector(
|
|
|
|
|
onTapDown: (_) => setState(() => _btnScale = 0.96),
|
|
|
|
|
onTapUp: (_) => setState(() => _btnScale = 1.03),
|
|
|
|
|
onTapCancel: () => setState(() => _btnScale = 1.0),
|
|
|
|
|
child: ElevatedButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
showTopAlert(
|
|
|
|
|
context,
|
|
|
|
|
'Launching Register Dashboard... Enjoy billing!',
|
|
|
|
|
icon: Icons.rocket_launch_outlined,
|
|
|
|
|
);
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadeSlidePageRoute(
|
|
|
|
|
child: BillingDashboardScreen(
|
|
|
|
|
businessName: widget.businessName,
|
|
|
|
|
businessType: widget.businessType,
|
|
|
|
|
gstin: widget.gstin,
|
|
|
|
|
barcodeScanner: widget.barcodeScanner,
|
|
|
|
|
kotManagement: widget.kotManagement,
|
|
|
|
|
inventoryAlerts: widget.inventoryAlerts,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
style: ElevatedButton.styleFrom(
|
|
|
|
|
minimumSize: const Size.fromHeight(56),
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: const [
|
|
|
|
|
Icon(Icons.receipt, size: 20),
|
|
|
|
|
SizedBox(width: 8),
|
|
|
|
|
Text('Create Your First Bill'),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
2026-06-10 13:29:04 +05:30
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
2026-06-10 14:08:47 +05:30
|
|
|
const SizedBox(height: 24),
|
|
|
|
|
],
|
|
|
|
|
),
|
2026-06-10 13:29:04 +05:30
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
2026-06-10 14:08:47 +05:30
|
|
|
);
|
|
|
|
|
}
|
2026-06-10 13:29:04 +05:30
|
|
|
}
|