This commit is contained in:
ytc1012
2025-12-02 16:38:58 +08:00
parent ef44d11c32
commit 86a368e1e3
34 changed files with 2767 additions and 686 deletions

View File

@@ -98,7 +98,7 @@ class _HistoryScreenState extends State<HistoryScreen> {
const SizedBox(height: 32),
ElevatedButton(
onPressed: () => Navigator.pop(context),
child: const Text('Start Focusing'),
child: Text(l10n.startFocusing),
),
],
),
@@ -159,7 +159,7 @@ class _HistoryScreenState extends State<HistoryScreen> {
children: [
Expanded(
child: _buildStat(
'Total',
l10n.total,
l10n.minutesValue(totalMins, l10n.minutes(totalMins)),
'⏱️',
),
@@ -167,7 +167,7 @@ class _HistoryScreenState extends State<HistoryScreen> {
const SizedBox(width: 16),
Expanded(
child: _buildStat(
'Distractions',
l10n.distractions(distractions),
l10n.distractionsCount(
distractions,
l10n.times(distractions),

View File

@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import '../l10n/app_localizations.dart';
import '../theme/app_colors.dart';
import '../theme/app_constants.dart';
import '../services/storage_service.dart';
import '../services/points_service.dart';
import '../services/achievement_service.dart';
@@ -418,14 +419,14 @@ class _ProfileScreenState extends State<ProfileScreen> {
const SizedBox(height: 16),
// Calendar grid (last 28 days)
_buildCalendarGrid(),
_buildCalendarGrid(l10n),
],
),
);
}
/// Build calendar grid showing check-in history
Widget _buildCalendarGrid() {
Widget _buildCalendarGrid(AppLocalizations l10n) {
final now = DateTime.now();
final today = DateTime(now.year, now.month, now.day);
@@ -434,16 +435,24 @@ class _ProfileScreenState extends State<ProfileScreen> {
// Weekday labels
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: ['S', 'M', 'T', 'W', 'T', 'F', 'S']
children: [
l10n.weekdayS,
l10n.weekdayM,
l10n.weekdayT,
l10n.weekdayW,
l10n.weekdayTh,
l10n.weekdayF,
l10n.weekdaySa,
]
.map(
(day) => SizedBox(
width: 40,
width: ProfileConstants.calendarCellSize,
child: Center(
child: Text(
day,
style: const TextStyle(
style: TextStyle(
fontFamily: 'Nunito',
fontSize: 12,
fontSize: FontSizes.caption,
fontWeight: FontWeight.w600,
color: AppColors.textSecondary,
),

View File

@@ -115,7 +115,7 @@ class SessionDetailScreen extends StatelessWidget {
_buildStatRow(
icon: '🤚',
label: 'Distractions',
label: l10n.distractions(session.distractionCount),
value:
'${session.distractionCount} ${l10n.times(session.distractionCount)}',
),
@@ -123,7 +123,7 @@ class SessionDetailScreen extends StatelessWidget {
_buildStatRow(
icon: '🏁',
label: 'Status',
label: l10n.status,
value: session.completed
? l10n.completed
: l10n.stoppedEarly,