OnboardingPozoAppv1/flutter_app/lib/screens/setup_complete_screen.dart

344 lines
13 KiB
Dart
Raw Normal View History

import 'package:flutter/material.dart';
import '../theme.dart';
import '../route_transitions.dart';
import 'billing_dashboard_screen.dart';
class SetupCompleteScreen extends StatelessWidget {
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,
});
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);
final categoryText = _getCategoryDisplayName(businessType);
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),
// Circular Green Check badge
Container(
width: 96,
height: 96,
decoration: const BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
color: Colors.black12,
blurRadius: 16,
offset: Offset(0, 8),
)
],
),
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,
),
),
),
),
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,
),
SizedBox(height: gap * 1.5),
// Glassmorphism summary Card
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),
)
],
),
child: Column(
children: [
// 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(
businessName,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.black87,
),
),
],
),
)
],
),
// 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,
),
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,
),
),
],
),
)
],
),
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,
),
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 (barcodeScanner) 'Barcode Enabled',
if (kotManagement) 'KOT/Kitchen Order',
if (inventoryAlerts) 'Low Stock Warnings',
if (!barcodeScanner && !kotManagement && !inventoryAlerts) 'Standard Register',
].join(', '),
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
color: Colors.black87,
),
),
],
),
)
],
)
],
),
),
const SizedBox(height: 24),
// Primary Launcher CTA
ElevatedButton(
onPressed: () {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('⚡ Launching Register Dashboard... Enjoy billing!'),
behavior: SnackBarBehavior.floating,
backgroundColor: Colors.green,
duration: Duration(milliseconds: 1500),
),
);
Navigator.push(
context,
FadeSlidePageRoute(
child: BillingDashboardScreen(
businessName: businessName,
businessType: businessType,
gstin: gstin,
barcodeScanner: barcodeScanner,
kotManagement: kotManagement,
inventoryAlerts: 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'),
],
),
),
const SizedBox(height: 24),
],
),
),
),
),
),
),
);
}
}