fix: provider view model agreement redeem and product
This commit is contained in:
parent
a3148d8210
commit
176261923d
|
@ -11,9 +11,9 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|||
const CustomAppBar({
|
||||
Key? key,
|
||||
required this.height,
|
||||
this.leading,
|
||||
required this.title,
|
||||
this.trailing,
|
||||
this.leading,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
|
|
73
lib/application/component/radio_agreement.dart
Normal file
73
lib/application/component/radio_agreement.dart
Normal file
|
@ -0,0 +1,73 @@
|
|||
import 'package:cims_apps/application/theme/color_palette.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class RadioAgreement extends StatelessWidget {
|
||||
final void Function() onTap;
|
||||
final bool isAgree;
|
||||
final String desc;
|
||||
const RadioAgreement({super.key, required this.isAgree, required this.desc, required this.onTap,});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: onTap,
|
||||
child: AnimatedContainer(
|
||||
margin: const EdgeInsets.only(top: 4),
|
||||
duration: const Duration(milliseconds: 200),
|
||||
height: 16,
|
||||
width: 16,
|
||||
padding: const EdgeInsets.all(1),
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(
|
||||
color: isAgree
|
||||
? ColorPalette.primary
|
||||
: ColorPalette.slate200)),
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
isAgree ? ColorPalette.primary : ColorPalette.white,
|
||||
shape: BoxShape.circle),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 12,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
desc,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: ColorPalette.slate400),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {},
|
||||
child: const Text(
|
||||
'Read More',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
decoration: TextDecoration.underline,
|
||||
color: ColorPalette.primary),
|
||||
))
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -36,8 +36,8 @@ class GoalInvestingView extends StatelessWidget {
|
|||
routePush(
|
||||
context,
|
||||
page: OtherPlanView(
|
||||
selectedPlan: (value) {
|
||||
onListSelected(e.value.title);
|
||||
selectedPlan: (val) {
|
||||
onListSelected(val);
|
||||
},
|
||||
)
|
||||
);
|
||||
|
|
|
@ -54,7 +54,6 @@ class _InputInvestmentViewState extends State<InputInvestmentView> {
|
|||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w700,
|
||||
|
||||
),
|
||||
),
|
||||
Row(
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:math';
|
||||
|
||||
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';
|
||||
|
@ -72,6 +74,8 @@ class _OtherPlanViewState extends State<OtherPlanView> {
|
|||
disabled: !(selectedPlan.img != ''),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
print('haloo');
|
||||
print(selectedPlan.name);
|
||||
widget.selectedPlan(selectedPlan.name);
|
||||
},
|
||||
heightWrapContent: true,
|
||||
|
@ -91,6 +95,7 @@ class _OtherPlanViewState extends State<OtherPlanView> {
|
|||
if(plan.name == 'Create Plan'){
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
isDismissible: false,
|
||||
builder: (context) => modalCreatePlan(),
|
||||
);
|
||||
}
|
||||
|
@ -150,6 +155,9 @@ class _OtherPlanViewState extends State<OtherPlanView> {
|
|||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
setState(() {
|
||||
selectedPlan = Plan('', '');
|
||||
});
|
||||
},
|
||||
child: Icon(Icons.close_rounded),
|
||||
)
|
||||
|
@ -161,12 +169,12 @@ class _OtherPlanViewState extends State<OtherPlanView> {
|
|||
),
|
||||
SizedBox(height: 24),
|
||||
ButtonView(
|
||||
name: 'Select',
|
||||
name: 'Next',
|
||||
marginVertical: 0,
|
||||
disabled: !(createController.text != ''),
|
||||
onPressed: () {
|
||||
Navigator.of(context)..pop()..pop();
|
||||
widget.selectedPlan(selectedPlan.name);
|
||||
widget.selectedPlan(createController.text);
|
||||
},
|
||||
heightWrapContent: true,
|
||||
width: SizeConfig.width,
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import 'package:cims_apps/application/component/button/button_view.dart';
|
||||
import 'package:cims_apps/application/component/radio_agreement.dart';
|
||||
import 'package:cims_apps/application/theme/color_palette.dart';
|
||||
import 'package:cims_apps/core/route/route.dart';
|
||||
import 'package:cims_apps/core/utils/number_formatter.dart';
|
||||
|
@ -6,22 +7,19 @@ import 'package:cims_apps/features/dashboard/dashboard_account/view/product/view
|
|||
import 'package:cims_apps/features/dashboard/dashboard_account/view/product/view_model/product_view_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TotalPaymentView extends StatefulWidget {
|
||||
class TotalPaymentView extends StatelessWidget {
|
||||
final int totalInvest;
|
||||
final List<Product> listProduct;
|
||||
final bool isAgree;
|
||||
final void Function() onTapAgree;
|
||||
const TotalPaymentView({
|
||||
super.key,
|
||||
required this.listProduct,
|
||||
required this.totalInvest,
|
||||
required this.isAgree,
|
||||
required this.onTapAgree,
|
||||
});
|
||||
|
||||
@override
|
||||
State<TotalPaymentView> createState() => _TotalPaymentViewState();
|
||||
}
|
||||
|
||||
class _TotalPaymentViewState extends State<TotalPaymentView> {
|
||||
bool isAgreement = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SingleChildScrollView(
|
||||
|
@ -49,7 +47,7 @@ class _TotalPaymentViewState extends State<TotalPaymentView> {
|
|||
],
|
||||
),
|
||||
),
|
||||
...widget.listProduct.asMap().entries.map((e) {
|
||||
...listProduct.asMap().entries.map((e) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 16, right: 24, bottom: 16, top: 16),
|
||||
|
@ -75,7 +73,7 @@ class _TotalPaymentViewState extends State<TotalPaymentView> {
|
|||
flex: 7,
|
||||
child: Text(
|
||||
NumberFormatter.numberCurrency(
|
||||
widget.totalInvest * e.value.totalPercent!,
|
||||
totalInvest * e.value.totalPercent!,
|
||||
'Rp ',
|
||||
'id_ID'),
|
||||
textAlign: TextAlign.end,
|
||||
|
@ -129,7 +127,7 @@ class _TotalPaymentViewState extends State<TotalPaymentView> {
|
|||
),
|
||||
Text(
|
||||
NumberFormatter.numberCurrency(
|
||||
widget.totalInvest, 'Rp ', 'id_ID'),
|
||||
totalInvest, 'Rp ', 'id_ID'),
|
||||
textAlign: TextAlign.end,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
|
@ -139,7 +137,14 @@ class _TotalPaymentViewState extends State<TotalPaymentView> {
|
|||
],
|
||||
),
|
||||
),
|
||||
buttonAgreement(),
|
||||
RadioAgreement(
|
||||
isAgree: isAgree,
|
||||
desc: 'I agree to buy the mutual fund on this page and have read and agreed to all the contents of the Prospectus and summary information and understand the risks of my investment decision. Read More',
|
||||
onTap: () {
|
||||
print('gagaga');
|
||||
onTapAgree();
|
||||
},
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
|
||||
child: Row(
|
||||
|
@ -154,7 +159,7 @@ class _TotalPaymentViewState extends State<TotalPaymentView> {
|
|||
),
|
||||
Text(
|
||||
NumberFormatter.numberCurrency(
|
||||
widget.totalInvest, 'Rp ', 'id_ID'),
|
||||
totalInvest, 'Rp ', 'id_ID'),
|
||||
textAlign: TextAlign.end,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
|
@ -165,16 +170,16 @@ class _TotalPaymentViewState extends State<TotalPaymentView> {
|
|||
),
|
||||
),
|
||||
ButtonView(
|
||||
disabled: !isAgreement,
|
||||
disabled: !isAgree,
|
||||
name: 'Subscribe Now',
|
||||
onPressed: () {
|
||||
routePush(context,
|
||||
page: PaymentMethodView(
|
||||
totalInvest: widget.totalInvest,
|
||||
totalInvest: totalInvest,
|
||||
));
|
||||
},
|
||||
disabledBgColor: ColorPalette.slate200.withOpacity(0.5),
|
||||
textColor: isAgreement ? Colors.white : ColorPalette.slate400,
|
||||
textColor: isAgree ? Colors.white : ColorPalette.slate400,
|
||||
textWeight: FontWeight.w700,
|
||||
textSize: 20,
|
||||
backgroundColor: ColorPalette.primary,
|
||||
|
@ -185,71 +190,67 @@ class _TotalPaymentViewState extends State<TotalPaymentView> {
|
|||
);
|
||||
}
|
||||
|
||||
Widget buttonAgreement() {
|
||||
bool isAgree = isAgreement;
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
isAgreement = !isAgreement;
|
||||
});
|
||||
},
|
||||
child: AnimatedContainer(
|
||||
margin: const EdgeInsets.only(top: 4),
|
||||
duration: const Duration(milliseconds: 200),
|
||||
height: 16,
|
||||
width: 16,
|
||||
padding: const EdgeInsets.all(1),
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(
|
||||
color: isAgree
|
||||
? ColorPalette.primary
|
||||
: ColorPalette.slate200)),
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
isAgree ? ColorPalette.primary : ColorPalette.white,
|
||||
shape: BoxShape.circle),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 12,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'I agree to buy the mutual fund on this page and have read and agreed to all the contents of the Prospectus and summary information and understand the risks of my investment decision.',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: ColorPalette.slate400),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {},
|
||||
child: const Text(
|
||||
'Read More',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
decoration: TextDecoration.underline,
|
||||
color: ColorPalette.primary),
|
||||
))
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
// Widget buttonAgreement() {
|
||||
// return Padding(
|
||||
// padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
|
||||
// child: Row(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// GestureDetector(
|
||||
// onTap: () {
|
||||
// },
|
||||
// child: AnimatedContainer(
|
||||
// margin: const EdgeInsets.only(top: 4),
|
||||
// duration: const Duration(milliseconds: 200),
|
||||
// height: 16,
|
||||
// width: 16,
|
||||
// padding: const EdgeInsets.all(1),
|
||||
// alignment: Alignment.center,
|
||||
// decoration: BoxDecoration(
|
||||
// shape: BoxShape.circle,
|
||||
// border: Border.all(
|
||||
// color: isAgree
|
||||
// ? ColorPalette.primary
|
||||
// : ColorPalette.slate200)),
|
||||
// child: AnimatedContainer(
|
||||
// duration: const Duration(milliseconds: 200),
|
||||
// child: Container(
|
||||
// decoration: BoxDecoration(
|
||||
// color:
|
||||
// isAgree ? ColorPalette.primary : ColorPalette.white,
|
||||
// shape: BoxShape.circle),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// const SizedBox(
|
||||
// width: 12,
|
||||
// ),
|
||||
// Expanded(
|
||||
// child: Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// const Text(
|
||||
// 'I agree to buy the mutual fund on this page and have read and agreed to all the contents of the Prospectus and summary information and understand the risks of my investment decision.',
|
||||
// style: TextStyle(
|
||||
// fontSize: 16,
|
||||
// fontWeight: FontWeight.w600,
|
||||
// color: ColorPalette.slate400),
|
||||
// ),
|
||||
// GestureDetector(
|
||||
// onTap: () {},
|
||||
// child: const Text(
|
||||
// 'Read More',
|
||||
// style: TextStyle(
|
||||
// fontSize: 16,
|
||||
// fontWeight: FontWeight.w600,
|
||||
// decoration: TextDecoration.underline,
|
||||
// color: ColorPalette.primary),
|
||||
// ))
|
||||
// ],
|
||||
// ))
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -40,8 +40,14 @@ class _PlanViewState extends State<PlanView> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return Scaffold(
|
||||
appBar: CustomAppBar(height: 70, title: 'Investment Plan'),
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => PlanViewModel(),
|
||||
child: Scaffold(
|
||||
appBar: CustomAppBar(
|
||||
height: SizeConfig.height * 0.08,
|
||||
title: 'Investment Plan',
|
||||
leading: SizedBox(),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
padding: EdgeInsets.all(24),
|
||||
child: Column(
|
||||
|
@ -66,6 +72,7 @@ class _PlanViewState extends State<PlanView> {
|
|||
),
|
||||
GoalInvestingView(
|
||||
onListSelected: (p0) {
|
||||
print(p0);
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
|
@ -78,6 +85,7 @@ class _PlanViewState extends State<PlanView> {
|
|||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,9 +5,12 @@ import 'package:cims_apps/application/component/subscribe/total_payment_view.dar
|
|||
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/dashboard/dashboard_account/view/plan/view/step_invest_plan/options_starting_invest.dart';
|
||||
import 'package:cims_apps/features/dashboard/dashboard_account/view/plan/view_model/plan_view_model.dart';
|
||||
import 'package:cims_apps/features/dashboard/dashboard_account/view/product/view/product_view.dart';
|
||||
import 'package:cims_apps/features/dashboard/dashboard_account/view/product/view_model/product_view_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class ResultOptionsProduct extends StatelessWidget {
|
||||
final int totalInvest;
|
||||
|
@ -21,6 +24,10 @@ class ResultOptionsProduct extends StatelessWidget {
|
|||
Product(name: 'Gemilang Kas 2 Kelas A', type: 'Shares', totalPercent: 0.1)
|
||||
];
|
||||
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => PlanViewModel(),
|
||||
child: Consumer<PlanViewModel>(
|
||||
builder: (context, provider, child) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
|
@ -30,10 +37,21 @@ class ResultOptionsProduct extends StatelessWidget {
|
|||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Row(
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Icon(Icons.arrow_back, color: ColorPalette.slate500),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return OptionsStartingInvest(totalInvest: totalInvest);
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Icon(Icons.arrow_back, color: ColorPalette.slate500)
|
||||
),
|
||||
Text('Results from your risk profile',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
|
@ -41,7 +59,13 @@ class ResultOptionsProduct extends StatelessWidget {
|
|||
color: ColorPalette.slate800
|
||||
),
|
||||
),
|
||||
Icon(Icons.close_rounded, color: ColorPalette.slate400)
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
|
||||
},
|
||||
child: Icon(Icons.close_rounded, color: ColorPalette.slate400)
|
||||
)
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 32),
|
||||
|
@ -134,13 +158,23 @@ class ResultOptionsProduct extends StatelessWidget {
|
|||
ButtonView(
|
||||
name: 'Next',
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
builder: (context) =>
|
||||
TotalPaymentView(
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => PlanViewModel(),
|
||||
child: Consumer<PlanViewModel>(
|
||||
builder: (context, planProvider, _) {
|
||||
return TotalPaymentView(
|
||||
listProduct: listProduct,
|
||||
totalInvest: totalInvest,
|
||||
isAgree: planProvider.isAgree,
|
||||
onTapAgree: planProvider.setAgree,
|
||||
);
|
||||
}
|
||||
),
|
||||
)
|
||||
);
|
||||
},
|
||||
|
@ -153,4 +187,7 @@ class ResultOptionsProduct extends StatelessWidget {
|
|||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,4 +3,10 @@ import 'package:flutter/material.dart';
|
|||
|
||||
class PlanViewModel extends ChangeNotifier {
|
||||
List<Product> listProduct = [];
|
||||
bool isAgree = false;
|
||||
|
||||
void setAgree() {
|
||||
isAgree = !isAgree;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
|
@ -152,8 +152,8 @@ class _PortofolioViewState extends State<PortofolioView> {
|
|||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 24, vertical: 12),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
|
@ -162,7 +162,7 @@ class _PortofolioViewState extends State<PortofolioView> {
|
|||
children: [
|
||||
Icon(Icons.add, size: 18, color: ColorPalette.primary),
|
||||
SizedBox(width: 4),
|
||||
Text('Create',
|
||||
const Text('Create',
|
||||
style: TextStyle(
|
||||
color: ColorPalette.primary,
|
||||
fontWeight: FontWeight.w600
|
||||
|
@ -173,7 +173,7 @@ class _PortofolioViewState extends State<PortofolioView> {
|
|||
],
|
||||
),
|
||||
),
|
||||
...listColumnPortofolio(),
|
||||
// ...listColumnPortofolio(),
|
||||
cardPortfolio()
|
||||
],
|
||||
),
|
||||
|
@ -388,11 +388,11 @@ class _PortofolioViewState extends State<PortofolioView> {
|
|||
Widget cardPortfolio() {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
routePush(context, page: PortfolioDetailView());
|
||||
routePush(context, page: const PortfolioDetailView());
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 24),
|
||||
padding: EdgeInsets.all(16),
|
||||
margin: const EdgeInsets.symmetric(horizontal: 24),
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: ColorPalette.slate200)
|
||||
|
@ -402,7 +402,7 @@ class _PortofolioViewState extends State<PortofolioView> {
|
|||
Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.all(4),
|
||||
padding: const EdgeInsets.all(4),
|
||||
decoration: BoxDecoration(
|
||||
color: ColorPalette.blue200.withOpacity(0.5),
|
||||
borderRadius: BorderRadius.circular(8)
|
||||
|
@ -412,8 +412,8 @@ class _PortofolioViewState extends State<PortofolioView> {
|
|||
width: SizeConfig.width * 0.07
|
||||
)
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
Column(
|
||||
const SizedBox(width: 8),
|
||||
const Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextTitle(title: 'Education', fontSize: 16,),
|
||||
|
@ -427,11 +427,11 @@ class _PortofolioViewState extends State<PortofolioView> {
|
|||
),
|
||||
],
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 8),
|
||||
child: Divider(height: 1, color: ColorPalette.slate200),
|
||||
),
|
||||
Row(
|
||||
const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
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/radio_agreement.dart';
|
||||
import 'package:cims_apps/application/component/text_title/text_title.dart';
|
||||
import 'package:cims_apps/application/theme/color_palette.dart';
|
||||
import 'package:cims_apps/core/utils/number_formatter.dart';
|
||||
import 'package:cims_apps/core/utils/size_config.dart';
|
||||
import 'package:cims_apps/features/dashboard/dashboard_account/view/portfolio/redeem_product/view_model/redeem_product_view_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
@ -24,7 +27,7 @@ class TotalRedeem extends StatelessWidget {
|
|||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Investment Funds that You Cash Out',
|
||||
const Text('Investment Funds that You Cash Out',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: ColorPalette.slate800,
|
||||
|
@ -33,18 +36,18 @@ class TotalRedeem extends StatelessWidget {
|
|||
),
|
||||
GestureDetector(
|
||||
onTap: () => Navigator.pop(context),
|
||||
child: Icon(Icons.close_rounded, color: ColorPalette.slate800,)
|
||||
child: const Icon(Icons.close_rounded, color: ColorPalette.slate800,)
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Divider(height: 1, color: ColorPalette.slate200,),
|
||||
const Divider(height: 1, color: ColorPalette.slate200,),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
|
||||
child: cardProduct(provider.getCurrentProduct, provider.getUnit!),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 24),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
|
@ -64,9 +67,9 @@ class TotalRedeem extends StatelessWidget {
|
|||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||
const SizedBox(height: 16),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 24),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
|
@ -86,8 +89,59 @@ class TotalRedeem extends StatelessWidget {
|
|||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16,),
|
||||
|
||||
const SizedBox(height: 16,),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 24, vertical: 16),
|
||||
color: ColorPalette.slate200.withOpacity(0.5),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
child: TextTitle(
|
||||
title: 'Estimated Funds Disbursed',
|
||||
color: ColorPalette.slate500,
|
||||
fontSize: 16,
|
||||
)
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
NumberFormatter.numberCurrency((provider.getCurrentProduct.priceUnit! * provider.getUnit!).toInt(), 'Rp ', 'id_ID', decimalDigits: 0),
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(
|
||||
color: ColorPalette.slate800,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 18
|
||||
),
|
||||
)
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
RadioAgreement(
|
||||
isAgree: provider.isAgree,
|
||||
desc: 'I agree to the sale of the mutual funds listed on this page. I understand that the total funds disbursed are approximate. The amount received may change according to the closing price of the mutual fund on the day of sale.',
|
||||
onTap: provider.setAgree
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
ButtonView(
|
||||
disabled: !provider.isAgree,
|
||||
name: 'Redeem',
|
||||
textSize: 20,
|
||||
marginVertical: 0,
|
||||
disabledBgColor: ColorPalette.slate200.withOpacity(0.5),
|
||||
textColor: !provider.isAgree ? ColorPalette.slate400 : Colors.white,
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
builder: (context) {
|
||||
return TotalRedeem();
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 24)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -35,6 +35,8 @@ class RedeemProductViewModel extends ChangeNotifier {
|
|||
double? get getAmount => amount;
|
||||
double? get getUnit => unit;
|
||||
|
||||
bool isAgree = false;
|
||||
|
||||
void setCurrentAcc(Account account) {
|
||||
currentAccount = account;
|
||||
notifyListeners();
|
||||
|
@ -61,4 +63,9 @@ class RedeemProductViewModel extends ChangeNotifier {
|
|||
currentProduct = product;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setAgree() {
|
||||
isAgree = !isAgree;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@ import 'package:cims_apps/application/component/subscribe/goal_investing_view.da
|
|||
import 'package:cims_apps/application/component/subscribe/input_investment_view.dart';
|
||||
import 'package:cims_apps/application/component/subscribe/total_payment_view.dart';
|
||||
import 'package:cims_apps/application/theme/color_palette.dart';
|
||||
import 'package:cims_apps/features/dashboard/dashboard_account/view/plan/view_model/plan_view_model.dart';
|
||||
import 'package:cims_apps/features/dashboard/dashboard_account/view/product/view_model/product_view_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
@ -11,10 +12,9 @@ class SelectGoalInvesting extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProvider(create: (context) => ProductViewModel(),)
|
||||
],
|
||||
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => ProductViewModel(),
|
||||
child: Consumer<ProductViewModel>(
|
||||
builder: (context, provider, child) {
|
||||
return Container(
|
||||
|
@ -51,6 +51,10 @@ class SelectGoalInvesting extends StatelessWidget {
|
|||
context: context,
|
||||
isScrollControlled: true,
|
||||
builder: (context) {
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => ProductViewModel(),
|
||||
child: Consumer<ProductViewModel>(
|
||||
builder: (context, provider, child) {
|
||||
return InputInvestmentView(
|
||||
selectedPlan: p0,
|
||||
nextMove: (value) {
|
||||
|
@ -60,15 +64,27 @@ class SelectGoalInvesting extends StatelessWidget {
|
|||
context: context,
|
||||
isScrollControlled: true,
|
||||
builder: (context) =>
|
||||
TotalPaymentView(
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => ProductViewModel(),
|
||||
child: Consumer<ProductViewModel>(
|
||||
builder: (context, provider, child) {
|
||||
return TotalPaymentView(
|
||||
listProduct: [
|
||||
provider.getSelectedProduct
|
||||
],
|
||||
totalInvest: formatIntParse,
|
||||
isAgree: provider.isAgree,
|
||||
onTapAgree: provider.setAgree,
|
||||
);
|
||||
}
|
||||
),
|
||||
)
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
|
|
|
@ -14,6 +14,7 @@ class ProductViewModel extends ChangeNotifier {
|
|||
Product get getSelectedProduct => selectedProduct;
|
||||
|
||||
double totalInvestment = 0;
|
||||
bool isAgree = false;
|
||||
|
||||
void setSelectedProduct(Product product) {
|
||||
selectedProduct = product;
|
||||
|
@ -24,4 +25,9 @@ class ProductViewModel extends ChangeNotifier {
|
|||
totalInvestment = value;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setAgree() {
|
||||
isAgree = !isAgree;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
|
@ -8,7 +8,7 @@ class ProfileView extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: CustomAppBar(height: SizeConfig.height * .1, title: 'Profile'),
|
||||
appBar: CustomAppBar(height: SizeConfig.height * .08, title: 'Profile'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,8 +8,7 @@ class TransactionView extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar:
|
||||
CustomAppBar(height: SizeConfig.height * .1, title: 'Transaction'),
|
||||
appBar: CustomAppBar(height: SizeConfig.height * 0.08, title: 'Transaction'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user