scannabletextformfield 0.1.0 copy "scannabletextformfield: ^0.1.0" to clipboard
scannabletextformfield: ^0.1.0 copied to clipboard

A Flutter form field that allows text to be scanned in via a barcode or QR code.

scannabletextformfield #

A form field for text input in Flutter Forms that allows data to be scanned in via QR or barcodes in addition to being typed in.

Usage Example #

import 'package:scannabletextformfield/scannabletextformfield.dart';

//somewhere in your widget UI, ideally within a [Form]
ScannableTextFormField(
	validator: (value) {
		if (value == null || value.isEmpty) {
			return 'A value is required';
		}
		//add your own validation here if you want to verify the data being scanned is correct
		return null;
	},
	textInputDecoration: const InputDecoration(
		border: OutlineInputBorder(),
		labelText: "Label",
		hintText: "Placeholder hint text",
		helperText: 'additional help text',
	),
	scanTransformer: (data) => {
		//Optional: include this propperty if you want to transform the data from scanned codes before it gets entered into the text box, such as extracting an identifier from a URL.
		return data;
	}
)
0
likes
140
points
24
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter form field that allows text to be scanned in via a barcode or QR code.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

cupertino_icons, flutter, simple_barcode_scanner

More

Packages that depend on scannabletextformfield