Compare commits
No commits in common. "d82d427bcc84b9bed42ac309829ea2441aa5da21" and "f407eca735dc376ccbd59055ff6ae412a5355ff0" have entirely different histories.
d82d427bcc
...
f407eca735
Binary file not shown.
Before Width: | Height: | Size: 1.6 KiB |
|
@ -14,7 +14,6 @@ class PathAssets {
|
||||||
static const String iconPortofolioShares = 'assets/icons/icon-portofolio-shares.png';
|
static const String iconPortofolioShares = 'assets/icons/icon-portofolio-shares.png';
|
||||||
static const String iconPortofolioSharia = 'assets/icons/icon-portofolio-sharia.png';
|
static const String iconPortofolioSharia = 'assets/icons/icon-portofolio-sharia.png';
|
||||||
static const String iconPortofolioMoneyMarket = 'assets/icons/icon-portofolio-moneymarket.png';
|
static const String iconPortofolioMoneyMarket = 'assets/icons/icon-portofolio-moneymarket.png';
|
||||||
static const String iconShield = 'assets/icons/icon-shield.png';
|
|
||||||
|
|
||||||
/// IMAGE
|
/// IMAGE
|
||||||
static const String imgSplashLogo = 'assets/images/splash-logo.png';
|
static const String imgSplashLogo = 'assets/images/splash-logo.png';
|
||||||
|
|
|
@ -1,176 +0,0 @@
|
||||||
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<ItemSelectForm> listItem;
|
|
||||||
final ValueChanged<String> onSelect;
|
|
||||||
final FormFieldValidator<String>? 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<void>(
|
|
||||||
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,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -155,7 +155,7 @@ class TextFormView extends StatelessWidget {
|
||||||
hintStyle: hintTextStyle ??
|
hintStyle: hintTextStyle ??
|
||||||
const TextStyle(
|
const TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: ColorPalette.greyFont,
|
color: Colors.grey,
|
||||||
fontWeight: FontWeight.normal,
|
fontWeight: FontWeight.normal,
|
||||||
),
|
),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
|
@ -167,19 +167,19 @@ class TextFormView extends StatelessWidget {
|
||||||
disabledBorder: OutlineInputBorder(
|
disabledBorder: OutlineInputBorder(
|
||||||
borderRadius: _borderRadius,
|
borderRadius: _borderRadius,
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: disabledborderColor ?? ColorPalette.greyBorder,
|
color: disabledborderColor ?? ColorPalette.greyFont,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderRadius: _borderRadius,
|
borderRadius: _borderRadius,
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: enabledborderColor ?? ColorPalette.greyBorder,
|
color: enabledborderColor ?? ColorPalette.greyBase,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderRadius: _borderRadius,
|
borderRadius: _borderRadius,
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: focusedBorderColor ?? ColorPalette.greyBorder,
|
color: focusedBorderColor ?? ColorPalette.greyBase,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
border: OutlineInputBorder(borderRadius: _borderRadius),
|
border: OutlineInputBorder(borderRadius: _borderRadius),
|
||||||
|
|
|
@ -3,6 +3,7 @@ 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/features/auth/registration/view/initial_registration_step.dart';
|
import 'package:cims_apps/features/auth/registration/view/initial_registration_step.dart';
|
||||||
|
import 'package:cims_apps/features/bottom_navigation_view.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
@ -41,7 +42,7 @@ class RegistrationView extends StatelessWidget {
|
||||||
text: 'Already have an account? ',
|
text: 'Already have an account? ',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
decoration: TextDecoration.none,
|
decoration: TextDecoration.underline,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
|
|
|
@ -1,91 +0,0 @@
|
||||||
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: () {},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,12 +1,9 @@
|
||||||
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/theme/color_palette.dart';
|
import 'package:cims_apps/application/theme/color_palette.dart';
|
||||||
import 'package:cims_apps/core/utils/size_config.dart';
|
import 'package:cims_apps/core/utils/size_config.dart';
|
||||||
import 'package:cims_apps/features/auth/registration/view/submission_data/initial_take_photo.dart';
|
|
||||||
import 'package:cims_apps/features/auth/registration/view/submission_data/submit_email.dart';
|
import 'package:cims_apps/features/auth/registration/view/submission_data/submit_email.dart';
|
||||||
import 'package:cims_apps/features/auth/registration/view/submission_data/submit_personal_data.dart';
|
import 'package:cims_apps/features/auth/registration/view/submission_data/submit_personal_data.dart';
|
||||||
import 'package:cims_apps/features/auth/registration/viewmodel/submission_data_viewmodel.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
|
|
||||||
class SubmissionParent extends StatefulWidget {
|
class SubmissionParent extends StatefulWidget {
|
||||||
static const routeName = '/SubmissionParent';
|
static const routeName = '/SubmissionParent';
|
||||||
|
@ -17,16 +14,29 @@ class SubmissionParent extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _SubmissionParentState extends State<SubmissionParent> {
|
class _SubmissionParentState extends State<SubmissionParent> {
|
||||||
|
int _currentStep = 1;
|
||||||
|
final int _stepAmount = 9;
|
||||||
Widget _stepItem({bool isCurrentStep = false, bool isDone = false}) {
|
Widget _stepItem({bool isCurrentStep = false, bool isDone = false}) {
|
||||||
return Container(
|
return GestureDetector(
|
||||||
margin: const EdgeInsets.only(right: 4.0, left: 4.0),
|
onTap: () {
|
||||||
height: 6,
|
setState(() {
|
||||||
width: SizeConfig.width * .08,
|
if (_currentStep > 1) {
|
||||||
decoration: BoxDecoration(
|
_currentStep--;
|
||||||
color: isCurrentStep || isDone
|
} else if (_currentStep == 1) {
|
||||||
? ColorPalette.primary
|
_currentStep++;
|
||||||
: ColorPalette.greyBorderNeutrals,
|
}
|
||||||
borderRadius: BorderRadius.circular(50),
|
});
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
margin: const EdgeInsets.only(right: 4.0, left: 4.0),
|
||||||
|
height: 6,
|
||||||
|
width: SizeConfig.width * .08,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: isCurrentStep || isDone
|
||||||
|
? ColorPalette.primary
|
||||||
|
: ColorPalette.greyBorderNeutrals,
|
||||||
|
borderRadius: BorderRadius.circular(50),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -38,7 +48,9 @@ class _SubmissionParentState extends State<SubmissionParent> {
|
||||||
case 2:
|
case 2:
|
||||||
return const SubmitEmail();
|
return const SubmitEmail();
|
||||||
case 3:
|
case 3:
|
||||||
return const InitialTakePhoto();
|
return Container(
|
||||||
|
child: Text("Step 3"),
|
||||||
|
);
|
||||||
case 4:
|
case 4:
|
||||||
return Container(
|
return Container(
|
||||||
child: Text("Step 4"),
|
child: Text("Step 4"),
|
||||||
|
@ -68,58 +80,48 @@ class _SubmissionParentState extends State<SubmissionParent> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ChangeNotifierProvider(
|
return Scaffold(
|
||||||
create: (context) => SubmissionDataViewModel(),
|
appBar: AppBar(
|
||||||
builder: (context, child) {
|
title: const Text('Registration'),
|
||||||
return Scaffold(
|
),
|
||||||
appBar: AppBar(
|
body: Stack(
|
||||||
title: const Text('Registration'),
|
children: [
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 16.0, vertical: 16.0),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: List.generate(
|
||||||
|
_stepAmount,
|
||||||
|
(index) => _stepItem(
|
||||||
|
isCurrentStep: _currentStep == index + 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||||
|
child: _content(_currentStep),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
child: ButtonView(
|
||||||
|
name: 'Next',
|
||||||
|
marginVertical: 16.0,
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
_currentStep++;
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
body: Stack(
|
)
|
||||||
children: [
|
],
|
||||||
Consumer<SubmissionDataViewModel>(
|
),
|
||||||
builder: (context, provider, child) {
|
);
|
||||||
return Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 16.0, vertical: 16.0),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: List.generate(
|
|
||||||
provider.stepAmount,
|
|
||||||
(index) => _stepItem(
|
|
||||||
isCurrentStep: provider.currentStep == index + 1,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
|
||||||
child: _content(provider.currentStep),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
provider.currentStep == 3
|
|
||||||
? const SizedBox()
|
|
||||||
: Align(
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
child: ButtonView(
|
|
||||||
name: 'Next',
|
|
||||||
marginVertical: 16.0,
|
|
||||||
onPressed: () {
|
|
||||||
provider.nextSubmission(context);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,81 +1,21 @@
|
||||||
import 'package:cims_apps/application/assets/path_assets.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';
|
||||||
import 'package:cims_apps/features/auth/registration/viewmodel/submission_data_viewmodel.dart';
|
|
||||||
import 'package:flutter/gestures.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
|
|
||||||
class SubmitEmail extends StatelessWidget {
|
class SubmitEmail extends StatelessWidget {
|
||||||
const SubmitEmail({Key? key}) : super(key: key);
|
const SubmitEmail({Key? key}) : super(key: key);
|
||||||
|
|
||||||
Widget _emailVerify() {
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
return Column(
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
const ImageView(image: PathAssets.imgEmail),
|
const TextCaption(title: 'Enter your e-mail'),
|
||||||
Align(
|
TextFormView(
|
||||||
alignment: Alignment.center,
|
name: 'E-mail Address',
|
||||||
child: RichText(
|
hintText: 'Input e-mail address',
|
||||||
textAlign: TextAlign.center,
|
|
||||||
text: TextSpan(children: [
|
|
||||||
const TextSpan(
|
|
||||||
text:
|
|
||||||
'We have sent a verification link to your e-mail. \nPlease check your email for ',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.black,
|
|
||||||
decoration: TextDecoration.none,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
TextSpan(
|
|
||||||
recognizer: TapGestureRecognizer()
|
|
||||||
..onTap = () {
|
|
||||||
print('object');
|
|
||||||
},
|
|
||||||
text: 'verification',
|
|
||||||
style: const TextStyle(
|
|
||||||
color: Colors.blue,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const TextSpan(
|
|
||||||
text: ' to \ncontinue registration.',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.black,
|
|
||||||
decoration: TextDecoration.none,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return ChangeNotifierProvider(
|
|
||||||
create: (context) => SubmissionDataViewModel(),
|
|
||||||
builder: (context, child) {
|
|
||||||
return Consumer<SubmissionDataViewModel>(
|
|
||||||
builder: (context, provider, child) {
|
|
||||||
return Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
!provider.isEmailVerify
|
|
||||||
? const TextCaption(title: 'Enter your e-mail')
|
|
||||||
: const TextCaption(title: 'Check your e-mail '),
|
|
||||||
!provider.isEmailVerify
|
|
||||||
? TextFormView(
|
|
||||||
name: 'E-mail Address',
|
|
||||||
hintText: 'Input e-mail address',
|
|
||||||
onTap: () {
|
|
||||||
provider.submitEmail();
|
|
||||||
},
|
|
||||||
)
|
|
||||||
: _emailVerify(),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,56 +1,16 @@
|
||||||
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/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:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
|
|
||||||
class SubmitPersonalData extends StatelessWidget {
|
class SubmitPersonalData extends StatelessWidget {
|
||||||
const SubmitPersonalData({Key? key}) : super(key: key);
|
const SubmitPersonalData({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
List<ItemSelectForm> listForm = [
|
return Column(
|
||||||
ItemSelectForm('key1', 'text'),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
ItemSelectForm('key2', 'text'),
|
children: [
|
||||||
ItemSelectForm('key3', 'text'),
|
TextCaption(title: 'Your personal details'),
|
||||||
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,
|
|
||||||
)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
listItem: listForm,
|
|
||||||
onSelect: (value) {},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
16
pubspec.lock
16
pubspec.lock
|
@ -259,14 +259,6 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.10.0"
|
version: "1.10.0"
|
||||||
nested:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: nested
|
|
||||||
sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.0"
|
|
||||||
octo_image:
|
octo_image:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -379,14 +371,6 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.7.4"
|
version: "3.7.4"
|
||||||
provider:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: provider
|
|
||||||
sha256: "9a96a0a19b594dbc5bf0f1f27d2bc67d5f95957359b461cd9feb44ed6ae75096"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "6.1.1"
|
|
||||||
remove_emoji_input_formatter:
|
remove_emoji_input_formatter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -42,8 +42,6 @@ dependencies:
|
||||||
fl_chart: ^0.65.0
|
fl_chart: ^0.65.0
|
||||||
intl: ^0.19.0
|
intl: ^0.19.0
|
||||||
carousel_slider: ^4.2.1
|
carousel_slider: ^4.2.1
|
||||||
provider: ^6.1.1
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user