fix: continued product view
This commit is contained in:
parent
96c676ac4c
commit
81231505b1
|
@ -9,13 +9,14 @@ class ButtonView extends StatelessWidget {
|
|||
final double? height, width, widthSuffix, widthPrefix, marginVertical;
|
||||
final EdgeInsetsGeometry? contentPadding;
|
||||
final bool isSecondaryColor, isOutlined, heightWrapContent, disabled;
|
||||
final Color? backgroundColor, textColor;
|
||||
final Color? backgroundColor, textColor, borderColor;
|
||||
final MainAxisAlignment? mainAxisAlignmentContent;
|
||||
// final _widthBtn = SizeConfig.screenWidth / 1.5;
|
||||
final _widthBtn = SizeConfig.width * .9;
|
||||
// final _heightBtn = SizeConfig.screenHeight / 12;
|
||||
final _heightBtn = SizeConfig.height * .07;
|
||||
final FontWeight textWeight;
|
||||
final TextAlign textAlign;
|
||||
final double? textSize, sizeBorderRadius;
|
||||
final int? maxLines;
|
||||
|
||||
|
@ -31,9 +32,11 @@ class ButtonView extends StatelessWidget {
|
|||
this.width,
|
||||
this.contentPadding,
|
||||
this.backgroundColor,
|
||||
this.borderColor,
|
||||
this.textColor,
|
||||
this.textWeight = FontWeight.bold,
|
||||
this.textSize,
|
||||
this.textAlign = TextAlign.center,
|
||||
this.mainAxisAlignmentContent,
|
||||
this.disabled = false,
|
||||
this.heightWrapContent = false,
|
||||
|
@ -74,11 +77,11 @@ class ButtonView extends StatelessWidget {
|
|||
borderRadius: BorderRadius.circular(sizeBorderRadius ?? 48),
|
||||
side: isOutlined
|
||||
? BorderSide(
|
||||
color: disabled
|
||||
color: borderColor ?? (disabled
|
||||
? color.surface
|
||||
: isSecondaryColor
|
||||
? ColorPalette.greyBorder
|
||||
: ColorPalette.primary,
|
||||
: ColorPalette.primary),
|
||||
)
|
||||
: BorderSide.none,
|
||||
),
|
||||
|
@ -100,7 +103,7 @@ class ButtonView extends StatelessWidget {
|
|||
Flexible(
|
||||
child: Text(
|
||||
name,
|
||||
textAlign: TextAlign.center,
|
||||
textAlign: textAlign,
|
||||
maxLines: maxLines,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
|
|
|
@ -83,6 +83,7 @@ class ColorPalette {
|
|||
static const Color slate800 = Color(0xFF1E293B);
|
||||
static const Color purple100 = Color(0xFFEDE9FE);
|
||||
static const Color purple500 = Color(0xFF8B5CF6);
|
||||
static const Color orange50 = Color(0xFFFFF7ED);
|
||||
static const Color orange100 = Color(0xFFFFEDD5);
|
||||
static const Color orange500 = Color(0xFFF97316);
|
||||
static const Color cyan100 = Color(0xFFCFFAFE);
|
||||
|
|
|
@ -53,7 +53,7 @@ class _InvestTypeViewState extends State<InvestTypeView> {
|
|||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
ButtonBack(),
|
||||
const ButtonBack(),
|
||||
TextTitle(title: widget.title, color: Colors.white),
|
||||
SizedBox(
|
||||
width: SizeConfig.width * 0.1,
|
||||
|
@ -104,9 +104,9 @@ class _InvestTypeViewState extends State<InvestTypeView> {
|
|||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
segmentFilter(const Icon(Icons.filter_alt_outlined), 'Filter', () { }),
|
||||
segmentFilter(const RotatedBox(quarterTurns: 1, child: Icon(Icons.compare_arrows)), 'Sort', () { }),
|
||||
segmentFilter(const Icon(Icons.dashboard_outlined), 'Compare', () { }),
|
||||
segmentFilter(const Icon(Icons.filter_alt_outlined, color: ColorPalette.slate400,), 'Filter', () { }),
|
||||
segmentFilter(const RotatedBox(quarterTurns: 1, child: Icon(Icons.compare_arrows, color: ColorPalette.slate400)), 'Sort', () { }),
|
||||
segmentFilter(const Icon(Icons.dashboard_outlined, color: ColorPalette.slate400), 'Compare', () { }),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
@ -153,13 +153,13 @@ class _InvestTypeViewState extends State<InvestTypeView> {
|
|||
Row(
|
||||
children: [
|
||||
ImageView(image: PathAssets.imgProduct, width: SizeConfig.width * .12,),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
product.name,
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18
|
||||
),
|
||||
|
@ -176,34 +176,34 @@ class _InvestTypeViewState extends State<InvestTypeView> {
|
|||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Text('Yield', style: TextStyle(color: ColorPalette.slate400, fontWeight: FontWeight.w600),),
|
||||
const Text('Yield', style: TextStyle(color: ColorPalette.slate400, fontWeight: FontWeight.w600),),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'${product.yield.toString()}%',
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
color: ColorPalette.green400,
|
||||
fontWeight: FontWeight.w600
|
||||
),
|
||||
),
|
||||
Text('/'),
|
||||
Text('3year', style: TextStyle(color: ColorPalette.slate400, fontWeight: FontWeight.w600),)
|
||||
const Text('/'),
|
||||
const Text('3year', style: TextStyle(color: ColorPalette.slate400, fontWeight: FontWeight.w600),)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text('Price/unit', style: TextStyle(color: ColorPalette.slate400, fontWeight: FontWeight.w600),),
|
||||
const Text('Price/unit', style: TextStyle(color: ColorPalette.slate400, fontWeight: FontWeight.w600),),
|
||||
Row(
|
||||
children: [
|
||||
Icon(Icons.trending_up_outlined, size: 18, color: ColorPalette.green400,),
|
||||
SizedBox(
|
||||
const Icon(Icons.trending_up_outlined, size: 18, color: ColorPalette.green400,),
|
||||
const SizedBox(
|
||||
width: 2,
|
||||
),
|
||||
Text(
|
||||
NumberFormatter.numberCurrency(product.priceUnit, 'Rp', 'id_ID'),
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w600
|
||||
),
|
||||
),
|
||||
|
@ -213,12 +213,12 @@ class _InvestTypeViewState extends State<InvestTypeView> {
|
|||
),
|
||||
Column(
|
||||
children: [
|
||||
Text('Managed funds', style: TextStyle(color: ColorPalette.slate400, fontWeight: FontWeight.w600),),
|
||||
const Text('Managed funds', style: TextStyle(color: ColorPalette.slate400, fontWeight: FontWeight.w600),),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
NumberFormatter.compactCurrency(product.funds, 'Rp ', 'id_ID'),
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w600
|
||||
),
|
||||
),
|
||||
|
|
|
@ -164,7 +164,7 @@ class _ProductViewState extends State<ProductView> {
|
|||
Expanded(
|
||||
child: Row(
|
||||
children: [
|
||||
ImageView(image: PathAssets.imgProduct, width: SizeConfig.width * .12,),
|
||||
ImageView(image: PathAssets.imgProduct, width: SizeConfig.width * .12),
|
||||
SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Text(
|
||||
|
@ -269,6 +269,10 @@ class _ProductViewState extends State<ProductView> {
|
|||
const SizedBox(
|
||||
height: 24,
|
||||
),
|
||||
moreAction(),
|
||||
const SizedBox(
|
||||
height: 24,
|
||||
),
|
||||
cardInformation('Time Machine', timeMachine()),
|
||||
const SizedBox(
|
||||
height: 24,
|
||||
|
@ -509,6 +513,58 @@ class _ProductViewState extends State<ProductView> {
|
|||
);
|
||||
}
|
||||
|
||||
Widget moreAction() {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: ButtonView(
|
||||
onPressed: () {
|
||||
|
||||
},
|
||||
prefixIcon: Icon(Icons.space_dashboard_sharp),
|
||||
backgroundColor: ColorPalette.blue50,
|
||||
sizeBorderRadius: 8,
|
||||
isSecondaryColor: false,
|
||||
width: SizeConfig.width * .5,
|
||||
heightWrapContent: true,
|
||||
isOutlined: true,
|
||||
widthPrefix: 10,
|
||||
name: 'Routine Savings',
|
||||
textSize: 14,
|
||||
textAlign: TextAlign.start,
|
||||
contentPadding: EdgeInsets.all(12),
|
||||
)
|
||||
),
|
||||
SizedBox(
|
||||
width: 16,
|
||||
),
|
||||
Expanded(
|
||||
child: ButtonView(
|
||||
onPressed: () {
|
||||
|
||||
},
|
||||
prefixIcon: Icon(Icons.space_dashboard_sharp, color: ColorPalette.orange500),
|
||||
widthPrefix: 10,
|
||||
name: 'Compare Mutual Funds',
|
||||
width: SizeConfig.width * .5,
|
||||
heightWrapContent: true,
|
||||
backgroundColor: ColorPalette.orange50,
|
||||
sizeBorderRadius: 8,
|
||||
isOutlined: true,
|
||||
borderColor: ColorPalette.orange500,
|
||||
textSize: 14,
|
||||
textAlign: TextAlign.start,
|
||||
textColor: ColorPalette.orange500,
|
||||
contentPadding: EdgeInsets.all(12),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget timeMachine() {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
|
Loading…
Reference in New Issue
Block a user