feat: Refactor code structure and optimize performance across multiple modules
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:krow/core/entity/staff_contact_entity.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
part 'assigned_staff_event.dart';
|
||||
part 'assigned_staff_state.dart';
|
||||
|
||||
class AssignedStaffBloc extends Bloc<AssignedStaffEvent, AssignedStaffState> {
|
||||
AssignedStaffBloc(
|
||||
{required List<StaffContact> staffContacts, required String department})
|
||||
: super(AssignedStaffState(
|
||||
staffContacts: staffContacts,
|
||||
department: department,
|
||||
)) {}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
part of 'assigned_staff_bloc.dart';
|
||||
|
||||
@immutable
|
||||
sealed class AssignedStaffEvent {}
|
||||
@@ -0,0 +1,23 @@
|
||||
part of 'assigned_staff_bloc.dart';
|
||||
|
||||
@immutable
|
||||
class AssignedStaffState {
|
||||
final List<StaffContact> staffContacts;
|
||||
final String department;
|
||||
final bool inLoading;
|
||||
|
||||
const AssignedStaffState({required this.staffContacts, required this.department, this.inLoading = false});
|
||||
|
||||
copyWith({
|
||||
List<StaffContact>? staffContacts,
|
||||
String? department,
|
||||
bool? canManualAssign,
|
||||
bool? inLoading,
|
||||
}) {
|
||||
return AssignedStaffState(
|
||||
staffContacts: staffContacts ?? this.staffContacts,
|
||||
department: department ?? this.department,
|
||||
inLoading: inLoading ?? this.inLoading,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user