QrStyle enum
Defines the visual styling options for QR codes.
This enum provides 10 distinct visual styles for QR codes, ranging from the standard solid pattern to artistic styles with special effects. All styles maintain the QR code's scannability while offering various aesthetic options.
These styles only apply to QR codes and have no effect on other barcode types like EAN-13 or Code 128.
Example usage:
// Create a QR code with a gradient style
QrBarGenView(
data: 'https://flutter.dev',
type: QrBarType.qr,
qrStyle: QrStyle.gradient,
fg: Colors.blue,
secondaryColor: Colors.purple,
);
Most styles work with standard QR code readers, but some of the more decorative styles might reduce scannability with low-quality cameras. The standard style provides maximum compatibility.
- Inheritance
- Available extensions
Values
- standard → const QrStyle
-
Standard QR code with solid colors (default)
This is the classic QR code appearance with square modules and solid colors. Provides maximum compatibility with all QR code scanners.
Example parameters:
- fg: Sets the color of all QR modules
- bg: Sets the background color
- rounded → const QrStyle
-
Rounded corners on QR modules for a softer look
Maintains the standard QR pattern but replaces square data modules with circles, creating a softer, more modern appearance.
The eye patterns remain square for better recognition while the data modules are circular.
- withLogo → const QrStyle
-
QR code with a logo/image in the center
Embeds a custom logo or image in the center of the QR code. QR codes have built-in error correction that allows parts of the code to be obscured while remaining functional.
Requires the
logoparameter to be set with an ImageProvider. The logo should not be too large (typically not more than 25% of the QR size). - gradient → const QrStyle
-
QR code with gradient coloring
Applies a smooth color transition from the primary color to the secondary color across the QR code, creating a visually appealing gradient effect.
Requires the
secondaryColorparameter to be set. The gradient runs from top-left to bottom-right. - fancyEyes → const QrStyle
-
QR code with distinct eye styling
Customizes the three positioning marker squares (eyes) in the corners of the QR code with a different color and circular shape.
Uses the
secondaryColorparameter to color the eye patterns, while the main data modules use the standardfgcolor. - dots → const QrStyle
-
QR code with dot-pattern modules
Renders all modules (both eyes and data) as circles instead of squares, creating a distinctive dotted appearance.
This style creates a more modern, softer visual while maintaining good scannability.
- framed → const QrStyle
-
QR code with a custom frame around it
Adds a decorative border around the QR code with customizable color and width.
Uses the
frameColorparameter for the border color andframeWidthfor the border thickness. The border has rounded corners. - shadow → const QrStyle
-
QR code with a shadow effect
Applies a drop shadow behind the QR code for a subtle 3D effect.
Customizable with
shadowColor,shadowOffset, andshadowBlurRadiusparameters to control the appearance of the shadow. - mosaic → const QrStyle
-
QR code with alternating colors in a checkerboard pattern
Creates a two-tone effect by alternating between two colors in a checkerboard pattern across the QR modules.
Uses the
fgcolor for the primary modules andsecondaryColorfor the alternating modules to create a distinctive mosaic pattern. - pixelArt → const QrStyle
-
QR code that emulates a retro pixel art style
Applies different colors to different parts of the QR code to create a retro gaming aesthetic, with different colors for the corners, edges, and central data.
Uses all three color parameters:
fgfor the main data modulessecondaryColorfor the edgestertiaryColorfor the corner patterns
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- label → String
-
Available on QrStyle, provided by the QrStyleExt extension
Returns a human-readable label for each QR style.no setter - name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited