mirror of
https://github.com/DRYTRIX/TimeTracker.git
synced 2026-05-18 04:08:48 -05:00
fix(mobile): use UserPrefs dateFormatKey and timeFormatKey in UI
Screens referenced dateFormat and timeFormat, which do not exist on UserPrefs. Align with the model and date_format_utils key-based API so flutter analyze and tests compile.
This commit is contained in:
@@ -273,7 +273,7 @@ class _DashboardTabState extends ConsumerState<DashboardTab> {
|
||||
: formatDateRange(
|
||||
entry.startTime,
|
||||
entry.endTime,
|
||||
ref.watch(userPrefsProvider).valueOrNull?.dateFormat,
|
||||
ref.watch(userPrefsProvider).valueOrNull?.dateFormatKey,
|
||||
);
|
||||
return Card(
|
||||
margin: const EdgeInsets.only(bottom: AppSpacing.sm),
|
||||
|
||||
@@ -138,7 +138,7 @@ class _TimeEntriesScreenState extends ConsumerState<TimeEntriesScreen> {
|
||||
void _showFilterDialog() {
|
||||
final currentFilter = ref.read(timeEntriesProvider).filter;
|
||||
final prefs = ref.read(userPrefsProvider).valueOrNull;
|
||||
final dateFormatKey = prefs?.dateFormat;
|
||||
final dateFormatKey = prefs?.dateFormatKey;
|
||||
DateTime? startDate;
|
||||
DateTime? endDate;
|
||||
|
||||
|
||||
@@ -341,8 +341,8 @@ class _TimeEntryFormScreenState extends ConsumerState<TimeEntryFormScreen> {
|
||||
_startTime.hour,
|
||||
_startTime.minute,
|
||||
),
|
||||
ref.read(userPrefsProvider).valueOrNull?.dateFormat,
|
||||
ref.read(userPrefsProvider).valueOrNull?.timeFormat,
|
||||
ref.read(userPrefsProvider).valueOrNull?.dateFormatKey,
|
||||
ref.read(userPrefsProvider).valueOrNull?.timeFormatKey,
|
||||
),
|
||||
),
|
||||
trailing: const Icon(Icons.calendar_today),
|
||||
@@ -362,8 +362,8 @@ class _TimeEntryFormScreenState extends ConsumerState<TimeEntryFormScreen> {
|
||||
_endTime!.hour,
|
||||
_endTime!.minute,
|
||||
),
|
||||
ref.read(userPrefsProvider).valueOrNull?.dateFormat,
|
||||
ref.read(userPrefsProvider).valueOrNull?.timeFormat,
|
||||
ref.read(userPrefsProvider).valueOrNull?.dateFormatKey,
|
||||
ref.read(userPrefsProvider).valueOrNull?.timeFormatKey,
|
||||
)
|
||||
: 'Not set',
|
||||
),
|
||||
|
||||
@@ -111,7 +111,7 @@ class TimeEntryCard extends ConsumerWidget {
|
||||
formatDateRange(
|
||||
entry.startTime,
|
||||
entry.endTime,
|
||||
ref.watch(userPrefsProvider).valueOrNull?.dateFormat,
|
||||
ref.watch(userPrefsProvider).valueOrNull?.dateFormatKey,
|
||||
),
|
||||
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
|
||||
Reference in New Issue
Block a user