QrGenerationOptions class
Options for generating QR codes
Constructors
-
QrGenerationOptions({int size = 512, ErrorCorrectionLevel errorCorrectionLevel = ErrorCorrectionLevel.medium, Color foregroundColor = const Color(0xFF000000), Color backgroundColor = const Color(0xFFFFFFFF), int margin = 20, Uint8List? logoData, double logoSizeRatio = 0.2, bool roundedCorners = false, double cornerRadius = 4.0, List<
Color> ? gradientColors, double gradientDirection = 0.0, bool addBorder = false, int borderWidth = 2, Color borderColor = const Color(0xFF000000)}) -
const
-
QrGenerationOptions.fromJson(Map<
String, dynamic> json) -
Creates options from a JSON map
factory
Properties
- addBorder → bool
-
Whether to add a border around the QR code
final
- backgroundColor → Color
-
The background color of the QR code
final
- borderColor → Color
-
Border color
final
- borderWidth → int
-
Border width in pixels
final
- cornerRadius → double
-
The radius for rounded corners (if enabled)
final
- errorCorrectionLevel → ErrorCorrectionLevel
-
The error correction level
final
- foregroundColor → Color
-
The foreground color of the QR code
final
-
gradientColors
→ List<
Color> ? -
Custom gradient colors (if null, uses solid colors)
final
- gradientDirection → double
-
Gradient direction (0.0 = horizontal, 0.5 = diagonal, 1.0 = vertical)
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- logoData → Uint8List?
-
Optional logo to embed in the center of the QR code
final
- logoSizeRatio → double
-
Size of the logo as a percentage of the QR code size (0.0 to 0.3)
final
- margin → int
-
The margin around the QR code in pixels
final
- roundedCorners → bool
-
Whether to use rounded corners for the QR code modules
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → int
-
The size of the QR code in pixels (width and height)
final
Methods
-
copyWith(
{int? size, ErrorCorrectionLevel? errorCorrectionLevel, Color? foregroundColor, Color? backgroundColor, int? margin, Uint8List? logoData, double? logoSizeRatio, bool? roundedCorners, double? cornerRadius, List< Color> ? gradientColors, double? gradientDirection, bool? addBorder, int? borderWidth, Color? borderColor}) → QrGenerationOptions - Creates a copy of this options with the given fields replaced
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts the options to a JSON map for platform communication
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited