diff --git a/android/app/build.gradle b/android/app/build.gradle index eed7249..92ff861 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -43,8 +43,7 @@ android { } defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.example.e_waste_bank_mobile" + applicationId "org.PBPF07.e_waste_bank_mobile" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. minSdkVersion flutter.minSdkVersion diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 8d4d8c8..8372a5b 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -14,7 +14,7 @@ { 'approved': checkboxValue .toString() }); + if (response[ + 'status']) { + // ignore: use_build_context_synchronously + ScaffoldMessenger + .of(context) + .showSnackBar( + SnackBar( + backgroundColor: + Colors.blue, + // ignore: prefer_const_constructors + content: Text( + "Request user berhasil diupdate", + style: const TextStyle( + color: Colors + .white), + ), + action: + SnackBarAction( + label: 'Close', + textColor: + Colors + .white, + onPressed: () { + ScaffoldMessenger.of( + context) + .hideCurrentSnackBar(); + }, + ), + )); + } // ignore: use_build_context_synchronously Navigator.push( context, diff --git a/keuangan/lib/widgets/admin_list_keuangan.dart b/keuangan/lib/widgets/admin_list_keuangan.dart index b5b836a..c904aef 100644 --- a/keuangan/lib/widgets/admin_list_keuangan.dart +++ b/keuangan/lib/widgets/admin_list_keuangan.dart @@ -185,6 +185,36 @@ class _AdminListKeuanganPageState extends State { 'uang_user': amount .toString() }); + if (response[ + 'status']) { + // ignore: use_build_context_synchronously + ScaffoldMessenger + .of(context) + .showSnackBar( + SnackBar( + backgroundColor: + Colors.blue, + // ignore: prefer_const_constructors + content: Text( + "Uang user berhasil ditambahkan", + style: const TextStyle( + color: Colors + .white), + ), + action: + SnackBarAction( + label: 'Close', + textColor: + Colors + .white, + onPressed: () { + ScaffoldMessenger.of( + context) + .hideCurrentSnackBar(); + }, + ), + )); + } // ignore: use_build_context_synchronously Navigator.push( context, diff --git a/keuangan/lib/widgets/user_cashouts_create.dart b/keuangan/lib/widgets/user_cashouts_create.dart index e835d6d..404a2d5 100644 --- a/keuangan/lib/widgets/user_cashouts_create.dart +++ b/keuangan/lib/widgets/user_cashouts_create.dart @@ -4,7 +4,6 @@ import 'package:keuangan/providers/user_keuanganadmin_provider.dart'; import 'package:provider/provider.dart'; import 'package:pbp_django_auth/pbp_django_auth.dart'; - class UserCreateCashoutsPage extends StatefulWidget { const UserCreateCashoutsPage({Key? key}) : super(key: key); @@ -19,7 +18,8 @@ class _UserCreateCashoutsPageState extends State { @override Widget build(BuildContext context) { - CookieRequest requester = Provider.of(context, listen: false); + CookieRequest requester = + Provider.of(context, listen: false); return Scaffold( appBar: AppBar( @@ -86,8 +86,6 @@ class _UserCreateCashoutsPageState extends State { return 'Nominal tidak boleh kosong!'; } else if (double.tryParse(value) == null) { return 'Nominal tidak valid!'; - } else if (((double.parse(value) / 0.01) % 1) != 0) { // TODO handler floating point menyebalkan - return 'Nominal hanya boleh mengandung dua angka di belakang koma!'; } return null; }, @@ -117,6 +115,7 @@ class _UserCreateCashoutsPageState extends State { const Center( child: Text( "Request penarikan berhasil!", + textAlign: TextAlign.center, style: TextStyle( fontWeight: FontWeight.bold), ), @@ -136,9 +135,7 @@ class _UserCreateCashoutsPageState extends State { ], ), ); - } - ) - ); + })); } else { showDialog( context: context, @@ -156,6 +153,7 @@ class _UserCreateCashoutsPageState extends State { Center( child: Text( "Request penarikan gagal: ${response['message']}", + textAlign: TextAlign.center, style: const TextStyle( fontWeight: FontWeight.bold), ), @@ -174,9 +172,7 @@ class _UserCreateCashoutsPageState extends State { ], ), ); - } - ) - ); + })); } } }, diff --git a/keuangan/lib/widgets/user_cashouts_detail.dart b/keuangan/lib/widgets/user_cashouts_detail.dart index 0a01a7b..f1cb444 100644 --- a/keuangan/lib/widgets/user_cashouts_detail.dart +++ b/keuangan/lib/widgets/user_cashouts_detail.dart @@ -83,7 +83,7 @@ class CashoutDetailPage extends StatelessWidget { backgroundColor: MaterialStateProperty.all(Colors.blue), ), child: const Text( - 'Back', + 'Kembali', style: TextStyle(color: Colors.white), ), ), diff --git a/keuangan/lib/widgets/user_list_cashouts.dart b/keuangan/lib/widgets/user_list_cashouts.dart index 6ffe0d9..9adc76d 100644 --- a/keuangan/lib/widgets/user_list_cashouts.dart +++ b/keuangan/lib/widgets/user_list_cashouts.dart @@ -60,6 +60,7 @@ class _UserListCashoutsPageState extends State { children: const [ Text( "Belum ada penarikan yang anda buat.", + textAlign: TextAlign.center, style: TextStyle(color: Color(0xff59A5D8), fontSize: 20), ), SizedBox(height: 8), diff --git a/lib/authentication/login_page.dart b/lib/authentication/login_page.dart index 2d6d7c2..6863cbb 100644 --- a/lib/authentication/login_page.dart +++ b/lib/authentication/login_page.dart @@ -121,14 +121,12 @@ class _LoginPageState extends State { TextButton( onPressed: () async { if (_loginPageFormKey.currentState!.validate()) { - // TODO CircularProgessIndicator final response = await requester.login( "https://e-waste-bank.up.railway.app/auth/login/", { 'username': username, 'password': password, }); - // TODO text formatting di dialog berhasil dan gagal if (requester.loggedIn) { userProvider.login(username, response['role']); userKeuanganAdminProvider.login( @@ -154,6 +152,7 @@ class _LoginPageState extends State { const Center( child: Text( "Login berhasil!", + textAlign: TextAlign.center, style: TextStyle( fontWeight: FontWeight.bold), ), @@ -195,6 +194,7 @@ class _LoginPageState extends State { Center( child: Text( "Login gagal! ${response['message']}", + textAlign: TextAlign.center, style: const TextStyle( fontWeight: FontWeight.bold), ), diff --git a/lib/drawer.dart b/lib/drawer.dart index b19fe34..a9a6fc3 100644 --- a/lib/drawer.dart +++ b/lib/drawer.dart @@ -59,7 +59,7 @@ class _MyDrawerState extends State { Visibility( visible: userProvider.isAuthenticated(), child: ListTile( - title: const Text('penjemputan'), + title: const Text('Penjemputan'), onTap: () { Navigator.pushReplacement( context, diff --git a/pubspec.yaml b/pubspec.yaml index bbe4612..9568a76 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 2.0.0+1 +version: 2.0.1+1 environment: sdk: '>=2.18.4 <3.0.0'