This repository has been archived on 2025-04-22. You can view files and clone it, but cannot push or open issues or pull requests.
ha_client/lib/utils/event_bus_events.dart
2019-09-04 15:10:25 +03:00

84 lines
1.6 KiB
Dart

part of '../main.dart';
class StateChangedEvent {
String entityId;
String newState;
bool needToRebuildUI;
StateChangedEvent({
this.entityId,
this.newState,
this.needToRebuildUI: false
});
}
class SettingsChangedEvent {
bool reconnect;
SettingsChangedEvent(this.reconnect);
}
class RefreshDataFinishedEvent {
RefreshDataFinishedEvent();
}
class ReloadUIEvent {
final bool full;
ReloadUIEvent(this.full);
}
class StartAuthEvent {
String oauthUrl;
bool starting;
StartAuthEvent(this.oauthUrl, this.starting);
}
class ServiceCallEvent {
String domain;
String service;
String entityId;
Map<String, dynamic> additionalParams;
ServiceCallEvent(this.domain, this.service, this.entityId, this.additionalParams);
}
class ShowPopupDialogEvent {
final String title;
final String body;
final String positiveText;
final String negativeText;
final onPositive;
final onNegative;
ShowPopupDialogEvent({this.title, this.body, this.positiveText: "Ok", this.negativeText: "Cancel", this.onPositive, this.onNegative});
}
class ShowPopupMessageEvent {
final String title;
final String body;
final String buttonText;
final onButtonClick;
ShowPopupMessageEvent({this.title, this.body, this.buttonText: "Ok", this.onButtonClick});
}
class ShowEntityPageEvent {
Entity entity;
ShowEntityPageEvent(this.entity);
}
class ShowPageEvent {
final String path;
final bool goBackFirst;
ShowPageEvent({@required this.path, this.goBackFirst: false});
}
class ShowErrorEvent {
final UserError error;
ShowErrorEvent(this.error);
}