Sync data message when in Offline Mode

This commit is contained in:
yaso 2026-06-25 12:24:30 +02:00
parent 8d78fb6357
commit d722251d50
3 changed files with 15 additions and 8 deletions

View file

@ -88,11 +88,17 @@ class _MihHomeState extends State<MihHome> {
RefreshIndicator(
key: mzansiProfileProvider.refreshIndicatorKey,
onRefresh: () async {
await mzansiProfileProvider.syncWithMihServerData();
bool success =
await mzansiProfileProvider.syncWithMihServerData();
if (context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
MihSnackBar(
child: Text("Data Synced with MIH Server."),
child: Text(
success
? "Data Synced with MIH Server."
: "MIH App operation in Offline Mode",
),
// backgroundColor: success ? null : MihColors.red(),
),
);
}