style: apply dart format across project
This commit is contained in:
@@ -23,7 +23,7 @@ class MonthlyExpenseChartCard extends StatelessWidget {
|
||||
/// Y축 최대값을 계산합니다 (언어별 통화 단위에 맞춰)
|
||||
double _calculateChartMaxY(double maxValue, String locale) {
|
||||
final currency = CurrencyUtil.getDefaultCurrency(locale);
|
||||
|
||||
|
||||
if (currency == 'KRW' || currency == 'JPY') {
|
||||
// 소수점이 없는 통화 (원화, 엔화)
|
||||
if (maxValue <= 0) return 100000;
|
||||
@@ -33,9 +33,10 @@ class MonthlyExpenseChartCard extends StatelessWidget {
|
||||
if (maxValue <= 200000) return 200000;
|
||||
if (maxValue <= 500000) return 500000;
|
||||
if (maxValue <= 1000000) return 1000000;
|
||||
|
||||
|
||||
// 큰 금액은 자릿수에 맞춰 반올림
|
||||
final magnitude = math.pow(10, maxValue.toString().split('.')[0].length - 1).toDouble();
|
||||
final magnitude =
|
||||
math.pow(10, maxValue.toString().split('.')[0].length - 1).toDouble();
|
||||
return ((maxValue / magnitude).ceil() * magnitude).toDouble();
|
||||
} else {
|
||||
// 소수점이 있는 통화 (달러, 위안)
|
||||
@@ -47,7 +48,7 @@ class MonthlyExpenseChartCard extends StatelessWidget {
|
||||
if (maxValue <= 250) return 250.0;
|
||||
if (maxValue <= 500) return 500.0;
|
||||
if (maxValue <= 1000) return 1000.0;
|
||||
|
||||
|
||||
// 큰 금액은 100 단위로 반올림
|
||||
return ((maxValue / 100).ceil() * 100).toDouble();
|
||||
}
|
||||
@@ -164,8 +165,7 @@ class MonthlyExpenseChartCard extends StatelessWidget {
|
||||
0,
|
||||
(max, data) => math.max(
|
||||
max, data['totalExpense'] as double)),
|
||||
locale
|
||||
),
|
||||
locale),
|
||||
barGroups: _getMonthlyBarGroups(locale),
|
||||
gridData: FlGridData(
|
||||
show: true,
|
||||
@@ -176,13 +176,12 @@ class MonthlyExpenseChartCard extends StatelessWidget {
|
||||
0,
|
||||
(max, data) => math.max(max,
|
||||
data['totalExpense'] as double)),
|
||||
locale
|
||||
),
|
||||
CurrencyUtil.getDefaultCurrency(locale)
|
||||
),
|
||||
locale),
|
||||
CurrencyUtil.getDefaultCurrency(locale)),
|
||||
getDrawingHorizontalLine: (value) {
|
||||
return FlLine(
|
||||
color: AppColors.navyGray.withValues(alpha: 0.1),
|
||||
color:
|
||||
AppColors.navyGray.withValues(alpha: 0.1),
|
||||
strokeWidth: 1,
|
||||
);
|
||||
},
|
||||
@@ -233,10 +232,11 @@ class MonthlyExpenseChartCard extends StatelessWidget {
|
||||
),
|
||||
children: [
|
||||
TextSpan(
|
||||
text: CurrencyUtil.formatTotalAmountWithLocale(
|
||||
monthlyData[group.x]['totalExpense']
|
||||
as double,
|
||||
locale),
|
||||
text: CurrencyUtil
|
||||
.formatTotalAmountWithLocale(
|
||||
monthlyData[group.x]
|
||||
['totalExpense'] as double,
|
||||
locale),
|
||||
style: const TextStyle(
|
||||
color: Color(0xFFFBBF24),
|
||||
fontSize: 14,
|
||||
@@ -254,7 +254,8 @@ class MonthlyExpenseChartCard extends StatelessWidget {
|
||||
const SizedBox(height: 16),
|
||||
Center(
|
||||
child: ThemedText.caption(
|
||||
text: AppLocalizations.of(context).monthlySubscriptionExpense,
|
||||
text: AppLocalizations.of(context)
|
||||
.monthlySubscriptionExpense,
|
||||
style: const TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -270,4 +271,4 @@ class MonthlyExpenseChartCard extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user