app configs added.

main_production_RSG
Sikander Saleem 1 month ago
parent 31e9488e2a
commit d8eee902ad

@ -27,7 +27,7 @@
"project_id":"388421841222408054", "project_id":"388421841222408054",
"app_id":"111820283", "app_id":"111820283",
"api_key":"DQEDACmCXaRhehJz6Col9ZoLjfEmJCZn2/FIsIDJccmzQmq61gFYr7msISoMMgprtwaxo5vZ4Gyn2TIj6Y7v+sd1IGqforIJaKyaPA==", "api_key":"DQEDACmCXaRhehJz6Col9ZoLjfEmJCZn2/FIsIDJccmzQmq61gFYr7msISoMMgprtwaxo5vZ4Gyn2TIj6Y7v+sd1IGqforIJaKyaPA==",
"package_name":"com.hmg.atoms" "package_name":"com.cloudsolutions.rsgatoms"
}, },
"oauth_client":{ "oauth_client":{
"client_id":"111820283", "client_id":"111820283",
@ -35,17 +35,17 @@
}, },
"app_info":{ "app_info":{
"app_id":"111820283", "app_id":"111820283",
"package_name":"com.hmg.atoms" "package_name":"com.cloudsolutions.rsgatoms"
}, },
"configuration_version":"3.0", "configuration_version":"3.0",
"appInfos":[ "appInfos":[
{ {
"package_name":"com.hmg.atoms", "package_name":"com.cloudsolutions.rsgatoms",
"client":{ "client":{
"app_id":"111820283" "app_id":"111820283"
}, },
"app_info":{ "app_info":{
"package_name":"com.hmg.atoms", "package_name":"com.cloudsolutions.rsgatoms",
"app_id":"111820283" "app_id":"111820283"
}, },
"oauth_client":{ "oauth_client":{

@ -163,10 +163,10 @@ void main() async {
if (Platform.isIOS) { if (Platform.isIOS) {
await Firebase.initializeApp( await Firebase.initializeApp(
options: const FirebaseOptions( options: const FirebaseOptions(
apiKey: "AIzaSyACQkSleNwU1jzEKR5ho1uSfZERokwwAbc", apiKey: "AIzaSyDp8yKlAni0SnHbf2V7G-TG1DyKzAeNhQw",
appId: "1:973582662416:ios:bc4a8061444c6a08fbc395", appId: "1:187000537087:ios:ec99ad6f5226b5083df1ca",
messagingSenderId: "973582662416", messagingSenderId: "187000537087",
projectId: "atoms-fb912", projectId: "rsg-atoms",
), ),
); );
} else { } else {

@ -92,7 +92,7 @@ class _LoginPageState extends State<LoginPage> {
height: 100.toScreenHeight, height: 100.toScreenHeight,
), ),
"RSG_logo".toSvgAsset(width: 110), "RSG_logo".toSvgAsset(width: 110),
25.height, 16.height,
context.translation.signInToYour.customHeadingText(context).custom(color: Colors.white, fontSize: 27, fontWeight: FontWeight.w500), 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), context.translation.account.customHeadingText(context).custom(color: Colors.white, fontSize: 27, fontWeight: FontWeight.w500),
15.height, 15.height,

@ -62,6 +62,26 @@ class _SplashPageState extends State<SplashPage> {
// //
// }, (id, title, body, payload) async {}); // }, (id, title, body, payload) async {});
super.initState(); super.initState();
initApp();
}
void initApp() {
// Start splash logic after a delay
Future.delayed(const Duration(seconds: 1), () 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);
}
}
});
} }
void checkTokenValidity(String token) async { void checkTokenValidity(String token) async {
@ -185,23 +205,6 @@ class _SplashPageState extends State<SplashPage> {
_settingProvider = Provider.of<SettingProvider>(context, listen: false); _settingProvider = Provider.of<SettingProvider>(context, listen: false);
_userProvider = Provider.of<UserProvider>(context, listen: false); _userProvider = Provider.of<UserProvider>(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( return Scaffold(
body: Stack( body: Stack(
alignment: Alignment.center, alignment: Alignment.center,

Loading…
Cancel
Save