SfBarcodeThemeData constructor

SfBarcodeThemeData({
  1. Brightness? brightness,
  2. Color? backgroundColor,
  3. Color? barColor,
  4. Color? textColor,
  5. TextStyle? textStyle,
})

Initialize the SfBarcode theme data

Implementation

factory SfBarcodeThemeData({
  Brightness? brightness,
  Color? backgroundColor,
  Color? barColor,
  Color? textColor,
  TextStyle? textStyle,
}) {
  brightness = brightness ?? Brightness.light;
  final bool isLight = brightness == Brightness.light;
  backgroundColor ??= Colors.transparent;
  barColor ??= isLight ? const Color(0xFF212121) : const Color(0xFFE0E0E0);
  textColor ??= isLight ? const Color(0xFF212121) : const Color(0xFFE0E0E0);

  return SfBarcodeThemeData.raw(
    brightness: brightness,
    backgroundColor: backgroundColor,
    barColor: barColor,
    textColor: textColor,
    textStyle: textStyle,
  );
}