diff --git a/README.md b/README.md
index 6d025032..63a5939a 100644
--- a/README.md
+++ b/README.md
@@ -87,6 +87,14 @@ You can add accounts to a wallet by:
---
+### 5. App Upgrade System
+- Automatic update detection – Prompts users to install the latest version directly from within the app.
+- Cross-platform support – Works on Android, iOS.
+- Custom appcast feed – Fetches release information from a hosted `appcast.xml`.
+- Powered by: [Upgrader](https://pub.dev/packages/upgrader)
+
+---
+
## RPC Communication
Qubic Wallet interacts with the network using the following RPC endpoints:
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 0de28475..a200d3d4 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -58,4 +58,11 @@
android:name="flutterEmbedding"
android:value="2" />
+
+
+
+
+
+
+
diff --git a/lib/main.dart b/lib/main.dart
index 7fadd29c..23c8d9f8 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -39,7 +39,6 @@ Future main() async {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
getIt.get().setVersion(packageInfo.version);
getIt.get().setBuildNumber(packageInfo.buildNumber);
-
getIt.get().checkWalletIsInitialized();
} catch (e) {
appLogger.e(e.toString());
diff --git a/lib/pages/main/main_screen.dart b/lib/pages/main/main_screen.dart
index ea60445d..aa8307de 100644
--- a/lib/pages/main/main_screen.dart
+++ b/lib/pages/main/main_screen.dart
@@ -16,9 +16,9 @@ import 'package:qubic_wallet/l10n/l10n.dart';
import 'package:qubic_wallet/models/app_link/app_link_controller.dart';
import 'package:qubic_wallet/models/wallet_connect/wallet_connect_modals_controller.dart';
import 'package:qubic_wallet/pages/main/download_cmd_utils.dart';
+import 'package:qubic_wallet/pages/main/tab_dapps/tab_dapps.dart';
import 'package:qubic_wallet/pages/main/tab_settings/tab_settings.dart';
import 'package:qubic_wallet/pages/main/tab_wallet_contents.dart';
-import 'package:qubic_wallet/pages/main/tab_dapps/tab_dapps.dart';
import 'package:qubic_wallet/pages/main/wallet_contents/add_account_modal_bottom_sheet.dart';
import 'package:qubic_wallet/resources/qubic_cmd.dart';
import 'package:qubic_wallet/services/wallet_connect_service.dart';
@@ -28,6 +28,8 @@ import 'package:qubic_wallet/stores/settings_store.dart';
import 'package:qubic_wallet/styles/text_styles.dart';
import 'package:qubic_wallet/timed_controller.dart';
import 'package:universal_platform/universal_platform.dart';
+import 'package:upgrader/upgrader.dart';
+import 'package:version/version.dart';
class MainScreen extends StatefulWidget {
final int initialTabIndex;
@@ -157,7 +159,8 @@ class _MainScreenState extends State with WidgetsBindingObserver {
if (error != "") {
//Error overriding for more than max accounts in wallet
if (error == "Failed to perform action. Server returned status 400") {
- if (applicationStore.currentQubicIDs.length > Config.maxAccountsInWallet) {
+ if (applicationStore.currentQubicIDs.length >
+ Config.maxAccountsInWallet) {
return;
}
}
@@ -298,34 +301,57 @@ class _MainScreenState extends State with WidgetsBindingObserver {
];
}
+ UpgraderStore _buildAppCastStore() {
+ const url =
+ 'https://raw.githubusercontent.com/ahmed-tarek-salem/qubic-appcast-test/refs/heads/main/appcast.xml?v=2';
+ final version = getIt.get().versionInfo ?? '1.0.0';
+ return UpgraderAppcastStore(
+ appcastURL: url,
+ osVersion: Version.parse(version),
+ );
+ }
+
Widget getMain() {
+ final upgrader = Upgrader(
+ //TODO remove debugDisplayAlways and debugLogging when done
+ debugDisplayAlways: true,
+ debugLogging: true,
+ storeController: UpgraderStoreController(
+ onAndroid: _buildAppCastStore,
+ oniOS: _buildAppCastStore,
+ ),
+ );
if (applicationStore.hasStoredWalletSettings) {
_controller.jumpToTab(applicationStore.currentTabIndex);
} else {
_controller.jumpToTab(0);
}
- // _controller.jumpToPreviousTab();
- return PersistentTabView(
- controller: _controller,
- navBarHeight: 60,
- navBarBuilder: (navBarConfig) => Style1BottomNavBar(
- navBarConfig: navBarConfig,
- navBarDecoration: const NavBarDecoration(
- border: Border(
- top: BorderSide(width: 1, color: LightThemeColors.navBorder),
- ),
- color: LightThemeColors.background)),
-
- tabs: _tabs(),
-
- backgroundColor: LightThemeColors.background,
-
- // Default is Colors.white.
- handleAndroidBackButtonPress: true, // Default is true.
- navBarOverlap: const NavBarOverlap.none(),
- resizeToAvoidBottomInset:
- true, // This needs to be true if you want to move up the screen when keyboard appears. Default is true.
- stateManagement: true, // Default is true.
+ return UpgradeAlert(
+ upgrader: upgrader,
+ showIgnore: false,
+ dialogStyle: UpgradeDialogStyle.material,
+ child: PersistentTabView(
+ controller: _controller,
+ navBarHeight: 60,
+ navBarBuilder: (navBarConfig) => Style1BottomNavBar(
+ navBarConfig: navBarConfig,
+ navBarDecoration: const NavBarDecoration(
+ border: Border(
+ top: BorderSide(width: 1, color: LightThemeColors.navBorder),
+ ),
+ color: LightThemeColors.background)),
+
+ tabs: _tabs(),
+
+ backgroundColor: LightThemeColors.background,
+
+ // Default is Colors.white.
+ handleAndroidBackButtonPress: true, // Default is true.
+ navBarOverlap: const NavBarOverlap.none(),
+ resizeToAvoidBottomInset:
+ true, // This needs to be true if you want to move up the screen when keyboard appears. Default is true.
+ stateManagement: true, // Default is true.
+ ),
);
}
diff --git a/pubspec.yaml b/pubspec.yaml
index 35d37f61..186fcdb4 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -76,6 +76,8 @@ dependencies:
safe_device: ^1.2.1
cryptography: ^2.7.0
no_screenshot: ^0.3.1
+ upgrader: ^12.1.0
+ version: ^3.0.0
implicitly_animated_list: ^2.3.0
cached_network_image: ^3.4.1