feat: Update ownerId assignment in HomeRepositoryImpl and clean up shifts page code
This commit is contained in:
@@ -105,7 +105,7 @@ class HomeRepositoryImpl
|
|||||||
address: staff.addres,
|
address: staff.addres,
|
||||||
avatar: staff.photoUrl,
|
avatar: staff.photoUrl,
|
||||||
),
|
),
|
||||||
ownerId: session?.ownerId,
|
ownerId: staff.ownerId,
|
||||||
);
|
);
|
||||||
StaffSessionStore.instance.setSession(updatedSession);
|
StaffSessionStore.instance.setSession(updatedSession);
|
||||||
|
|
||||||
|
|||||||
@@ -187,8 +187,6 @@ class ShiftsRepositoryImpl
|
|||||||
.listShiftRolesByVendorId(vendorId: vendorId)
|
.listShiftRolesByVendorId(vendorId: vendorId)
|
||||||
.execute());
|
.execute());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
final allShiftRoles = result.data.shiftRoles;
|
final allShiftRoles = result.data.shiftRoles;
|
||||||
|
|
||||||
// Fetch my applications to filter out already booked shifts
|
// Fetch my applications to filter out already booked shifts
|
||||||
|
|||||||
@@ -175,30 +175,30 @@ class _ShiftsPageState extends State<ShiftsPage> {
|
|||||||
child: state is ShiftsLoading
|
child: state is ShiftsLoading
|
||||||
? const Center(child: CircularProgressIndicator())
|
? const Center(child: CircularProgressIndicator())
|
||||||
: state is ShiftsError
|
: state is ShiftsError
|
||||||
? Center(
|
? Center(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(UiConstants.space5),
|
padding: const EdgeInsets.all(UiConstants.space5),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
translateErrorKey(state.message),
|
translateErrorKey(state.message),
|
||||||
style: UiTypography.body2r.textSecondary,
|
style: UiTypography.body2r.textSecondary,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
)
|
),
|
||||||
: _buildTabContent(
|
),
|
||||||
|
)
|
||||||
|
: _buildTabContent(
|
||||||
myShifts,
|
myShifts,
|
||||||
pendingAssignments,
|
pendingAssignments,
|
||||||
cancelledShifts,
|
cancelledShifts,
|
||||||
availableJobs,
|
availableJobs,
|
||||||
historyShifts,
|
historyShifts,
|
||||||
availableLoading,
|
availableLoading,
|
||||||
historyLoading,
|
historyLoading,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -254,14 +254,14 @@ class _ShiftsPageState extends State<ShiftsPage> {
|
|||||||
onTap: !enabled
|
onTap: !enabled
|
||||||
? null
|
? null
|
||||||
: () {
|
: () {
|
||||||
setState(() => _activeTab = id);
|
setState(() => _activeTab = id);
|
||||||
if (id == 'history') {
|
if (id == 'history') {
|
||||||
_bloc.add(LoadHistoryShiftsEvent());
|
_bloc.add(LoadHistoryShiftsEvent());
|
||||||
}
|
}
|
||||||
if (id == 'find') {
|
if (id == 'find') {
|
||||||
_bloc.add(LoadAvailableShiftsEvent());
|
_bloc.add(LoadAvailableShiftsEvent());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
vertical: UiConstants.space2,
|
vertical: UiConstants.space2,
|
||||||
@@ -290,9 +290,17 @@ class _ShiftsPageState extends State<ShiftsPage> {
|
|||||||
Flexible(
|
Flexible(
|
||||||
child: Text(
|
child: Text(
|
||||||
label,
|
label,
|
||||||
style: (isActive ? UiTypography.body3m.copyWith(color: UiColors.primary) : UiTypography.body3m.white).copyWith(
|
style:
|
||||||
color: !enabled ? UiColors.white.withValues(alpha: 0.5) : null,
|
(isActive
|
||||||
),
|
? UiTypography.body3m.copyWith(
|
||||||
|
color: UiColors.primary,
|
||||||
|
)
|
||||||
|
: UiTypography.body3m.white)
|
||||||
|
.copyWith(
|
||||||
|
color: !enabled
|
||||||
|
? UiColors.white.withValues(alpha: 0.5)
|
||||||
|
: null,
|
||||||
|
),
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ dependencies:
|
|||||||
url_launcher: ^6.3.1
|
url_launcher: ^6.3.1
|
||||||
firebase_auth: ^6.1.4
|
firebase_auth: ^6.1.4
|
||||||
firebase_data_connect: ^0.2.2+2
|
firebase_data_connect: ^0.2.2+2
|
||||||
|
meta: ^1.17.0
|
||||||
|
bloc: ^8.1.4
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|||||||
Reference in New Issue
Block a user