pull/76/head
Sultan khan 1 month ago
commit 318441c77f

@ -126,7 +126,7 @@
"gregorianDate": "التاريخ الميلادي", "gregorianDate": "التاريخ الميلادي",
"verifyLoginWith": "يرجى اختيار واحدة من الخيارات التالية للتحقق", "verifyLoginWith": "يرجى اختيار واحدة من الخيارات التالية للتحقق",
"registerUser": "تسجيل", "registerUser": "تسجيل",
"verifyWithFingerprint":"البيومترية", "verifyWithFingerprint": "البيومترية",
"verifyWithFaceid": "معرف الوجه", "verifyWithFaceid": "معرف الوجه",
"verifyWithSms": "رسالة قصيرة", "verifyWithSms": "رسالة قصيرة",
"verifyWithWhatsapp": "واتساب", "verifyWithWhatsapp": "واتساب",
@ -850,6 +850,11 @@
"pleaseEnterAValidEmailFormat": "يرجى إدخال تنسيق بريد إلكتروني صالح", "pleaseEnterAValidEmailFormat": "يرجى إدخال تنسيق بريد إلكتروني صالح",
"selectCountry": "اختر الدولة", "selectCountry": "اختر الدولة",
"forLoginVerification": "للتحقق من تسجيل الدخول", "forLoginVerification": "للتحقق من تسجيل الدخول",
"searchHospital": "بحث في المستشفى" "searchHospital": "بحث في المستشفى",
"skip": "تخطي",
"getStarted": "ابدأ الآن",
"onboardingHeading1": "حجز المواعيد لم يكن أسهل من قبل",
"onboardingBody1": "ببضع نقرات فقط يمكنك استشارة الطبيب الذي تختاره.",
"onboardingHeading2": "الوصول إلى السجل الطبي بين يديك",
"onboardingBody2": "تتبع تاريخك الطبي بما في ذلك الفحوصات المخبرية، الوصفات الطبية، التأمين، وغيرها."
} }

@ -846,5 +846,11 @@
"selectCountry": "Select Country", "selectCountry": "Select Country",
"forLoginVerification": "for login verification", "forLoginVerification": "for login verification",
"lastLoginBy": "Last login by", "lastLoginBy": "Last login by",
"searchHospital": "Search Hospital" "searchHospital": "Search Hospital",
"skip": "Skip",
"getStarted": "Get Started",
"onboardingHeading1": "Booking appointment has never been easy",
"onboardingBody1": "In few clicks find yourself having consultation with the doctor of your choice.",
"onboardingHeading2": "Access the medical history on finger tips",
"onboardingBody2": "Keep track on your medical history including labs, prescription, insurance, etc"
} }

