UScannerPage class
A ready-to-use full-screen scanner page wrapping UScanner.
By default it pops with the scanned string, so it can be awaited with UScannerPage.open.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- UScannerPage
- Available extensions
Constructors
-
UScannerPage({String? title, PreferredSizeWidget? appBar, bool showAppBar = true, Color? backgroundColor, bool autoPopOnScan = true, ValueChanged<
String> ? onScan, ValueChanged<List< ? onCodes, void onScanError(Object error, StackTrace stackTrace)?, UCameraController? controller, bool autoStart = true, UCameraFacing facing = UCameraFacing.back, UCameraResolution resolution = UCameraResolution.high, UScanSpeed speed = UScanSpeed.normal, List<UCode> >UCodeFormat> formats = const <UCodeFormat>[], UScanEngine engine = UScanEngine.auto, bool torchEnabled = false, bool tryInvert = false, double? initialZoom, BoxFit fit = BoxFit.cover, Widget errorBuilder(BuildContext context, UCameraException error)?, WidgetBuilder? placeholderBuilder, LayoutWidgetBuilder? overlayBuilder, Rect? scanWindow, bool restrictToScanWindow = true, bool useAppLifecycleState = true, bool tapToFocus = true, bool pinchToZoom = true, bool singleScan = true, bool hapticOnScan = true, bool showOverlay = true, Color? overlayColor, Size scanWindowSize = const Size(280, 280), Color? borderColor, double borderWidth = 3, double borderRadius = 16, double cornerLength = 32, bool showCorners = true, bool showFullBorder = false, bool showScanLine = true, Color? scanLineColor, double scanLineThickness = 2, Duration scanLineDuration = const Duration(seconds: 2), bool showTrackingBoxes = false, String? hintText, bool showHint = true, TextStyle? hintTextStyle, UScannerHintPosition hintPosition = UScannerHintPosition.bottom, double hintGap = 20, EdgeInsets hintPadding = const EdgeInsets.symmetric(horizontal: 14, vertical: 10), Color? hintBackgroundColor, double hintBorderRadius = 12, bool showControls = true, bool showTorchButton = true, bool showSwitchCameraButton = true, bool showGalleryButton = false, bool showZoomSlider = false, Alignment controlsAlignment = Alignment.bottomCenter, double controlsSpacing = 24, EdgeInsets controlsPadding = const EdgeInsets.only(bottom: 40), Color? controlIconColor, Color? controlActiveIconColor, Color? controlBackgroundColor, double controlButtonSize = 52, double controlIconSize = 26, IconData torchOnIcon = Icons.flash_on_rounded, IconData torchOffIcon = Icons.flash_off_rounded, IconData switchCameraIcon = Icons.cameraswitch_rounded, IconData galleryIcon = Icons.photo_library_rounded, Key? key}) -
const
Properties
- appBar → PreferredSizeWidget?
-
final
- autoPopOnScan → bool
-
final
- autoStart → bool
-
final
- backgroundColor → Color?
-
final
- borderColor → Color?
-
final
- borderRadius → double
-
final
- borderWidth → double
-
final
- controlActiveIconColor → Color?
-
final
- controlBackgroundColor → Color?
-
final
- controlButtonSize → double
-
final
- controlIconColor → Color?
-
final
- controlIconSize → double
-
final
- controller → UCameraController?
-
final
- controlsAlignment → Alignment
-
final
- controlsPadding → EdgeInsets
-
final
- controlsSpacing → double
-
final
- cornerLength → double
-
final
- engine → UScanEngine
-
final
- errorBuilder → Widget Function(BuildContext context, UCameraException error)?
-
final
- facing → UCameraFacing
-
final
- fit → BoxFit
-
final
-
formats
→ List<
UCodeFormat> -
final
- galleryIcon → IconData
-
final
- hapticOnScan → bool
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hintBackgroundColor → Color?
-
final
- hintBorderRadius → double
-
final
- hintGap → double
-
final
- hintPadding → EdgeInsets
-
final
- hintPosition → UScannerHintPosition
-
final
- hintText → String?
-
final
- hintTextStyle → TextStyle?
-
final
- initialZoom → double?
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onCodes
→ ValueChanged<
List< ?UCode> > -
final
-
onScan
→ ValueChanged<
String> ? -
final
- onScanError → void Function(Object error, StackTrace stackTrace)?
-
final
- overlayBuilder → LayoutWidgetBuilder?
-
final
- overlayColor → Color?
-
final
- pinchToZoom → bool
-
final
- placeholderBuilder → WidgetBuilder?
-
final
- resolution → UCameraResolution
-
final
- restrictToScanWindow → bool
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scanLineColor → Color?
-
final
- scanLineDuration → Duration
-
final
- scanLineThickness → double
-
final
- scanWindow → Rect?
-
final
- scanWindowSize → Size
-
final
- showAppBar → bool
-
final
- showControls → bool
-
final
- showCorners → bool
-
final
- showFullBorder → bool
-
final
- showGalleryButton → bool
-
final
- showHint → bool
-
final
- showOverlay → bool
-
final
- showScanLine → bool
-
final
- showSwitchCameraButton → bool
-
final
- showTorchButton → bool
-
final
- showTrackingBoxes → bool
-
final
- showZoomSlider → bool
-
final
- singleScan → bool
-
final
- speed → UScanSpeed
-
final
- switchCameraIcon → IconData
-
final
- tapToFocus → bool
-
final
- title → String?
-
final
- torchEnabled → bool
-
final
- torchOffIcon → IconData
-
final
- torchOnIcon → IconData
-
final
- tryInvert → bool
-
final
- useAppLifecycleState → bool
-
final
Methods
-
alignAtBottomCenter(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtBottomLeft(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtBottomRight(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtCenter(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtCenterLeft(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtCenterRight(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtLERP(
Alignment a, Alignment b, double t, {Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtTopCenter(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtTopLeft(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtTopRight(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignXY(
double x, double y, {Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
card(
{Color? backgroundColor, double? elevation, EdgeInsetsGeometry? margin}) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
chip(
{required Color backgroundColor, double? width, double? height, Alignment? alignment, double borderWidth = 1, double radius = 12, Color borderColor = Colors.transparent, EdgeInsets padding = const EdgeInsets.symmetric(horizontal: 8, vertical: 6), EdgeInsetsGeometry? margin, BoxConstraints? constraints}) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
container(
{double? width, double? height, Alignment? alignment, Color? backgroundColor, double borderWidth = 1, double radius = 1, Color borderColor = Colors.transparent, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, BoxConstraints? constraints}) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
expanded(
{int flex = 1}) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
fadeSlideIn(
{int milliseconds = 1000, double offset = 24}) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
fit(
{Alignment alignment = Alignment.center}) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
form(
GlobalKey< FormState> key) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
ltr(
) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onDoubleTap(
GestureTapCallback? onPressed) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
onLongPress(
GestureTapCallback? onPressed) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
onPress(
VoidCallback onTap, {double pressedScale = 0.9, Duration duration = const Duration(milliseconds: 120)}) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
onTap(
GestureTapCallback? onPressed) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
onTapInk(
GestureTapCallback? onPressed) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
pAll(
double padding) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
pLTRB(
double left, double top, double right, double bottom) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
pOnly(
{double left = 0.0, double top = 0.0, double right = 0.0, double bottom = 0.0}) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
position(
{double? left, double? top, double? right, double? bottom, double? width, double? height}) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
pSymmetric(
{double horizontal = 0.0, double vertical = 0.0}) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
rotate(
double scale) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
rtl(
) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
safeArea(
) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
scale(
double scale) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
scrollable(
{Axis scrollDirection = Axis.vertical}) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
showMenus(
List< PopupMenuEntry< items) → Widgetint> > -
Available on Widget, provided by the WidgetsExtension extension
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
-
translate(
Offset offset) → Widget -
Available on Widget, provided by the WidgetsExtension extension
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
open(
{String? title, List< UCodeFormat> formats = const <UCodeFormat>[], String? hintText, bool showGalleryButton = false, UScanSpeed speed = UScanSpeed.normal}) → Future<String?> - Pushes this page and awaits the scanned string, or null if dismissed.
-
openForCode(
{String? title, List< UCodeFormat> formats = const <UCodeFormat>[], String? hintText}) → Future<UCode?> - Pushes this page and awaits the full result, with format and geometry.