|
|
|
@ -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(
|
|
|
|
|