fixed member dashboard issue
This commit is contained in:
parent
60e998fea4
commit
a200064284
|
|
@ -297,14 +297,14 @@ class _MemberDashboardState extends State<MemberDashboard> {
|
|||
Widget _buildGroupCard(dynamic group) {
|
||||
final color = Colors.green.shade600;
|
||||
final groupName = group.name ?? 'Unnamed Group';
|
||||
final totalAmount = group.totalAmount ?? 0;
|
||||
final monthlyInstallment = group.monthlyInstallment ?? 0;
|
||||
final totalValue = group.totalValue ?? 0.0;
|
||||
final monthlyInstallment = group.monthlyInstallment ?? 0.0;
|
||||
final durationMonths = group.durationMonths ?? 0;
|
||||
final status = group.status ?? 'pending';
|
||||
|
||||
// Format currency
|
||||
final totalValue = '₹${totalAmount.toString().replaceAllMapped(RegExp(r'(\d{1,3})(?=(\d{3})+(?!\d))'), (Match m) => '${m[1]},')}';
|
||||
final installmentValue = '₹${monthlyInstallment.toString().replaceAllMapped(RegExp(r'(\d{1,3})(?=(\d{3})+(?!\d))'), (Match m) => '${m[1]},')}';
|
||||
final totalValueFormatted = '₹${_formatCurrency(totalValue)}';
|
||||
final installmentValueFormatted = '₹${_formatCurrency(monthlyInstallment)}';
|
||||
|
||||
return InteractiveCard(
|
||||
onTap: () {
|
||||
|
|
@ -353,7 +353,7 @@ class _MemberDashboardState extends State<MemberDashboard> {
|
|||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _buildGroupInfo('Total Value', totalValue),
|
||||
child: _buildGroupInfo('Total Value', totalValueFormatted),
|
||||
),
|
||||
SizedBox(width: 8.w),
|
||||
Expanded(
|
||||
|
|
@ -365,7 +365,7 @@ class _MemberDashboardState extends State<MemberDashboard> {
|
|||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _buildGroupInfo('Installment', installmentValue),
|
||||
child: _buildGroupInfo('Installment', installmentValueFormatted),
|
||||
),
|
||||
SizedBox(width: 8.w),
|
||||
Expanded(
|
||||
|
|
@ -397,6 +397,15 @@ class _MemberDashboardState extends State<MemberDashboard> {
|
|||
return status[0].toUpperCase() + status.substring(1).toLowerCase();
|
||||
}
|
||||
|
||||
String _formatCurrency(double amount) {
|
||||
// Format number with Indian comma notation
|
||||
final amountStr = amount.toStringAsFixed(0);
|
||||
return amountStr.replaceAllMapped(
|
||||
RegExp(r'(\d{1,3})(?=(\d{3})+(?!\d))'),
|
||||
(Match m) => '${m[1]},'
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildGroupInfo(String label, String value) {
|
||||
return Container(
|
||||
padding: EdgeInsets.all(12.w),
|
||||
|
|
|
|||
Loading…
Reference in New Issue