diff --git a/rumahSehat_jwt/bin/main/apap/tk/rumahSehat_jwt/model/TagihanModel.class b/rumahSehat_jwt/bin/main/apap/tk/rumahSehat_jwt/model/TagihanModel.class index 1999aff52d8dd58f691509634fc44d94cba827c3..3dbb6d53182f21732f74865eb20b42272cd72930 100644 Binary files a/rumahSehat_jwt/bin/main/apap/tk/rumahSehat_jwt/model/TagihanModel.class and b/rumahSehat_jwt/bin/main/apap/tk/rumahSehat_jwt/model/TagihanModel.class differ diff --git a/rumahSehat_jwt/bin/main/apap/tk/rumahSehat_jwt/repository/AppointmentDb.class b/rumahSehat_jwt/bin/main/apap/tk/rumahSehat_jwt/repository/AppointmentDb.class index 45b0d88791532f351f560e10f45de977fb063da9..b5f4b2f3124773f783d0db14bd6125acc2ea1817 100644 Binary files a/rumahSehat_jwt/bin/main/apap/tk/rumahSehat_jwt/repository/AppointmentDb.class and b/rumahSehat_jwt/bin/main/apap/tk/rumahSehat_jwt/repository/AppointmentDb.class differ diff --git a/rumahSehat_jwt/bin/main/apap/tk/rumahSehat_jwt/repository/PasienDb.class b/rumahSehat_jwt/bin/main/apap/tk/rumahSehat_jwt/repository/PasienDb.class index 38bca5e073e9261d4a34a9ba945f00447eda6936..0d359d4c16006750fe109b17053583e0d96250de 100644 Binary files a/rumahSehat_jwt/bin/main/apap/tk/rumahSehat_jwt/repository/PasienDb.class and b/rumahSehat_jwt/bin/main/apap/tk/rumahSehat_jwt/repository/PasienDb.class differ diff --git a/rumahSehat_jwt/bin/main/apap/tk/rumahSehat_jwt/restController/AppointmentRestController.class b/rumahSehat_jwt/bin/main/apap/tk/rumahSehat_jwt/restController/AppointmentRestController.class index 09a497436804ae13ed42a1688a59f10d1d0444d7..9a4657646d99d34df42bac21e51a6f09ea732105 100644 Binary files a/rumahSehat_jwt/bin/main/apap/tk/rumahSehat_jwt/restController/AppointmentRestController.class and b/rumahSehat_jwt/bin/main/apap/tk/rumahSehat_jwt/restController/AppointmentRestController.class differ diff --git a/rumahSehat_jwt/bin/main/apap/tk/rumahSehat_jwt/service/AppointmentServiceImpl.class b/rumahSehat_jwt/bin/main/apap/tk/rumahSehat_jwt/service/AppointmentServiceImpl.class index 86ae347b4aa3a5269ee419c2ec05fb224af4c808..86cb48e5ec349e6e466a1f1086e936028bb9f866 100644 Binary files a/rumahSehat_jwt/bin/main/apap/tk/rumahSehat_jwt/service/AppointmentServiceImpl.class and b/rumahSehat_jwt/bin/main/apap/tk/rumahSehat_jwt/service/AppointmentServiceImpl.class differ diff --git a/rumahSehat_jwt/bin/main/apap/tk/rumahSehat_jwt/service/PasienServiceImpl.class b/rumahSehat_jwt/bin/main/apap/tk/rumahSehat_jwt/service/PasienServiceImpl.class index 8f7af0fadf489244f30461446d75ce6ef6abf0cc..457459ea33a11aa72f3ef39974ab48aa91eb3cd4 100644 Binary files a/rumahSehat_jwt/bin/main/apap/tk/rumahSehat_jwt/service/PasienServiceImpl.class and b/rumahSehat_jwt/bin/main/apap/tk/rumahSehat_jwt/service/PasienServiceImpl.class differ diff --git a/rumahSehat_mobile/android/local.properties b/rumahSehat_mobile/android/local.properties index 264303e9b0b90fcf945505a2cc66626634d432ca..7d34589db00d1c050b957104ef35aecf4fd31eba 100644 --- a/rumahSehat_mobile/android/local.properties +++ b/rumahSehat_mobile/android/local.properties @@ -1,6 +1,6 @@ -sdk.dir=/Users/davidjohan/Library/Android/sdk +sdk.dir=C:\\Users\\Fayza Hanifah\\AppData\\Local\\Android\\sdk ======= -flutter.sdk=/Users/davidjohan/Developer/flutter +flutter.sdk=C:\\src\\flutter flutter.buildMode=debug flutter.versionName=1.0.0 flutter.versionCode=1 \ No newline at end of file diff --git a/rumahSehat_mobile/lib/url_settings.dart b/rumahSehat_mobile/lib/url_settings.dart index 072ec70e7c51ac411dd412f5262c7d7659fd4472..346d367e75e7d092a72cb28d94360e86e745b2db 100644 --- a/rumahSehat_mobile/lib/url_settings.dart +++ b/rumahSehat_mobile/lib/url_settings.dart @@ -1,4 +1,4 @@ -const String base_url = "http://172.20.10.7:8081/api"; +const String base_url = "http://localhost:8081/api"; const String appointment_url = base_url + "/appointment"; const String add_appointment_url = appointment_url + "/add"; const String doctor_url = base_url + "/dokter"; diff --git a/rumahSehat_mobile/lib/user_page/view_user_profile.dart b/rumahSehat_mobile/lib/user_page/view_user_profile.dart index b34a7df80f6055a7b3b4b7fb69edf669280cda86..8fd1f021462f164a67af39fd3725bbeb1f687d68 100644 --- a/rumahSehat_mobile/lib/user_page/view_user_profile.dart +++ b/rumahSehat_mobile/lib/user_page/view_user_profile.dart @@ -3,10 +3,46 @@ import 'package:sizer/sizer.dart'; import 'package:rumahsehat_mobile/fragments.dart'; import 'package:rumahsehat_mobile/home_page/home.dart'; import 'package:rumahsehat_mobile/user_page/top_up_saldo.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:rumahsehat_mobile/login.dart'; -class UserProfileScreen extends StatelessWidget { - const UserProfileScreen({Key? key}) : super(key: key); +class UserProfileScreen extends StatefulWidget { static String routeName = "UserProfileScreen"; + const UserProfileScreen({Key? key}) : super(key: key); + @override + UserProfileScreenState createState() => UserProfileScreenState(); +} + + class UserProfileScreenState extends State<UserProfileScreen> + { + + final Future<SharedPreferences> _prefs = SharedPreferences.getInstance(); + late Future<String> _email; + late Future<String> _username; + late Future<String> _jwtToken; + + @override + void initState() { + super.initState(); + _email = _prefs.then((SharedPreferences prefs) { + return prefs.getString('email') ?? ''; + }); + _username = _prefs.then((SharedPreferences prefs) { + return prefs.getString('username') ?? ''; + }); + _jwtToken = _prefs.then((SharedPreferences prefs) { + return prefs.getString('jwtToken') ?? ''; + }); + } + + Future<void> _logout() async { + final SharedPreferences prefs = await _prefs; + setState(() { + prefs.remove('email'); + prefs.remove('username'); + prefs.remove('jwtToken'); + }); + } @override Widget build(BuildContext context) { @@ -92,7 +128,33 @@ class UserProfileScreen extends StatelessWidget { ), ), ), + ), + Container( + margin: const EdgeInsets.only(top: 15.0), + child: OutlinedButton( + style: OutlinedButton.styleFrom( + side: BorderSide(color: Colors.green, width: 1), //<-- SEE HERE + ), + onPressed: () { + _logout(); + Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute( + builder: (context) => + LoginForm()), + ModalRoute.withName("/login")); + } + + , + child: Text( + "Logout", + style: TextStyle( + color: Colors.green, + ), + ), + ), ) + ], ), ), @@ -100,6 +162,7 @@ class UserProfileScreen extends StatelessWidget { } } + class ProfileDetailColumn extends StatelessWidget { const ProfileDetailColumn( {Key? key, required this.title, required this.value}) @@ -140,4 +203,13 @@ class ProfileDetailColumn extends StatelessWidget { ), ); } -} \ No newline at end of file + + + } + + + + + + +