active property Null safety

Future<DisplayMode> active

active fetches the currently active mode. This is not always the preferred mode set by setPreferredMode. It can be altered by the system based on the display settings.

Implementation

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

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