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/'
api_url = 'http://192.168.20.131:3000/'
url = 'http://192.168.20.45: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/
.dart_tool
.idea
/linux/
/macos/
/web/
/windows/
# IntelliJ related
*.iml
@ -48,3 +45,9 @@ app.*.map.json
/android/app/debug
/android/app/profile
/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">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:label="rfid_app"
android:name="${applicationName}"

View File

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

View File

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

View File

@ -33,7 +33,9 @@ class PulsaDetailView extends StatelessWidget {
),
borderRadius: BorderRadius.circular(10),
),
child: Column(
child: model.detailPenyewaModel == null
? const Center(child: CircularProgressIndicator())
: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
@ -62,7 +64,7 @@ class PulsaDetailView extends StatelessWidget {
),
),
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 {
logHistorySewaanList = [];
try {
var response = await httpService.get('scan/log');
MyResponseModel myResponseModel = MyResponseModel.fromJson(response.data);

View File

@ -37,6 +37,7 @@ class EditPenyewaDialogView extends StatelessWidget {
borderRadius: BorderRadius.circular(10),
color: backgroundColor,
),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
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 {
log.i('data : $data');
var res = await dialogService.showCustomDialog(
variant: DialogType.scanRfidDialogView,
title: 'Pembayaran Retribusi',

View File

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

View File

@ -37,7 +37,7 @@ class SplashScreenView extends StatelessWidget {
),
const SizedBox(height: 10),
Text(
"Sistem Retribusi Pasar Enrekang",
"Sistem Retribusi Pasar Lakessi",
style: boldTextStyle.copyWith(
fontSize: 20,
),
@ -47,7 +47,7 @@ class SplashScreenView extends StatelessWidget {
),
),
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,
style: regularTextStyle,
),