Revert "formatted all files."

This reverts commit 04250ebc98.
This commit is contained in:
Faris Armoush
2025-06-12 16:04:49 +03:00
parent 218f43bacb
commit c642ba2644
473 changed files with 4335 additions and 5417 deletions

View File

@ -22,8 +22,7 @@ class SosDeviceBloc extends Bloc<SosDeviceEvent, SosDeviceState> {
late SosStatusModel deviceStatus;
FutureOr<void> _getDeviceStatus(
GetDeviceStatus event, Emitter<SosDeviceState> emit) async {
FutureOr<void> _getDeviceStatus(GetDeviceStatus event, Emitter<SosDeviceState> emit) async {
emit(SosDeviceLoadingState());
try {
final status = await DevicesManagementApi().getDeviceStatus(event.uuid);
@ -34,8 +33,7 @@ class SosDeviceBloc extends Bloc<SosDeviceEvent, SosDeviceState> {
}
}
FutureOr<void> _getBatchStatus(
GetBatchStatus event, Emitter<SosDeviceState> emit) async {
FutureOr<void> _getBatchStatus(GetBatchStatus event, Emitter<SosDeviceState> emit) async {
emit(SosDeviceLoadingState());
try {
final status = await DevicesManagementApi().getBatchStatus(event.uuids);
@ -46,31 +44,25 @@ class SosDeviceBloc extends Bloc<SosDeviceEvent, SosDeviceState> {
}
}
FutureOr<void> _getDeviceRecords(
GetDeviceRecords event, Emitter<SosDeviceState> emit) async {
FutureOr<void> _getDeviceRecords(GetDeviceRecords event, Emitter<SosDeviceState> emit) async {
emit(SosReportLoadingState());
try {
final from = DateTime.now()
.subtract(const Duration(days: 30))
.millisecondsSinceEpoch;
final from = DateTime.now().subtract(const Duration(days: 30)).millisecondsSinceEpoch;
final to = DateTime.now().millisecondsSinceEpoch;
final records = await DevicesManagementApi.getDeviceReportsByDate(
event.uuid, 'sos', from.toString(), to.toString());
final DeviceReport records =
await DevicesManagementApi.getDeviceReportsByDate(event.uuid, 'sos', from.toString(), to.toString());
emit(SosReportLoadedState(records));
} catch (e) {
emit(SosReportErrorState(e.toString()));
}
}
FutureOr<void> _getDeviceAutomationRecords(
GetDeviceAutomationRecords event, Emitter<SosDeviceState> emit) async {
FutureOr<void> _getDeviceAutomationRecords(GetDeviceAutomationRecords event, Emitter<SosDeviceState> emit) async {
emit(SosAutomationReportLoadingState());
try {
final from = DateTime.now()
.subtract(const Duration(days: 30))
.millisecondsSinceEpoch;
final from = DateTime.now().subtract(const Duration(days: 30)).millisecondsSinceEpoch;
final to = DateTime.now().millisecondsSinceEpoch;
final records = await DevicesManagementApi.getDeviceReportsByDate(
final DeviceReport records = await DevicesManagementApi.getDeviceReportsByDate(
event.uuid, 'sos_automation', from.toString(), to.toString());
emit(SosAutomationReportLoadedState(records));
} catch (e) {
@ -78,17 +70,14 @@ class SosDeviceBloc extends Bloc<SosDeviceEvent, SosDeviceState> {
}
}
FutureOr<void> _backToSosStatusView(
BackToSosStatusView event, Emitter<SosDeviceState> emit) {
FutureOr<void> _backToSosStatusView(BackToSosStatusView event, Emitter<SosDeviceState> emit) {
emit(SosDeviceLoadedState(deviceStatus));
}
FutureOr<void> _sosFactoryReset(
SosFactoryReset event, Emitter<SosDeviceState> emit) async {
FutureOr<void> _sosFactoryReset(SosFactoryReset event, Emitter<SosDeviceState> emit) async {
emit(SosDeviceLoadingState());
try {
final response = await DevicesManagementApi()
.factoryReset(event.factoryReset, event.deviceId);
final response = await DevicesManagementApi().factoryReset(event.factoryReset, event.deviceId);
if (response) {
emit(SosDeviceLoadedState(deviceStatus));
} else {