diff --git a/assets/icons/icon-shield.png b/assets/icons/icon-shield.png new file mode 100644 index 0000000..b4a9572 Binary files /dev/null and b/assets/icons/icon-shield.png differ diff --git a/lib/application/assets/path_assets.dart b/lib/application/assets/path_assets.dart index 01a9b0b..3bfdc02 100644 --- a/lib/application/assets/path_assets.dart +++ b/lib/application/assets/path_assets.dart @@ -10,6 +10,7 @@ class PathAssets { static const String iconGoogle = 'assets/icons/icon-google.png'; static const String icon1 = 'assets/icons/icon-1.png'; static const String iconConnect = 'assets/icons/icon-connect.png'; + static const String iconShield = 'assets/icons/icon-shield.png'; /// IMAGE static const String imgSplashLogo = 'assets/images/splash-logo.png'; diff --git a/lib/application/component/select_form/select_form_view.dart b/lib/application/component/select_form/select_form_view.dart new file mode 100644 index 0000000..5e2fa4d --- /dev/null +++ b/lib/application/component/select_form/select_form_view.dart @@ -0,0 +1,176 @@ +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'; + +class ItemSelectForm { + final String key; + final String text; + final String? description; + final bool isOther; + final String image; + + ItemSelectForm( + this.key, + this.text, { + this.isOther = false, + this.image = "", + this.description, + }); +} + +class SelectFormView extends StatelessWidget { + final String name; + final String? hintText; + final TextStyle? hintTextStyle; + final TextEditingController? ctrl; + final Widget? bottomSheetTitle; + final List listItem; + final ValueChanged onSelect; + final FormFieldValidator? validator; + final _borderRadius = const Radius.circular(24); + final bool? enabled; + const SelectFormView( + {Key? key, + required this.name, + this.hintText, + this.hintTextStyle, + this.ctrl, + this.bottomSheetTitle, + required this.listItem, + required this.onSelect, + this.validator, + this.enabled}) + : super(key: key); + + @override + Widget build(BuildContext context) { + bottomSheet() { + showModalBottomSheet( + context: context, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: _borderRadius, + topRight: _borderRadius, + ), + ), + builder: (BuildContext context) { + ItemSelectForm? selectedForm; + String? selectedKey; + if (listItem.isNotEmpty) { + var res = listItem.where((element) => element.key == selectedKey); + if (res.isNotEmpty) { + selectedForm = res.first; + } + } + return StatefulBuilder(builder: ( + BuildContext context, + StateSetter stateSetter, + ) { + return Container( + height: SizeConfig.height * .45, + padding: const EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + bottomSheetTitle ?? Container(), + // const SizedBox(height: 16), + Expanded( + child: SingleChildScrollView( + scrollDirection: Axis.vertical, + child: Column( + children: [ + ...listItem.map( + (e) => Card( + elevation: 0, + color: Colors.transparent, + shape: const RoundedRectangleBorder( + side: BorderSide( + color: ColorPalette.greyBorder, + ), + borderRadius: + BorderRadius.all(Radius.circular(12)), + ), + child: ListTile( + title: Text( + e.text, + style: const TextStyle( + fontSize: 14, + ), + ), + subtitle: e.description != null + ? Text( + e.description!, + maxLines: 2, + overflow: TextOverflow.ellipsis, + ) + : null, + // trailing: const Icon( + // Icons.check_circle, + // color: ColorPalette.primary, + // ), + trailing: Radio( + focusColor: ColorPalette.primary, + activeColor: ColorPalette.primary, + visualDensity: const VisualDensity( + horizontal: VisualDensity.minimumDensity, + vertical: VisualDensity.minimumDensity, + ), + materialTapTargetSize: + MaterialTapTargetSize.shrinkWrap, + value: e.key, + groupValue: selectedKey, + onChanged: (value) { + // selectedForm = + // ItemSelectForm(e.key, e.text); + // stateSetter(() { + // selectedKey = selectedForm!.key; + // }); + }, + ), + onTap: () { + ctrl?.text = e.text; + onSelect(e.key); + Navigator.of(context).pop(); + }, + ), + ), + ), + ], + ), + ), + ), + ButtonView( + name: 'Select', + marginVertical: 4.0, + onPressed: () { + // print('object $') + }, + ) + ], + ), + ); + }); + }, + ); + } + + return TextFormView( + name: name, + readOnly: true, + enabled: enabled ?? true, + onTap: () { + if (listItem.isNotEmpty) bottomSheet(); + }, + validator: validator, + hintText: hintText, + hintTextStyle: hintTextStyle, + ctrl: ctrl, + suffixIcon: Icon( + Icons.keyboard_arrow_down, + size: SizeConfig.width * .07, + ), + ); + } +} diff --git a/lib/features/auth/registration/view/submission_data/initial_take_photo.dart b/lib/features/auth/registration/view/submission_data/initial_take_photo.dart new file mode 100644 index 0000000..10f20a2 --- /dev/null +++ b/lib/features/auth/registration/view/submission_data/initial_take_photo.dart @@ -0,0 +1,91 @@ +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/image/image_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/core/utils/size_config.dart'; +import 'package:flutter/material.dart'; + +class InitialTakePhoto extends StatelessWidget { + const InitialTakePhoto({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + List listImg = [ + {'urlImg': PathAssets.imgKtpBlur, 'tag': 'Blurry Photo'}, + {'urlImg': PathAssets.imgKtpLight, 'tag': 'Light Reflection'}, + {'urlImg': PathAssets.imgKtpCropped, 'tag': 'Cropped Photo'}, + {'urlImg': PathAssets.imgKtpClear, 'tag': 'Clear Photo'}, + ]; + return SizedBox( + height: SizeConfig.height * .75, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const TextCaption( + title: 'Take a photo your ID card', + subtitle: + 'Make sure your photo is clearly legible for identity verification purposes', + ), + SizedBox( + width: SizeConfig.height, + child: Wrap( + alignment: WrapAlignment.spaceBetween, + spacing: 10, + runSpacing: 10, + children: List.generate(listImg.length, (index) { + final urlList = listImg[index]['urlImg']; + final tag = listImg[index]['tag']; + return Column( + children: [ + ImageView( + image: urlList, + width: SizeConfig.width * .42, + ), + const SizedBox( + height: 8, + ), + Text( + tag, + style: const TextStyle( + color: ColorPalette.slate800, + fontWeight: FontWeight.w600), + ), + ], + ); + }), + ), + ), + // const Spacer(), + const Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + ImageView( + image: PathAssets.iconShield, + width: 20, + height: 22, + ), + SizedBox( + width: 8, + ), + Expanded( + child: Text( + 'In accordance with OJK regulations, an ID card is required to purchase mutual funds.', + style: TextStyle( + fontWeight: FontWeight.w600, + color: ColorPalette.primary, + ), + ), + ) + ], + ), + ButtonView( + name: 'Take a Photo', + marginVertical: 16.0, + onPressed: () {}, + ) + ], + ), + ); + } +} diff --git a/lib/features/auth/registration/viewmodel/submission_data_viewmodel.dart b/lib/features/auth/registration/viewmodel/submission_data_viewmodel.dart new file mode 100644 index 0000000..c7a97fb --- /dev/null +++ b/lib/features/auth/registration/viewmodel/submission_data_viewmodel.dart @@ -0,0 +1,31 @@ +import 'package:flutter/material.dart'; + +class SubmissionDataViewModel extends ChangeNotifier { + int currentStep = 1; + int stepAmount = 9; + bool _isEmailVerify = false; + bool get isEmailVerify => _isEmailVerify; + + submitEmail() { + _isEmailVerify = !_isEmailVerify; + notifyListeners(); + } + + onWillPopSubmission(BuildContext context) { + if (currentStep != 1) { + currentStep--; + notifyListeners(); + } else { + Navigator.of(context).pop(true); + } + } + + nextSubmission(BuildContext context) { + if (currentStep < stepAmount) { + currentStep++; + } else { + //ToDo : Go To next step after completing the submission + } + notifyListeners(); + } +}