mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-10-12 02:37:11 +02:00
add offline mode - not yet functional really
This commit is contained in:
1 parent
cf8df39f1e
commit
000bb6c567
3 files changed
+39
-4
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../../app_state.dart';
|
||||
|
||||
class OfflineModeSection extends StatelessWidget {
|
||||
const OfflineModeSection({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final appState = context.watch<AppState>();
|
||||
return ListTile(
|
||||
leading: const Icon(Icons.wifi_off),
|
||||
title: const Text('Offline Mode'),
|
||||
subtitle: const Text('Disable all network requests except for local/offline areas.'),
|
||||
trailing: Switch(
|
||||
value: appState.offlineMode,
|
||||
onChanged: (value) async => await appState.setOfflineMode(value),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user