diff --git a/lib/features/auth/registration/view/submission_data/risk_profile/results_view.dart b/lib/features/auth/registration/view/submission_data/risk_profile/results_view.dart index 0123b80..674913c 100644 --- a/lib/features/auth/registration/view/submission_data/risk_profile/results_view.dart +++ b/lib/features/auth/registration/view/submission_data/risk_profile/results_view.dart @@ -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/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/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'; class ResultsView extends StatelessWidget { @@ -24,7 +24,7 @@ class ResultsView extends StatelessWidget { title: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - BackButtonView(), + const BackButtonView(), const Text('Risk Profile', textAlign: TextAlign.center), SizedBox(width: SizeConfig.width * 0.1) ], @@ -33,7 +33,7 @@ class ResultsView extends StatelessWidget { side: BorderSide(color: ColorPalette.slate200)), ), body: SingleChildScrollView( - padding: EdgeInsets.all(24), + padding: const EdgeInsets.all(24), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -49,21 +49,21 @@ class ResultsView extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( - padding: EdgeInsets.all(24), + padding: const EdgeInsets.all(24), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( typeResult.type, - style: TextStyle( + style: const TextStyle( fontWeight: FontWeight.bold, fontSize: 24, color: ColorPalette.white), ), - SizedBox( + const SizedBox( height: 16, ), - Text( + const Text( 'Total Score :', style: TextStyle( fontWeight: FontWeight.bold, @@ -72,7 +72,7 @@ class ResultsView extends StatelessWidget { ), Text( totalScore, - style: TextStyle( + style: const TextStyle( fontWeight: FontWeight.bold, fontSize: 28, color: ColorPalette.white), @@ -84,29 +84,30 @@ class ResultsView extends StatelessWidget { ), ), ), - SizedBox( + const SizedBox( height: 24, ), Text(typeResult.desc, - style: TextStyle(color: ColorPalette.slate500, fontSize: 16)), - SizedBox( + style: const TextStyle( + color: ColorPalette.slate500, fontSize: 16)), + const SizedBox( height: 24, ), - Text( + const Text( 'Suitable Product', style: TextStyle( color: ColorPalette.slate800, fontWeight: FontWeight.bold, fontSize: 16), ), - SizedBox( + const SizedBox( height: 16, ), Wrap( runSpacing: 16, children: typeResult.suitableProduct.map((e) { return Container( - padding: EdgeInsets.all(16), + padding: const EdgeInsets.all(16), decoration: BoxDecoration( borderRadius: BorderRadius.circular(6), border: Border.all(color: ColorPalette.slate200), @@ -114,7 +115,7 @@ class ResultsView extends StatelessWidget { child: Row( children: [ Container( - padding: EdgeInsets.all(8), + padding: const EdgeInsets.all(8), alignment: Alignment.center, decoration: BoxDecoration( shape: BoxShape.circle, @@ -122,13 +123,13 @@ class ResultsView extends StatelessWidget { child: Image.asset(e['icon'], width: SizeConfig.width * 0.07, color: typeResult.color)), - SizedBox( + const SizedBox( width: 12, ), Expanded( child: Text( e['desc'], - style: TextStyle( + style: const TextStyle( fontSize: 16, fontWeight: FontWeight.bold, color: ColorPalette.slate800), @@ -139,7 +140,7 @@ class ResultsView extends StatelessWidget { ); }).toList(), ), - SizedBox( + const SizedBox( height: 32, ), ButtonView( @@ -152,22 +153,21 @@ class ResultsView extends StatelessWidget { isOutlined: true, textSize: 16, heightWrapContent: true, - contentPadding: EdgeInsets.all(16), + contentPadding: const EdgeInsets.all(16), width: SizeConfig.width, ), - SizedBox( + const SizedBox( height: 16, ), ButtonView( name: 'Confirm', onPressed: () { - //TODO route ke terms condition - routePush(context, page: DialogSuccess()); + routePush(context, page: const TermsAndConditionView()); }, marginVertical: 0, textSize: 16, heightWrapContent: true, - contentPadding: EdgeInsets.all(16), + contentPadding: const EdgeInsets.all(16), width: SizeConfig.width, ) ], diff --git a/lib/features/auth/registration/view/submission_data/terms_and_condition/terms_and_condition_view.dart b/lib/features/auth/registration/view/submission_data/terms_and_condition/terms_and_condition_view.dart index 5d0e5d1..88524b6 100644 --- a/lib/features/auth/registration/view/submission_data/terms_and_condition/terms_and_condition_view.dart +++ b/lib/features/auth/registration/view/submission_data/terms_and_condition/terms_and_condition_view.dart @@ -1,7 +1,11 @@ import 'package:cims_apps/application/component/custom_app_bar/custom_app_bar.dart'; import 'package:cims_apps/application/component/button/button_view.dart'; import 'package:cims_apps/application/theme/color_palette.dart'; +import 'package:cims_apps/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'; class TermsAndConditionView extends StatelessWidget { 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' ]; - return Scaffold( - appBar: CustomAppBar( - height: 70, - title: 'Terms And Condition' - ), - body: SingleChildScrollView( - padding: EdgeInsets.all(24), - child: Column( - children: [ - Text( - 'In relevance with the data that i have submitted and in relation to the purchase of Mutual Fund Products, I hereby declare that:', - style: TextStyle( - fontWeight: FontWeight.w600, - color: ColorPalette.slate800 + return ChangeNotifierProvider( + create: (context) => SubmissionDataViewModel(), + builder: (context, child) { + return Scaffold( + appBar: + const CustomAppBar(height: 70, title: 'Terms And Condition'), + body: SingleChildScrollView( + padding: const EdgeInsets.all(24), + child: Column( + children: [ + const Text( + 'In relevance with the data that i have submitted and in relation to the purchase of Mutual Fund Products, I hereby declare that:', + style: TextStyle( + 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), - ...listRules.asMap().entries.map((e) { - return Padding( - padding: EdgeInsets.only(top: e.key != 0 ? 12 : 0), + bottomNavigationBar: Consumer( + builder: (context, provider, child) { + return Container( + height: 84, + padding: const EdgeInsets.symmetric(horizontal: 24), child: Row( - crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text('${e.key + 1}', style: TextStyle(color: ColorPalette.slate500)), - SizedBox(width: 12), 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 - ) - ) - ], - ), - ), - ); + }), + ); + }); } }