@ -11,6 +11,7 @@ class CacheConst {
static const String lastLoginDate = "lastLoginDate"; static const String lastLoginDate = "lastLoginDate";
static const String lastLoginTime = "lastLoginTime"; static const String lastLoginTime = "lastLoginTime";
static const String memberModel = "memberModel"; static const String memberModel = "memberModel";
static const String firstLaunch = "firstLaunch";
static const String isShowOnboarding = "is_show_onboarding"; static const String isShowOnboarding = "is_show_onboarding";
static const String appAuthToken = "app_auth_token"; static const String appAuthToken = "app_auth_token";

@ -162,6 +162,16 @@ class Utils {
} }
} }
static Future<bool> getBoolFromPrefs(String key) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
return prefs.getBool(key) ?? true;
}
static Future<bool> saveBoolFromPrefs(String key, bool value) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
return await prefs.setBool(key, value);
}
static Future<String> getStringFromPrefs(String key) async { static Future<String> getStringFromPrefs(String key) async {
SharedPreferences prefs = await SharedPreferences.getInstance(); SharedPreferences prefs = await SharedPreferences.getInstance();
return prefs.getString(key) ?? ""; return prefs.getString(key) ?? "";
@ -671,7 +681,8 @@ class Utils {
); );
} }
static Widget getPaymentAmountWithSymbol2(num habibWalletAmount, {double iconSize = 14, Color iconColor = AppColors.textColor, Color textColor = AppColors.blackColor, bool isSaudiCurrency = true, bool isExpanded = true}) { static Widget getPaymentAmountWithSymbol2(num habibWalletAmount,
{double iconSize = 14, Color iconColor = AppColors.textColor, Color textColor = AppColors.blackColor, bool isSaudiCurrency = true, bool isExpanded = true}) {
return RichText( return RichText(
maxLines: 1, maxLines: 1,
text: TextSpan( text: TextSpan(

@ -1,6 +1,9 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/cache_consts.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/int_extensions.dart'; import 'package:hmg_patient_app_new/extensions/int_extensions.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
@ -10,6 +13,8 @@ import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart'; import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart';
import 'package:lottie/lottie.dart'; import 'package:lottie/lottie.dart';
import '../../core/dependencies.dart';
class OnboardingScreen extends StatefulWidget { class OnboardingScreen extends StatefulWidget {
OnboardingScreen({Key? key}) : super(key: key); OnboardingScreen({Key? key}) : super(key: key);
@ -24,7 +29,10 @@ class _OnboardingScreenState extends State<OnboardingScreen> {
late PageController pageController; late PageController pageController;
void goToHomePage() => Navigator.of(context).pushReplacement(FadePage(page: LandingNavigation())); void goToHomePage() {
Utils.saveBoolFromPrefs(CacheConst.firstLaunch, false);
Navigator.of(context).pushReplacement(FadePage(page: LandingNavigation()));
}
@override @override
void initState() { void initState() {
@ -118,7 +126,7 @@ class _OnboardingScreenState extends State<OnboardingScreen> {
transitionBuilder: (child, anim) => FadeTransition(opacity: anim, child: child), transitionBuilder: (child, anim) => FadeTransition(opacity: anim, child: child),
child: selectedIndex == 0 child: selectedIndex == 0
? CustomButton( ? CustomButton(
icon: AppAssets.arrow_forward, icon: getIt.get<AppState>().isArabic() ? AppAssets.arrow_back : AppAssets.arrow_forward,
iconSize: 32.h, iconSize: 32.h,
width: 86.h, width: 86.h,
height: 56.h, height: 56.h,
@ -156,7 +164,9 @@ class _OnboardingScreenState extends State<OnboardingScreen> {
children: [ children: [
Align( Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: Lottie.asset(icon, repeat: true, reverse: false, frameRate: FrameRate(60), width: MediaQuery.sizeOf(context).width - 50, height: MediaQuery.sizeOf(context).width - 50)) child: Transform.flip(
flipX: getIt.get<AppState>().isArabic() ? true : false,
child: Lottie.asset(icon, repeat: true, reverse: false, frameRate: FrameRate(60), width: MediaQuery.sizeOf(context).width - 50, height: MediaQuery.sizeOf(context).width - 50)))
.expanded, .expanded,
// 12.height, // 12.height,
Text( Text(

@ -36,8 +36,6 @@ class SplashPage extends StatefulWidget {
class _SplashScreenState extends State<SplashPage> { class _SplashScreenState extends State<SplashPage> {
late AuthenticationViewModel authVm; late AuthenticationViewModel authVm;
bool isNewDesign = true;
Future<void> initializeStuff() async { Future<void> initializeStuff() async {
Timer( Timer(
Duration(milliseconds: 500), Duration(milliseconds: 500),
@ -50,15 +48,10 @@ class _SplashScreenState extends State<SplashPage> {
Timer(Duration(seconds: 2, milliseconds: 500), () async { Timer(Duration(seconds: 2, milliseconds: 500), () async {
LocalNotification.init(onNotificationClick: (payload) {}); LocalNotification.init(onNotificationClick: (payload) {});
if (isNewDesign) { if (await Utils.getBoolFromPrefs(CacheConst.firstLaunch)) {
Navigator.of(context).pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: OnboardingScreen()))); Navigator.of(context).pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: OnboardingScreen())));
} else { } else {
Navigator.of(context).pushReplacement( Navigator.of(context).pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: LandingNavigation())));
CustomPageRoute(
page: LandingNavigation(),
// page: LoginScreen(),
),
);
} }
}); });
var zoom = ZoomVideoSdk(); var zoom = ZoomVideoSdk();
@ -97,42 +90,7 @@ class _SplashScreenState extends State<SplashPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: AppColors.whiteColor, backgroundColor: AppColors.whiteColor,
body: isNewDesign body: Lottie.asset(AppAnimations.loadingAnimation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 80.h, height: 80.h, fit: BoxFit.fill).center);
? Lottie.asset(AppAnimations.loadingAnimation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 80.h, height: 80.h, fit: BoxFit.fill).center
: Stack(
alignment: Alignment.center,
children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 53),
child: Image.asset(AppAssets.hmg_logo, fit: BoxFit.fitWidth, width: MediaQuery.of(context).size.width),
),
Align(
alignment: Alignment.bottomCenter,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
"Powered by",
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w400, color: AppColors.textColor, letterSpacing: -0.56, height: 16 / 14),
),
SizedBox(
height: 5,
),
Utils.buildSvgWithAssets(icon: AppAssets.cloud_logo, width: 40, height: 40),
SizedBox(height: 7),
// Text(
// "Version 1.1.0",
// style: TextStyle(fontSize: 10, fontWeight: FontWeight.w400, color: Color(0xff3989898), letterSpacing: 0, height: 12 / 10),
// ),
SizedBox(
height: 18,
)
],
),
)
],
),
);
} }
} }

Loading…
Cancel
Save