fix: term condition page

This commit is contained in:
Dian Bayu Nugroho 2024-02-16 17:35:58 +07:00
parent a6248520ef
commit e86e67b9c9
2 changed files with 92 additions and 79 deletions

View File

@ -3,8 +3,8 @@ 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/registration_password_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:cims_apps/features/auth/registration/view/submission_data/risk_profile/risk_profile_view_model/risk_profile_view_model.dart';
import 'package:cims_apps/features/auth/registration/view/submission_data/terms_and_condition/terms_and_condition_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ResultsView extends StatelessWidget { class ResultsView extends StatelessWidget {
@ -24,7 +24,7 @@ class ResultsView extends StatelessWidget {
title: Row( title: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
BackButtonView(), const BackButtonView(),
const Text('Risk Profile', textAlign: TextAlign.center), const Text('Risk Profile', textAlign: TextAlign.center),
SizedBox(width: SizeConfig.width * 0.1) SizedBox(width: SizeConfig.width * 0.1)
], ],
@ -33,7 +33,7 @@ class ResultsView extends StatelessWidget {
side: BorderSide(color: ColorPalette.slate200)), side: BorderSide(color: ColorPalette.slate200)),
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
padding: EdgeInsets.all(24), padding: const EdgeInsets.all(24),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -49,21 +49,21 @@ class ResultsView extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Container( Container(
padding: EdgeInsets.all(24), padding: const EdgeInsets.all(24),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
typeResult.type, typeResult.type,
style: TextStyle( style: const TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 24, fontSize: 24,
color: ColorPalette.white), color: ColorPalette.white),
), ),
SizedBox( const SizedBox(
height: 16, height: 16,
), ),
Text( const Text(
'Total Score :', 'Total Score :',
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -72,7 +72,7 @@ class ResultsView extends StatelessWidget {
), ),
Text( Text(
totalScore, totalScore,
style: TextStyle( style: const TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 28, fontSize: 28,
color: ColorPalette.white), color: ColorPalette.white),
@ -84,29 +84,30 @@ class ResultsView extends StatelessWidget {
), ),
), ),
), ),
SizedBox( const SizedBox(
height: 24, height: 24,
), ),
Text(typeResult.desc, Text(typeResult.desc,
style: TextStyle(color: ColorPalette.slate500, fontSize: 16)), style: const TextStyle(
SizedBox( color: ColorPalette.slate500, fontSize: 16)),
const SizedBox(
height: 24, height: 24,
), ),
Text( const Text(
'Suitable Product', 'Suitable Product',
style: TextStyle( style: TextStyle(
color: ColorPalette.slate800, color: ColorPalette.slate800,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 16), fontSize: 16),
), ),
SizedBox( const SizedBox(
height: 16, height: 16,
), ),
Wrap( Wrap(
runSpacing: 16, runSpacing: 16,
children: typeResult.suitableProduct.map((e) { children: typeResult.suitableProduct.map((e) {
return Container( return Container(
padding: EdgeInsets.all(16), padding: const EdgeInsets.all(16),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(6),
border: Border.all(color: ColorPalette.slate200), border: Border.all(color: ColorPalette.slate200),
@ -114,7 +115,7 @@ class ResultsView extends StatelessWidget {
child: Row( child: Row(
children: [ children: [
Container( Container(
padding: EdgeInsets.all(8), padding: const EdgeInsets.all(8),
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
@ -122,13 +123,13 @@ class ResultsView extends StatelessWidget {
child: Image.asset(e['icon'], child: Image.asset(e['icon'],
width: SizeConfig.width * 0.07, width: SizeConfig.width * 0.07,
color: typeResult.color)), color: typeResult.color)),
SizedBox( const SizedBox(
width: 12, width: 12,
), ),
Expanded( Expanded(
child: Text( child: Text(
e['desc'], e['desc'],
style: TextStyle( style: const TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: ColorPalette.slate800), color: ColorPalette.slate800),
@ -139,7 +140,7 @@ class ResultsView extends StatelessWidget {
); );
}).toList(), }).toList(),
), ),
SizedBox( const SizedBox(
height: 32, height: 32,
), ),
ButtonView( ButtonView(
@ -152,22 +153,21 @@ class ResultsView extends StatelessWidget {
isOutlined: true, isOutlined: true,
textSize: 16, textSize: 16,
heightWrapContent: true, heightWrapContent: true,
contentPadding: EdgeInsets.all(16), contentPadding: const EdgeInsets.all(16),
width: SizeConfig.width, width: SizeConfig.width,
), ),
SizedBox( const SizedBox(
height: 16, height: 16,
), ),
ButtonView( ButtonView(
name: 'Confirm', name: 'Confirm',
onPressed: () { onPressed: () {
//TODO route ke terms condition routePush(context, page: const TermsAndConditionView());
routePush(context, page: DialogSuccess());
}, },
marginVertical: 0, marginVertical: 0,
textSize: 16, textSize: 16,
heightWrapContent: true, heightWrapContent: true,
contentPadding: EdgeInsets.all(16), contentPadding: const EdgeInsets.all(16),
width: SizeConfig.width, width: SizeConfig.width,
) )
], ],

View File

@ -1,7 +1,11 @@
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/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/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 TermsAndConditionView extends StatelessWidget { class TermsAndConditionView extends StatelessWidget {
const TermsAndConditionView({super.key}); const TermsAndConditionView({super.key});
@ -22,69 +26,78 @@ class TermsAndConditionView extends StatelessWidget {
'I am willing to provide my data and information from PT Gemilang Indonesia Manajemen Investasi to groups' 'I am willing to provide my data and information from PT Gemilang Indonesia Manajemen Investasi to groups'
]; ];
return Scaffold( return ChangeNotifierProvider(
appBar: CustomAppBar( create: (context) => SubmissionDataViewModel(),
height: 70, builder: (context, child) {
title: 'Terms And Condition' return Scaffold(
), appBar:
body: SingleChildScrollView( const CustomAppBar(height: 70, title: 'Terms And Condition'),
padding: EdgeInsets.all(24), body: SingleChildScrollView(
child: Column( padding: const EdgeInsets.all(24),
children: [ child: Column(
Text( children: [
'In relevance with the data that i have submitted and in relation to the purchase of Mutual Fund Products, I hereby declare that:', const Text(
style: TextStyle( 'In relevance with the data that i have submitted and in relation to the purchase of Mutual Fund Products, I hereby declare that:',
fontWeight: FontWeight.w600, style: TextStyle(
color: ColorPalette.slate800 fontWeight: FontWeight.w600,
color: ColorPalette.slate800),
),
const SizedBox(height: 12),
...listRules.asMap().entries.map((e) {
return Padding(
padding: EdgeInsets.only(top: e.key != 0 ? 12 : 0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('${e.key + 1}',
style: const TextStyle(
color: ColorPalette.slate500)),
const SizedBox(width: 12),
Expanded(
child: Text(e.value,
style: const TextStyle(
color: ColorPalette.slate500)))
],
),
);
})
],
), ),
), ),
SizedBox(height: 12), bottomNavigationBar: Consumer<SubmissionDataViewModel>(
...listRules.asMap().entries.map((e) { builder: (context, provider, child) {
return Padding( return Container(
padding: EdgeInsets.only(top: e.key != 0 ? 12 : 0), height: 84,
padding: const EdgeInsets.symmetric(horizontal: 24),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text('${e.key + 1}', style: TextStyle(color: ColorPalette.slate500)),
SizedBox(width: 12),
Expanded( Expanded(
child: Text(e.value, style: TextStyle(color: ColorPalette.slate500)) child: ButtonView(
) name: 'Decline',
onPressed: () {
Navigator.pop(context);
},
marginVertical: 16,
backgroundColor: ColorPalette.white,
textColor: ColorPalette.primary,
isOutlined: true,
borderColor: ColorPalette.primary,
)),
const SizedBox(width: 16),
Expanded(
child: ButtonView(
name: 'Accept',
onPressed: () {
provider.nextSubmission(context);
routePush(context,
page: const SubmissionParent());
},
marginVertical: 16))
], ],
), ),
); );
}) }),
], );
), });
),
bottomNavigationBar: Container(
height: 84,
padding: EdgeInsets.symmetric(horizontal: 24),
color: Colors.red,
child: Row(
children: [
Expanded(
child: ButtonView(
name: 'Decline',
onPressed: () {},
marginVertical: 16,
backgroundColor: ColorPalette.white,
textColor: ColorPalette.primary,
isOutlined: true,
borderColor: ColorPalette.primary,
)
),
SizedBox(width: 16),
Expanded(
child: ButtonView(
name: 'Accept',
onPressed: () {},
marginVertical: 16
)
)
],
),
),
);
} }
} }