fix: pull origin dev
This commit is contained in:
@@ -1,91 +0,0 @@
|
||||
import 'package:cims_apps/application/assets/path_assets.dart';
|
||||
import 'package:cims_apps/application/component/button/button_view.dart';
|
||||
import 'package:cims_apps/application/component/image/image_view.dart';
|
||||
import 'package:cims_apps/application/component/text_caption/text_caption.dart';
|
||||
import 'package:cims_apps/application/theme/color_palette.dart';
|
||||
import 'package:cims_apps/core/utils/size_config.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class InitialTakePhoto extends StatelessWidget {
|
||||
const InitialTakePhoto({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List listImg = [
|
||||
{'urlImg': PathAssets.imgKtpBlur, 'tag': 'Blurry Photo'},
|
||||
{'urlImg': PathAssets.imgKtpLight, 'tag': 'Light Reflection'},
|
||||
{'urlImg': PathAssets.imgKtpCropped, 'tag': 'Cropped Photo'},
|
||||
{'urlImg': PathAssets.imgKtpClear, 'tag': 'Clear Photo'},
|
||||
];
|
||||
return SizedBox(
|
||||
height: SizeConfig.height * .75,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const TextCaption(
|
||||
title: 'Take a photo your ID card',
|
||||
subtitle:
|
||||
'Make sure your photo is clearly legible for identity verification purposes',
|
||||
),
|
||||
SizedBox(
|
||||
width: SizeConfig.height,
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.spaceBetween,
|
||||
spacing: 10,
|
||||
runSpacing: 10,
|
||||
children: List.generate(listImg.length, (index) {
|
||||
final urlList = listImg[index]['urlImg'];
|
||||
final tag = listImg[index]['tag'];
|
||||
return Column(
|
||||
children: [
|
||||
ImageView(
|
||||
image: urlList,
|
||||
width: SizeConfig.width * .42,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Text(
|
||||
tag,
|
||||
style: const TextStyle(
|
||||
color: ColorPalette.slate800,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
// const Spacer(),
|
||||
const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
ImageView(
|
||||
image: PathAssets.iconShield,
|
||||
width: 20,
|
||||
height: 22,
|
||||
),
|
||||
SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'In accordance with OJK regulations, an ID card is required to purchase mutual funds.',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: ColorPalette.primary,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
ButtonView(
|
||||
name: 'Take a Photo',
|
||||
marginVertical: 16.0,
|
||||
onPressed: () {},
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ import 'package:cims_apps/application/component/button/button_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/initial_take_photo.dart';
|
||||
import 'package:cims_apps/features/auth/registration/view/submission_data/submit_photo_ktp.dart';
|
||||
import 'package:cims_apps/features/auth/registration/view/submission_data/submit_email.dart';
|
||||
import 'package:cims_apps/features/auth/registration/view/submission_data/submit_personal_data.dart';
|
||||
import 'package:cims_apps/features/auth/registration/viewmodel/submission_data_viewmodel.dart';
|
||||
@@ -40,7 +40,7 @@ class _SubmissionParentState extends State<SubmissionParent> {
|
||||
case 2:
|
||||
return const SubmitEmail();
|
||||
case 3:
|
||||
return const InitialTakePhoto();
|
||||
return const SubmitPhotoKtp();
|
||||
case 4:
|
||||
return Container(
|
||||
child: Text("Step 4"),
|
||||
@@ -101,7 +101,7 @@ class _SubmissionParentState extends State<SubmissionParent> {
|
||||
provider.stepAmount,
|
||||
(index) => _stepItem(
|
||||
isCurrentStep:
|
||||
provider.currentStep == index + 1,
|
||||
provider.getCurrentStep == index + 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -110,10 +110,10 @@ class _SubmissionParentState extends State<SubmissionParent> {
|
||||
child: Container(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: _content(provider.currentStep),
|
||||
child: _content(provider.getCurrentStep),
|
||||
),
|
||||
),
|
||||
provider.currentStep == 3
|
||||
provider.getCurrentStep == 3
|
||||
? const SizedBox()
|
||||
: Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
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/take_picture_screen/take_picture_screen.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/core/utils/size_config.dart';
|
||||
import 'package:cims_apps/features/auth/registration/viewmodel/submission_data_viewmodel.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class SubmitPhotoKtp extends StatelessWidget {
|
||||
const SubmitPhotoKtp({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List listImg = [
|
||||
{'urlImg': PathAssets.imgKtpBlur, 'tag': 'Blurry Photo'},
|
||||
{'urlImg': PathAssets.imgKtpLight, 'tag': 'Light Reflection'},
|
||||
{'urlImg': PathAssets.imgKtpCropped, 'tag': 'Cropped Photo'},
|
||||
{'urlImg': PathAssets.imgKtpClear, 'tag': 'Clear Photo'},
|
||||
];
|
||||
return MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => SubmissionDataViewModel(),
|
||||
),
|
||||
],
|
||||
builder: (context, child) {
|
||||
return SizedBox(
|
||||
height: SizeConfig.height * .75,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const TextCaption(
|
||||
title: 'Take a photo your ID card',
|
||||
subtitle:
|
||||
'Make sure your photo is clearly legible for identity verification purposes',
|
||||
),
|
||||
SizedBox(
|
||||
width: SizeConfig.height,
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.spaceBetween,
|
||||
spacing: 10,
|
||||
runSpacing: 10,
|
||||
children: List.generate(listImg.length, (index) {
|
||||
final urlList = listImg[index]['urlImg'];
|
||||
final tag = listImg[index]['tag'];
|
||||
return Column(
|
||||
children: [
|
||||
ImageView(
|
||||
image: urlList,
|
||||
width: SizeConfig.width * .42,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Text(
|
||||
tag,
|
||||
style: const TextStyle(
|
||||
color: ColorPalette.slate800,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
// const Spacer(),
|
||||
const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
ImageView(
|
||||
image: PathAssets.iconShield,
|
||||
width: 20,
|
||||
height: 22,
|
||||
),
|
||||
SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'In accordance with OJK regulations, an ID card is required to purchase mutual funds.',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: ColorPalette.primary,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Consumer<SubmissionDataViewModel>(
|
||||
builder: (context, provider, child) {
|
||||
return ButtonView(
|
||||
name: 'Take a Photo',
|
||||
marginVertical: 16.0,
|
||||
onPressed: () {
|
||||
provider.initCamera().then((cameras) {
|
||||
routePush(context,
|
||||
page: TakePictureScreen(
|
||||
camera: cameras.first,
|
||||
takeContent: 'ktp',
|
||||
));
|
||||
});
|
||||
},
|
||||
);
|
||||
})
|
||||
],
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,27 @@
|
||||
import 'package:camera/camera.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SubmissionDataViewModel extends ChangeNotifier {
|
||||
int currentStep = 1;
|
||||
static int _currentStep = 1;
|
||||
int get getCurrentStep => _currentStep;
|
||||
int stepAmount = 9;
|
||||
bool _isEmailVerify = false;
|
||||
bool get isEmailVerify => _isEmailVerify;
|
||||
|
||||
Future<List<CameraDescription>> initCamera() async {
|
||||
final cameras = await availableCameras();
|
||||
final camerasDesc = cameras;
|
||||
return camerasDesc;
|
||||
}
|
||||
|
||||
submitEmail() {
|
||||
_isEmailVerify = !_isEmailVerify;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
onWillPopSubmission(BuildContext context) {
|
||||
if (currentStep != 1) {
|
||||
currentStep--;
|
||||
if (getCurrentStep != 1) {
|
||||
_currentStep--;
|
||||
notifyListeners();
|
||||
} else {
|
||||
Navigator.of(context).pop(true);
|
||||
@@ -21,8 +29,8 @@ class SubmissionDataViewModel extends ChangeNotifier {
|
||||
}
|
||||
|
||||
nextSubmission(BuildContext context) {
|
||||
if (currentStep < stepAmount) {
|
||||
currentStep++;
|
||||
if (getCurrentStep < stepAmount) {
|
||||
_currentStep++;
|
||||
} else {
|
||||
//ToDo : Go To next step after completing the submission
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user