@@ -5,11 +5,9 @@ import 'package:firebase_messaging/firebase_messaging.dart';
55import 'package:flutter/material.dart' ;
66import 'package:flutter_local_notifications/flutter_local_notifications.dart' ;
77import 'package:google_nav_bar/google_nav_bar.dart' ;
8- import 'package:in_app_update/in_app_update.dart' ;
98import 'package:propview/config.dart' ;
109import 'package:propview/services/baseService.dart' ;
1110import 'package:propview/utils/progressBar.dart' ;
12- import 'package:propview/utils/snackBar.dart' ;
1311import 'package:propview/utils/udpatepop.dart' ;
1412import 'package:propview/views/Admin/Home/HomeScreen.dart' ;
1513import 'package:propview/views/Admin/TaskManager/TaskManagerHome.dart' ;
@@ -41,7 +39,6 @@ class _LandingScreenState extends State<LandingScreen> {
4139 setState (() {
4240 isLoading = true ;
4341 });
44- await checkForUpdate ();
4542 await checkVersion ();
4643 initialiseLocalNotification ();
4744 FirebaseMessaging .onMessage.listen ((RemoteMessage message) async {
@@ -161,29 +158,11 @@ class _LandingScreenState extends State<LandingScreen> {
161158 });
162159 }
163160
164- AppUpdateInfo _updateInfo;
165- Future <void > checkForUpdate () async {
166- InAppUpdate .checkForUpdate ().then ((info) {
167- setState (() {
168- _updateInfo = info;
169- });
170- }).catchError ((e) {
171- showInSnackBar (context, e.toString (), 800 );
172- });
173- if (_updateInfo? .updateAvailability == UpdateAvailability .updateAvailable) {
174- await InAppUpdate .performImmediateUpdate ()
175- .catchError ((e) => showInSnackBar (context, e.toString (), 800 ));
176- }
177- }
178-
179161 checkVersion () async {
180162 var getVersion = await BaseService .getAppCurrentVersion ();
181163 var responseMap = jsonDecode (getVersion);
182164 if (responseMap != Config .APP_VERISON ) {
183- versionErrorWiget (responseMap, context,
184- "https://play.google.com/store/apps/details?id=com.propdial.propview" );
185- InAppUpdate .performImmediateUpdate ()
186- .catchError ((e) => showInSnackBar (context, e.toString (), 800 ));
165+ versionErrorWiget (responseMap, context);
187166 }
188167 }
189168
0 commit comments