HubbleThemeData.mobileLight constructor

HubbleThemeData.mobileLight(
  1. FlutterView view
)

Implementation

factory HubbleThemeData.mobileLight(FlutterView view) {
  _scale = _scaleFactor(view);

  final typography =
      HubbleTypography.mobile().copyUpdateScaledTextSize(_scale);
  final spaces = HubbleSpaces.mobile().copyUpdateScale(_scale);
  final spacing = HubbleSpacing.mobile(spaces);
  final colors = HubbleColorPalette.light();
  final solidButtonStyle = HubbleButtonStyle.solid(
    colors: colors,
    typography: typography,
  );

  final ghostButtonStyle = HubbleButtonStyle.ghost(
    colors: colors,
    typography: typography,
  );

  final colorScheme = ColorScheme.fromSeed(
    seedColor: colors.brand.secondary.dark,
    // background: colors.onBackground,
    // brightness: Brightness.dark,
    // error: colors.system.error.dark,
    // onPrimary: colors.brand.primary.dark,
    // secondary: colors.brand.secondary.dark,
    // tertiary: colors.brand.tertiary.dark,
  );

  return HubbleThemeData(
    id: 1,
    colorScheme: colorScheme,
    genericTextFieldStyle: GenericTextFieldStyle()
      ..textFieldBackground = colors.base.tertiary.normal,
    brightness: Brightness.light,
    freezableEditFieldStyle: FreezableEditFieldStyle.light(
      typography: typography,
      colors: colors,
    ),
    radioButtonStyle: HubbleRadioButtonVariants.light(
      colors: colors,
      spaces: spaces,
      typography: typography,
    ),
    scale: _scale,
    name: 'mobileLight',
    radius: HubbleRadius.mobile(),
    otpTextField: PlainTextFieldStyles()
      ..textStyle = typography.s19.copyWith(
        color: colors.brand.secondary.medium,
        fontWeight: FontWeight.w600,
        letterSpacing: 1.5.dp,
      )
      ..prefixTextStyle = typography.s19.copyWith(
        color: colors.brand.secondary.medium,
        fontWeight: FontWeight.w600,
      )
      ..errorBorder = Border.all(color: Colors.transparent)
      ..fieldBackground = Colors.transparent
      ..prefixColorWhenEmpty = colors.base.secondary.medium
      ..contentPadding =
          EdgeInsets.only(top: 10.0.dp, bottom: spaces.sizes[5])
      ..hintTextStyle = (typography.s19.copyWith(
        fontWeight: FontWeight.w600,
        color: colors.base.tertiary.dark,
        letterSpacing: 1.5,
      ))
      ..labelTextStyle = (typography.s19.copyWith(
        fontWeight: FontWeight.w600,
        color: colors.base.tertiary.dark,
        letterSpacing: 0.0,
      ))
      ..padding = EdgeInsets.zero,
    primaryTextField: PlainTextFieldStyles()
      ..textStyle = typography.s19.copyWith(
        color: colors.base.primary.dark,
        fontWeight: FontWeight.w600,
        letterSpacing: 1.5,
      )
      ..prefixTextStyle = typography.s19.copyWith(
        color: colors.base.primary.dark,
        fontWeight: FontWeight.w600,
      )
      ..errorBorder = Border.all(color: Colors.transparent)
      ..fieldBackground = Colors.transparent
      ..prefixColorWhenEmpty = colors.base.secondary.medium
      ..contentPadding =
          EdgeInsets.only(top: spaces.sizes[10], bottom: spaces.sizes[5])
      ..hintTextStyle = (typography.s19.copyWith(
        fontWeight: FontWeight.w600,
        color: colors.base.tertiary.dark,
        letterSpacing: 0.0,
      ))
      ..labelTextStyle = (typography.s19.copyWith(
        fontWeight: FontWeight.w600,
        color: colors.base.tertiary.dark,
        letterSpacing: 0.0,
      ))
      ..cursorHeight = 29.0.dp
      ..padding = EdgeInsets.zero,
    switchStyle: HubbleSwitchStyle.light(colors),
    colors: colors,
    spacing: spacing,
    typography: typography,
    ghostButtons: HubbleButtonStyleSizeVariants(
      large: ghostButtonStyle.copyWith(
        height: spaces.sizes[48],
        padding: EdgeInsets.symmetric(horizontal: spacing.spaces.xl),
        textStyle: ghostButtonStyle.textStyle.copyUpdateAll(
          fontSize: spaces.sizes[16],
          fontWeight: FontWeight.w600,
        ),
      ),
      medium: ghostButtonStyle.copyWith(
        height: spaces.sizes[40],
        padding: EdgeInsets.symmetric(horizontal: spacing.spaces.xl),
        textStyle: ghostButtonStyle.textStyle.copyUpdateAll(
          fontSize: spaces.sizes[14],
          fontWeight: FontWeight.w600,
        ),
      ),
      small: ghostButtonStyle.copyWith(
        height: spaces.sizes[32],
        padding: EdgeInsets.symmetric(horizontal: spaces.sizes[16]),
        textStyle: ghostButtonStyle.textStyle.copyUpdateAll(
          fontSize: spaces.sizes[12],
          fontWeight: FontWeight.w600,
        ),
      ),
    ),
    buttons: HubbleButtonStyleSizeVariants(
      large: solidButtonStyle.copyWith(
        height: spaces.sizes[48],
        padding: EdgeInsets.symmetric(horizontal: spacing.spaces.xl),
        textStyle: HubbleButtonStateVariant.all(typography.buttonLarge)
            .copyWith(
                grey: typography.buttonLarge
                    .copyWith(color: colors.textColorDark),
                enabled:
                    typography.buttonLarge.copyWith(color: Colors.white)),
      ),
      medium: solidButtonStyle.copyWith(
        height: spaces.sizes[40],
        padding: EdgeInsets.symmetric(horizontal: spacing.spaces.xl),
        textStyle:
            HubbleButtonStateVariant.all(typography.buttonMedium).copyWith(
          grey: typography.buttonMedium.copyWith(color: colors.textColorDark),
        ),
      ),
      small: solidButtonStyle.copyWith(
        height: spaces.sizes[32],
        padding: EdgeInsets.symmetric(horizontal: spaces.sizes[16]),
        textStyle:
            HubbleButtonStateVariant.all(typography.buttonSmall).copyWith(
          grey: typography.buttonSmall.copyWith(color: colors.textColorDark),
        ),
      ),
    ),
  );
}