mirror of
https://github.com/SyncrowIOT/web.git
synced 2026-10-24 19:27:56 +00:00
Connected devices to widgets, and is currently making the necessary and correct api calls for everything to function properly.
This commit is contained in:
+4
-1
@@ -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(
|
||||
|
||||
+2
-1
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user