Connected devices to widgets, and is currently making the necessary and correct api calls for everything to function properly.

This commit is contained in:
Faris Armoush
2025-05-14 15:35:22 +03:00
parent 7515b347ce
commit 0e61e52bf8
7 changed files with 66 additions and 23 deletions
@@ -33,6 +33,9 @@ class AnalyticsDevicesBloc
selectedDevice: devices.firstOrNull,
),
);
if (devices.isNotEmpty) {
event.onSuccess(devices.first);
}
} catch (e) {
emit(
AnalyticsDevicesState(
@@ -40,7 +43,7 @@ class AnalyticsDevicesBloc
errorMessage: e.toString(),
),
);
}
}
}
void _onSelectAnalyticsDevice(
@@ -8,9 +8,10 @@ sealed class AnalyticsDevicesEvent extends Equatable {
}
final class LoadAnalyticsDevicesEvent extends AnalyticsDevicesEvent {
const LoadAnalyticsDevicesEvent(this.param);
const LoadAnalyticsDevicesEvent({required this.param, required this.onSuccess});
final GetAnalyticsDevicesParam param;
final void Function(AnalyticsDevice device) onSuccess;
@override
List<Object> get props => [param];