GamepadConnectionEvent.parse constructor

GamepadConnectionEvent.parse(
  1. Map map
)

Implementation

factory GamepadConnectionEvent.parse(Map<dynamic, dynamic> map) {
  final gamepadId = map['gamepadId'] as String;
  final name = map['name'] as String;
  final type = GamepadConnectionEventType.values.byName(
    map['type'] as String,
  );

  return GamepadConnectionEvent(
    gamepadId: gamepadId,
    name: name,
    type: type,
  );
}