first commit
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:frontend_eccp_mobile/app/core/constants/constants.dart';
|
||||
|
||||
class ProfileHeaderCard extends StatelessWidget {
|
||||
const ProfileHeaderCard({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: AppPadding.p14,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.neutralWhite,
|
||||
borderRadius: AppRadius.r18,
|
||||
boxShadow: AppShadows.md,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: AppRadius.rFull,
|
||||
child: Image.network(
|
||||
'https://i.pravatar.cc/150?img=12',
|
||||
width: 64,
|
||||
height: 64,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
|
||||
AppSpacing.w14,
|
||||
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Rosaldo',
|
||||
style: AppTextStyles.h3,
|
||||
),
|
||||
|
||||
AppSpacing.h2,
|
||||
|
||||
Text(
|
||||
'NRP : 1882098',
|
||||
style: AppTextStyles.badge.copyWith(
|
||||
color: AppColors.neutral600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:frontend_eccp_mobile/app/core/constants/constants.dart';
|
||||
|
||||
class ProfileMenuSection extends StatelessWidget {
|
||||
const ProfileMenuSection({
|
||||
required this.title,
|
||||
required this.items,
|
||||
this.backgroundColor = Colors.white,
|
||||
super.key,
|
||||
});
|
||||
|
||||
final String title;
|
||||
final List<ProfileMenuItem> items;
|
||||
final Color backgroundColor;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: AppPadding.h16,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: AppTextStyles.section,
|
||||
),
|
||||
|
||||
AppSpacing.h12,
|
||||
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: backgroundColor,
|
||||
borderRadius: AppRadius.r14,
|
||||
boxShadow: AppShadows.md,
|
||||
),
|
||||
child: Column(
|
||||
children: List.generate(
|
||||
items.length,
|
||||
(index) {
|
||||
final item = items[index];
|
||||
final isLast = index == items.length - 1;
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
_ProfileMenuTile(item: item),
|
||||
|
||||
if (!isLast)
|
||||
Divider(
|
||||
height: 1,
|
||||
thickness: 1,
|
||||
color: AppColors.neutral200,
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ProfileMenuItem {
|
||||
ProfileMenuItem({
|
||||
required this.icon,
|
||||
required this.label,
|
||||
required this.iconColor,
|
||||
this.onTap,
|
||||
this.useArrow = true,
|
||||
this.color,
|
||||
});
|
||||
|
||||
final IconData icon;
|
||||
final String label;
|
||||
final bool useArrow;
|
||||
final VoidCallback? onTap;
|
||||
Color? color = AppColors.supportSteel600;
|
||||
Color iconColor;
|
||||
}
|
||||
|
||||
class _ProfileMenuTile extends StatelessWidget {
|
||||
const _ProfileMenuTile({
|
||||
required this.item,
|
||||
});
|
||||
|
||||
final ProfileMenuItem item;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
borderRadius: AppRadius.r14,
|
||||
onTap: item.onTap,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 14,
|
||||
vertical: 14,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
color: item.iconColor.withValues(alpha: 0.1),
|
||||
),
|
||||
padding: AppPadding.p6,
|
||||
child: Icon(
|
||||
item.icon,
|
||||
size: AppIconSizes.md,
|
||||
color: item.iconColor,
|
||||
),
|
||||
),
|
||||
|
||||
AppSpacing.w12,
|
||||
|
||||
Expanded(
|
||||
child: Text(
|
||||
item.label,
|
||||
style: AppTextStyles.body.copyWith(
|
||||
color: item.color,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
if (item.useArrow)
|
||||
Icon(
|
||||
Icons.chevron_right,
|
||||
size: AppIconSizes.lg,
|
||||
color: AppColors.neutral400,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user