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