mySecondaryTextStyle function

TextStyle mySecondaryTextStyle(
  1. BuildContext context, {
  2. int? size,
  3. Color? color,
  4. FontWeight? weight,
  5. String? fontFamily,
  6. double? letterSpacing,
  7. FontStyle? fontStyle,
  8. double? wordSpacing,
  9. TextDecoration? decoration,
  10. TextDecorationStyle? textDecorationStyle,
  11. TextBaseline? textBaseline,
  12. Color? decorationColor,
  13. Color? backgroundColor,
  14. double? height,
})

Implementation

TextStyle mySecondaryTextStyle(
  BuildContext context, {
  int? size,
  Color? color,
  FontWeight? weight,
  String? fontFamily,
  double? letterSpacing,
  FontStyle? fontStyle,
  double? wordSpacing,
  TextDecoration? decoration,
  TextDecorationStyle? textDecorationStyle,
  TextBaseline? textBaseline,
  Color? decorationColor,
  Color? backgroundColor,
  double? height,
}) {
  final theme = Theme.of(context); // Get the current theme

  return TextStyle(
    fontSize: size != null ? size.toDouble() : textSecondarySizeGlobal,
    color: color ??
        (theme.brightness == Brightness.dark
            ? Colors.white
            : textPrimaryColorGlobal),
    fontWeight: weight ?? fontWeightSecondaryGlobal,
    fontFamily: fontFamily ?? fontFamilySecondaryGlobal,
    letterSpacing: letterSpacing,
    fontStyle: fontStyle,
    decoration: decoration,
    decorationStyle: textDecorationStyle,
    decorationColor: decorationColor,
    wordSpacing: wordSpacing,
    textBaseline: textBaseline,
    backgroundColor: backgroundColor,
    height: height,
  );
}