refactor(team_members): improve comments and remove unused code in Team Members Bottom Sheet
This commit is contained in:
parent
e96aeeb14b
commit
b0c97a850c
@ -42,7 +42,7 @@ class TeamMembersBottomSheet {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
// Title at top center
|
|
||||||
MyText.titleMedium(
|
MyText.titleMedium(
|
||||||
'Bucket Details',
|
'Bucket Details',
|
||||||
fontWeight: 700,
|
fontWeight: 700,
|
||||||
@ -50,7 +50,7 @@ class TeamMembersBottomSheet {
|
|||||||
|
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
|
|
||||||
// Header with title and optional edit button
|
// Header with title and edit
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -71,7 +71,7 @@ class TeamMembersBottomSheet {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
// Bucket info
|
// Info
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -106,8 +106,6 @@ class TeamMembersBottomSheet {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
// Can edit indicator
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 8),
|
padding: const EdgeInsets.only(top: 8),
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -125,73 +123,7 @@ class TeamMembersBottomSheet {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
const SizedBox(height: 10),
|
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 Divider(thickness: 1),
|
||||||
const SizedBox(height: 6),
|
const SizedBox(height: 6),
|
||||||
MyText.labelLarge(
|
MyText.labelLarge(
|
||||||
@ -205,7 +137,6 @@ class TeamMembersBottomSheet {
|
|||||||
|
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
|
|
||||||
// Members list
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
@ -226,6 +157,8 @@ class TeamMembersBottomSheet {
|
|||||||
final member = members[index];
|
final member = members[index];
|
||||||
final firstName = member.firstName ?? '';
|
final firstName = member.firstName ?? '';
|
||||||
final lastName = member.lastName ?? '';
|
final lastName = member.lastName ?? '';
|
||||||
|
final isOwner =
|
||||||
|
member.id == bucket.createdBy.id;
|
||||||
|
|
||||||
return ListTile(
|
return ListTile(
|
||||||
dense: true,
|
dense: true,
|
||||||
@ -235,9 +168,32 @@ class TeamMembersBottomSheet {
|
|||||||
lastName: lastName,
|
lastName: lastName,
|
||||||
size: 32,
|
size: 32,
|
||||||
),
|
),
|
||||||
title: MyText.bodyMedium(
|
title: Row(
|
||||||
'${firstName.isNotEmpty ? firstName : 'Unnamed'} ${lastName.isNotEmpty ? lastName : ''}',
|
children: [
|
||||||
fontWeight: 600,
|
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(
|
subtitle: MyText.bodySmall(
|
||||||
member.jobRole ?? '',
|
member.jobRole ?? '',
|
||||||
@ -248,6 +204,7 @@ class TeamMembersBottomSheet {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user