icons and splash screens

This commit is contained in:
stopflock
2025-08-10 00:19:55 -05:00
parent 63675bd18a
commit 6bf9556c65
57 changed files with 395 additions and 230 deletions
+4
View File
@@ -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
View File
@@ -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;