refactor(team_members): improve comments and remove unused code in Team Members Bottom Sheet

This commit is contained in:
Vaibhav Surve 2025-07-15 15:33:13 +05:30
parent e96aeeb14b
commit b0c97a850c

View File

@ -42,7 +42,7 @@ class TeamMembersBottomSheet {
),
),
const SizedBox(height: 10),
// Title at top center
MyText.titleMedium(
'Bucket Details',
fontWeight: 700,
@ -50,7 +50,7 @@ class TeamMembersBottomSheet {
const SizedBox(height: 12),
// Header with title and optional edit button
// Header with title and edit
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Row(
@ -71,7 +71,7 @@ class TeamMembersBottomSheet {
),
),
// Bucket info
// Info
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Column(
@ -106,8 +106,6 @@ class TeamMembersBottomSheet {
),
],
),
// Can edit indicator
Padding(
padding: const EdgeInsets.only(top: 8),
child: Row(
@ -125,73 +123,7 @@ class TeamMembersBottomSheet {
],
),
),
const SizedBox(height: 10),
// Created by
Row(
children: [
CircleAvatar(
radius: 14,
backgroundColor: Colors.grey.shade300,
backgroundImage:
bucket.createdBy.photo != null &&
bucket.createdBy.photo!.isNotEmpty
? NetworkImage(bucket.createdBy.photo!)
: null,
child: bucket.createdBy.photo == null
? Text(
bucket.createdBy.firstName.isNotEmpty
? bucket.createdBy.firstName[0]
: '?',
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 12,
),
)
: null,
),
const SizedBox(width: 8),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Expanded(
child: MyText.labelSmall(
'${bucket.createdBy.firstName} ${bucket.createdBy.lastName}',
fontWeight: 600,
),
),
const SizedBox(width: 6),
Container(
padding: const EdgeInsets.symmetric(
horizontal: 6, vertical: 2),
decoration: BoxDecoration(
color: Colors.red.shade50,
borderRadius:
BorderRadius.circular(4),
),
child: MyText.labelSmall(
"Owner",
fontWeight: 600,
color: Colors.red,
),
),
],
),
MyText.bodySmall(
bucket.createdBy.jobRoleName,
color: Colors.grey[600],
),
],
),
),
],
),
const SizedBox(height: 12),
const Divider(thickness: 1),
const SizedBox(height: 6),
MyText.labelLarge(
@ -205,7 +137,6 @@ class TeamMembersBottomSheet {
const SizedBox(height: 4),
// Members list
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
@ -226,6 +157,8 @@ class TeamMembersBottomSheet {
final member = members[index];
final firstName = member.firstName ?? '';
final lastName = member.lastName ?? '';
final isOwner =
member.id == bucket.createdBy.id;
return ListTile(
dense: true,
@ -235,9 +168,32 @@ class TeamMembersBottomSheet {
lastName: lastName,
size: 32,
),
title: MyText.bodyMedium(
'${firstName.isNotEmpty ? firstName : 'Unnamed'} ${lastName.isNotEmpty ? lastName : ''}',
fontWeight: 600,
title: Row(
children: [
Expanded(
child: MyText.bodyMedium(
'${firstName.isNotEmpty ? firstName : 'Unnamed'} ${lastName.isNotEmpty ? lastName : ''}',
fontWeight: 600,
),
),
if (isOwner)
Container(
margin:
const EdgeInsets.only(left: 6),
padding: const EdgeInsets.symmetric(
horizontal: 6, vertical: 2),
decoration: BoxDecoration(
color: Colors.red.shade50,
borderRadius:
BorderRadius.circular(4),
),
child: MyText.labelSmall(
"Owner",
fontWeight: 600,
color: Colors.red,
),
),
],
),
subtitle: MyText.bodySmall(
member.jobRole ?? '',
@ -248,6 +204,7 @@ class TeamMembersBottomSheet {
),
),
),
const SizedBox(height: 8),
],
);