This commit is contained in:
Hamza-Ayed
2024-07-06 10:02:06 +03:00
parent 002b33af49
commit 819a32eec1
14 changed files with 144 additions and 44 deletions

View File

@@ -3,6 +3,7 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:SEFER/views/auth/login_page.dart';
import 'package:package_info_plus/package_info_plus.dart';
import '../../constant/box_name.dart';
import '../../main.dart';
@@ -15,10 +16,23 @@ class SplashScreenController extends GetxController
late Animation<double> zoomInAnimation;
late Animation<double> zoomOutAnimation;
@override
void onInit() {
super.onInit();
String packageInfo = '';
late String version = '1.5.48';
Future<void> checkForUpdate() async {
final packageInfo = await PackageInfo.fromPlatform();
final currentVersion = packageInfo.buildNumber;
final version1 = packageInfo.version;
print('currentVersion is : $currentVersion');
// Fetch the latest version from your server
version = version1.toString();
print('version: ${version}');
update();
}
@override
void onInit() async {
super.onInit();
checkForUpdate();
animationController = AnimationController(
vsync: this,
duration: const Duration(seconds: 4),