fix: component select form
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import 'package:cims_apps/application/component/select_form/select_form_view.dart';
|
||||
import 'package:cims_apps/application/component/text_caption/text_caption.dart';
|
||||
import 'package:cims_apps/application/theme/color_palette.dart';
|
||||
import 'package:cims_apps/features/auth/registration/viewmodel/submission_data_viewmodel.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
@@ -10,44 +9,48 @@ class SubmitPersonalData extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List<ItemSelectForm> listForm = [
|
||||
ItemSelectForm('key1', 'text'),
|
||||
ItemSelectForm('key2', 'text'),
|
||||
ItemSelectForm('key3', 'text'),
|
||||
ItemSelectForm('key4', 'text'),
|
||||
ItemSelectForm('key5', 'text'),
|
||||
];
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => SubmissionDataViewModel(),
|
||||
builder: (context, child) {
|
||||
return Consumer<SubmissionDataViewModel>(
|
||||
builder: (context, provider, child) {
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const TextCaption(title: 'Your personal details'),
|
||||
SelectFormView(
|
||||
name: 'Occupation',
|
||||
hintText: 'Select occupation ',
|
||||
bottomSheetTitle: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text('Occupation'),
|
||||
IconButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
icon: const Icon(
|
||||
Icons.clear,
|
||||
size: 20,
|
||||
color: ColorPalette.greyBase,
|
||||
)),
|
||||
],
|
||||
child: Form(
|
||||
key: provider.formKeyPersonalData,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const TextCaption(title: 'Your personal details'),
|
||||
SelectFormView(
|
||||
name: 'Occupation',
|
||||
hintText: 'Select occupation ',
|
||||
ctrl: provider.ctrlOccupation,
|
||||
listItem: provider.listOccupation,
|
||||
onSelect: (value) {},
|
||||
),
|
||||
listItem: listForm,
|
||||
onSelect: (value) {},
|
||||
),
|
||||
],
|
||||
SelectFormView(
|
||||
name: 'Income Level (IDR)',
|
||||
hintText: 'Select Income ',
|
||||
ctrl: provider.ctrlIncome,
|
||||
listItem: provider.listIncome,
|
||||
onSelect: (value) {},
|
||||
),
|
||||
SelectFormView(
|
||||
name: 'Marital Status',
|
||||
hintText: 'Select Marital Status ',
|
||||
ctrl: provider.ctrlMarital,
|
||||
listItem: provider.listMarital,
|
||||
onSelect: (value) {},
|
||||
),
|
||||
SelectFormView(
|
||||
name: 'Source of Fund',
|
||||
hintText: 'Select Source of Fund ',
|
||||
ctrl: provider.ctrlSourceFund,
|
||||
listItem: provider.listSourceFund,
|
||||
onSelect: (value) {},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:camera/camera.dart';
|
||||
import 'package:cims_apps/application/component/select_form/select_form_view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SubmissionDataViewModel extends ChangeNotifier {
|
||||
@@ -7,6 +8,32 @@ class SubmissionDataViewModel extends ChangeNotifier {
|
||||
int stepAmount = 9;
|
||||
bool _isEmailVerify = false;
|
||||
bool get isEmailVerify => _isEmailVerify;
|
||||
var formKeyPersonalData = GlobalKey<FormState>();
|
||||
TextEditingController ctrlOccupation = TextEditingController();
|
||||
TextEditingController ctrlIncome = TextEditingController();
|
||||
TextEditingController ctrlMarital = TextEditingController();
|
||||
TextEditingController ctrlSourceFund = TextEditingController();
|
||||
|
||||
List<ItemSelectForm> listOccupation = [
|
||||
ItemSelectForm('key1', 'Student'),
|
||||
ItemSelectForm('key2', 'Entrepreneur'),
|
||||
ItemSelectForm('key3', 'Civil Servant'),
|
||||
];
|
||||
List<ItemSelectForm> listIncome = [
|
||||
ItemSelectForm('key1', '< 10 million/year'),
|
||||
ItemSelectForm('key2', '10 – 50 million/year'),
|
||||
ItemSelectForm('key3', '50 – 100 million/year'),
|
||||
];
|
||||
List<ItemSelectForm> listMarital = [
|
||||
ItemSelectForm('key1', 'Single'),
|
||||
ItemSelectForm('key2', 'Married'),
|
||||
ItemSelectForm('key3', 'Divorced'),
|
||||
];
|
||||
List<ItemSelectForm> listSourceFund = [
|
||||
ItemSelectForm('key1', 'Revenue'),
|
||||
ItemSelectForm('key2', 'Business Profit'),
|
||||
ItemSelectForm('key3', 'Saving interest'),
|
||||
];
|
||||
|
||||
Future<List<CameraDescription>> initCamera() async {
|
||||
final cameras = await availableCameras();
|
||||
|
||||
Reference in New Issue
Block a user