preferred property Null safety

Future<DisplayMode> preferred

preferred returns the currently preferred mode. If not manually set with setPreferredMode then it will be DisplayMode.auto.

Implementation

static Future<DisplayMode> get preferred async {
  final Map<dynamic, dynamic> mode = (await _channel
      .invokeMethod<Map<dynamic, dynamic>>('getPreferredMode'))!;

  return DisplayMode.fromJson(mode.cast<String, dynamic>());
}