MColor.system constructor

const MColor.system(
  1. MSystemColor system, {
  2. required String fallback,
  3. String? fallbackDark,
  4. double opacity = 1.0,
})

A colour from the user's system theme, with a fallback for everywhere it is unavailable.

Android 12+ (API 31) resolves this to the live Material You palette. Older Android, and iOS, use fallback and fallbackDark — iOS has no wallpaper-derived palette, so the fallback is what actually renders there. Pick fallbacks that look right on their own; most widgets are seen on iOS or pre-31 devices too.

Implementation

const MColor.system(
  MSystemColor this.system, {
  required String fallback,
  String? fallbackDark,
  this.opacity = 1.0,
})  : hex = fallback,
      dark = fallbackDark,
      bind = null;