feat: adopt material 3 theme and billing adjustments
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../theme/color_scheme_ext.dart';
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
import 'dart:math' as math;
|
||||
import 'package:provider/provider.dart';
|
||||
import '../../services/currency_util.dart';
|
||||
import '../../providers/locale_provider.dart';
|
||||
import '../../theme/app_colors.dart';
|
||||
import '../glassmorphism_card.dart';
|
||||
// Glass 제거: Material 3 Card 사용
|
||||
import '../themed_text.dart';
|
||||
import '../../l10n/app_localizations.dart';
|
||||
import '../../utils/reduce_motion.dart';
|
||||
@@ -75,11 +75,13 @@ class MonthlyExpenseChartCard extends StatelessWidget {
|
||||
}
|
||||
|
||||
// 월간 지출 차트 데이터
|
||||
List<BarChartGroupData> _getMonthlyBarGroups(String locale) {
|
||||
List<BarChartGroupData> _getMonthlyBarGroups(
|
||||
BuildContext context, String locale) {
|
||||
final List<BarChartGroupData> barGroups = [];
|
||||
final calculatedMax = monthlyData.fold<double>(
|
||||
0, (max, data) => math.max(max, data['totalExpense'] as double));
|
||||
final maxAmount = _calculateChartMaxY(calculatedMax, locale);
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
|
||||
for (int i = 0; i < monthlyData.length; i++) {
|
||||
final data = monthlyData[i];
|
||||
@@ -89,20 +91,13 @@ class MonthlyExpenseChartCard extends StatelessWidget {
|
||||
barRods: [
|
||||
BarChartRodData(
|
||||
toY: data['totalExpense'],
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
const Color(0xFF3B82F6).withValues(alpha: 0.7),
|
||||
const Color(0xFF60A5FA),
|
||||
],
|
||||
begin: Alignment.bottomCenter,
|
||||
end: Alignment.topCenter,
|
||||
),
|
||||
color: scheme.primary,
|
||||
width: 18,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
backDrawRodData: BackgroundBarChartRodData(
|
||||
show: true,
|
||||
toY: maxAmount,
|
||||
color: AppColors.navyGray.withValues(alpha: 0.1),
|
||||
color: scheme.onSurfaceVariant.withValues(alpha: 0.08),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -132,10 +127,17 @@ class MonthlyExpenseChartCard extends StatelessWidget {
|
||||
parent: animationController,
|
||||
curve: const Interval(0.4, 0.9, curve: Curves.easeOut),
|
||||
)),
|
||||
child: GlassmorphismCard(
|
||||
blur: 10,
|
||||
opacity: 0.1,
|
||||
borderRadius: 16,
|
||||
child: Card(
|
||||
elevation: 3,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
side: BorderSide(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.outline
|
||||
.withValues(alpha: 0.5),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
@@ -168,7 +170,7 @@ class MonthlyExpenseChartCard extends StatelessWidget {
|
||||
(max, data) => math.max(
|
||||
max, data['totalExpense'] as double)),
|
||||
locale),
|
||||
barGroups: _getMonthlyBarGroups(locale),
|
||||
barGroups: _getMonthlyBarGroups(context, locale),
|
||||
gridData: FlGridData(
|
||||
show: true,
|
||||
drawVerticalLine: false,
|
||||
@@ -182,8 +184,10 @@ class MonthlyExpenseChartCard extends StatelessWidget {
|
||||
CurrencyUtil.getDefaultCurrency(locale)),
|
||||
getDrawingHorizontalLine: (value) {
|
||||
return FlLine(
|
||||
color:
|
||||
AppColors.navyGray.withValues(alpha: 0.1),
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.onSurfaceVariant
|
||||
.withValues(alpha: 0.1),
|
||||
strokeWidth: 1,
|
||||
);
|
||||
},
|
||||
@@ -222,14 +226,18 @@ class MonthlyExpenseChartCard extends StatelessWidget {
|
||||
barTouchData: BarTouchData(
|
||||
enabled: true,
|
||||
touchTooltipData: BarTouchTooltipData(
|
||||
tooltipBgColor: AppColors.darkNavy,
|
||||
tooltipBgColor: Theme.of(context)
|
||||
.colorScheme
|
||||
.inverseSurface,
|
||||
tooltipRoundedRadius: 8,
|
||||
getTooltipItem:
|
||||
(group, groupIndex, rod, rodIndex) {
|
||||
return BarTooltipItem(
|
||||
'${monthlyData[group.x]['monthName']}\n',
|
||||
const TextStyle(
|
||||
color: AppColors.pureWhite,
|
||||
TextStyle(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.onInverseSurface,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
children: [
|
||||
@@ -239,8 +247,10 @@ class MonthlyExpenseChartCard extends StatelessWidget {
|
||||
monthlyData[group.x]
|
||||
['totalExpense'] as double,
|
||||
locale),
|
||||
style: const TextStyle(
|
||||
color: Color(0xFFFBBF24),
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.warning,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user