Compare commits
7 Commits
66ace5b217
...
57a4e828c9
Author | SHA1 | Date | |
---|---|---|---|
57a4e828c9 | |||
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 iconChecklistOutlined =
|
||||
'assets/icons/icon-ceklis-outline.png';
|
||||
static const String iconLock = 'assets/icons/icon-lock.png';
|
||||
|
||||
/// IMAGE
|
||||
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/text_caption/text_caption.dart';
|
||||
import 'package:cims_apps/application/theme/color_palette.dart';
|
||||
|
@ -112,10 +113,8 @@ class OtpView extends StatelessWidget {
|
|||
create: (context) => OtpViewModel(),
|
||||
builder: (context, child) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(title),
|
||||
),
|
||||
body: Container(
|
||||
appBar: CustomAppBar(height: SizeConfig.height * .1, title: title),
|
||||
body: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child:
|
||||
Consumer<OtpViewModel>(builder: (context, provider, child) {
|
||||
|
|
|
@ -9,7 +9,7 @@ class ItemSelectForm {
|
|||
final String text;
|
||||
final String? description;
|
||||
final bool isOther;
|
||||
final String image;
|
||||
String image;
|
||||
|
||||
ItemSelectForm(
|
||||
this.key,
|
||||
|
@ -25,7 +25,6 @@ class SelectFormView extends StatelessWidget {
|
|||
final String? hintText;
|
||||
final TextStyle? hintTextStyle;
|
||||
final TextEditingController? ctrl;
|
||||
final Widget? bottomSheetTitle;
|
||||
final List<ItemSelectForm> listItem;
|
||||
final ValueChanged<String> onSelect;
|
||||
final FormFieldValidator<String>? validator;
|
||||
|
@ -37,7 +36,6 @@ class SelectFormView extends StatelessWidget {
|
|||
this.hintText,
|
||||
this.hintTextStyle,
|
||||
this.ctrl,
|
||||
this.bottomSheetTitle,
|
||||
required this.listItem,
|
||||
required this.onSelect,
|
||||
this.validator,
|
||||
|
@ -56,48 +54,71 @@ class SelectFormView extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
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,
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.vertical(
|
||||
top: Radius.circular(20),
|
||||
),
|
||||
),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
bottomSheetTitle ?? Container(),
|
||||
// const SizedBox(height: 16),
|
||||
Row(
|
||||
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(
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
child: Column(
|
||||
children: [
|
||||
...listItem.map(
|
||||
(e) => Card(
|
||||
...listItem.map((e) {
|
||||
bool selected = e.text == ctrl?.text;
|
||||
return Card(
|
||||
elevation: 0,
|
||||
color: Colors.transparent,
|
||||
shape: const RoundedRectangleBorder(
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
color: ColorPalette.greyBorder,
|
||||
color: selected
|
||||
? ColorPalette.primary
|
||||
: ColorPalette.greyBorder,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(12)),
|
||||
const BorderRadius.all(Radius.circular(12)),
|
||||
),
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
e.text,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: selected
|
||||
? ColorPalette.primary
|
||||
: ColorPalette.slate500),
|
||||
),
|
||||
subtitle: e.description != null
|
||||
? Text(
|
||||
|
@ -106,37 +127,19 @@ class SelectFormView extends StatelessWidget {
|
|||
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;
|
||||
// });
|
||||
},
|
||||
),
|
||||
trailing: selected
|
||||
? const Icon(Icons.check_circle_rounded,
|
||||
color: ColorPalette.primary)
|
||||
: null,
|
||||
onTap: () {
|
||||
ctrl?.text = e.text;
|
||||
onSelect(e.key);
|
||||
Navigator.of(context).pop();
|
||||
stateSetter(() {
|
||||
ctrl?.text = e.text;
|
||||
onSelect(e.key);
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -145,7 +148,7 @@ class SelectFormView extends StatelessWidget {
|
|||
name: 'Select',
|
||||
marginVertical: 4.0,
|
||||
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:flutter/material.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;
|
||||
|
||||
const DisplayPictureScreen(
|
||||
{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
|
||||
Widget build(BuildContext context) {
|
||||
List listIcons = [
|
||||
|
@ -85,7 +106,7 @@ class DisplayPictureScreen extends StatelessWidget {
|
|||
SizedBox(
|
||||
width: SizeConfig.width,
|
||||
height: SizeConfig.height * .4,
|
||||
child: Image.file(File(imagePath))),
|
||||
child: Image.file(File(widget.imagePath))),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 16.0),
|
||||
child: Text(
|
||||
|
@ -103,7 +124,8 @@ class DisplayPictureScreen extends StatelessWidget {
|
|||
runSpacing: 8,
|
||||
children: List.generate(4, (index) {
|
||||
List filteredList = listIcons
|
||||
.where((element) => element['key'] == content)
|
||||
.where(
|
||||
(element) => element['key'] == widget.content)
|
||||
.toList();
|
||||
final urlImg = filteredList[index]['urlImg'];
|
||||
final tag = filteredList[index]['tag'];
|
||||
|
@ -162,10 +184,10 @@ class DisplayPictureScreen extends StatelessWidget {
|
|||
provider.initCamera().then((cameras) {
|
||||
routePush(context,
|
||||
page: TakePictureScreen(
|
||||
camera: content == 'ktp'
|
||||
camera: widget.content == 'ktp'
|
||||
? cameras[0]
|
||||
: cameras[1],
|
||||
takeContent: content,
|
||||
takeContent: widget.content,
|
||||
));
|
||||
});
|
||||
},
|
||||
|
|
|
@ -137,9 +137,9 @@ class TextFormView extends StatelessWidget {
|
|||
onTap: onTap,
|
||||
onEditingComplete: onSubmit,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 14,
|
||||
color: fontColorDisabled ?? Colors.black,
|
||||
color: fontColorDisabled ?? ColorPalette.slate500,
|
||||
),
|
||||
readOnly: readOnly,
|
||||
validator: validator,
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
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/custom_app_bar/custom_app_bar.dart';
|
||||
import 'package:cims_apps/application/component/image/image_view.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/submission_data/submission_parent.dart';
|
||||
import 'package:cims_apps/features/dashboard/dashboard_public/view/dashboard_public_view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class InitialRegistrationStep extends StatelessWidget {
|
||||
|
@ -92,12 +94,12 @@ class InitialRegistrationStep extends StatelessWidget {
|
|||
{
|
||||
'desc': 'Personal Data',
|
||||
'isActive': true,
|
||||
'isDone': true,
|
||||
'isDone': false,
|
||||
'isLast': false,
|
||||
},
|
||||
{
|
||||
'desc': 'Email',
|
||||
'isActive': true,
|
||||
'isActive': false,
|
||||
'isDone': false,
|
||||
'isLast': false,
|
||||
},
|
||||
|
@ -146,9 +148,8 @@ class InitialRegistrationStep extends StatelessWidget {
|
|||
];
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Registration'),
|
||||
),
|
||||
appBar:
|
||||
CustomAppBar(height: SizeConfig.height * .1, title: 'Registration'),
|
||||
body: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24.0),
|
||||
child: Column(
|
||||
|
@ -175,7 +176,7 @@ class InitialRegistrationStep extends StatelessWidget {
|
|||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: SizeConfig.height * .6,
|
||||
height: SizeConfig.height * .55,
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
child: Column(
|
||||
|
@ -192,12 +193,29 @@ class InitialRegistrationStep extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
ButtonView(
|
||||
name: 'Let’s Start',
|
||||
marginVertical: 8.0,
|
||||
onPressed: () {
|
||||
routePush(context, page: const SubmissionParent());
|
||||
},
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
ButtonView(
|
||||
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/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/text_caption/text_caption.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/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/view/initial_registration_step.dart';
|
||||
import 'package:cims_apps/features/auth/registration/viewmodel/registration_viewmodel.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
@ -20,9 +21,8 @@ class RegistrationPasswordView extends StatelessWidget {
|
|||
create: (context) => RegistrationViewModel(),
|
||||
builder: (context, child) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Sign Up'),
|
||||
),
|
||||
appBar:
|
||||
CustomAppBar(height: SizeConfig.height * .1, title: 'Sign Up'),
|
||||
body: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Consumer<RegistrationViewModel>(
|
||||
|
@ -45,6 +45,8 @@ class RegistrationPasswordView extends StatelessWidget {
|
|||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Password must filled';
|
||||
} else if (value.length <= 8) {
|
||||
return 'Minimum password 8 Character';
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
@ -139,7 +141,7 @@ class DialogSuccess extends StatelessWidget {
|
|||
marginVertical: 8.0,
|
||||
onPressed: () {
|
||||
routePush(context,
|
||||
page: const SubmissionParent(),
|
||||
page: const InitialRegistrationStep(),
|
||||
routeType: RouteType.pushReplace);
|
||||
},
|
||||
)
|
||||
|
|
|
@ -29,7 +29,11 @@ class RegistrationSuccessView extends StatelessWidget {
|
|||
name: 'Next',
|
||||
marginVertical: 0.0,
|
||||
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/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/otp/otp_view.dart';
|
||||
import 'package:cims_apps/application/component/text_caption/text_caption.dart';
|
||||
|
@ -24,6 +25,11 @@ class RegistrationView extends StatelessWidget {
|
|||
context: context,
|
||||
isScrollControlled: true,
|
||||
enableDrag: false,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.vertical(
|
||||
top: Radius.zero,
|
||||
),
|
||||
),
|
||||
builder: (BuildContext context) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(
|
||||
|
@ -46,10 +52,9 @@ class RegistrationView extends StatelessWidget {
|
|||
create: (context) => RegistrationViewModel(),
|
||||
builder: (context, child) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Sign Up'),
|
||||
),
|
||||
body: Container(
|
||||
appBar:
|
||||
CustomAppBar(height: SizeConfig.height * .1, title: 'Sign Up'),
|
||||
body: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
child: Consumer<RegistrationViewModel>(
|
||||
builder: (context, provider, child) {
|
||||
|
@ -68,6 +73,7 @@ class RegistrationView extends StatelessWidget {
|
|||
inputFormatters: [
|
||||
FilteringTextInputFormatter.deny(RegExp(r'^0'))
|
||||
],
|
||||
contentPadding: EdgeInsets.zero,
|
||||
prefixIcon: Container(
|
||||
width: SizeConfig.width * .23,
|
||||
padding:
|
||||
|
|
|
@ -1,27 +1,24 @@
|
|||
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/select_form/select_form_view.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/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/submission_data/data_bank/guide_screen.dart';
|
||||
import 'package:cims_apps/features/auth/registration/viewmodel/submission_data_viewmodel.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'confirm_bank_account.dart';
|
||||
|
||||
class SubmitBankAccount extends StatelessWidget {
|
||||
const SubmitBankAccount({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
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(
|
||||
providers: [
|
||||
ChangeNotifierProvider(
|
||||
|
@ -38,11 +35,14 @@ class SubmitBankAccount extends StatelessWidget {
|
|||
const TextCaption(title: 'Input your bank account data'),
|
||||
SelectFormView(
|
||||
name: 'Bank Name',
|
||||
listItem: listForm,
|
||||
hintText: 'Select Bank',
|
||||
listItem: provider.listBank,
|
||||
ctrl: provider.ctrlBankName,
|
||||
onSelect: (value) {},
|
||||
),
|
||||
TextFormView(
|
||||
name: 'Account Number',
|
||||
hintText: 'Input Account Number',
|
||||
trailingTitleWidget: SizedBox(
|
||||
width: 24,
|
||||
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(
|
||||
"Make sure the account you use is in your name, not someone else's",
|
||||
style: TextStyle(
|
||||
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(
|
||||
name: 'Confirm',
|
||||
onPressed: () {
|
||||
routePush(context, page: const TermsAndConditionView());
|
||||
routePush(
|
||||
context,
|
||||
page: const TermsAndConditionView(),
|
||||
routeType: RouteType.pushReplace,
|
||||
);
|
||||
},
|
||||
marginVertical: 0,
|
||||
textSize: 16,
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
import 'package:cims_apps/application/component/button/back_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/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/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/risk_profile/risk_profile_view.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_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/submit_signature.dart';
|
||||
import 'package:cims_apps/features/auth/registration/viewmodel/submission_data_viewmodel.dart';
|
||||
import 'package:cims_apps/features/bottom_navigation_view.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
|
||||
Widget build(BuildContext context) {
|
||||
return ChangeNotifierProvider(
|
||||
|
@ -94,24 +76,8 @@ class _SubmissionParentState extends State<SubmissionParent> {
|
|||
child: Consumer<SubmissionDataViewModel>(
|
||||
builder: (context, provider, child) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 70,
|
||||
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)),
|
||||
),
|
||||
appBar: CustomAppBar(
|
||||
height: SizeConfig.height * .1, title: 'Registration'),
|
||||
body: Stack(
|
||||
children: [
|
||||
Column(
|
||||
|
@ -123,13 +89,19 @@ class _SubmissionParentState extends State<SubmissionParent> {
|
|||
horizontal: 16.0, vertical: 16.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: List.generate(
|
||||
provider.stepAmount,
|
||||
(index) => _stepItem(
|
||||
isCurrentStep:
|
||||
provider.getCurrentStep == index + 1,
|
||||
),
|
||||
),
|
||||
children:
|
||||
List.generate(provider.stepAmount, (index) {
|
||||
// print('indd $index');
|
||||
// print(
|
||||
// 'getCurrentStep ${provider.getCurrentStep}');
|
||||
return _stepItem(
|
||||
isCurrentStep: provider.getCurrentStep ==
|
||||
index + 1 ||
|
||||
provider.getCurrentStep - 1 == index + 1,
|
||||
// isDone:
|
||||
// index + 1 != provider.getCurrentStep + 1,
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
|
@ -139,21 +111,6 @@ class _SubmissionParentState extends State<SubmissionParent> {
|
|||
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/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/component/text_form/text_form_view.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/submission_data/submission_parent.dart';
|
||||
import 'package:cims_apps/features/auth/registration/viewmodel/submission_data_viewmodel.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class SubmitDataIdCard extends StatelessWidget {
|
||||
const SubmitDataIdCard({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List listImg = [
|
||||
{'urlImg': PathAssets.imgKtpClear, 'tag': 'ID Card'},
|
||||
{'urlImg': PathAssets.imgSelfieClear, 'tag': 'Selfie with ID Card'},
|
||||
];
|
||||
|
||||
bottomSheet() {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
|
@ -83,7 +84,7 @@ class SubmitDataIdCard extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
|
||||
Widget photoDocument() {
|
||||
Widget photoDocument(SubmissionDataViewModel provider) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
|
@ -100,16 +101,21 @@ class SubmitDataIdCard extends StatelessWidget {
|
|||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: listImg.map((e) {
|
||||
children: provider.listImg.map((e) {
|
||||
return Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: SizeConfig.height * .18,
|
||||
width: SizeConfig.width * .45,
|
||||
child: ImageView(
|
||||
image: e['urlImg'],
|
||||
fit: BoxFit.fill,
|
||||
borderRadius: 12,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: Image.file(
|
||||
File(e.image),
|
||||
fit: BoxFit.fill,
|
||||
errorBuilder: (context, error, stackTrace) {
|
||||
return const Icon(Icons.image_not_supported_outlined);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
|
@ -118,7 +124,7 @@ class SubmitDataIdCard extends StatelessWidget {
|
|||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
e['tag'],
|
||||
e.text,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
style: const TextStyle(
|
||||
|
@ -151,68 +157,90 @@ class SubmitDataIdCard extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
|
||||
return SingleChildScrollView(
|
||||
child: 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(),
|
||||
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,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
return MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => SubmissionDataViewModel(),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
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/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/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:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
@ -58,22 +62,36 @@ class SubmitEmail extends StatelessWidget {
|
|||
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(),
|
||||
],
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
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(),
|
||||
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/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:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
@ -10,44 +12,63 @@ class SubmitPersonalData extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List<ItemSelectForm> listForm = [
|
||||
ItemSelectForm('key1', 'text'),
|
||||
ItemSelectForm('key2', 'text'),
|
||||
ItemSelectForm('key3', 'text'),
|
||||
ItemSelectForm('key4', 'text'),
|
||||
ItemSelectForm('key5', 'text'),
|
||||
];
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => SubmissionDataViewModel(),
|
||||
builder: (context, child) {
|
||||
return Consumer<SubmissionDataViewModel>(
|
||||
builder: (context, provider, child) {
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const TextCaption(title: 'Your personal details'),
|
||||
SelectFormView(
|
||||
name: 'Occupation',
|
||||
hintText: 'Select occupation ',
|
||||
bottomSheetTitle: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text('Occupation'),
|
||||
IconButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
icon: const Icon(
|
||||
Icons.clear,
|
||||
size: 20,
|
||||
color: ColorPalette.greyBase,
|
||||
)),
|
||||
],
|
||||
child: Form(
|
||||
key: provider.formKeyPersonalData,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const TextCaption(title: 'Your personal details'),
|
||||
SelectFormView(
|
||||
name: 'Occupation',
|
||||
hintText: 'Select occupation ',
|
||||
ctrl: provider.ctrlOccupation,
|
||||
listItem: provider.listOccupation,
|
||||
onSelect: (value) {},
|
||||
),
|
||||
listItem: listForm,
|
||||
onSelect: (value) {},
|
||||
),
|
||||
],
|
||||
SelectFormView(
|
||||
name: 'Income Level (IDR)',
|
||||
hintText: 'Select Income ',
|
||||
ctrl: provider.ctrlIncome,
|
||||
listItem: provider.listIncome,
|
||||
onSelect: (value) {},
|
||||
),
|
||||
SelectFormView(
|
||||
name: 'Marital Status',
|
||||
hintText: 'Select Marital Status ',
|
||||
ctrl: provider.ctrlMarital,
|
||||
listItem: provider.listMarital,
|
||||
onSelect: (value) {},
|
||||
),
|
||||
SelectFormView(
|
||||
name: 'Source of Fund',
|
||||
hintText: 'Select Source of Fund ',
|
||||
ctrl: provider.ctrlSourceFund,
|
||||
listItem: provider.listSourceFund,
|
||||
onSelect: (value) {},
|
||||
),
|
||||
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/component/button/button_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/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:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
@ -18,16 +22,30 @@ class InitialSignature extends StatelessWidget {
|
|||
)
|
||||
],
|
||||
builder: (context, child) {
|
||||
return const Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextCaption(title: 'Draw your digital sign'),
|
||||
ImageView(image: PathAssets.frameSignature),
|
||||
ListTileView(
|
||||
title:
|
||||
'Make sure the sign you draw is match with your ID Card'),
|
||||
],
|
||||
);
|
||||
return Consumer<SubmissionDataViewModel>(
|
||||
builder: (context, provider, child) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const TextCaption(title: 'Draw your digital sign'),
|
||||
const ImageView(image: PathAssets.frameSignature),
|
||||
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/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/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:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
@ -90,7 +90,11 @@ class TermsAndConditionView extends StatelessWidget {
|
|||
onPressed: () {
|
||||
provider.nextSubmission(context);
|
||||
routePush(context,
|
||||
page: const SubmissionParent());
|
||||
routeType: RouteType.pushReplace,
|
||||
page: SetPinView(
|
||||
currentPin: '',
|
||||
submitPin: (context, pin) {},
|
||||
));
|
||||
},
|
||||
marginVertical: 16))
|
||||
],
|
||||
|
|
|
@ -1,12 +1,59 @@
|
|||
import 'package:camera/camera.dart';
|
||||
import 'package:cims_apps/application/component/select_form/select_form_view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class SubmissionDataViewModel extends ChangeNotifier {
|
||||
SubmissionDataViewModel() {
|
||||
_getData();
|
||||
}
|
||||
|
||||
static int _currentStep = 1;
|
||||
int get getCurrentStep => _currentStep;
|
||||
int stepAmount = 9;
|
||||
bool _isEmailVerify = false;
|
||||
bool get isEmailVerify => _isEmailVerify;
|
||||
var formKeyPersonalData = GlobalKey<FormState>();
|
||||
TextEditingController ctrlOccupation = TextEditingController();
|
||||
TextEditingController ctrlIncome = TextEditingController();
|
||||
TextEditingController ctrlMarital = TextEditingController();
|
||||
TextEditingController ctrlSourceFund = TextEditingController();
|
||||
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 {
|
||||
final cameras = await availableCameras();
|
||||
|
@ -37,4 +84,24 @@ class SubmissionDataViewModel extends ChangeNotifier {
|
|||
|
||||
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
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
body: SingleChildScrollView(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 32.0,
|
||||
bottom: 8.0,
|
||||
|
|
|
@ -33,6 +33,43 @@ class MyApp extends StatelessWidget {
|
|||
)),
|
||||
fontFamily: 'Manrope',
|
||||
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(
|
||||
primary: const Color(0xff2563EB),
|
||||
onPrimary: const Color(0xFFFF9130),
|
||||
|
|
58
pubspec.lock
58
pubspec.lock
|
@ -488,6 +488,62 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
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:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
|
@ -671,4 +727,4 @@ packages:
|
|||
version: "6.5.0"
|
||||
sdks:
|
||||
dart: ">=3.2.3 <4.0.0"
|
||||
flutter: ">=3.13.0"
|
||||
flutter: ">=3.16.0"
|
||||
|
|
|
@ -50,6 +50,7 @@ dependencies:
|
|||
path: ^1.8.3
|
||||
syncfusion_flutter_signaturepad: ^24.2.4
|
||||
dotted_border: ^2.1.0
|
||||
shared_preferences: ^2.2.2
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user