SfBarcodeThemeData.raw constructor

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

Create a SfBarcodeThemeData given a set of exact values. All the values must be specified.

This will rarely be used directly. It is used by lerp to create intermediate themes based on two themes created with the SfBarcodeThemeData constructor.

Implementation

factory SfBarcodeThemeData.raw({
  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(
    backgroundColor: backgroundColor,
    barColor: barColor,
    textColor: textColor,
    textStyle: textStyle,
  );
}