import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'core/models/financial_table_entry.dart'; import 'shared/widgets/financial_table.dart'; void main() { runApp(const FinancialTableTestApp()); } class FinancialTableTestApp extends StatelessWidget { const FinancialTableTestApp({super.key}); @override Widget build(BuildContext context) { return ScreenUtilInit( designSize: const Size(375, 812), minTextAdapt: true, splitScreenMode: true, builder: (context, child) { return MaterialApp( title: 'Financial Table Test', theme: ThemeData( primarySwatch: Colors.green, useMaterial3: true, ), home: const FinancialTableTestPage(), ); }, ); } } class FinancialTableTestPage extends StatelessWidget { const FinancialTableTestPage({super.key}); @override Widget build(BuildContext context) { // Sample data based on the image provided final sampleData = [ FinancialTableEntry( monthYear: 'Mar-25', chitValue: 200000, bidAmount: 175300, subscriptionAmount: 10000, commissionInstallment: 250, totalPayableInstallment: 10250, dividendAmount: 24700, ), FinancialTableEntry( monthYear: 'Apr-25', chitValue: 200000, bidAmount: 177900, subscriptionAmount: 10000, commissionInstallment: 250, totalPayableInstallment: 10250, dividendAmount: 22100, ), FinancialTableEntry( monthYear: 'May-25', chitValue: 200000, bidAmount: 180500, subscriptionAmount: 10000, commissionInstallment: 250, totalPayableInstallment: 10250, dividendAmount: 19500, ), FinancialTableEntry( monthYear: 'Jun-25', chitValue: 200000, bidAmount: 183100, subscriptionAmount: 10000, commissionInstallment: 250, totalPayableInstallment: 10250, dividendAmount: 16900, ), FinancialTableEntry( monthYear: 'Jul-25', chitValue: 200000, bidAmount: 185700, subscriptionAmount: 10000, commissionInstallment: 250, totalPayableInstallment: 10250, dividendAmount: 14300, ), FinancialTableEntry( monthYear: 'Aug-25', chitValue: 200000, bidAmount: 188300, subscriptionAmount: 10000, commissionInstallment: 250, totalPayableInstallment: 10250, dividendAmount: 11700, ), FinancialTableEntry( monthYear: 'Sep-25', chitValue: 200000, bidAmount: 190900, subscriptionAmount: 10000, commissionInstallment: 250, totalPayableInstallment: 10250, dividendAmount: 9100, ), FinancialTableEntry( monthYear: 'Oct-25', chitValue: 200000, bidAmount: 193500, subscriptionAmount: 10000, commissionInstallment: 250, totalPayableInstallment: 10250, dividendAmount: 6500, ), FinancialTableEntry( monthYear: 'Nov-25', chitValue: 200000, bidAmount: 196100, subscriptionAmount: 10000, commissionInstallment: 250, totalPayableInstallment: 10250, dividendAmount: 3900, ), FinancialTableEntry( monthYear: 'Dec-25', chitValue: 200000, bidAmount: 198700, subscriptionAmount: 10000, commissionInstallment: 250, totalPayableInstallment: 10250, dividendAmount: 1300, ), FinancialTableEntry( monthYear: 'Jan-26', chitValue: 200000, bidAmount: 201300, subscriptionAmount: 10000, commissionInstallment: 250, totalPayableInstallment: 10250, dividendAmount: -1300, ), FinancialTableEntry( monthYear: 'Feb-26', chitValue: 200000, bidAmount: 203900, subscriptionAmount: 10000, commissionInstallment: 250, totalPayableInstallment: 10250, dividendAmount: -3900, ), FinancialTableEntry( monthYear: 'Mar-26', chitValue: 200000, bidAmount: 206500, subscriptionAmount: 10000, commissionInstallment: 250, totalPayableInstallment: 10250, dividendAmount: -6500, ), FinancialTableEntry( monthYear: 'Apr-26', chitValue: 200000, bidAmount: 209100, subscriptionAmount: 10000, commissionInstallment: 250, totalPayableInstallment: 10250, dividendAmount: -9100, ), FinancialTableEntry( monthYear: 'May-26', chitValue: 200000, bidAmount: 211700, subscriptionAmount: 10000, commissionInstallment: 250, totalPayableInstallment: 10250, dividendAmount: -11700, ), FinancialTableEntry( monthYear: 'Jun-26', chitValue: 200000, bidAmount: 214300, subscriptionAmount: 10000, commissionInstallment: 250, totalPayableInstallment: 10250, dividendAmount: -14300, ), FinancialTableEntry( monthYear: 'Jul-26', chitValue: 200000, bidAmount: 216900, subscriptionAmount: 10000, commissionInstallment: 250, totalPayableInstallment: 10250, dividendAmount: -16900, ), FinancialTableEntry( monthYear: 'Aug-26', chitValue: 200000, bidAmount: 219500, subscriptionAmount: 10000, commissionInstallment: 250, totalPayableInstallment: 10250, dividendAmount: -19500, ), FinancialTableEntry( monthYear: 'Sep-26', chitValue: 200000, bidAmount: 222100, subscriptionAmount: 10000, commissionInstallment: 250, totalPayableInstallment: 10250, dividendAmount: -22100, ), FinancialTableEntry( monthYear: 'Oct-26', chitValue: 200000, bidAmount: 224700, subscriptionAmount: 10000, commissionInstallment: 250, totalPayableInstallment: 10250, dividendAmount: -24700, ), // Total row FinancialTableEntry( monthYear: 'Total', chitValue: 4000000, bidAmount: 4000000, subscriptionAmount: 200000, commissionInstallment: 5000, totalPayableInstallment: 205000, dividendAmount: 0, ), ]; return Scaffold( appBar: AppBar( title: const Text('Financial Table Test'), backgroundColor: Colors.green.shade600, foregroundColor: Colors.white, ), body: SingleChildScrollView( padding: EdgeInsets.all(16.w), child: Column( children: [ Text( 'Financial Summary Table', style: TextStyle( fontSize: 24.sp, fontWeight: FontWeight.bold, color: Colors.green.shade700, ), ), SizedBox(height: 16.h), Text( 'Based on the provided image, this table shows the monthly financial breakdown for a chit fund group.', style: TextStyle( fontSize: 14.sp, color: Colors.grey.shade600, ), textAlign: TextAlign.center, ), SizedBox(height: 24.h), // Full table FinancialTable( entries: sampleData, onRefresh: () { // Refresh functionality print('Refreshing financial data...'); }, ), SizedBox(height: 32.h), // Compact table for comparison Text( 'Compact Version (for mobile)', style: TextStyle( fontSize: 18.sp, fontWeight: FontWeight.w600, color: Colors.green.shade700, ), ), SizedBox(height: 16.h), CompactFinancialTable( entries: sampleData, onRefresh: () { print('Refreshing compact financial data...'); }, ), ], ), ), ); } }