effectiveAppBarColor method

Color effectiveAppBarColor(
  1. ZetaColorScheme colorScheme
)

Returns effective appBar color depending upon the color scheme.

colorScheme is the color palette maintained by the app/theme for standard color consistency across the app.

ZetaAppBarStyle is the style variant for AppBar, which determines the colour that should be derived from the colorScheme.

Returns Color, the final colour to be applied to the appBar.

Implementation

Color effectiveAppBarColor(ZetaColorScheme colorScheme) {
  switch (this) {
    case ZetaAppBarStyle.primary:
      // Applying primary color of color scheme
      return colorScheme.primary;
    case ZetaAppBarStyle.secondary:
      // Applying secondary color of color scheme
      return colorScheme.secondary;
    case ZetaAppBarStyle.surface:
      // Applying surface color of color scheme
      return colorScheme.surface;
    case ZetaAppBarStyle.background:
      // Applying background color of color scheme
      return colorScheme.background;
  }
}