feat: submit data bank account
This commit is contained in:
parent
4bad9cd18c
commit
23d189c288
BIN
assets/icons/icon-question.png
Normal file
BIN
assets/icons/icon-question.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
BIN
assets/images/img-guide-bank.png
Normal file
BIN
assets/images/img-guide-bank.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 53 KiB |
BIN
assets/images/img-guide1.png
Normal file
BIN
assets/images/img-guide1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 76 KiB |
BIN
assets/images/img-guide2.png
Normal file
BIN
assets/images/img-guide2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 119 KiB |
|
@ -10,10 +10,14 @@ class PathAssets {
|
|||
static const String iconGoogle = 'assets/icons/icon-google.png';
|
||||
static const String icon1 = 'assets/icons/icon-1.png';
|
||||
static const String iconConnect = 'assets/icons/icon-connect.png';
|
||||
static const String iconPortofolioBonds = 'assets/icons/icon-portofolio-bonds.png';
|
||||
static const String iconPortofolioShares = 'assets/icons/icon-portofolio-shares.png';
|
||||
static const String iconPortofolioSharia = 'assets/icons/icon-portofolio-sharia.png';
|
||||
static const String iconPortofolioMoneyMarket = 'assets/icons/icon-portofolio-moneymarket.png';
|
||||
static const String iconPortofolioBonds =
|
||||
'assets/icons/icon-portofolio-bonds.png';
|
||||
static const String iconPortofolioShares =
|
||||
'assets/icons/icon-portofolio-shares.png';
|
||||
static const String iconPortofolioSharia =
|
||||
'assets/icons/icon-portofolio-sharia.png';
|
||||
static const String iconPortofolioMoneyMarket =
|
||||
'assets/icons/icon-portofolio-moneymarket.png';
|
||||
static const String iconShield = 'assets/icons/icon-shield.png';
|
||||
static const String iconFlag = 'assets/icons/icon-flag.png';
|
||||
static const String iconKtp1 = 'assets/icons/icon-ktp1.png';
|
||||
|
@ -28,6 +32,7 @@ class PathAssets {
|
|||
static const String iconBalance = 'assets/icons/icon-balance.png';
|
||||
static const String iconMoneyReceive = 'assets/icons/icon-money-receive.png';
|
||||
static const String iconCoins = 'assets/icons/icon-coins.png';
|
||||
static const String iconQuestion = 'assets/icons/icon-question.png';
|
||||
|
||||
/// IMAGE
|
||||
static const String imgSplashLogo = 'assets/images/splash-logo.png';
|
||||
|
@ -40,7 +45,8 @@ class PathAssets {
|
|||
static const String imgKtpCropped = 'assets/images/img-ktp-cropped.png';
|
||||
static const String imgKtpClear = 'assets/images/img-ktp-clear.png';
|
||||
static const String imgKtpBlur = 'assets/images/img-ktp-blur.png';
|
||||
static const String imgDashboardAccount = 'assets/images/img-dashboard-account.png';
|
||||
static const String imgDashboardAccount =
|
||||
'assets/images/img-dashboard-account.png';
|
||||
static const String imgCarousel = 'assets/images/img-carousel.png';
|
||||
static const String imgArticles = 'assets/images/img-articles.png';
|
||||
static const String imgProduct = 'assets/images/img-product.png';
|
||||
|
@ -49,11 +55,15 @@ class PathAssets {
|
|||
static const String imgBgSelfie = 'assets/images/img-bg-photo-selfie.png';
|
||||
static const String imgDataReport = 'assets/images/img-data-report.png';
|
||||
static const String imgDataAnalysis = 'assets/images/img-data-analysis.png';
|
||||
static const String imgBusinessFailure = 'assets/images/img-business-failure.png';
|
||||
static const String imgBusinessFailure =
|
||||
'assets/images/img-business-failure.png';
|
||||
static const String imgLeader = 'assets/images/img-leader.png';
|
||||
static const String imgMoneyIncome = 'assets/images/img-money-income.png';
|
||||
static const String imgGrowing = 'assets/images/img-growing.png';
|
||||
static const String imgCat = 'assets/images/img-cat.png';
|
||||
static const String imgDeer = 'assets/images/img-deer.png';
|
||||
static const String imgLion = 'assets/images/img-lion.png';
|
||||
static const String imgGuideBank = 'assets/images/img-guide-bank.png';
|
||||
static const String imgGuide1 = 'assets/images/img-guide1.png';
|
||||
static const String imgGuide2 = 'assets/images/img-guide2.png';
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
|
|||
|
||||
class TextCaption extends StatelessWidget {
|
||||
final String title, subtitle;
|
||||
final TextAlign? textAlignSubtitle;
|
||||
final TextAlign? textAlign, textAlignSubtitle;
|
||||
final CrossAxisAlignment? crossAxisAlignment;
|
||||
const TextCaption({
|
||||
Key? key,
|
||||
|
@ -11,6 +11,7 @@ class TextCaption extends StatelessWidget {
|
|||
this.subtitle = '',
|
||||
this.textAlignSubtitle,
|
||||
this.crossAxisAlignment,
|
||||
this.textAlign,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
|
@ -23,6 +24,7 @@ class TextCaption extends StatelessWidget {
|
|||
children: [
|
||||
Text(
|
||||
title,
|
||||
textAlign: textAlign ?? TextAlign.start,
|
||||
style: const TextStyle(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.w700,
|
||||
|
|
|
@ -81,23 +81,26 @@ class TextFormView extends StatelessWidget {
|
|||
if (inputFormatters != null && maxLength != null) {
|
||||
inputFormatters?.add(LengthLimitingTextInputFormatter(maxLength));
|
||||
}
|
||||
return Column(
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
name.isNotEmpty
|
||||
? validator != null
|
||||
// ? validator != null
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
name,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
// color: ColorPalette.greyLight,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: ColorPalette.slate800,
|
||||
),
|
||||
),
|
||||
suffixLable ??
|
||||
|
@ -115,8 +118,8 @@ class TextFormView extends StatelessWidget {
|
|||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
),
|
||||
// : const SizedBox(),
|
||||
trailingTitleWidget ?? const SizedBox(),
|
||||
],
|
||||
),
|
||||
|
@ -191,13 +194,14 @@ class TextFormView extends StatelessWidget {
|
|||
suffixIconConstraints: suffixIconConstraints,
|
||||
prefixIconConstraints: preffixIconConstraints,
|
||||
prefix: prefix,
|
||||
contentPadding: contentPadding ?? const EdgeInsets.symmetric(
|
||||
contentPadding: contentPadding ??
|
||||
const EdgeInsets.symmetric(
|
||||
horizontal: 8.0,
|
||||
vertical: 16.0,
|
||||
)
|
||||
),
|
||||
)),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ import 'package:cims_apps/core/utils/size_config.dart';
|
|||
import 'package:cims_apps/features/auth/login/view/password_view.dart';
|
||||
import 'package:cims_apps/features/auth/login/view/phone_number_view.dart';
|
||||
import 'package:cims_apps/features/auth/login/view_model/login_view_model.dart';
|
||||
import 'package:cims_apps/features/auth/registration/view/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/bottom_navigation_view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
@ -69,14 +69,14 @@ class _LoginViewState extends State<LoginView> {
|
|||
],
|
||||
),
|
||||
shape: const RoundedRectangleBorder(
|
||||
side: BorderSide(color: ColorPalette.slate200)
|
||||
),
|
||||
side: BorderSide(color: ColorPalette.slate200)),
|
||||
),
|
||||
body: PageView(
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
controller: pageController,
|
||||
children: [
|
||||
PhoneNumberView(nextStep: nextStep, controller: phoneNumberController),
|
||||
PhoneNumberView(
|
||||
nextStep: nextStep, controller: phoneNumberController),
|
||||
PasswordView(nextStep: nextStep, controller: passwordController)
|
||||
],
|
||||
),
|
||||
|
|
|
@ -1,164 +0,0 @@
|
|||
import 'package:cims_apps/application/assets/path_assets.dart';
|
||||
import 'package:cims_apps/application/component/button/button_back.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/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/risk_profile/results_view.dart';
|
||||
import 'package:cims_apps/features/auth/registration/view/risk_profile/risk_profile_view.dart';
|
||||
import 'package:cims_apps/features/auth/registration/view/risk_profile/risk_profile_view_model/risk_profile_view_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class QuestionView extends StatefulWidget {
|
||||
const QuestionView({super.key});
|
||||
|
||||
@override
|
||||
State<QuestionView> createState() => _QuestionViewState();
|
||||
}
|
||||
|
||||
class _QuestionViewState extends State<QuestionView> {
|
||||
int currentPage = 0;
|
||||
PageController pageController = PageController();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => RiskProfileViewModel(),
|
||||
child: Consumer<RiskProfileViewModel>(
|
||||
builder: (context, provider, child) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 70,
|
||||
backgroundColor: Colors.white,
|
||||
surfaceTintColor: Colors.white,
|
||||
automaticallyImplyLeading: false,
|
||||
centerTitle: true,
|
||||
title: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
ButtonBack(),
|
||||
const Text('Risk Profile', textAlign: TextAlign.center),
|
||||
SizedBox(
|
||||
width: SizeConfig.width * 0.1
|
||||
)
|
||||
],
|
||||
),
|
||||
shape: const RoundedRectangleBorder(
|
||||
side: BorderSide(color: ColorPalette.slate200)
|
||||
),
|
||||
),
|
||||
body: PageView(
|
||||
controller: pageController,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
children: provider.listRiskProfileQuestion.asMap().entries.map((e) {
|
||||
return containerQuestion(
|
||||
e.value,
|
||||
e.key,
|
||||
(index, score) => provider.selectedAnswer(index, score)
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
bottomNavigationBar: SizedBox(
|
||||
height: 84,
|
||||
child: ButtonView(
|
||||
name: 'Next',
|
||||
marginVertical: 16,
|
||||
onPressed: () {
|
||||
if(currentPage > 3){
|
||||
int totalScore = provider.listScore.reduce((value, element) => value + element);
|
||||
provider.setTypeResult(totalScore);
|
||||
routePush(context, page: ResultsView(totalScore: totalScore.toString(), typeResult: provider.typeResult));
|
||||
}else{
|
||||
setState(() {
|
||||
currentPage += 1;
|
||||
});
|
||||
pageController.nextPage(duration: Duration(milliseconds: 300), curve: Curves.ease);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget containerQuestion(RiskProfileQuestion data, int index, void Function(int index, int score) onTapAnswers) {
|
||||
return SizedBox(
|
||||
height: SizeConfig.height,
|
||||
width: SizeConfig.width,
|
||||
child: ListView(
|
||||
padding: EdgeInsets.all(24),
|
||||
children: [
|
||||
ImageView(
|
||||
image: data.img,
|
||||
fit: BoxFit.fitWidth,
|
||||
),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
Text(
|
||||
'${index + 1} of 5 question',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: ColorPalette.primary
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Text(
|
||||
data.question,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 24,
|
||||
color: ColorPalette.slate800
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
Column(
|
||||
children: data.answers.asMap().entries.map((e) {
|
||||
bool selected = data.selectedScore == e.value.score;
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
onTapAnswers(index, e.value.score);
|
||||
},
|
||||
child: AnimatedContainer(
|
||||
duration: Duration(milliseconds: 300),
|
||||
margin: EdgeInsets.only(top: 12),
|
||||
padding: EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: selected ? ColorPalette.primary : ColorPalette.slate200),
|
||||
borderRadius: BorderRadius.circular(8)
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
e.value.title,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: selected ? ColorPalette.primary : ColorPalette.slate500,
|
||||
fontWeight: FontWeight.w500
|
||||
),
|
||||
),
|
||||
),
|
||||
if(selected)...[
|
||||
Icon(Icons.check_circle_rounded, color: ColorPalette.primary)
|
||||
]
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,126 @@
|
|||
import 'package:cims_apps/application/assets/path_assets.dart';
|
||||
import 'package:cims_apps/application/component/button/button_back.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 GuideScreen extends StatelessWidget {
|
||||
const GuideScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List listImg = [
|
||||
{
|
||||
'urlImg': PathAssets.imgGuide1,
|
||||
'title': 'Passbook',
|
||||
'subtitle': 'Look in your passbook for the account number'
|
||||
},
|
||||
{
|
||||
'urlImg': PathAssets.imgGuide2,
|
||||
'title': 'Mobile Banking App',
|
||||
'subtitle':
|
||||
'Open the mobile banking app and you will find your account number'
|
||||
},
|
||||
];
|
||||
|
||||
listGuide() {
|
||||
return Column(
|
||||
children: listImg.map((e) {
|
||||
return Container(
|
||||
width: SizeConfig.width,
|
||||
height: SizeConfig.height * .18,
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
margin: const EdgeInsets.symmetric(vertical: 8.0),
|
||||
decoration: BoxDecoration(
|
||||
color: ColorPalette.white,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(
|
||||
color: ColorPalette.slate400,
|
||||
width: 2,
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 8.0),
|
||||
child: ImageView(
|
||||
image: e['urlImg'],
|
||||
width: SizeConfig.width * .4,
|
||||
fit: BoxFit.fill,
|
||||
borderRadius: 8,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
e['title'],
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: ColorPalette.slate800,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
e['subtitle'],
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: ColorPalette.slate500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
));
|
||||
}).toList(),
|
||||
);
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 70,
|
||||
backgroundColor: Colors.white,
|
||||
surfaceTintColor: Colors.white,
|
||||
automaticallyImplyLeading: false,
|
||||
title: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const ButtonBack(),
|
||||
const Text('Guide'),
|
||||
SizedBox(
|
||||
width: SizeConfig.width * 0.1,
|
||||
)
|
||||
],
|
||||
),
|
||||
shape: const RoundedRectangleBorder(
|
||||
side: BorderSide(color: ColorPalette.slate200)),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
const ImageView(image: PathAssets.imgGuideBank),
|
||||
const TextCaption(
|
||||
textAlign: TextAlign.center,
|
||||
title: 'Guide to knowing your account number'),
|
||||
listGuide(),
|
||||
ButtonView(
|
||||
name: 'close',
|
||||
isOutlined: true,
|
||||
onPressed: () => Navigator.pop(context),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
import 'package:cims_apps/application/assets/path_assets.dart';
|
||||
import 'package:cims_apps/application/component/image/image_view.dart';
|
||||
import 'package:cims_apps/application/component/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/features/auth/registration/view/submission_data/data_bank/guide_screen.dart';
|
||||
import 'package:flutter/material.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 SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const TextCaption(title: 'Input your bank account data'),
|
||||
SelectFormView(
|
||||
name: 'Bank Name',
|
||||
listItem: listForm,
|
||||
onSelect: (value) {},
|
||||
),
|
||||
TextFormView(
|
||||
name: 'Account Number',
|
||||
trailingTitleWidget: SizedBox(
|
||||
width: 24,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
routePush(context, page: GuideScreen());
|
||||
},
|
||||
child: const ImageView(image: PathAssets.iconQuestion),
|
||||
),
|
||||
),
|
||||
),
|
||||
TextFormView(name: 'Account Owner Name'),
|
||||
const Text(
|
||||
"Make sure the account you use is in your name, not someone else's",
|
||||
style: TextStyle(
|
||||
color: ColorPalette.slate400,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,164 @@
|
|||
import 'package:cims_apps/application/assets/path_assets.dart';
|
||||
import 'package:cims_apps/application/component/button/button_back.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/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/risk_profile/results_view.dart';
|
||||
import 'package:cims_apps/features/auth/registration/view/submission_data/risk_profile/risk_profile_view_model/risk_profile_view_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class QuestionView extends StatefulWidget {
|
||||
const QuestionView({super.key});
|
||||
|
||||
@override
|
||||
State<QuestionView> createState() => _QuestionViewState();
|
||||
}
|
||||
|
||||
class _QuestionViewState extends State<QuestionView> {
|
||||
int currentPage = 0;
|
||||
PageController pageController = PageController();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => RiskProfileViewModel(),
|
||||
child:
|
||||
Consumer<RiskProfileViewModel>(builder: (context, provider, child) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 70,
|
||||
backgroundColor: Colors.white,
|
||||
surfaceTintColor: Colors.white,
|
||||
automaticallyImplyLeading: false,
|
||||
centerTitle: true,
|
||||
title: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
ButtonBack(),
|
||||
const Text('Risk Profile', textAlign: TextAlign.center),
|
||||
SizedBox(width: SizeConfig.width * 0.1)
|
||||
],
|
||||
),
|
||||
shape: const RoundedRectangleBorder(
|
||||
side: BorderSide(color: ColorPalette.slate200)),
|
||||
),
|
||||
body: PageView(
|
||||
controller: pageController,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
children: provider.listRiskProfileQuestion.asMap().entries.map((e) {
|
||||
return containerQuestion(e.value, e.key,
|
||||
(index, score) => provider.selectedAnswer(index, score));
|
||||
}).toList(),
|
||||
),
|
||||
bottomNavigationBar: SizedBox(
|
||||
height: 84,
|
||||
child: ButtonView(
|
||||
name: 'Next',
|
||||
marginVertical: 16,
|
||||
onPressed: () {
|
||||
if (currentPage > 3) {
|
||||
int totalScore = provider.listScore
|
||||
.reduce((value, element) => value + element);
|
||||
provider.setTypeResult(totalScore);
|
||||
routePush(context,
|
||||
page: ResultsView(
|
||||
totalScore: totalScore.toString(),
|
||||
typeResult: provider.typeResult));
|
||||
} else {
|
||||
setState(() {
|
||||
currentPage += 1;
|
||||
});
|
||||
pageController.nextPage(
|
||||
duration: Duration(milliseconds: 300),
|
||||
curve: Curves.ease);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
Widget containerQuestion(RiskProfileQuestion data, int index,
|
||||
void Function(int index, int score) onTapAnswers) {
|
||||
return SizedBox(
|
||||
height: SizeConfig.height,
|
||||
width: SizeConfig.width,
|
||||
child: ListView(
|
||||
padding: EdgeInsets.all(24),
|
||||
children: [
|
||||
ImageView(
|
||||
image: data.img,
|
||||
fit: BoxFit.fitWidth,
|
||||
),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
Text(
|
||||
'${index + 1} of 5 question',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, color: ColorPalette.primary),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Text(
|
||||
data.question,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 24,
|
||||
color: ColorPalette.slate800),
|
||||
),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
Column(
|
||||
children: data.answers.asMap().entries.map((e) {
|
||||
bool selected = data.selectedScore == e.value.score;
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
onTapAnswers(index, e.value.score);
|
||||
},
|
||||
child: AnimatedContainer(
|
||||
duration: Duration(milliseconds: 300),
|
||||
margin: EdgeInsets.only(top: 12),
|
||||
padding: EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: selected
|
||||
? ColorPalette.primary
|
||||
: ColorPalette.slate200),
|
||||
borderRadius: BorderRadius.circular(8)),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
e.value.title,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: selected
|
||||
? ColorPalette.primary
|
||||
: ColorPalette.slate500,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
),
|
||||
if (selected) ...[
|
||||
Icon(Icons.check_circle_rounded,
|
||||
color: ColorPalette.primary)
|
||||
]
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -6,7 +6,7 @@ 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_password_view.dart';
|
||||
import 'package:cims_apps/features/auth/registration/view/risk_profile/risk_profile_view_model/risk_profile_view_model.dart';
|
||||
import 'package:cims_apps/features/auth/registration/view/submission_data/risk_profile/risk_profile_view_model/risk_profile_view_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
|
@ -5,7 +5,7 @@ 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/risk_profile/question_view.dart';
|
||||
import 'package:cims_apps/features/auth/registration/view/submission_data/risk_profile/question_view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class RiskProfileView extends StatelessWidget {
|
||||
|
@ -24,14 +24,11 @@ class RiskProfileView extends StatelessWidget {
|
|||
children: [
|
||||
ButtonBack(),
|
||||
const Text('Risk Profile', textAlign: TextAlign.center),
|
||||
SizedBox(
|
||||
width: SizeConfig.width * 0.1
|
||||
)
|
||||
SizedBox(width: SizeConfig.width * 0.1)
|
||||
],
|
||||
),
|
||||
shape: const RoundedRectangleBorder(
|
||||
side: BorderSide(color: ColorPalette.slate200)
|
||||
),
|
||||
side: BorderSide(color: ColorPalette.slate200)),
|
||||
),
|
||||
body: Container(
|
||||
width: SizeConfig.width,
|
||||
|
@ -52,8 +49,7 @@ class RiskProfileView extends StatelessWidget {
|
|||
style: TextStyle(
|
||||
color: ColorPalette.slate800,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 24
|
||||
),
|
||||
fontSize: 24),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
|
@ -64,8 +60,7 @@ class RiskProfileView extends StatelessWidget {
|
|||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: ColorPalette.slate500
|
||||
),
|
||||
color: ColorPalette.slate500),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -87,8 +82,7 @@ class RiskProfileView extends StatelessWidget {
|
|||
style: TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: ColorPalette.primary,
|
||||
fontSize: 16
|
||||
),
|
||||
fontSize: 16),
|
||||
)
|
||||
],
|
||||
),
|
|
@ -2,6 +2,8 @@ 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/data_bank/submit_bank_account.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_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';
|
||||
|
@ -45,13 +47,9 @@ class _SubmissionParentState extends State<SubmissionParent> {
|
|||
case 4:
|
||||
return const SubmitPhotoSelfie();
|
||||
case 5:
|
||||
return Container(
|
||||
child: Text("Step 5"),
|
||||
);
|
||||
return const SubmitDataIdCard();
|
||||
case 6:
|
||||
return Container(
|
||||
child: Text("Step 6"),
|
||||
);
|
||||
return const SubmitBankAccount();
|
||||
case 7:
|
||||
return Container(
|
||||
child: Text("Step 7"),
|
||||
|
|
|
@ -7,8 +7,8 @@ import 'package:cims_apps/application/theme/color_palette.dart';
|
|||
import 'package:cims_apps/core/utils/size_config.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SubmissionDataIdCard extends StatelessWidget {
|
||||
const SubmissionDataIdCard({Key? key}) : super(key: key);
|
||||
class SubmitDataIdCard extends StatelessWidget {
|
||||
const SubmitDataIdCard({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
Loading…
Reference in New Issue
Block a user