feat: add gallery feature with database integration and rendering capabilities
Build Android App / build (push) Failing after 2m19s

This commit is contained in:
ImBenji
2026-08-25 11:46:33 +01:00
parent b66b73a3c6
commit 8c2212b563
17 changed files with 2902 additions and 885 deletions
@@ -0,0 +1,42 @@
import "dart:async";
import "package:flutter/foundation.dart";
import "package:quotegen_client/services/quote_api_v2.dart";
// tracks whether the render backend is reachable, so the ui can hide stuff
// that actually needs it (video render, snapshot links etc) when its down
class BackendStatusProvider extends ChangeNotifier {
// start optimistic - dont want everything flashing away before the first check lands
bool isOnline = true;
bool hasChecked = false;
Timer? _pollTimer;
bool _disposed = false;
BackendStatusProvider() {
checkNow();
_pollTimer = Timer.periodic(const Duration(seconds: 15), (_) => checkNow());
}
Future<void> checkNow() async {
final online = await QuoteGeneratorApiV2.checkHealth();
if (_disposed) return;
hasChecked = true;
if (online != isOnline) {
isOnline = online;
notifyListeners();
}
}
@override
void dispose() {
_disposed = true;
_pollTimer?.cancel();
super.dispose();
}
}