diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 70fa7d5b..4aa82609 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -43,7 +43,7 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 8792c07d..75800a41 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -7,7 +7,7 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName - Atoms + RSG Atoms CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -15,7 +15,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - Atoms + RSG Atoms CFBundlePackageType APPL NFCReaderUsageDescription diff --git a/lib/new_views/pages/login_page.dart b/lib/new_views/pages/login_page.dart index 1c6a83bd..1bddb16f 100644 --- a/lib/new_views/pages/login_page.dart +++ b/lib/new_views/pages/login_page.dart @@ -91,7 +91,7 @@ class _LoginPageState extends State { SizedBox( height: 100.toScreenHeight, ), - "logo_white".toPngAsset(width: 110), + "RSG_logo".toSvgAsset(width: 110), 25.height, context.translation.signInToYour.customHeadingText(context).custom(color: Colors.white, fontSize: 27, fontWeight: FontWeight.w500), context.translation.account.customHeadingText(context).custom(color: Colors.white, fontSize: 27, fontWeight: FontWeight.w500), diff --git a/lib/new_views/pages/splash_page.dart b/lib/new_views/pages/splash_page.dart index 2b619ac4..d06dc9c3 100644 --- a/lib/new_views/pages/splash_page.dart +++ b/lib/new_views/pages/splash_page.dart @@ -3,7 +3,6 @@ import 'dart:io'; import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; -import 'package:flare_flutter/flare_actor.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:local_auth/local_auth.dart'; @@ -14,6 +13,7 @@ import 'package:test_sa/controllers/api_routes/urls.dart'; import 'package:test_sa/controllers/notification/firebase_notification_manger.dart'; import 'package:test_sa/controllers/providers/api/user_provider.dart'; import 'package:test_sa/controllers/providers/settings/setting_provider.dart'; +import 'package:test_sa/extensions/text_extensions.dart'; import 'package:test_sa/extensions/widget_extensions.dart'; import 'package:test_sa/new_views/app_style/app_color.dart'; import 'package:test_sa/new_views/common_widgets/app_lazy_loading.dart'; @@ -184,10 +184,34 @@ class _SplashPageState extends State { SizeConfig.init(context); _settingProvider = Provider.of(context, listen: false); _userProvider = Provider.of(context, listen: false); + + // Start splash logic after a delay + Future.delayed(const Duration(seconds: 2), () async { + if (!mounted) return; + + bool isSafe = await checkDeviceSafety(); + + if (!isSafe) { + Navigator.pushNamedAndRemoveUntil(context, UnsafeDeviceScreen.routeName, (_) => false); + } else { + if (_settingProvider.isLoaded && (_settingProvider.user != null)) { + checkTokenValidity(_settingProvider.user!.token!); + } else { + Navigator.of(context).pushNamedAndRemoveUntil(LoginPage.routeName, (routes) => true); + } + } + }); + return Scaffold( body: Stack( alignment: Alignment.center, children: [ + // RSG Logo + Hero( + tag: "logo", + child: "RSG_logo".toSvgAsset(height: 100), + ).center, + // Loading indicator if (loading) Positioned( bottom: 100, @@ -196,42 +220,6 @@ class _SplashPageState extends State { height: 36, child: CircularProgressIndicator(color: AppColor.loadingColor(context), strokeWidth: 3), )), - SizedBox( - width: MediaQuery.of(context).size.width / 1.1, - child: Hero( - tag: "logo", - child: FlareActor( - "assets/rives/atoms_splash.flr", - fit: BoxFit.contain, - animation: "splash", - callback: (animation) async { - bool isSafe = await checkDeviceSafety(); - - if (!isSafe) { - Navigator.pushNamedAndRemoveUntil(context, UnsafeDeviceScreen.routeName, (_) => false); - } else { - if (_settingProvider.isLoaded && (_settingProvider.user != null)) { - checkTokenValidity(_settingProvider.user!.token!); - } else { - Navigator.of(context).pushNamedAndRemoveUntil(LoginPage.routeName, (routes) => true); - } - } - - // if (_settingProvider.isLoaded && (_settingProvider.user?.isLiveToken ?? false)) { - // _userProvider.user = _settingProvider.user; - // Navigator.of(context).pushNamedAndRemoveUntil(LandPage.routeName, (routes) => true); - // // if(isnotificationCame) - // // Navigator.of(context).push(MaterialPageRoute( - // // builder: (_) => ServiceRequestDetailsPage( - // // serviceRequest: ServiceRequest(id: "72348"), - // // ))); - // /// The below line for the new design - // // Navigator.of(context).pushNamedAndRemoveUntil(LandPage.routeName, (routes) => true); - // } - }, - ), - ), - ).center, ], ), ); diff --git a/lib/new_views/pages/unsafe_device_view.dart b/lib/new_views/pages/unsafe_device_view.dart index 2f6d2f10..5c7fd7a7 100644 --- a/lib/new_views/pages/unsafe_device_view.dart +++ b/lib/new_views/pages/unsafe_device_view.dart @@ -30,7 +30,7 @@ class _UnsafeDeviceScreenState extends State { children: [ 21.height, // Center(child: Image.asset("assets/images/logos/main_mohemm_logo.png", width: 200, height: 50)), - "logo".toSvgAsset(height: 64), + "RSG_logo".toSvgAsset(height: 64), 50.height, "Sorry".heading5(context).custom(color: AppColor.textStyleColor(context)), 21.height, diff --git a/lib/views/update_available_screen.dart b/lib/views/update_available_screen.dart index 558a0233..c48fd48b 100644 --- a/lib/views/update_available_screen.dart +++ b/lib/views/update_available_screen.dart @@ -21,7 +21,7 @@ class UpdateAvailableScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ - Hero(tag: "logo", child: "logo".toSvgAsset(height: 64)), + Hero(tag: "logo", child: "RSG_logo".toSvgAsset(height: 64)), 48.height, Text( "Update Available",