cims_apps/lib/application/component/goal_investing_view.dart

64 lines
2.0 KiB
Dart

import 'package:cims_apps/application/assets/path_assets.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 GoalInvest {
String icon;
String title;
GoalInvest(this.icon, this.title);
}
class GoalInvestingView extends StatelessWidget {
final void Function(String) onListSelected;
const GoalInvestingView({super.key, required this.onListSelected});
@override
Widget build(BuildContext context) {
List<GoalInvest> listGoalInvest = [
GoalInvest(PathAssets.iconToga, 'Education'),
GoalInvest(PathAssets.iconCake, 'Marriage'),
GoalInvest(PathAssets.iconHouse, 'Old age days'),
GoalInvest(PathAssets.iconCreatePlan, 'Create Plan'),
];
return Column(
children:
listGoalInvest.asMap().entries.map((e) {
return Padding(
padding: EdgeInsets.only(top: e.key != 0 ? 16 : 0),
child: ListTile(
onTap: () {
onListSelected(e.value.title);
},
shape: RoundedRectangleBorder(
side: BorderSide(color: ColorPalette.slate200),
borderRadius: BorderRadius.circular(14)
),
leading: Container(
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: ColorPalette.blue200.withOpacity(0.5),
borderRadius: BorderRadius.circular(8)
),
child: Image.asset(
e.value.icon,
width: SizeConfig.width * 0.07
)
),
contentPadding: EdgeInsets.symmetric(horizontal: 16, vertical: 4),
title: Text(e.value.title,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 16
),
),
trailing: Icon(Icons.chevron_right_rounded),
),
);
}).toList()
);
}
}