Compare commits
No commits in common. "fdca27233b86c3162abb29dd0e56cc831e90ae0f" and "466d49312da846cf19ca5e5672e4958e9bc20033" have entirely different histories.
fdca27233b
...
466d49312d
|
@ -1,144 +0,0 @@
|
||||||
import 'package:calendar_date_picker2/calendar_date_picker2.dart';
|
|
||||||
import 'package:cims_apps/application/component/button/button_view.dart';
|
|
||||||
import 'package:cims_apps/application/component/text_form/text_form_view.dart';
|
|
||||||
import 'package:cims_apps/application/theme/color_palette.dart';
|
|
||||||
import 'package:cims_apps/core/utils/size_config.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:intl/intl.dart';
|
|
||||||
|
|
||||||
class DatePickerView extends StatelessWidget {
|
|
||||||
final String name;
|
|
||||||
final TextEditingController ctrl;
|
|
||||||
final DateTime? minDate, maxDate;
|
|
||||||
final String? hintText, buttonName;
|
|
||||||
final bool isMultipleSelection, enabled;
|
|
||||||
final List<DateTime>? initialValue;
|
|
||||||
final ValueChanged<OnChangedDatePickerModel>? onChanged;
|
|
||||||
final ValueChanged<List<DateTime?>>? onFinish;
|
|
||||||
final FormFieldValidator<String>? validatorDate;
|
|
||||||
const DatePickerView(
|
|
||||||
{Key? key,
|
|
||||||
required this.name,
|
|
||||||
required this.ctrl,
|
|
||||||
this.minDate,
|
|
||||||
this.maxDate,
|
|
||||||
this.hintText,
|
|
||||||
this.buttonName,
|
|
||||||
required this.isMultipleSelection,
|
|
||||||
required this.enabled,
|
|
||||||
this.initialValue,
|
|
||||||
this.onChanged,
|
|
||||||
this.onFinish,
|
|
||||||
this.validatorDate})
|
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
String _dateFormat(DateTime? dateTime) =>
|
|
||||||
dateTime != null ? DateFormat('dd/MM/yyyy').format(dateTime) : "";
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
List<DateTime?> initData = initialValue ?? [];
|
|
||||||
List<DateTime?> dateList = [];
|
|
||||||
|
|
||||||
String dateLabel() {
|
|
||||||
return dateList.map((e) => _dateFormat(e)).join(" - ");
|
|
||||||
}
|
|
||||||
|
|
||||||
onChangedDatePicker(List<DateTime?> value) {
|
|
||||||
if (isMultipleSelection) {
|
|
||||||
final pickerDateRange = PickerDateRange(
|
|
||||||
startDate: value[0] ?? DateTime.now(),
|
|
||||||
endDate:
|
|
||||||
value.length > 1 ? value[1] ?? DateTime.now() : DateTime.now(),
|
|
||||||
);
|
|
||||||
onChanged
|
|
||||||
?.call(OnChangedDatePickerModel(pickerDateRange: pickerDateRange));
|
|
||||||
} else {
|
|
||||||
onChanged?.call(OnChangedDatePickerModel(dateTime: value[0]));
|
|
||||||
}
|
|
||||||
dateList = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
dialogDatePicker() {
|
|
||||||
showModalBottomSheet(
|
|
||||||
context: context,
|
|
||||||
isScrollControlled: true,
|
|
||||||
builder: (BuildContext context) {
|
|
||||||
return Container(
|
|
||||||
padding: const EdgeInsets.only(top: 16.0),
|
|
||||||
height: SizeConfig.height * .65,
|
|
||||||
child: Column(
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
CalendarDatePicker2(
|
|
||||||
value: [...initData],
|
|
||||||
config: CalendarDatePicker2Config(
|
|
||||||
centerAlignModePicker: true,
|
|
||||||
calendarType: isMultipleSelection
|
|
||||||
? CalendarDatePicker2Type.range
|
|
||||||
: CalendarDatePicker2Type.single,
|
|
||||||
customModePickerIcon: const SizedBox(),
|
|
||||||
firstDate: minDate ?? DateTime(1900),
|
|
||||||
lastDate: maxDate,
|
|
||||||
),
|
|
||||||
// initialValue: [...initData],
|
|
||||||
onValueChanged: (value) {
|
|
||||||
onChangedDatePicker(value);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
||||||
child: ButtonView(
|
|
||||||
width: SizeConfig.width,
|
|
||||||
onPressed: () {
|
|
||||||
if (dateList.isNotEmpty) {
|
|
||||||
onFinish?.call(dateList);
|
|
||||||
ctrl.text = dateLabel();
|
|
||||||
initData = dateList;
|
|
||||||
}
|
|
||||||
Navigator.pop(context);
|
|
||||||
},
|
|
||||||
name: 'OK',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return TextFormView(
|
|
||||||
name: name,
|
|
||||||
hintText: hintText,
|
|
||||||
readOnly: true,
|
|
||||||
ctrl: ctrl,
|
|
||||||
validator: validatorDate,
|
|
||||||
enabled: enabled,
|
|
||||||
onTap: () {
|
|
||||||
if (enabled) dialogDatePicker();
|
|
||||||
},
|
|
||||||
suffixIcon: const UnconstrainedBox(
|
|
||||||
child: Icon(
|
|
||||||
Icons.calendar_today_rounded,
|
|
||||||
color: ColorPalette.slate400,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class OnChangedDatePickerModel {
|
|
||||||
final DateTime? dateTime;
|
|
||||||
final PickerDateRange? pickerDateRange;
|
|
||||||
|
|
||||||
OnChangedDatePickerModel({this.dateTime, this.pickerDateRange});
|
|
||||||
}
|
|
||||||
|
|
||||||
class PickerDateRange {
|
|
||||||
final DateTime startDate;
|
|
||||||
final DateTime endDate;
|
|
||||||
|
|
||||||
PickerDateRange({required this.startDate, required this.endDate});
|
|
||||||
}
|
|
|
@ -24,13 +24,13 @@ class SubmissionParent extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _SubmissionParentState extends State<SubmissionParent> {
|
class _SubmissionParentState extends State<SubmissionParent> {
|
||||||
Widget _stepItem({bool isCurrentStep = false}) {
|
Widget _stepItem({bool isCurrentStep = false, bool isDone = false}) {
|
||||||
return Container(
|
return Container(
|
||||||
margin: const EdgeInsets.only(right: 0.0, left: 4.0),
|
margin: const EdgeInsets.only(right: 0.0, left: 4.0),
|
||||||
height: 6,
|
height: 6,
|
||||||
width: SizeConfig.width * .08,
|
width: SizeConfig.width * .08,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: isCurrentStep
|
color: isCurrentStep || isDone
|
||||||
? ColorPalette.primary
|
? ColorPalette.primary
|
||||||
: ColorPalette.greyBorderNeutrals,
|
: ColorPalette.greyBorderNeutrals,
|
||||||
borderRadius: BorderRadius.circular(50),
|
borderRadius: BorderRadius.circular(50),
|
||||||
|
@ -91,10 +91,15 @@ class _SubmissionParentState extends State<SubmissionParent> {
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children:
|
children:
|
||||||
List.generate(provider.stepAmount, (index) {
|
List.generate(provider.stepAmount, (index) {
|
||||||
|
// print('indd $index');
|
||||||
|
// print(
|
||||||
|
// 'getCurrentStep ${provider.getCurrentStep}');
|
||||||
return _stepItem(
|
return _stepItem(
|
||||||
isCurrentStep:
|
isCurrentStep: provider.getCurrentStep ==
|
||||||
provider.getCurrentStep == index + 1 ||
|
index + 1 ||
|
||||||
provider.getCurrentStep - 1 > index,
|
provider.getCurrentStep - 1 == index + 1,
|
||||||
|
// isDone:
|
||||||
|
// index + 1 != provider.getCurrentStep + 1,
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
|
|
|
@ -2,7 +2,6 @@ import 'dart:io';
|
||||||
|
|
||||||
import 'package:cims_apps/application/assets/path_assets.dart';
|
import 'package:cims_apps/application/assets/path_assets.dart';
|
||||||
import 'package:cims_apps/application/component/button/button_view.dart';
|
import 'package:cims_apps/application/component/button/button_view.dart';
|
||||||
import 'package:cims_apps/application/component/date_picker/date_picker_view.dart';
|
|
||||||
import 'package:cims_apps/application/component/image/image_view.dart';
|
import 'package:cims_apps/application/component/image/image_view.dart';
|
||||||
import 'package:cims_apps/application/component/text_caption/text_caption.dart';
|
import 'package:cims_apps/application/component/text_caption/text_caption.dart';
|
||||||
import 'package:cims_apps/application/component/text_form/text_form_view.dart';
|
import 'package:cims_apps/application/component/text_form/text_form_view.dart';
|
||||||
|
@ -175,11 +174,13 @@ class SubmitDataIdCard extends StatelessWidget {
|
||||||
title: 'Check your ID card data for accuracy'),
|
title: 'Check your ID card data for accuracy'),
|
||||||
TextFormView(name: 'NIK'),
|
TextFormView(name: 'NIK'),
|
||||||
TextFormView(name: 'Full Name'),
|
TextFormView(name: 'Full Name'),
|
||||||
DatePickerView(
|
TextFormView(
|
||||||
name: 'Birth Date',
|
name: 'Birth Date',
|
||||||
ctrl: provider.ctrlBirthDate,
|
suffixIcon: const Icon(
|
||||||
isMultipleSelection: false,
|
Icons.calendar_today_rounded,
|
||||||
enabled: true),
|
color: ColorPalette.slate400,
|
||||||
|
),
|
||||||
|
),
|
||||||
photoDocument(provider),
|
photoDocument(provider),
|
||||||
Container(
|
Container(
|
||||||
width: SizeConfig.width,
|
width: SizeConfig.width,
|
||||||
|
|
|
@ -5,7 +5,6 @@ import 'package:cims_apps/application/component/text_caption/text_caption.dart';
|
||||||
import 'package:cims_apps/application/component/text_form/text_form_view.dart';
|
import 'package:cims_apps/application/component/text_form/text_form_view.dart';
|
||||||
import 'package:cims_apps/core/route/route.dart';
|
import 'package:cims_apps/core/route/route.dart';
|
||||||
import 'package:cims_apps/core/utils/size_config.dart';
|
import 'package:cims_apps/core/utils/size_config.dart';
|
||||||
import 'package:cims_apps/core/utils/string_utils.dart';
|
|
||||||
import 'package:cims_apps/features/auth/registration/view/submission_data/submission_parent.dart';
|
import 'package:cims_apps/features/auth/registration/view/submission_data/submission_parent.dart';
|
||||||
import 'package:cims_apps/features/auth/registration/viewmodel/submission_data_viewmodel.dart';
|
import 'package:cims_apps/features/auth/registration/viewmodel/submission_data_viewmodel.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
|
@ -33,7 +32,10 @@ class SubmitEmail extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
recognizer: TapGestureRecognizer()..onTap = () {},
|
recognizer: TapGestureRecognizer()
|
||||||
|
..onTap = () {
|
||||||
|
print('object');
|
||||||
|
},
|
||||||
text: 'verification',
|
text: 'verification',
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
|
@ -72,16 +74,6 @@ class SubmitEmail extends StatelessWidget {
|
||||||
? TextFormView(
|
? TextFormView(
|
||||||
name: 'E-mail Address',
|
name: 'E-mail Address',
|
||||||
hintText: 'Input e-mail address',
|
hintText: 'Input e-mail address',
|
||||||
keyboardType: TextInputType.emailAddress,
|
|
||||||
validator: (value) {
|
|
||||||
if (value!.isEmpty) {
|
|
||||||
return 'Filled cannot be empty';
|
|
||||||
} else if (!StringUtils.emailValidation(value)) {
|
|
||||||
return 'Format email wrong';
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// onTap: () {
|
// onTap: () {
|
||||||
// provider.submitEmail();
|
// provider.submitEmail();
|
||||||
// },
|
// },
|
||||||
|
|
|
@ -19,7 +19,6 @@ class SubmissionDataViewModel extends ChangeNotifier {
|
||||||
TextEditingController ctrlMarital = TextEditingController();
|
TextEditingController ctrlMarital = TextEditingController();
|
||||||
TextEditingController ctrlSourceFund = TextEditingController();
|
TextEditingController ctrlSourceFund = TextEditingController();
|
||||||
TextEditingController ctrlBankName = TextEditingController();
|
TextEditingController ctrlBankName = TextEditingController();
|
||||||
TextEditingController ctrlBirthDate = TextEditingController();
|
|
||||||
int step = 1;
|
int step = 1;
|
||||||
|
|
||||||
List<ItemSelectForm> listOccupation = [
|
List<ItemSelectForm> listOccupation = [
|
||||||
|
|
20
pubspec.lock
20
pubspec.lock
|
@ -49,14 +49,6 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.1"
|
version: "1.1.1"
|
||||||
calendar_date_picker2:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: calendar_date_picker2
|
|
||||||
sha256: b91d51b8d0928f9745e0113e86d06b161ac48c52b7530337a3b77283cbc6be27
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.5.3"
|
|
||||||
camera:
|
camera:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -300,10 +292,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: js
|
name: js
|
||||||
sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf
|
sha256: "4186c61b32f99e60f011f7160e32c89a758ae9b1d0c6d28e2c02ef0382300e2b"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.1"
|
version: "0.7.0"
|
||||||
lints:
|
lints:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -633,18 +625,18 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: syncfusion_flutter_core
|
name: syncfusion_flutter_core
|
||||||
sha256: "4eed0d3ae50c16b5e8e4957f3c1917e9bd0315a08dfb49a104ca8fc10244bef3"
|
sha256: e8580e201c7197feac830b501889e877796a9fabbe20dcdbe90a981603939101
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "24.2.6"
|
version: "24.2.4"
|
||||||
syncfusion_flutter_signaturepad:
|
syncfusion_flutter_signaturepad:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: syncfusion_flutter_signaturepad
|
name: syncfusion_flutter_signaturepad
|
||||||
sha256: da55bd7d796f2c9b4707f3e063e443f67c355c6098002e446bbf43672952916e
|
sha256: "878e1063b909a83c83677627261780d42d532d0b5e7e259d84da805008e7fb0d"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "24.2.6"
|
version: "24.2.4"
|
||||||
synchronized:
|
synchronized:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -51,8 +51,6 @@ dependencies:
|
||||||
syncfusion_flutter_signaturepad: ^24.2.4
|
syncfusion_flutter_signaturepad: ^24.2.4
|
||||||
dotted_border: ^2.1.0
|
dotted_border: ^2.1.0
|
||||||
shared_preferences: ^2.2.2
|
shared_preferences: ^2.2.2
|
||||||
calendar_date_picker2: ^0.5.3
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user