serializeFocusMode function Null safety

String serializeFocusMode(
  1. FocusMode focusMode
)

Returns the focus mode as a String.

Implementation

String serializeFocusMode(FocusMode focusMode) {
  switch (focusMode) {
    case FocusMode.locked:
      return 'locked';
    case FocusMode.auto:
      return 'auto';
    default:
      throw ArgumentError('Unknown FocusMode value');
  }
}