-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from enrique-lozano/feat/finance-health-stats
Add more finance health data to the user
- Loading branch information
Showing
9 changed files
with
847 additions
and
326 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
lib/app/stats/widgets/finance_health/finance_health_main_info.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:monekin/core/presentation/responsive/breakpoints.dart'; | ||
import 'package:monekin/core/presentation/widgets/animated_progress_bar.dart'; | ||
import 'package:monekin/core/services/finance_health_service.dart'; | ||
|
||
class FinanceHealthMainInfo extends StatelessWidget { | ||
const FinanceHealthMainInfo({super.key, required this.financeHealthData}); | ||
|
||
final FinanceHealthData financeHealthData; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ConstrainedBox( | ||
constraints: BoxConstraints( | ||
maxHeight: | ||
BreakPoint.of(context).isLargerThan(BreakpointID.md) ? 265 : 180), | ||
child: Row( | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: [ | ||
AnimatedProgressBar( | ||
value: (financeHealthData.healthyScore ?? 20) / 100, | ||
direction: Axis.vertical, | ||
width: 16, | ||
color: FinanceHealthData.getHealthyValueColor( | ||
financeHealthData.healthyScore), | ||
), | ||
const SizedBox(width: 16), | ||
Expanded( | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
mainAxisAlignment: MainAxisAlignment.spaceEvenly, | ||
children: [ | ||
Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text.rich( | ||
TextSpan(children: [ | ||
TextSpan( | ||
text: financeHealthData.healthyScoreString(), | ||
style: Theme.of(context) | ||
.textTheme | ||
.headlineLarge! | ||
.copyWith( | ||
color: FinanceHealthData.getHealthyValueColor( | ||
financeHealthData.healthyScore), | ||
fontWeight: FontWeight.w700, | ||
), | ||
), | ||
const TextSpan(text: ' / 100'), | ||
]), | ||
), | ||
Text( | ||
financeHealthData.getHealthyScoreReviewTitle(context), | ||
style: Theme.of(context).textTheme.titleMedium!.copyWith( | ||
color: FinanceHealthData.getHealthyValueColor( | ||
financeHealthData.healthyScore), | ||
fontWeight: FontWeight.w700, | ||
), | ||
), | ||
], | ||
), | ||
Text( | ||
financeHealthData.getHealthyScoreReviewDescr(context), | ||
style: Theme.of(context).textTheme.bodySmall, | ||
), | ||
], | ||
), | ||
) | ||
], | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.