calculateBrightness method

Brightness calculateBrightness(
  1. BuildContext context
)

Implementation

Brightness calculateBrightness(BuildContext context) {
  final materialBrightness = Theme.of(context).brightness;
  final cupertinoBrightness = CupertinoTheme.of(context).brightness ??
      MediaQuery.of(context).platformBrightness;

  switch (applicationType) {
    case ApplicationType.material:
      return materialBrightness;
    case ApplicationType.cupertino:
      return cupertinoBrightness;
    case ApplicationType.both:
      return kIsWeb || !Platform.isIOS
          ? materialBrightness
          : cupertinoBrightness;
  }
}