UserStatusInfo constructor
UserStatusInfo(
- Map event
Creates a UserStatusInfo instance using the provided event data.
The event
should be a map containing raw data from a UserStatusEvent.
This constructor extracts and assigns the relevant data fields to the corresponding properties.
Implementation
UserStatusInfo(Map<dynamic, dynamic> event) {
_setUserStatusType(event);
// Set relevant data based on the type of user status event.
if (type == UserStatusEventType.ATTENTION) {
_setAttentionData(event);
} else if (type == UserStatusEventType.BLINK) {
_setBlinkData(event);
} else if (type == UserStatusEventType.DROWSINESS) {
_setDrowsinessData(event);
}
}