step 22 : no_login -> login dan list riwayat pake JWT done, masih belum done di refreshToken karena check waktu expired salah
This commit is contained in:
183
lib/screen/no-login-home/no_login_card_riwayat_scan.dart
Normal file
183
lib/screen/no-login-home/no_login_card_riwayat_scan.dart
Normal file
@@ -0,0 +1,183 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:scanktpflutter/model/sex_model.dart';
|
||||
import '../../app/app_extension.dart';
|
||||
import '../../app/route.dart';
|
||||
|
||||
import '../../app/constant.dart';
|
||||
import '../../model/edit_person_model.dart';
|
||||
import '../../model/person_ktp_model.dart';
|
||||
import '../../provider/scan_provider.dart';
|
||||
|
||||
class NoLoginCardRiwayatScan extends HookConsumerWidget {
|
||||
final PersonKtp data;
|
||||
const NoLoginCardRiwayatScan({
|
||||
super.key,
|
||||
required this.data,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: [
|
||||
SystemUiOverlay.bottom,
|
||||
]);
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
FocusManager.instance.primaryFocus!.unfocus();
|
||||
},
|
||||
child: Card(
|
||||
elevation: 2,
|
||||
color: Constant.textWhite,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(
|
||||
Constant.getActualYPhone(context: context, y: 12),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
data.personNIK,
|
||||
style: Constant.titleInputan600(context: context).copyWith(
|
||||
color: Constant.textBlack,
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
// print('id : ${data.personID}');
|
||||
ref.read(selectedPersonIdx.notifier).state =
|
||||
data.personID;
|
||||
|
||||
// set SEX
|
||||
ref.read(eSexSelected.notifier).state = SexModel(
|
||||
M_SexID: data.personSex,
|
||||
M_SexCode: "",
|
||||
m_sexname: data.m_sexname,
|
||||
M_SexNameLang: ""
|
||||
);
|
||||
|
||||
ref.read(selectedEdit.notifier).state = EditPersonModel(
|
||||
personID: data.personID,
|
||||
personNIK: data.personNIK,
|
||||
personName: data.personName,
|
||||
m_sexname: data.m_sexname,
|
||||
personDob: data.personDob,
|
||||
personSex: data.personSex,
|
||||
personUrl: data.personUrl,
|
||||
);
|
||||
Navigator.of(context).pushNamed(
|
||||
editScanRoute,
|
||||
);
|
||||
},
|
||||
child: Icon(
|
||||
Icons.edit,
|
||||
color: Constant.bgButton,
|
||||
size: 20,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: Constant.getActualYPhone(
|
||||
context: context,
|
||||
y: 12,
|
||||
),
|
||||
),
|
||||
// row nama
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.person_2_outlined,
|
||||
color: Constant.bgIcon,
|
||||
size: 20,
|
||||
),
|
||||
SizedBox(
|
||||
width: Constant.getActualXPhone(
|
||||
context: context,
|
||||
x: 8,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
data.personName,
|
||||
style: Constant.cardText(context: context).copyWith(
|
||||
color: Constant.textCardGrey,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
// row nama
|
||||
SizedBox(
|
||||
height: Constant.getActualYPhone(
|
||||
context: context,
|
||||
y: 10,
|
||||
),
|
||||
),
|
||||
// row dob
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.date_range_outlined,
|
||||
color: Constant.bgIcon,
|
||||
size: 20,
|
||||
),
|
||||
SizedBox(
|
||||
width: Constant.getActualXPhone(
|
||||
context: context,
|
||||
x: 8,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
formatDateJiffy(data.personDob),
|
||||
style: Constant.cardText(context: context).copyWith(
|
||||
color: Constant.textCardGrey,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
// row dob
|
||||
SizedBox(
|
||||
height: Constant.getActualYPhone(
|
||||
context: context,
|
||||
y: 10,
|
||||
),
|
||||
),
|
||||
// row jenis kelamin
|
||||
Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
'images/icongender.png',
|
||||
width: Constant.getActualXPhone(
|
||||
context: context,
|
||||
x: 20,
|
||||
),
|
||||
height: Constant.getActualYPhone(
|
||||
context: context,
|
||||
y: 20,
|
||||
),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
SizedBox(
|
||||
width: Constant.getActualXPhone(
|
||||
context: context,
|
||||
x: 8,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
data.m_sexname,
|
||||
style: Constant.cardText(context: context).copyWith(
|
||||
color: Constant.textCardGrey,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
// row jenis kelamin
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user