mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-07-06 20:57:54 +02:00
icons and splash screens
This commit is contained in:
@@ -42,6 +42,9 @@ class AppState extends ChangeNotifier {
|
||||
final _auth = AuthService();
|
||||
String? _username;
|
||||
|
||||
bool _isInitialized = false;
|
||||
bool get isInitialized => _isInitialized;
|
||||
|
||||
final List<CameraProfile> _profiles = [];
|
||||
final Set<CameraProfile> _enabled = {};
|
||||
static const String _enabledPrefsKey = 'enabled_profiles';
|
||||
@@ -153,6 +156,7 @@ class AppState extends ChangeNotifier {
|
||||
}
|
||||
|
||||
_startUploader();
|
||||
_isInitialized = true;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
|
||||
+20
-1
@@ -9,7 +9,26 @@ void main() {
|
||||
runApp(
|
||||
ChangeNotifierProvider(
|
||||
create: (_) => AppState(),
|
||||
child: const FlockMapApp(),
|
||||
child: Consumer<AppState>(
|
||||
builder: (context, appState, _) {
|
||||
if (!appState.isInitialized) {
|
||||
// You can customize this splash/loading screen as needed
|
||||
return MaterialApp(
|
||||
home: Scaffold(
|
||||
backgroundColor: Color(0xFF202020),
|
||||
body: Center(
|
||||
child: Image.asset(
|
||||
'assets/app_icon.png',
|
||||
width: 240,
|
||||
height: 240,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return const FlockMapApp();
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,17 +9,11 @@ final _tileFetchSemaphore = _SimpleSemaphore(4); // Max 4 concurrent
|
||||
|
||||
/// Fetches a tile from OSM, with in-memory retries/backoff, and global concurrency limit.
|
||||
/// Returns tile image bytes, or throws on persistent failure.
|
||||
import '../../app_state.dart';
|
||||
|
||||
Future<List<int>> fetchOSMTile({
|
||||
required int z,
|
||||
required int x,
|
||||
required int y,
|
||||
}) async {
|
||||
if (AppState().offlineMode) {
|
||||
print('[fetchOSMTile] BLOCKED by offline mode ($z/$x/$y)');
|
||||
throw Exception('Offline mode enabled—cannot fetch OSM tile.');
|
||||
}
|
||||
final url = 'https://tile.openstreetmap.org/$z/$x/$y.png';
|
||||
const int maxAttempts = 3;
|
||||
int attempt = 0;
|
||||
|
||||
Reference in New Issue
Block a user