KeyHelper constructor Null safety

KeyHelper(
  1. String toolkit
)

Create a KeyHelper implementation depending on the given toolkit.

Implementation

factory KeyHelper(String toolkit) {
  if (toolkit == 'glfw') {
    return GLFWKeyHelper();
  } else if (toolkit == 'gtk') {
    return GtkKeyHelper();
  } else {
    throw FlutterError('Window toolkit not recognized: $toolkit');
  }
}