createGBChipTheme function

ChipThemeData createGBChipTheme({
  1. required Color textBlack,
  2. required Color textBase,
  3. ChipThemeData? customTheme,
})

Creates default ChipThemeData for GB UI Kit chips.

Implementation

ChipThemeData createGBChipTheme({
  required Color textBlack,
  required Color textBase,
  ChipThemeData? customTheme,
}) {
  final defaultTheme = ChipThemeData(
    side: BorderSide.none,
    backgroundColor: const Color(0xffe8e8ed),
    deleteIconColor: textBase,
    labelStyle: TextStyle(
      fontSize: 13,
      fontWeight: FontWeight.w500,
      color: textBlack,
    ),
    padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 0),
    labelPadding: const EdgeInsets.only(left: 4, right: 2),
    shape: RoundedRectangleBorder(
      borderRadius: BorderRadius.circular(6),
    ),
  );

  return customTheme != null
      ? defaultTheme.copyWith(
          backgroundColor: customTheme.backgroundColor,
          deleteIconColor: customTheme.deleteIconColor,
          disabledColor: customTheme.disabledColor,
          selectedColor: customTheme.selectedColor,
          secondarySelectedColor: customTheme.secondarySelectedColor,
          shadowColor: customTheme.shadowColor,
          selectedShadowColor: customTheme.selectedShadowColor,
          showCheckmark: customTheme.showCheckmark,
          checkmarkColor: customTheme.checkmarkColor,
          labelStyle: customTheme.labelStyle,
          secondaryLabelStyle: customTheme.secondaryLabelStyle,
          brightness: customTheme.brightness,
          elevation: customTheme.elevation,
          pressElevation: customTheme.pressElevation,
          shape: customTheme.shape,
          side: customTheme.side,
          padding: customTheme.padding,
          labelPadding: customTheme.labelPadding,
          iconTheme: customTheme.iconTheme,
        )
      : defaultTheme;
}