first commit

This commit is contained in:
kicap 2024-04-05 01:16:29 +08:00
parent 09c19f74d0
commit 001676348e
11 changed files with 159 additions and 140 deletions

6
.env
View File

@ -1,2 +1,4 @@
url = 'http://192.168.20.131:3000/' url = 'http://192.168.20.45:3000/'
api_url = 'http://192.168.20.131:3000/' api_url = 'http://192.168.20.45:3000/'
# url = 'http://rfid-server1.kicap-karan.com/'
# api_url = 'http://rfid-server1.kicap-karan.com/'

11
.gitignore vendored
View File

@ -11,10 +11,7 @@
migrate_working_dir/ migrate_working_dir/
.dart_tool .dart_tool
.idea .idea
/linux/
/macos/
/web/
/windows/
# IntelliJ related # IntelliJ related
*.iml *.iml
@ -48,3 +45,9 @@ app.*.map.json
/android/app/debug /android/app/debug
/android/app/profile /android/app/profile
/android/app/release /android/app/release
#others os
linux*
macos*
web*
windows*

View File

@ -1,4 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> <manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>
<application <application
android:label="rfid_app" android:label="rfid_app"
android:name="${applicationName}" android:name="${applicationName}"

View File

@ -29,13 +29,14 @@ class LoginScreenViewModel extends CustomBaseViewModel {
navigationService.navigateTo(Routes.retributorIndexView); navigationService.navigateTo(Routes.retributorIndexView);
return; return;
} }
easyLoading.customLoading('Login...');
try { try {
var formData = var formData =
FormData.fromMap({'username': username, 'password': password}); FormData.fromMap({'username': username, 'password': password});
var response = await httpService.postWithFormData('login', formData); var response = await httpService.postWithFormData('login', formData);
MyResponseModel myResponseModel = MyResponseModel.fromJson(response.data); MyResponseModel myResponseModel = MyResponseModel.fromJson(response.data);
// log.i(myResponseModel.status); // log.i(myResponseModel);
if (myResponseModel.status == true) { if (myResponseModel.status == true) {
// mySharedPrefs.clear(); // mySharedPrefs.clear();
// log.i('pindah'); // log.i('pindah');
@ -56,6 +57,8 @@ class LoginScreenViewModel extends CustomBaseViewModel {
} catch (e) { } catch (e) {
log.e(e); log.e(e);
// snackbarService.showSnackbar(message: 'Error: $e'); // snackbarService.showSnackbar(message: 'Error: $e');
} finally {
easyLoading.dismiss();
} }
} }
} }

View File

@ -43,6 +43,8 @@ class PenyewaLogView extends StatelessWidget {
), ),
child: model.logHistorySewaanList == null child: model.logHistorySewaanList == null
? const Center(child: CircularProgressIndicator()) ? const Center(child: CircularProgressIndicator())
: model.logHistorySewaanList!.isEmpty
? const Center(child: Text('Belum ada log'))
: ListView.builder( : ListView.builder(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 15, vertical: 10), horizontal: 15, vertical: 10),
@ -60,9 +62,10 @@ class PenyewaLogView extends StatelessWidget {
child: Card( child: Card(
child: ListTile( child: ListTile(
title: Text( title: Text(
model.logHistorySewaanList![index].jenis!, model.logHistorySewaanList![index]
style: .jenis!,
boldTextStyle.copyWith(fontSize: 15), style: boldTextStyle.copyWith(
fontSize: 15),
), ),
subtitle: const Column( subtitle: const Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
@ -82,8 +85,9 @@ class PenyewaLogView extends StatelessWidget {
), ),
// dummy date and time // dummy date and time
trailing: Text( trailing: Text(
model.otherFunction.formatDateString(model model.otherFunction.formatDateString(
.logHistorySewaanList![index].date!), model.logHistorySewaanList![index]
.date!),
style: regularTextStyle, style: regularTextStyle,
), ),
), ),

View File

@ -33,7 +33,9 @@ class PulsaDetailView extends StatelessWidget {
), ),
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
), ),
child: Column( child: model.detailPenyewaModel == null
? const Center(child: CircularProgressIndicator())
: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -62,7 +64,7 @@ class PulsaDetailView extends StatelessWidget {
), ),
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
MyButton(text: 'Ganti Password') const MyButton(text: 'Ganti Password')
], ],
), ),
); );

View File

@ -14,6 +14,7 @@ class LogHistorySewaanViewModel extends CustomBaseViewModel {
} }
getData() async { getData() async {
logHistorySewaanList = [];
try { try {
var response = await httpService.get('scan/log'); var response = await httpService.get('scan/log');
MyResponseModel myResponseModel = MyResponseModel.fromJson(response.data); MyResponseModel myResponseModel = MyResponseModel.fromJson(response.data);

View File

@ -37,6 +37,7 @@ class EditPenyewaDialogView extends StatelessWidget {
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
color: backgroundColor, color: backgroundColor,
), ),
child: SingleChildScrollView(
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -97,6 +98,7 @@ class EditPenyewaDialogView extends StatelessWidget {
], ],
), ),
), ),
),
); );
}, },
); );

View File

@ -59,6 +59,7 @@ class RetributorIndexViewModel extends IndexTrackingViewModel {
} }
socketIoClient.on('scan', (data) async { socketIoClient.on('scan', (data) async {
log.i('data : $data');
var res = await dialogService.showCustomDialog( var res = await dialogService.showCustomDialog(
variant: DialogType.scanRfidDialogView, variant: DialogType.scanRfidDialogView,
title: 'Pembayaran Retribusi', title: 'Pembayaran Retribusi',

View File

@ -16,7 +16,7 @@ class ScanRfidDialogViewModel extends CustomBaseViewModel {
Future<void> init(data) async { Future<void> init(data) async {
log.d('init'); log.d('init');
log.d(data);
getData(data); getData(data);
} }

View File

@ -37,7 +37,7 @@ class SplashScreenView extends StatelessWidget {
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
Text( Text(
"Sistem Retribusi Pasar Enrekang", "Sistem Retribusi Pasar Lakessi",
style: boldTextStyle.copyWith( style: boldTextStyle.copyWith(
fontSize: 20, fontSize: 20,
), ),
@ -47,7 +47,7 @@ class SplashScreenView extends StatelessWidget {
), ),
), ),
const Text( const Text(
"Jln Panti Asuhan No. 3 Ujung Lare, Kec. Soreang, Kota Parepare, Sulawesi Selatan 91133", "Pasar Lakessi, Kota Parepare, Sulawesi Selatan 91133",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: regularTextStyle, style: regularTextStyle,
), ),