Compare commits
6 Commits
5cb76fca7f
...
466d49312d
Author | SHA1 | Date | |
---|---|---|---|
466d49312d | |||
9ba8b79112 | |||
4f50dc951a | |||
d66a9e3435 | |||
8e04b4e77e | |||
afc2bd3cc9 |
BIN
assets/icons/icon-lock.png
Normal file
BIN
assets/icons/icon-lock.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.4 KiB |
|
@ -39,6 +39,7 @@ class PathAssets {
|
||||||
static const String iconCreatePlan = 'assets/icons/icon-create-plan.png';
|
static const String iconCreatePlan = 'assets/icons/icon-create-plan.png';
|
||||||
static const String iconChecklistOutlined =
|
static const String iconChecklistOutlined =
|
||||||
'assets/icons/icon-ceklis-outline.png';
|
'assets/icons/icon-ceklis-outline.png';
|
||||||
|
static const String iconLock = 'assets/icons/icon-lock.png';
|
||||||
|
|
||||||
/// IMAGE
|
/// IMAGE
|
||||||
static const String imgSplashLogo = 'assets/images/splash-logo.png';
|
static const String imgSplashLogo = 'assets/images/splash-logo.png';
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import 'package:cims_apps/application/component/custom_app_bar/custom_app_bar.dart';
|
||||||
import 'package:cims_apps/application/component/otp/otp_viewmodel.dart';
|
import 'package:cims_apps/application/component/otp/otp_viewmodel.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/application/theme/color_palette.dart';
|
||||||
|
@ -112,10 +113,8 @@ class OtpView extends StatelessWidget {
|
||||||
create: (context) => OtpViewModel(),
|
create: (context) => OtpViewModel(),
|
||||||
builder: (context, child) {
|
builder: (context, child) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: CustomAppBar(height: SizeConfig.height * .1, title: title),
|
||||||
title: Text(title),
|
body: SingleChildScrollView(
|
||||||
),
|
|
||||||
body: Container(
|
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
child:
|
child:
|
||||||
Consumer<OtpViewModel>(builder: (context, provider, child) {
|
Consumer<OtpViewModel>(builder: (context, provider, child) {
|
||||||
|
|
|
@ -9,7 +9,7 @@ class ItemSelectForm {
|
||||||
final String text;
|
final String text;
|
||||||
final String? description;
|
final String? description;
|
||||||
final bool isOther;
|
final bool isOther;
|
||||||
final String image;
|
String image;
|
||||||
|
|
||||||
ItemSelectForm(
|
ItemSelectForm(
|
||||||
this.key,
|
this.key,
|
||||||
|
@ -25,7 +25,6 @@ class SelectFormView extends StatelessWidget {
|
||||||
final String? hintText;
|
final String? hintText;
|
||||||
final TextStyle? hintTextStyle;
|
final TextStyle? hintTextStyle;
|
||||||
final TextEditingController? ctrl;
|
final TextEditingController? ctrl;
|
||||||
final Widget? bottomSheetTitle;
|
|
||||||
final List<ItemSelectForm> listItem;
|
final List<ItemSelectForm> listItem;
|
||||||
final ValueChanged<String> onSelect;
|
final ValueChanged<String> onSelect;
|
||||||
final FormFieldValidator<String>? validator;
|
final FormFieldValidator<String>? validator;
|
||||||
|
@ -37,7 +36,6 @@ class SelectFormView extends StatelessWidget {
|
||||||
this.hintText,
|
this.hintText,
|
||||||
this.hintTextStyle,
|
this.hintTextStyle,
|
||||||
this.ctrl,
|
this.ctrl,
|
||||||
this.bottomSheetTitle,
|
|
||||||
required this.listItem,
|
required this.listItem,
|
||||||
required this.onSelect,
|
required this.onSelect,
|
||||||
this.validator,
|
this.validator,
|
||||||
|
@ -56,48 +54,71 @@ class SelectFormView extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
builder: (BuildContext context) {
|
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: (
|
return StatefulBuilder(builder: (
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
StateSetter stateSetter,
|
StateSetter stateSetter,
|
||||||
) {
|
) {
|
||||||
return Container(
|
return Container(
|
||||||
height: SizeConfig.height * .45,
|
height: SizeConfig.height * .45,
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.vertical(
|
||||||
|
top: Radius.circular(20),
|
||||||
|
),
|
||||||
|
),
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
bottomSheetTitle ?? Container(),
|
Row(
|
||||||
// const SizedBox(height: 16),
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
name,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: ColorPalette.slate800,
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () => Navigator.pop(context),
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.clear,
|
||||||
|
size: 26,
|
||||||
|
color: ColorPalette.greyBase,
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 16),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
scrollDirection: Axis.vertical,
|
scrollDirection: Axis.vertical,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
...listItem.map(
|
...listItem.map((e) {
|
||||||
(e) => Card(
|
bool selected = e.text == ctrl?.text;
|
||||||
|
return Card(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
color: Colors.transparent,
|
color: Colors.white,
|
||||||
shape: const RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
side: BorderSide(
|
side: BorderSide(
|
||||||
color: ColorPalette.greyBorder,
|
color: selected
|
||||||
|
? ColorPalette.primary
|
||||||
|
: ColorPalette.greyBorder,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius:
|
||||||
BorderRadius.all(Radius.circular(12)),
|
const BorderRadius.all(Radius.circular(12)),
|
||||||
),
|
),
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
e.text,
|
e.text,
|
||||||
style: const TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 16,
|
||||||
),
|
fontWeight: FontWeight.w500,
|
||||||
|
color: selected
|
||||||
|
? ColorPalette.primary
|
||||||
|
: ColorPalette.slate500),
|
||||||
),
|
),
|
||||||
subtitle: e.description != null
|
subtitle: e.description != null
|
||||||
? Text(
|
? Text(
|
||||||
|
@ -106,37 +127,19 @@ class SelectFormView extends StatelessWidget {
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
// trailing: const Icon(
|
trailing: selected
|
||||||
// Icons.check_circle,
|
? const Icon(Icons.check_circle_rounded,
|
||||||
// color: ColorPalette.primary,
|
color: ColorPalette.primary)
|
||||||
// ),
|
: null,
|
||||||
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: () {
|
onTap: () {
|
||||||
ctrl?.text = e.text;
|
stateSetter(() {
|
||||||
onSelect(e.key);
|
ctrl?.text = e.text;
|
||||||
Navigator.of(context).pop();
|
onSelect(e.key);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
),
|
}),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -145,7 +148,7 @@ class SelectFormView extends StatelessWidget {
|
||||||
name: 'Select',
|
name: 'Select',
|
||||||
marginVertical: 4.0,
|
marginVertical: 4.0,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
// print('object $')
|
Navigator.pop(context);
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|
135
lib/application/component/set_pin_view/set_pin_view.dart
Normal file
135
lib/application/component/set_pin_view/set_pin_view.dart
Normal file
|
@ -0,0 +1,135 @@
|
||||||
|
import 'package:cims_apps/application/assets/path_assets.dart';
|
||||||
|
import 'package:cims_apps/application/component/custom_app_bar/custom_app_bar.dart';
|
||||||
|
import 'package:cims_apps/application/component/image/image_view.dart';
|
||||||
|
import 'package:cims_apps/application/component/set_pin_view/set_pin_viewmodel.dart';
|
||||||
|
import 'package:cims_apps/application/theme/color_palette.dart';
|
||||||
|
import 'package:cims_apps/core/route/route.dart';
|
||||||
|
import 'package:cims_apps/core/utils/size_config.dart';
|
||||||
|
import 'package:cims_apps/features/auth/registration/view/registration_success_view.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:pinput/pinput.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class SetPinView extends StatelessWidget {
|
||||||
|
final String currentPin;
|
||||||
|
final void Function(BuildContext context, String pin) submitPin;
|
||||||
|
|
||||||
|
const SetPinView({
|
||||||
|
Key? key,
|
||||||
|
required this.currentPin,
|
||||||
|
required this.submitPin,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
Widget _stepItem({bool isCurrentStep = false, bool isDone = false}) {
|
||||||
|
return Container(
|
||||||
|
margin:
|
||||||
|
const EdgeInsets.only(right: 4.0, left: 4.0, top: 16.0, bottom: 40.0),
|
||||||
|
height: 6,
|
||||||
|
width: SizeConfig.width * .08,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: isCurrentStep || isDone
|
||||||
|
? ColorPalette.primary
|
||||||
|
: ColorPalette.greyBorderNeutrals,
|
||||||
|
borderRadius: BorderRadius.circular(50),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final textTheme = Theme.of(context).textTheme;
|
||||||
|
final pinInputController = TextEditingController();
|
||||||
|
const pinInputLength = 6;
|
||||||
|
const defaultPinTheme = PinTheme(
|
||||||
|
margin: EdgeInsets.symmetric(horizontal: 4.0, vertical: 16.0),
|
||||||
|
textStyle: TextStyle(
|
||||||
|
fontSize: 22,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
);
|
||||||
|
|
||||||
|
final pInputFocusNode = FocusNode();
|
||||||
|
|
||||||
|
final focusedPinTheme = defaultPinTheme.copyWith(
|
||||||
|
decoration: defaultPinTheme.decoration?.copyWith(),
|
||||||
|
);
|
||||||
|
|
||||||
|
final submittedPinTheme = defaultPinTheme.copyWith(
|
||||||
|
decoration: defaultPinTheme.decoration?.copyWith(),
|
||||||
|
);
|
||||||
|
final followingPinTheme = defaultPinTheme.copyWith(
|
||||||
|
width: 13,
|
||||||
|
height: 13,
|
||||||
|
textStyle: const TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
color: Color.fromRGBO(30, 60, 87, 1),
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
decoration: defaultPinTheme.decoration?.copyWith(
|
||||||
|
color: ColorPalette.white,
|
||||||
|
border: Border.all(color: ColorPalette.slate300),
|
||||||
|
borderRadius: BorderRadius.circular(100),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
return ChangeNotifierProvider(
|
||||||
|
create: (context) => SetPinViewModel(),
|
||||||
|
builder: (context, child) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: CustomAppBar(
|
||||||
|
height: SizeConfig.height * .1, title: 'Registration'),
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||||
|
child: Consumer<SetPinViewModel>(
|
||||||
|
builder: (context, provider, child) {
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: List.generate(
|
||||||
|
9,
|
||||||
|
(index) => _stepItem(isCurrentStep: true, isDone: true),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
ImageView(
|
||||||
|
image: PathAssets.iconLock,
|
||||||
|
width: SizeConfig.width * .15,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
!provider.isPinCompleted
|
||||||
|
? 'Set your PIN'
|
||||||
|
: 'Confirm your PIN',
|
||||||
|
style: textTheme.headlineLarge,
|
||||||
|
),
|
||||||
|
Pinput(
|
||||||
|
onCompleted: (pin) {
|
||||||
|
if (!provider.isPinCompleted) {
|
||||||
|
provider.changePin();
|
||||||
|
pinInputController.clear();
|
||||||
|
} else {
|
||||||
|
routePush(context,
|
||||||
|
routeType: RouteType.pushReplace,
|
||||||
|
page: const RegistrationSuccessView());
|
||||||
|
}
|
||||||
|
},
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
obscureText: true,
|
||||||
|
autofocus: true,
|
||||||
|
isCursorAnimationEnabled: false,
|
||||||
|
length: pinInputLength,
|
||||||
|
controller: pinInputController,
|
||||||
|
defaultPinTheme: defaultPinTheme,
|
||||||
|
focusNode: pInputFocusNode,
|
||||||
|
focusedPinTheme: focusedPinTheme,
|
||||||
|
submittedPinTheme: submittedPinTheme,
|
||||||
|
followingPinTheme: followingPinTheme,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class SetPinViewModel extends ChangeNotifier {
|
||||||
|
bool isPinCompleted = false;
|
||||||
|
void changePin() {
|
||||||
|
isPinCompleted = !isPinCompleted;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
}
|
|
@ -11,13 +11,34 @@ import 'package:cims_apps/features/auth/registration/view/submission_data/submis
|
||||||
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/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
class DisplayPictureScreen extends StatelessWidget {
|
class DisplayPictureScreen extends StatefulWidget {
|
||||||
final String imagePath, content;
|
final String imagePath, content;
|
||||||
|
|
||||||
const DisplayPictureScreen(
|
const DisplayPictureScreen(
|
||||||
{super.key, required this.imagePath, required this.content});
|
{super.key, required this.imagePath, required this.content});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<DisplayPictureScreen> createState() => _DisplayPictureScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _DisplayPictureScreenState extends State<DisplayPictureScreen> {
|
||||||
|
Future<void> saveData() async {
|
||||||
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
|
if (widget.content == 'ktp') {
|
||||||
|
prefs.setString('imagePath', widget.imagePath);
|
||||||
|
} else {
|
||||||
|
prefs.setString('imagePathSelfie', widget.imagePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
saveData();
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
List listIcons = [
|
List listIcons = [
|
||||||
|
@ -85,7 +106,7 @@ class DisplayPictureScreen extends StatelessWidget {
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: SizeConfig.width,
|
width: SizeConfig.width,
|
||||||
height: SizeConfig.height * .4,
|
height: SizeConfig.height * .4,
|
||||||
child: Image.file(File(imagePath))),
|
child: Image.file(File(widget.imagePath))),
|
||||||
const Padding(
|
const Padding(
|
||||||
padding: EdgeInsets.symmetric(vertical: 16.0),
|
padding: EdgeInsets.symmetric(vertical: 16.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -103,7 +124,8 @@ class DisplayPictureScreen extends StatelessWidget {
|
||||||
runSpacing: 8,
|
runSpacing: 8,
|
||||||
children: List.generate(4, (index) {
|
children: List.generate(4, (index) {
|
||||||
List filteredList = listIcons
|
List filteredList = listIcons
|
||||||
.where((element) => element['key'] == content)
|
.where(
|
||||||
|
(element) => element['key'] == widget.content)
|
||||||
.toList();
|
.toList();
|
||||||
final urlImg = filteredList[index]['urlImg'];
|
final urlImg = filteredList[index]['urlImg'];
|
||||||
final tag = filteredList[index]['tag'];
|
final tag = filteredList[index]['tag'];
|
||||||
|
@ -162,10 +184,10 @@ class DisplayPictureScreen extends StatelessWidget {
|
||||||
provider.initCamera().then((cameras) {
|
provider.initCamera().then((cameras) {
|
||||||
routePush(context,
|
routePush(context,
|
||||||
page: TakePictureScreen(
|
page: TakePictureScreen(
|
||||||
camera: content == 'ktp'
|
camera: widget.content == 'ktp'
|
||||||
? cameras[0]
|
? cameras[0]
|
||||||
: cameras[1],
|
: cameras[1],
|
||||||
takeContent: content,
|
takeContent: widget.content,
|
||||||
));
|
));
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -137,9 +137,9 @@ class TextFormView extends StatelessWidget {
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
onEditingComplete: onSubmit,
|
onEditingComplete: onSubmit,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.w500,
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: fontColorDisabled ?? Colors.black,
|
color: fontColorDisabled ?? ColorPalette.slate500,
|
||||||
),
|
),
|
||||||
readOnly: readOnly,
|
readOnly: readOnly,
|
||||||
validator: validator,
|
validator: validator,
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
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/custom_app_bar/custom_app_bar.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/theme/color_palette.dart';
|
import 'package:cims_apps/application/theme/color_palette.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/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/dashboard/dashboard_public/view/dashboard_public_view.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class InitialRegistrationStep extends StatelessWidget {
|
class InitialRegistrationStep extends StatelessWidget {
|
||||||
|
@ -92,12 +94,12 @@ class InitialRegistrationStep extends StatelessWidget {
|
||||||
{
|
{
|
||||||
'desc': 'Personal Data',
|
'desc': 'Personal Data',
|
||||||
'isActive': true,
|
'isActive': true,
|
||||||
'isDone': true,
|
'isDone': false,
|
||||||
'isLast': false,
|
'isLast': false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'desc': 'Email',
|
'desc': 'Email',
|
||||||
'isActive': true,
|
'isActive': false,
|
||||||
'isDone': false,
|
'isDone': false,
|
||||||
'isLast': false,
|
'isLast': false,
|
||||||
},
|
},
|
||||||
|
@ -146,9 +148,8 @@ class InitialRegistrationStep extends StatelessWidget {
|
||||||
];
|
];
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar:
|
||||||
title: const Text('Registration'),
|
CustomAppBar(height: SizeConfig.height * .1, title: 'Registration'),
|
||||||
),
|
|
||||||
body: Container(
|
body: Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24.0),
|
padding: const EdgeInsets.symmetric(horizontal: 24.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
|
@ -175,7 +176,7 @@ class InitialRegistrationStep extends StatelessWidget {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: SizeConfig.height * .6,
|
height: SizeConfig.height * .55,
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
scrollDirection: Axis.vertical,
|
scrollDirection: Axis.vertical,
|
||||||
child: Column(
|
child: Column(
|
||||||
|
@ -192,12 +193,29 @@ class InitialRegistrationStep extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
ButtonView(
|
Row(
|
||||||
name: 'Let’s Start',
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
marginVertical: 8.0,
|
children: [
|
||||||
onPressed: () {
|
ButtonView(
|
||||||
routePush(context, page: const SubmissionParent());
|
name: 'Home Page',
|
||||||
},
|
marginVertical: 8.0,
|
||||||
|
width: SizeConfig.width * .42,
|
||||||
|
isOutlined: true,
|
||||||
|
onPressed: () {
|
||||||
|
routePush(context,
|
||||||
|
page: const DashboardPublicView(),
|
||||||
|
routeType: RouteType.pushReplace);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ButtonView(
|
||||||
|
name: 'Let’s Start',
|
||||||
|
marginVertical: 8.0,
|
||||||
|
width: SizeConfig.width * .42,
|
||||||
|
onPressed: () {
|
||||||
|
routePush(context, page: const SubmissionParent());
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
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/custom_app_bar/custom_app_bar.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';
|
||||||
import 'package:cims_apps/application/theme/color_palette.dart';
|
import 'package:cims_apps/application/theme/color_palette.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/features/auth/registration/view/submission_data/submission_parent.dart';
|
import 'package:cims_apps/features/auth/registration/view/initial_registration_step.dart';
|
||||||
import 'package:cims_apps/features/auth/registration/viewmodel/registration_viewmodel.dart';
|
import 'package:cims_apps/features/auth/registration/viewmodel/registration_viewmodel.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
@ -20,9 +21,8 @@ class RegistrationPasswordView extends StatelessWidget {
|
||||||
create: (context) => RegistrationViewModel(),
|
create: (context) => RegistrationViewModel(),
|
||||||
builder: (context, child) {
|
builder: (context, child) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar:
|
||||||
title: const Text('Sign Up'),
|
CustomAppBar(height: SizeConfig.height * .1, title: 'Sign Up'),
|
||||||
),
|
|
||||||
body: SingleChildScrollView(
|
body: SingleChildScrollView(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
child: Consumer<RegistrationViewModel>(
|
child: Consumer<RegistrationViewModel>(
|
||||||
|
@ -45,6 +45,8 @@ class RegistrationPasswordView extends StatelessWidget {
|
||||||
validator: (value) {
|
validator: (value) {
|
||||||
if (value!.isEmpty) {
|
if (value!.isEmpty) {
|
||||||
return 'Password must filled';
|
return 'Password must filled';
|
||||||
|
} else if (value.length <= 8) {
|
||||||
|
return 'Minimum password 8 Character';
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -139,7 +141,7 @@ class DialogSuccess extends StatelessWidget {
|
||||||
marginVertical: 8.0,
|
marginVertical: 8.0,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
routePush(context,
|
routePush(context,
|
||||||
page: const SubmissionParent(),
|
page: const InitialRegistrationStep(),
|
||||||
routeType: RouteType.pushReplace);
|
routeType: RouteType.pushReplace);
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
|
@ -29,7 +29,11 @@ class RegistrationSuccessView extends StatelessWidget {
|
||||||
name: 'Next',
|
name: 'Next',
|
||||||
marginVertical: 0.0,
|
marginVertical: 0.0,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
routePush(context, page: const BottomNavigationView());
|
routePush(
|
||||||
|
context,
|
||||||
|
page: const BottomNavigationView(),
|
||||||
|
routeType: RouteType.pushReplace,
|
||||||
|
);
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
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/custom_app_bar/custom_app_bar.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/otp/otp_view.dart';
|
import 'package:cims_apps/application/component/otp/otp_view.dart';
|
||||||
import 'package:cims_apps/application/component/text_caption/text_caption.dart';
|
import 'package:cims_apps/application/component/text_caption/text_caption.dart';
|
||||||
|
@ -24,6 +25,11 @@ class RegistrationView extends StatelessWidget {
|
||||||
context: context,
|
context: context,
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
enableDrag: false,
|
enableDrag: false,
|
||||||
|
shape: const RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.vertical(
|
||||||
|
top: Radius.zero,
|
||||||
|
),
|
||||||
|
),
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
|
@ -46,10 +52,9 @@ class RegistrationView extends StatelessWidget {
|
||||||
create: (context) => RegistrationViewModel(),
|
create: (context) => RegistrationViewModel(),
|
||||||
builder: (context, child) {
|
builder: (context, child) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar:
|
||||||
title: const Text('Sign Up'),
|
CustomAppBar(height: SizeConfig.height * .1, title: 'Sign Up'),
|
||||||
),
|
body: SingleChildScrollView(
|
||||||
body: Container(
|
|
||||||
padding: const EdgeInsets.all(24.0),
|
padding: const EdgeInsets.all(24.0),
|
||||||
child: Consumer<RegistrationViewModel>(
|
child: Consumer<RegistrationViewModel>(
|
||||||
builder: (context, provider, child) {
|
builder: (context, provider, child) {
|
||||||
|
@ -68,6 +73,7 @@ class RegistrationView extends StatelessWidget {
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
FilteringTextInputFormatter.deny(RegExp(r'^0'))
|
FilteringTextInputFormatter.deny(RegExp(r'^0'))
|
||||||
],
|
],
|
||||||
|
contentPadding: EdgeInsets.zero,
|
||||||
prefixIcon: Container(
|
prefixIcon: Container(
|
||||||
width: SizeConfig.width * .23,
|
width: SizeConfig.width * .23,
|
||||||
padding:
|
padding:
|
||||||
|
|
|
@ -1,27 +1,24 @@
|
||||||
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/image/image_view.dart';
|
import 'package:cims_apps/application/component/image/image_view.dart';
|
||||||
import 'package:cims_apps/application/component/select_form/select_form_view.dart';
|
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/component/text_form/text_form_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/application/theme/color_palette.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/features/auth/registration/view/submission_data/data_bank/guide_screen.dart';
|
import 'package:cims_apps/features/auth/registration/view/submission_data/data_bank/guide_screen.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/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
import 'confirm_bank_account.dart';
|
||||||
|
|
||||||
class SubmitBankAccount extends StatelessWidget {
|
class SubmitBankAccount extends StatelessWidget {
|
||||||
const SubmitBankAccount({Key? key}) : super(key: key);
|
const SubmitBankAccount({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
List<ItemSelectForm> listForm = [
|
|
||||||
ItemSelectForm('key1', 'BCA'),
|
|
||||||
ItemSelectForm('key2', 'BRI'),
|
|
||||||
ItemSelectForm('key3', 'BNI'),
|
|
||||||
ItemSelectForm('key4', 'BANK MANDIRI'),
|
|
||||||
ItemSelectForm('key5', 'CIMB NIAGA'),
|
|
||||||
];
|
|
||||||
return MultiProvider(
|
return MultiProvider(
|
||||||
providers: [
|
providers: [
|
||||||
ChangeNotifierProvider(
|
ChangeNotifierProvider(
|
||||||
|
@ -38,11 +35,14 @@ class SubmitBankAccount extends StatelessWidget {
|
||||||
const TextCaption(title: 'Input your bank account data'),
|
const TextCaption(title: 'Input your bank account data'),
|
||||||
SelectFormView(
|
SelectFormView(
|
||||||
name: 'Bank Name',
|
name: 'Bank Name',
|
||||||
listItem: listForm,
|
hintText: 'Select Bank',
|
||||||
|
listItem: provider.listBank,
|
||||||
|
ctrl: provider.ctrlBankName,
|
||||||
onSelect: (value) {},
|
onSelect: (value) {},
|
||||||
),
|
),
|
||||||
TextFormView(
|
TextFormView(
|
||||||
name: 'Account Number',
|
name: 'Account Number',
|
||||||
|
hintText: 'Input Account Number',
|
||||||
trailingTitleWidget: SizedBox(
|
trailingTitleWidget: SizedBox(
|
||||||
width: 24,
|
width: 24,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
|
@ -53,13 +53,27 @@ class SubmitBankAccount extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextFormView(name: 'Account Owner Name'),
|
TextFormView(
|
||||||
|
name: 'Account Owner Name',
|
||||||
|
hintText: 'Input Account Name',
|
||||||
|
),
|
||||||
const Text(
|
const Text(
|
||||||
"Make sure the account you use is in your name, not someone else's",
|
"Make sure the account you use is in your name, not someone else's",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: ColorPalette.slate400,
|
color: ColorPalette.slate400,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
SizedBox(height: SizeConfig.height * .08),
|
||||||
|
ButtonView(
|
||||||
|
name: 'Next',
|
||||||
|
onPressed: () {
|
||||||
|
provider.next(context).then((value) {
|
||||||
|
if (value) {
|
||||||
|
routePush(context, page: const ConfirmBankAccount());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -162,7 +162,11 @@ class ResultsView extends StatelessWidget {
|
||||||
ButtonView(
|
ButtonView(
|
||||||
name: 'Confirm',
|
name: 'Confirm',
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
routePush(context, page: const TermsAndConditionView());
|
routePush(
|
||||||
|
context,
|
||||||
|
page: const TermsAndConditionView(),
|
||||||
|
routeType: RouteType.pushReplace,
|
||||||
|
);
|
||||||
},
|
},
|
||||||
marginVertical: 0,
|
marginVertical: 0,
|
||||||
textSize: 16,
|
textSize: 16,
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
import 'package:cims_apps/application/component/button/back_button_view.dart';
|
import 'package:cims_apps/application/component/custom_app_bar/custom_app_bar.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/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/features/auth/registration/view/submission_data/data_bank/confirm_bank_account.dart';
|
|
||||||
import 'package:cims_apps/features/auth/registration/view/submission_data/data_bank/submit_bank_account.dart';
|
import 'package:cims_apps/features/auth/registration/view/submission_data/data_bank/submit_bank_account.dart';
|
||||||
import 'package:cims_apps/features/auth/registration/view/submission_data/risk_profile/risk_profile_view.dart';
|
import 'package:cims_apps/features/auth/registration/view/submission_data/risk_profile/risk_profile_view.dart';
|
||||||
import 'package:cims_apps/features/auth/registration/view/submission_data/submit_data_id_card.dart';
|
import 'package:cims_apps/features/auth/registration/view/submission_data/submit_data_id_card.dart';
|
||||||
|
@ -12,7 +10,6 @@ import 'package:cims_apps/features/auth/registration/view/submission_data/submit
|
||||||
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/view/submission_data/submit_photo_selfie.dart';
|
import 'package:cims_apps/features/auth/registration/view/submission_data/submit_photo_selfie.dart';
|
||||||
import 'package:cims_apps/features/auth/registration/view/submission_data/submit_signature/initial_signature.dart';
|
import 'package:cims_apps/features/auth/registration/view/submission_data/submit_signature/initial_signature.dart';
|
||||||
import 'package:cims_apps/features/auth/registration/view/submission_data/submit_signature/submit_signature.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:cims_apps/features/bottom_navigation_view.dart';
|
import 'package:cims_apps/features/bottom_navigation_view.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
@ -64,21 +61,6 @@ class _SubmissionParentState extends State<SubmissionParent> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_contentPush(int index) {
|
|
||||||
switch (index) {
|
|
||||||
case 6:
|
|
||||||
routePush(context, page: const ConfirmBankAccount());
|
|
||||||
case 7:
|
|
||||||
routePush(context, page: const SubmitSignature());
|
|
||||||
// case 8:
|
|
||||||
// return const RiskProfileView();
|
|
||||||
// case 9:
|
|
||||||
// return Container(
|
|
||||||
// child: Text("Step 9"),
|
|
||||||
// );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ChangeNotifierProvider(
|
return ChangeNotifierProvider(
|
||||||
|
@ -94,24 +76,8 @@ class _SubmissionParentState extends State<SubmissionParent> {
|
||||||
child: Consumer<SubmissionDataViewModel>(
|
child: Consumer<SubmissionDataViewModel>(
|
||||||
builder: (context, provider, child) {
|
builder: (context, provider, child) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: CustomAppBar(
|
||||||
toolbarHeight: 70,
|
height: SizeConfig.height * .1, title: 'Registration'),
|
||||||
backgroundColor: Colors.white,
|
|
||||||
surfaceTintColor: Colors.white,
|
|
||||||
automaticallyImplyLeading: false,
|
|
||||||
title: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
const BackButtonView(),
|
|
||||||
const Text('Registration'),
|
|
||||||
SizedBox(
|
|
||||||
width: SizeConfig.width * 0.1,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
shape: const RoundedRectangleBorder(
|
|
||||||
side: BorderSide(color: ColorPalette.slate200)),
|
|
||||||
),
|
|
||||||
body: Stack(
|
body: Stack(
|
||||||
children: [
|
children: [
|
||||||
Column(
|
Column(
|
||||||
|
@ -123,13 +89,19 @@ class _SubmissionParentState extends State<SubmissionParent> {
|
||||||
horizontal: 16.0, vertical: 16.0),
|
horizontal: 16.0, vertical: 16.0),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: List.generate(
|
children:
|
||||||
provider.stepAmount,
|
List.generate(provider.stepAmount, (index) {
|
||||||
(index) => _stepItem(
|
// print('indd $index');
|
||||||
isCurrentStep:
|
// print(
|
||||||
provider.getCurrentStep == index + 1,
|
// 'getCurrentStep ${provider.getCurrentStep}');
|
||||||
),
|
return _stepItem(
|
||||||
),
|
isCurrentStep: provider.getCurrentStep ==
|
||||||
|
index + 1 ||
|
||||||
|
provider.getCurrentStep - 1 == index + 1,
|
||||||
|
// isDone:
|
||||||
|
// index + 1 != provider.getCurrentStep + 1,
|
||||||
|
);
|
||||||
|
}),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
|
@ -139,21 +111,6 @@ class _SubmissionParentState extends State<SubmissionParent> {
|
||||||
child: _content(provider.getCurrentStep),
|
child: _content(provider.getCurrentStep),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
provider.getCurrentStep == 3 ||
|
|
||||||
provider.getCurrentStep == 4 ||
|
|
||||||
provider.getCurrentStep == 8
|
|
||||||
? const SizedBox()
|
|
||||||
: Align(
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
child: ButtonView(
|
|
||||||
name: 'Next',
|
|
||||||
marginVertical: 16.0,
|
|
||||||
onPressed: () {
|
|
||||||
_contentPush(provider.getCurrentStep);
|
|
||||||
provider.nextSubmission(context);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,22 +1,23 @@
|
||||||
|
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/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';
|
||||||
import 'package:cims_apps/application/theme/color_palette.dart';
|
import 'package:cims_apps/application/theme/color_palette.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/features/auth/registration/view/submission_data/submission_parent.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 SubmitDataIdCard extends StatelessWidget {
|
class SubmitDataIdCard extends StatelessWidget {
|
||||||
const SubmitDataIdCard({Key? key}) : super(key: key);
|
const SubmitDataIdCard({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
List listImg = [
|
|
||||||
{'urlImg': PathAssets.imgKtpClear, 'tag': 'ID Card'},
|
|
||||||
{'urlImg': PathAssets.imgSelfieClear, 'tag': 'Selfie with ID Card'},
|
|
||||||
];
|
|
||||||
|
|
||||||
bottomSheet() {
|
bottomSheet() {
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
|
@ -83,7 +84,7 @@ class SubmitDataIdCard extends StatelessWidget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget photoDocument() {
|
Widget photoDocument(SubmissionDataViewModel provider) {
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
@ -100,16 +101,21 @@ class SubmitDataIdCard extends StatelessWidget {
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: listImg.map((e) {
|
children: provider.listImg.map((e) {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: SizeConfig.height * .18,
|
height: SizeConfig.height * .18,
|
||||||
width: SizeConfig.width * .45,
|
width: SizeConfig.width * .45,
|
||||||
child: ImageView(
|
child: ClipRRect(
|
||||||
image: e['urlImg'],
|
borderRadius: BorderRadius.circular(8),
|
||||||
fit: BoxFit.fill,
|
child: Image.file(
|
||||||
borderRadius: 12,
|
File(e.image),
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
errorBuilder: (context, error, stackTrace) {
|
||||||
|
return const Icon(Icons.image_not_supported_outlined);
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
|
@ -118,7 +124,7 @@ class SubmitDataIdCard extends StatelessWidget {
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
e['tag'],
|
e.text,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
|
@ -151,68 +157,90 @@ class SubmitDataIdCard extends StatelessWidget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return SingleChildScrollView(
|
return MultiProvider(
|
||||||
child: Column(
|
providers: [
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
ChangeNotifierProvider(
|
||||||
children: [
|
create: (context) => SubmissionDataViewModel(),
|
||||||
const TextCaption(title: 'Check your ID card data for accuracy'),
|
|
||||||
TextFormView(name: 'NIK'),
|
|
||||||
TextFormView(name: 'Full Name'),
|
|
||||||
TextFormView(
|
|
||||||
name: 'Birth Date',
|
|
||||||
suffixIcon: const Icon(
|
|
||||||
Icons.calendar_today_rounded,
|
|
||||||
color: ColorPalette.slate400,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
photoDocument(),
|
|
||||||
Container(
|
|
||||||
width: SizeConfig.width,
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
|
||||||
margin: const EdgeInsets.symmetric(vertical: 16.0),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: ColorPalette.blue50,
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
border: Border.all(
|
|
||||||
color: ColorPalette.greyLights,
|
|
||||||
width: 1,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
const ImageView(
|
|
||||||
image: PathAssets.iconShield,
|
|
||||||
width: 20,
|
|
||||||
height: 22,
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
width: 8,
|
|
||||||
),
|
|
||||||
const Expanded(
|
|
||||||
child: Text(
|
|
||||||
'Will my data be safe?',
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
color: ColorPalette.primary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
IconButton(
|
|
||||||
onPressed: () {
|
|
||||||
bottomSheet();
|
|
||||||
},
|
|
||||||
icon: const Icon(
|
|
||||||
Icons.arrow_forward_ios,
|
|
||||||
color: ColorPalette.primary,
|
|
||||||
size: 20,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
builder: (context, child) {
|
||||||
);
|
return SingleChildScrollView(
|
||||||
|
child: Consumer<SubmissionDataViewModel>(
|
||||||
|
builder: (context, provider, child) {
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
const TextCaption(
|
||||||
|
title: 'Check your ID card data for accuracy'),
|
||||||
|
TextFormView(name: 'NIK'),
|
||||||
|
TextFormView(name: 'Full Name'),
|
||||||
|
TextFormView(
|
||||||
|
name: 'Birth Date',
|
||||||
|
suffixIcon: const Icon(
|
||||||
|
Icons.calendar_today_rounded,
|
||||||
|
color: ColorPalette.slate400,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
photoDocument(provider),
|
||||||
|
Container(
|
||||||
|
width: SizeConfig.width,
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||||
|
margin: const EdgeInsets.symmetric(vertical: 16.0),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: ColorPalette.blue50,
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
border: Border.all(
|
||||||
|
color: ColorPalette.greyLights,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
const ImageView(
|
||||||
|
image: PathAssets.iconShield,
|
||||||
|
width: 20,
|
||||||
|
height: 22,
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 8,
|
||||||
|
),
|
||||||
|
const Expanded(
|
||||||
|
child: Text(
|
||||||
|
'Will my data be safe?',
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: ColorPalette.primary,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
bottomSheet();
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.arrow_forward_ios,
|
||||||
|
color: ColorPalette.primary,
|
||||||
|
size: 20,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
ButtonView(
|
||||||
|
name: 'Next',
|
||||||
|
onPressed: () async {
|
||||||
|
await provider.next(context).then((value) {
|
||||||
|
if (value) {
|
||||||
|
routePush(context, page: const SubmissionParent());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
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/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';
|
||||||
|
import 'package:cims_apps/core/route/route.dart';
|
||||||
|
import 'package:cims_apps/core/utils/size_config.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';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
@ -58,22 +62,36 @@ class SubmitEmail extends StatelessWidget {
|
||||||
builder: (context, child) {
|
builder: (context, child) {
|
||||||
return Consumer<SubmissionDataViewModel>(
|
return Consumer<SubmissionDataViewModel>(
|
||||||
builder: (context, provider, child) {
|
builder: (context, provider, child) {
|
||||||
return Column(
|
return SingleChildScrollView(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
child: Column(
|
||||||
children: [
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
!provider.isEmailVerify
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
? const TextCaption(title: 'Enter your e-mail')
|
children: [
|
||||||
: const TextCaption(title: 'Check your e-mail '),
|
!provider.isEmailVerify
|
||||||
!provider.isEmailVerify
|
? const TextCaption(title: 'Enter your e-mail')
|
||||||
? TextFormView(
|
: const TextCaption(title: 'Check your e-mail '),
|
||||||
name: 'E-mail Address',
|
!provider.isEmailVerify
|
||||||
hintText: 'Input e-mail address',
|
? TextFormView(
|
||||||
onTap: () {
|
name: 'E-mail Address',
|
||||||
provider.submitEmail();
|
hintText: 'Input e-mail address',
|
||||||
},
|
// onTap: () {
|
||||||
)
|
// provider.submitEmail();
|
||||||
: _emailVerify(),
|
// },
|
||||||
],
|
)
|
||||||
|
: _emailVerify(),
|
||||||
|
SizedBox(height: SizeConfig.height * .42),
|
||||||
|
ButtonView(
|
||||||
|
name: 'Next',
|
||||||
|
onPressed: () async {
|
||||||
|
await provider.next(context).then((value) {
|
||||||
|
if (value) {
|
||||||
|
routePush(context, page: const SubmissionParent());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
|
import 'package:cims_apps/application/component/button/button_view.dart';
|
||||||
import 'package:cims_apps/application/component/select_form/select_form_view.dart';
|
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/core/route/route.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/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
@ -10,44 +12,63 @@ class SubmitPersonalData extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
List<ItemSelectForm> listForm = [
|
|
||||||
ItemSelectForm('key1', 'text'),
|
|
||||||
ItemSelectForm('key2', 'text'),
|
|
||||||
ItemSelectForm('key3', 'text'),
|
|
||||||
ItemSelectForm('key4', 'text'),
|
|
||||||
ItemSelectForm('key5', 'text'),
|
|
||||||
];
|
|
||||||
return ChangeNotifierProvider(
|
return ChangeNotifierProvider(
|
||||||
create: (context) => SubmissionDataViewModel(),
|
create: (context) => SubmissionDataViewModel(),
|
||||||
builder: (context, child) {
|
builder: (context, child) {
|
||||||
return Consumer<SubmissionDataViewModel>(
|
return Consumer<SubmissionDataViewModel>(
|
||||||
builder: (context, provider, child) {
|
builder: (context, provider, child) {
|
||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
child: Column(
|
child: Form(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
key: provider.formKeyPersonalData,
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
child: Column(
|
||||||
children: [
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
const TextCaption(title: 'Your personal details'),
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
SelectFormView(
|
children: [
|
||||||
name: 'Occupation',
|
const TextCaption(title: 'Your personal details'),
|
||||||
hintText: 'Select occupation ',
|
SelectFormView(
|
||||||
bottomSheetTitle: Row(
|
name: 'Occupation',
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
hintText: 'Select occupation ',
|
||||||
children: [
|
ctrl: provider.ctrlOccupation,
|
||||||
const Text('Occupation'),
|
listItem: provider.listOccupation,
|
||||||
IconButton(
|
onSelect: (value) {},
|
||||||
onPressed: () => Navigator.pop(context),
|
|
||||||
icon: const Icon(
|
|
||||||
Icons.clear,
|
|
||||||
size: 20,
|
|
||||||
color: ColorPalette.greyBase,
|
|
||||||
)),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
listItem: listForm,
|
SelectFormView(
|
||||||
onSelect: (value) {},
|
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) {},
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
child: ButtonView(
|
||||||
|
name: 'Next',
|
||||||
|
onPressed: () async {
|
||||||
|
await provider.next(context).then((value) {
|
||||||
|
if (value) {
|
||||||
|
routePush(context,
|
||||||
|
page: const SubmissionParent());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
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/image/image_view.dart';
|
import 'package:cims_apps/application/component/image/image_view.dart';
|
||||||
import 'package:cims_apps/application/component/list_tile/list_tile_view.dart';
|
import 'package:cims_apps/application/component/list_tile/list_tile_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/core/route/route.dart';
|
||||||
|
import 'package:cims_apps/core/utils/size_config.dart';
|
||||||
|
import 'package:cims_apps/features/auth/registration/view/submission_data/submit_signature/submit_signature.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/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
@ -18,16 +22,30 @@ class InitialSignature extends StatelessWidget {
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
builder: (context, child) {
|
builder: (context, child) {
|
||||||
return const Column(
|
return Consumer<SubmissionDataViewModel>(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
builder: (context, provider, child) {
|
||||||
children: [
|
return Column(
|
||||||
TextCaption(title: 'Draw your digital sign'),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
ImageView(image: PathAssets.frameSignature),
|
children: [
|
||||||
ListTileView(
|
const TextCaption(title: 'Draw your digital sign'),
|
||||||
title:
|
const ImageView(image: PathAssets.frameSignature),
|
||||||
'Make sure the sign you draw is match with your ID Card'),
|
const ListTileView(
|
||||||
],
|
title:
|
||||||
);
|
'Make sure the sign you draw is match with your ID Card'),
|
||||||
|
SizedBox(height: SizeConfig.height * .07),
|
||||||
|
ButtonView(
|
||||||
|
name: 'Next',
|
||||||
|
onPressed: () {
|
||||||
|
provider.next(context).then((value) {
|
||||||
|
if (value) {
|
||||||
|
routePush(context, page: const SubmitSignature());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import 'package:cims_apps/application/component/custom_app_bar/custom_app_bar.dart';
|
import 'package:cims_apps/application/component/custom_app_bar/custom_app_bar.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/set_pin_view/set_pin_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/route/route.dart';
|
import 'package:cims_apps/core/route/route.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/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
@ -90,7 +90,11 @@ class TermsAndConditionView extends StatelessWidget {
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
provider.nextSubmission(context);
|
provider.nextSubmission(context);
|
||||||
routePush(context,
|
routePush(context,
|
||||||
page: const SubmissionParent());
|
routeType: RouteType.pushReplace,
|
||||||
|
page: SetPinView(
|
||||||
|
currentPin: '',
|
||||||
|
submitPin: (context, pin) {},
|
||||||
|
));
|
||||||
},
|
},
|
||||||
marginVertical: 16))
|
marginVertical: 16))
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,12 +1,59 @@
|
||||||
import 'package:camera/camera.dart';
|
import 'package:camera/camera.dart';
|
||||||
|
import 'package:cims_apps/application/component/select_form/select_form_view.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
class SubmissionDataViewModel extends ChangeNotifier {
|
class SubmissionDataViewModel extends ChangeNotifier {
|
||||||
|
SubmissionDataViewModel() {
|
||||||
|
_getData();
|
||||||
|
}
|
||||||
|
|
||||||
static int _currentStep = 1;
|
static int _currentStep = 1;
|
||||||
int get getCurrentStep => _currentStep;
|
int get getCurrentStep => _currentStep;
|
||||||
int stepAmount = 9;
|
int stepAmount = 9;
|
||||||
bool _isEmailVerify = false;
|
bool _isEmailVerify = false;
|
||||||
bool get isEmailVerify => _isEmailVerify;
|
bool get isEmailVerify => _isEmailVerify;
|
||||||
|
var formKeyPersonalData = GlobalKey<FormState>();
|
||||||
|
TextEditingController ctrlOccupation = TextEditingController();
|
||||||
|
TextEditingController ctrlIncome = TextEditingController();
|
||||||
|
TextEditingController ctrlMarital = TextEditingController();
|
||||||
|
TextEditingController ctrlSourceFund = TextEditingController();
|
||||||
|
TextEditingController ctrlBankName = TextEditingController();
|
||||||
|
int step = 1;
|
||||||
|
|
||||||
|
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'),
|
||||||
|
];
|
||||||
|
|
||||||
|
List<ItemSelectForm> listBank = [
|
||||||
|
ItemSelectForm('key1', 'BCA'),
|
||||||
|
ItemSelectForm('key2', 'BRI'),
|
||||||
|
ItemSelectForm('key3', 'BNI'),
|
||||||
|
ItemSelectForm('key4', 'BANK MANDIRI'),
|
||||||
|
ItemSelectForm('key5', 'CIMB NIAGA'),
|
||||||
|
];
|
||||||
|
|
||||||
|
List<ItemSelectForm> listImg = [
|
||||||
|
ItemSelectForm('', 'ID Card', image: ''),
|
||||||
|
ItemSelectForm('', 'Selfie with ID Card', image: ''),
|
||||||
|
];
|
||||||
|
|
||||||
Future<List<CameraDescription>> initCamera() async {
|
Future<List<CameraDescription>> initCamera() async {
|
||||||
final cameras = await availableCameras();
|
final cameras = await availableCameras();
|
||||||
|
@ -37,4 +84,24 @@ class SubmissionDataViewModel extends ChangeNotifier {
|
||||||
|
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<bool> next(BuildContext context) async {
|
||||||
|
if (getCurrentStep < stepAmount) {
|
||||||
|
_currentStep++;
|
||||||
|
notifyListeners();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _getData() async {
|
||||||
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
|
String? imagePath = prefs.getString('imagePath');
|
||||||
|
String? imagePathSelfie = prefs.getString('imagePathSelfie');
|
||||||
|
if (imagePath != null && imagePathSelfie != null) {
|
||||||
|
listImg[0].image = imagePath;
|
||||||
|
listImg[1].image = imagePathSelfie;
|
||||||
|
}
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ class DashboardPublicView extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Container(
|
body: SingleChildScrollView(
|
||||||
padding: const EdgeInsets.only(
|
padding: const EdgeInsets.only(
|
||||||
top: 32.0,
|
top: 32.0,
|
||||||
bottom: 8.0,
|
bottom: 8.0,
|
||||||
|
|
|
@ -33,6 +33,43 @@ class MyApp extends StatelessWidget {
|
||||||
)),
|
)),
|
||||||
fontFamily: 'Manrope',
|
fontFamily: 'Manrope',
|
||||||
scaffoldBackgroundColor: Colors.white,
|
scaffoldBackgroundColor: Colors.white,
|
||||||
|
textTheme: const TextTheme(
|
||||||
|
displaySmall: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: ColorPalette.slate800,
|
||||||
|
),
|
||||||
|
displayMedium: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: ColorPalette.slate800,
|
||||||
|
),
|
||||||
|
displayLarge: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: ColorPalette.slate800,
|
||||||
|
),
|
||||||
|
bodyMedium: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: ColorPalette.slate500,
|
||||||
|
),
|
||||||
|
bodyLarge: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: ColorPalette.slate500,
|
||||||
|
),
|
||||||
|
headlineSmall: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: ColorPalette.slate800,
|
||||||
|
),
|
||||||
|
headlineLarge: TextStyle(
|
||||||
|
fontSize: 28,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: ColorPalette.slate800,
|
||||||
|
),
|
||||||
|
),
|
||||||
colorScheme: const ColorScheme.light().copyWith(
|
colorScheme: const ColorScheme.light().copyWith(
|
||||||
primary: const Color(0xff2563EB),
|
primary: const Color(0xff2563EB),
|
||||||
onPrimary: const Color(0xFFFF9130),
|
onPrimary: const Color(0xFFFF9130),
|
||||||
|
|
58
pubspec.lock
58
pubspec.lock
|
@ -488,6 +488,62 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.27.7"
|
version: "0.27.7"
|
||||||
|
shared_preferences:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: shared_preferences
|
||||||
|
sha256: "81429e4481e1ccfb51ede496e916348668fd0921627779233bd24cc3ff6abd02"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.2"
|
||||||
|
shared_preferences_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_android
|
||||||
|
sha256: "8568a389334b6e83415b6aae55378e158fbc2314e074983362d20c562780fb06"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.1"
|
||||||
|
shared_preferences_foundation:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_foundation
|
||||||
|
sha256: "7708d83064f38060c7b39db12aefe449cb8cdc031d6062280087bc4cdb988f5c"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.3.5"
|
||||||
|
shared_preferences_linux:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_linux
|
||||||
|
sha256: "9f2cbcf46d4270ea8be39fa156d86379077c8a5228d9dfdb1164ae0bb93f1faa"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.3.2"
|
||||||
|
shared_preferences_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_platform_interface
|
||||||
|
sha256: "22e2ecac9419b4246d7c22bfbbda589e3acf5c0351137d87dd2939d984d37c3b"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.3.2"
|
||||||
|
shared_preferences_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_web
|
||||||
|
sha256: "7b15ffb9387ea3e237bb7a66b8a23d2147663d391cafc5c8f37b2e7b4bde5d21"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.2"
|
||||||
|
shared_preferences_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_windows
|
||||||
|
sha256: "841ad54f3c8381c480d0c9b508b89a34036f512482c407e6df7a9c4aa2ef8f59"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.3.2"
|
||||||
sky_engine:
|
sky_engine:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
|
@ -671,4 +727,4 @@ packages:
|
||||||
version: "6.5.0"
|
version: "6.5.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.2.3 <4.0.0"
|
dart: ">=3.2.3 <4.0.0"
|
||||||
flutter: ">=3.13.0"
|
flutter: ">=3.16.0"
|
||||||
|
|
|
@ -50,6 +50,7 @@ dependencies:
|
||||||
path: ^1.8.3
|
path: ^1.8.3
|
||||||
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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user