I've been struggled with FF application version control on Progressive Web Application(PWA). It's painful and felt stressful.
To manage this issue, I stored the latest version code to supabase, and check it each time users open app. If the version stored to users App State differ from supabase side, invoke this custom action. If the version number is default(0), it's the first time user opens app, so bypass this logic.
Better solutions are welcome.
// Custom Action Example
// appReload
import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:universal_html/html.dart' as universal_html;
Future appReload() async {
if (kIsWeb) {
// Web-specific code
universal_html.window.location.reload();
} else {
// Placeholder for non-web platform upgrade logic
print("Upgrade logic for mobile apps can go here.");
}
}