fix error screen
parent
8dc0529646
commit
b1ea70b9ab
|
@ -5,8 +5,8 @@ import 'package:unit2/utils/global_context.dart';
|
|||
import '../../../../theme-data.dart/colors.dart';
|
||||
import '../../../../utils/global.dart';
|
||||
|
||||
Widget getTile(
|
||||
IconData icondata, String title, String route, BuildContext context,UserData userData) {
|
||||
Widget getTile(IconData icondata, String title, String route,
|
||||
BuildContext context, UserData userData) {
|
||||
return ListTile(
|
||||
dense: true,
|
||||
leading: Icon(
|
||||
|
@ -19,25 +19,31 @@ Widget getTile(
|
|||
),
|
||||
onTap: () async {
|
||||
if (title.toLowerCase() == "logout") {
|
||||
confirmAlert(context, () async{
|
||||
confirmAlert(context, () async {
|
||||
await CREDENTIALS!.clear();
|
||||
await CREDENTIALS!.deleteAll(['username','password','saved']);
|
||||
Navigator.pushReplacementNamed (NavigationService.navigatorKey.currentContext!,"/");
|
||||
},"Logout","Are You sure you want to logout?");
|
||||
}if(title.toLowerCase() == 'profile'){
|
||||
ProfileArguments profileArguments = ProfileArguments(token: userData.user!.login!.token!, userID:userData.user!.login!.user!.profileId!);
|
||||
Navigator.pushNamed(context, route,arguments: profileArguments);
|
||||
}if(title.toLowerCase() == 'basic info'){
|
||||
Navigator.pushNamed(context, '/basic-info');
|
||||
}if(title.toLowerCase() == 'request sos'){
|
||||
Navigator.pushNamed(context, '/sos');
|
||||
await OFFLINE!.clear();
|
||||
await CREDENTIALS!.deleteAll(['username', 'password', 'saved']);
|
||||
Navigator.pushReplacementNamed(
|
||||
NavigationService.navigatorKey.currentContext!, "/");
|
||||
}, "Logout", "Are You sure you want to logout?");
|
||||
}
|
||||
if (title.toLowerCase() == 'profile') {
|
||||
ProfileArguments profileArguments = ProfileArguments(
|
||||
token: userData.user!.login!.token!,
|
||||
userID: userData.user!.login!.user!.profileId!);
|
||||
Navigator.pushNamed(context, route, arguments: profileArguments);
|
||||
}
|
||||
if (title.toLowerCase() == 'basic info') {
|
||||
Navigator.pushNamed(context, '/basic-info');
|
||||
}
|
||||
if (title.toLowerCase() == 'request sos') {
|
||||
Navigator.pushNamed(context, '/sos');
|
||||
}
|
||||
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
class ProfileArguments{
|
||||
class ProfileArguments {
|
||||
final int userID;
|
||||
final String token;
|
||||
const ProfileArguments({required this.token, required this.userID});
|
||||
|
|
|
@ -5,8 +5,8 @@ class Url {
|
|||
|
||||
String host() {
|
||||
// return '192.168.10.183:3000';
|
||||
// return 'agusandelnorte.gov.ph';
|
||||
return "192.168.10.219:3000";
|
||||
return 'agusandelnorte.gov.ph';
|
||||
// return "192.168.10.219:3000";
|
||||
// return "192.168.10.241";
|
||||
// return "192.168.10.221:3004";
|
||||
// return "playweb.agusandelnorte.gov.ph";
|
||||
|
|
Loading…
Reference in New Issue