ZetaCustomTheme constructor

ZetaCustomTheme({
  1. required String id,
  2. Color? primary,
  3. Color? primaryDark,
  4. Color? secondary,
  5. Color? secondaryDark,
})

Constructs a ZetaCustomTheme. To define every shade of a color, provide a ZetaColorSwatch or a MaterialColor. If only a Color is provided, a ZetaColorSwatch will be automatically generated.

Implementation

ZetaCustomTheme({
  required this.id,
  Color? primary,
  Color? primaryDark,
  Color? secondary,
  Color? secondaryDark,
})  : assert(
        !(primaryDark != null && primary == null),
        'Primary dark cannot be set without a primary color',
      ),
      assert(
        !(secondaryDark != null && secondary == null),
        'Secondary dark cannot be set without a secondary color',
      ),
      primary = primary != null ? ZetaColorSwatch.fromColor(primary) : null,
      primaryDark = primaryDark != null
          ? ZetaColorSwatch.fromColor(primaryDark)
          : primary != null
              ? ZetaColorSwatch.inverse(ZetaColorSwatch.fromColor(primary))
              : null,
      secondary = secondary != null ? ZetaColorSwatch.fromColor(secondary) : null,
      secondaryDark = secondaryDark != null
          ? ZetaColorSwatch.fromColor(secondaryDark)
          : secondary != null
              ? ZetaColorSwatch.inverse(ZetaColorSwatch.fromColor(secondary))
              : null;