feat: add alot
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:go_router/go_router.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../l10n/app_localizations.dart';
|
||||
import '../models/remote_command.dart';
|
||||
import '../utils/navigation.dart';
|
||||
import '../viewmodels/admin_pin_view_model.dart';
|
||||
import '../viewmodels/remote_sync_view_model.dart';
|
||||
@@ -41,7 +42,7 @@ class AdminScreenView extends StatelessWidget {
|
||||
);
|
||||
|
||||
if (confirmed == true && context.mounted) {
|
||||
context.read<RemoteSyncViewModel>().unlink();
|
||||
await context.read<RemoteSyncViewModel>().unlink();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,8 +136,13 @@ class AdminScreenView extends StatelessWidget {
|
||||
subtitle: remoteSync.isSyncing
|
||||
? l10n.syncing
|
||||
: remoteSync.lastSyncAt != null
|
||||
? l10n.lastSync(remoteSync.lastSyncAt!.toLocal().toString().substring(0, 19))
|
||||
: l10n.notSyncedYet,
|
||||
? l10n.lastSync(
|
||||
remoteSync.lastSyncAt!
|
||||
.toLocal()
|
||||
.toString()
|
||||
.substring(0, 19),
|
||||
)
|
||||
: l10n.notSyncedYet,
|
||||
trailing: remoteSync.isSyncing
|
||||
? const SizedBox(
|
||||
width: 20,
|
||||
@@ -154,20 +160,18 @@ class AdminScreenView extends StatelessWidget {
|
||||
children: remoteSync.activity.map((entry) {
|
||||
return ListTile(
|
||||
dense: true,
|
||||
leading: Icon(
|
||||
entry.result == 'completed'
|
||||
? Icons.check_circle_outline
|
||||
: entry.result == 'conflict'
|
||||
? Icons.warning_amber_outlined
|
||||
: Icons.error_outline,
|
||||
size: 20,
|
||||
),
|
||||
leading: Icon(switch (entry.result) {
|
||||
CommandResult.completed => Icons.check_circle_outline,
|
||||
CommandResult.conflict => Icons.warning_amber_outlined,
|
||||
CommandResult.failed ||
|
||||
CommandResult.expired => Icons.error_outline,
|
||||
}, size: 20),
|
||||
title: Text(
|
||||
'${entry.commandType} (${entry.commandId.substring(0, 8)}...)',
|
||||
style: const TextStyle(fontSize: 13),
|
||||
),
|
||||
subtitle: Text(
|
||||
'${entry.processedAt.toLocal()} - ${entry.result}',
|
||||
'${entry.processedAt.toLocal()} - ${entry.result.name}',
|
||||
style: const TextStyle(fontSize: 11),
|
||||
),
|
||||
);
|
||||
@@ -277,10 +281,7 @@ class _AdminTile extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
if (trailing != null) ...[
|
||||
const SizedBox(width: 8),
|
||||
trailing!,
|
||||
],
|
||||
if (trailing != null) ...[const SizedBox(width: 8), trailing!],
|
||||
if (onTap != null)
|
||||
Icon(
|
||||
Icons.chevron_right_rounded,
|
||||
@@ -292,4 +293,4 @@ class _AdminTile extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user