Untitled

mail@pastecode.io avatar
unknown
dart
a year ago
1.5 kB
1
Indexable
Never
import 'package:centro/app/modules/Common/onBoarding/bindings/on_boarding_binding.dart';
import 'package:centro/app/modules/Common/onBoarding/on_boarding_model/on_boarding_model.dart';
import 'package:centro/app/modules/Common/onBoarding/view/on_boarding_two_view.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';

class OnBoardingController extends GetxController {
  final GetStorage storage = GetStorage();

  @override
  void onReady() {
    storage.write('firstTimeOpen', true);
    super.onReady();
  }

  @override
  Future<void> onInit() async {
    super.onInit();
    Future.delayed(const Duration(seconds: 4), () async {
      await Get.off(() => const OnBoardingTwoView(),
          binding: OnBoardingBinding());
    });
  }

  RxInt currentIndex = 0.obs;
  PageController pageController = PageController();
  final GetStorage globalStorage = GetStorage();
  List<OnBoardingModel> contents = [
    OnBoardingModel(
        title: 'first onboard expression'.tr,
        image: 'assets/images/OnBoarding1BG.png',
        discription: 'onboard description one'.tr),
    OnBoardingModel(
        title: 'second onboard expression'.tr,
        image: 'assets/images/OnBoarding2BG.png',
        discription: 'onboard description two'.tr),
    OnBoardingModel(
        title: 'third onboard expression'.tr,
        image: 'assets/images/OnBoarding3BG.png',
        discription: 'onboard description three'.tr),
  ].obs;
}