ScreenEvent.fromScreenStateEvent constructor

ScreenEvent.fromScreenStateEvent(
  1. ScreenStateEvent event
)

Implementation

factory ScreenEvent.fromScreenStateEvent(ScreenStateEvent event) {
  ScreenEvent sd = ScreenEvent();

  switch (event) {
    case ScreenStateEvent.SCREEN_ON:
      sd.screenEvent = 'SCREEN_ON';
      break;
    case ScreenStateEvent.SCREEN_OFF:
      sd.screenEvent = 'SCREEN_OFF';
      break;
    case ScreenStateEvent.SCREEN_UNLOCKED:
      sd.screenEvent = 'SCREEN_UNLOCKED';
      break;
  }
  return sd;
}