Compare commits

...

2 Commits

View File

@@ -44,11 +44,11 @@ void main() async {
prefs.setString('token',token.toString()); */
Globalwait.principalid = prefs.getString("iam_principal_id").toString();
token = prefs.getString('token').toString();
bool? notificationstatus=prefs.getBool('notificationstatus');
bool? agreepolicy=prefs.getBool("agreepolicy");
Globalwait.token=token;
Globalwait.notificationstatus=notificationstatus;
Globalwait.agreeforprivacy=agreepolicy;
bool? notificationstatus = prefs.getBool('notificationstatus');
bool? agreepolicy = prefs.getBool("agreepolicy");
Globalwait.token = token;
Globalwait.notificationstatus = notificationstatus;
Globalwait.agreeforprivacy = agreepolicy;
runApp(const MyApp());
}
@@ -71,7 +71,6 @@ class _MyAppState extends State<MyApp> {
setState(() {
_connectionStatus = connectivityResult;
print("has internet");
});
} else {
setState(() {
@@ -81,6 +80,7 @@ class _MyAppState extends State<MyApp> {
});
}
}
Future<void> initConnectivity() async {
late ConnectivityResult result;
// Platform messages may fail, so we use a try/catch PlatformException.
@@ -89,7 +89,7 @@ class _MyAppState extends State<MyApp> {
print("initconnectivitity");
} on PlatformException catch (e) {
print("errrror");
print( e);
print(e);
return;
}
@@ -107,14 +107,15 @@ class _MyAppState extends State<MyApp> {
setState(() {
print("//////////////");
_connectionStatus = result;
if(_connectionStatus==ConnectivityResult.none){
if (_connectionStatus == ConnectivityResult.none) {
Get.to(NoInternet());
}else{
} else {
Get.back(result: true);
}
//_connectionStatus==ConnectivityResult.none?RouteName.nointernet:
});
}
@override
void initState() {
//checkInternet();
@@ -123,24 +124,16 @@ class _MyAppState extends State<MyApp> {
_connectivitySubscription =
_connectivity.onConnectivityChanged.listen(_updateConnectionStatus);
/* Future.delayed(Duration(seconds: 2), () async {
if (_connectionStatus == ConnectivityResult.none) {
await Get.to(NoInternet());
print("aaaaaaaaaaa");
} else {
print("rrrr");
}
});
*/ // TODO: implement initState
print("minor change for git");
super.initState();
}
@override
void dispose() {
_connectivitySubscription.cancel();
super.dispose();
}
//String? token="//";
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
print("////////////////connectionstring///////////");
@@ -153,7 +146,7 @@ class _MyAppState extends State<MyApp> {
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
initialRoute:'/',
initialRoute: '/',
/* token == "null" || token!.isEmpty || token == null
? '/'
: RouteName.entryPoint, */