boh
This commit is contained in:
@@ -16,9 +16,9 @@ class DashboardTaskListCubit extends Cubit<DashboardTaskListState> {
|
||||
|
||||
DashboardTaskListCubit() : super(DashboardTaskListState());
|
||||
|
||||
void startListening({required String staffId}) {
|
||||
void startListening({required String staffId}) async {
|
||||
emit(state.copyWith(status: DashboardTaskListStatus.loading));
|
||||
_loadTasks(staffId: staffId);
|
||||
await _loadTasks(staffId: staffId);
|
||||
_taskChannel?.unsubscribe();
|
||||
_taskChannel = _supabase
|
||||
.channel('public:tasks_staff_$staffId')
|
||||
|
||||
@@ -100,7 +100,7 @@ class _DashboardTasksCardContent extends StatelessWidget {
|
||||
if (state.status == DashboardTaskListStatus.failure) {
|
||||
return Center(
|
||||
child: Text(
|
||||
"Errore di caricamento",
|
||||
"Errore di caricamento ${state.errorMessage}",
|
||||
style: TextStyle(color: theme.colorScheme.error),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -236,23 +236,10 @@ class HomeScreen extends StatelessWidget {
|
||||
label: context.l10n.commonTask,
|
||||
color: Colors.teal,
|
||||
onTap: () {
|
||||
final companyId = context.read<SessionCubit>().state.company!.id!;
|
||||
final currentStaffId = context
|
||||
.read<SessionCubit>()
|
||||
.state
|
||||
.currentStaffMember!
|
||||
.id!;
|
||||
final emptyTask = TaskModel.empty(
|
||||
companyId: companyId,
|
||||
createdById: currentStaffId,
|
||||
);
|
||||
final savedTask = GetIt.I.get<TaskRepository>().createTask(
|
||||
emptyTask,
|
||||
);
|
||||
context.pushNamed(
|
||||
Routes.taskForm,
|
||||
pathParameters: {'id': 'new'},
|
||||
extra: savedTask,
|
||||
extra: (task: null),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user