Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/moralcode/flutterscannabletextformfield
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.
https://github.com/moralcode/flutterscannabletextformfield
barcode-scanner flutter flutter-forms qrcode-scanner
Last synced: about 1 month ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/moralcode/flutterscannabletextformfield
- Owner: MoralCode
- License: mit
- Created: 2023-02-10T15:19:27.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-11T01:42:12.000Z (almost 2 years ago)
- Last Synced: 2024-11-02T07:42:08.150Z (3 months ago)
- Topics: barcode-scanner, flutter, flutter-forms, qrcode-scanner
- Language: Dart
- Homepage:
- Size: 270 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# scannabletextformfield
[![Pub Version](https://img.shields.io/pub/v/scannabletextformfield)](https://pub.dev/packages/scannabletextformfield)
A form field for text input in [Flutter Forms](https://docs.flutter.dev/cookbook/forms) that allows data to be scanned in via QR or barcodes in addition to being typed in.
## Usage Example
```dart
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;
}
)
```