Merge pull request 'minor change' (#1) from development into main
Reviewed-on: http://192.168.50.12:3000/kishan.bhuta/Cheers_to_season_customer/pulls/1
This commit is contained in:
@@ -44,11 +44,11 @@ void main() async {
|
|||||||
prefs.setString('token',token.toString()); */
|
prefs.setString('token',token.toString()); */
|
||||||
Globalwait.principalid = prefs.getString("iam_principal_id").toString();
|
Globalwait.principalid = prefs.getString("iam_principal_id").toString();
|
||||||
token = prefs.getString('token').toString();
|
token = prefs.getString('token').toString();
|
||||||
bool? notificationstatus=prefs.getBool('notificationstatus');
|
bool? notificationstatus = prefs.getBool('notificationstatus');
|
||||||
bool? agreepolicy=prefs.getBool("agreepolicy");
|
bool? agreepolicy = prefs.getBool("agreepolicy");
|
||||||
Globalwait.token=token;
|
Globalwait.token = token;
|
||||||
Globalwait.notificationstatus=notificationstatus;
|
Globalwait.notificationstatus = notificationstatus;
|
||||||
Globalwait.agreeforprivacy=agreepolicy;
|
Globalwait.agreeforprivacy = agreepolicy;
|
||||||
runApp(const MyApp());
|
runApp(const MyApp());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,8 +60,8 @@ class MyApp extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _MyAppState extends State<MyApp> {
|
class _MyAppState extends State<MyApp> {
|
||||||
ConnectivityResult _connectionStatus = ConnectivityResult.none;
|
ConnectivityResult _connectionStatus = ConnectivityResult.none;
|
||||||
final Connectivity _connectivity = Connectivity();
|
final Connectivity _connectivity = Connectivity();
|
||||||
late StreamSubscription<ConnectivityResult> _connectivitySubscription;
|
late StreamSubscription<ConnectivityResult> _connectivitySubscription;
|
||||||
Future<void> checkInternet() async {
|
Future<void> checkInternet() async {
|
||||||
final connectivityResult = await (Connectivity().checkConnectivity());
|
final connectivityResult = await (Connectivity().checkConnectivity());
|
||||||
@@ -70,26 +70,26 @@ class _MyAppState extends State<MyApp> {
|
|||||||
connectivityResult == ConnectivityResult.mobile) {
|
connectivityResult == ConnectivityResult.mobile) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_connectionStatus = connectivityResult;
|
_connectionStatus = connectivityResult;
|
||||||
print("has internet");
|
print("has internet");
|
||||||
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
setState(() {
|
setState(() {
|
||||||
_connectionStatus = connectivityResult;
|
_connectionStatus = connectivityResult;
|
||||||
print("no internet");
|
print("no internet");
|
||||||
// Navigator.pushReplacementNamed(context, "/noInternet");
|
// Navigator.pushReplacementNamed(context, "/noInternet");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Future<void> initConnectivity() async {
|
|
||||||
|
Future<void> initConnectivity() async {
|
||||||
late ConnectivityResult result;
|
late ConnectivityResult result;
|
||||||
// Platform messages may fail, so we use a try/catch PlatformException.
|
// Platform messages may fail, so we use a try/catch PlatformException.
|
||||||
try {
|
try {
|
||||||
result = await _connectivity.checkConnectivity();
|
result = await _connectivity.checkConnectivity();
|
||||||
print("initconnectivitity");
|
print("initconnectivitity");
|
||||||
} on PlatformException catch (e) {
|
} on PlatformException catch (e) {
|
||||||
print("errrror");
|
print("errrror");
|
||||||
print( e);
|
print(e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,40 +107,33 @@ class _MyAppState extends State<MyApp> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
print("//////////////");
|
print("//////////////");
|
||||||
_connectionStatus = result;
|
_connectionStatus = result;
|
||||||
if(_connectionStatus==ConnectivityResult.none){
|
if (_connectionStatus == ConnectivityResult.none) {
|
||||||
Get.to(NoInternet());
|
Get.to(NoInternet());
|
||||||
}else{
|
} else {
|
||||||
Get.back(result: true);
|
Get.back(result: true);
|
||||||
}
|
}
|
||||||
//_connectionStatus==ConnectivityResult.none?RouteName.nointernet:
|
//_connectionStatus==ConnectivityResult.none?RouteName.nointernet:
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
//checkInternet();
|
//checkInternet();
|
||||||
// print(_connectionStatus.toString());
|
// print(_connectionStatus.toString());
|
||||||
initConnectivity();
|
initConnectivity();
|
||||||
|
|
||||||
_connectivitySubscription =
|
_connectivitySubscription =
|
||||||
_connectivity.onConnectivityChanged.listen(_updateConnectionStatus);
|
_connectivity.onConnectivityChanged.listen(_updateConnectionStatus);
|
||||||
/* Future.delayed(Duration(seconds: 2), () async {
|
print("minor change for git");
|
||||||
if (_connectionStatus == ConnectivityResult.none) {
|
|
||||||
await Get.to(NoInternet());
|
|
||||||
print("aaaaaaaaaaa");
|
|
||||||
} else {
|
|
||||||
print("rrrr");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
*/ // TODO: implement initState
|
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
@override
|
|
||||||
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_connectivitySubscription.cancel();
|
_connectivitySubscription.cancel();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
//String? token="//";
|
|
||||||
// This widget is the root of your application.
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
print("////////////////connectionstring///////////");
|
print("////////////////connectionstring///////////");
|
||||||
@@ -153,13 +146,13 @@ class _MyAppState extends State<MyApp> {
|
|||||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
|
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
|
||||||
useMaterial3: true,
|
useMaterial3: true,
|
||||||
),
|
),
|
||||||
initialRoute:'/',
|
initialRoute: '/',
|
||||||
/* token == "null" || token!.isEmpty || token == null
|
/* token == "null" || token!.isEmpty || token == null
|
||||||
? '/'
|
? '/'
|
||||||
: RouteName.entryPoint, */
|
: RouteName.entryPoint, */
|
||||||
getPages: AppRoutes.appRoutes(),
|
getPages: AppRoutes.appRoutes(),
|
||||||
),
|
),
|
||||||
designSize: const Size(390, 844),
|
designSize: const Size(390, 844),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user