uff
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flux/core/blocs/session/session_cubit.dart';
|
||||
import 'package:flux/features/tracking/data/tracking_repository.dart';
|
||||
import 'package:flux/features/tracking/models/tracking_model.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
|
||||
// Stati base: initial, loading, loaded, error
|
||||
class TrackingState {
|
||||
@@ -11,18 +13,13 @@ class TrackingState {
|
||||
}
|
||||
|
||||
class TrackingCubit extends Cubit<TrackingState> {
|
||||
final TrackingRepository _repo;
|
||||
final TrackingRepository _repo = GetIt.I.get<TrackingRepository>();
|
||||
final String parentId;
|
||||
final TrackingParentType parentType;
|
||||
final String companyId;
|
||||
final String companyId = GetIt.I.get<SessionCubit>().state.company!.id!;
|
||||
|
||||
TrackingCubit({
|
||||
required TrackingRepository repo,
|
||||
required this.parentId,
|
||||
required this.parentType,
|
||||
required this.companyId,
|
||||
}) : _repo = repo,
|
||||
super(TrackingState()) {
|
||||
TrackingCubit({required this.parentId, required this.parentType})
|
||||
: super(TrackingState()) {
|
||||
loadTrackings();
|
||||
}
|
||||
|
||||
@@ -46,7 +43,7 @@ class TrackingCubit extends Cubit<TrackingState> {
|
||||
companyId: companyId,
|
||||
message: message,
|
||||
type: TrackingType.manualNote,
|
||||
parentId: parentId,
|
||||
parentId: parentId!,
|
||||
parentType: parentType,
|
||||
staffId: staffId,
|
||||
isInternal: isInternal,
|
||||
|
||||
Reference in New Issue
Block a user