mirror of
https://github.com/simplezhli/flutter_barcode_reader.git
synced 2024-11-23 03:39:22 +08:00
Rename BarcodeScan class to BarcodeScanner
This commit is contained in:
parent
8906a076bf
commit
79a702761f
@ -1,6 +1,6 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:barcode_scan/barcode_scan.dart';
|
import 'package:barcode_scan/barcode_scanner.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
@ -43,7 +43,7 @@ class _MyAppState extends State<MyApp> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future scan() async {
|
Future scan() async {
|
||||||
String barcode = await BarcodeScan.scan();
|
String barcode = await BarcodeScanner.scan();
|
||||||
setState(() => this.barcode = barcode);
|
setState(() => this.barcode = barcode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ import 'dart:async';
|
|||||||
|
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
class BarcodeScan {
|
class BarcodeScanner {
|
||||||
static const MethodChannel _channel =
|
static const MethodChannel _channel =
|
||||||
const MethodChannel('com.apptreesoftware.barcode_scan');
|
const MethodChannel('com.apptreesoftware.barcode_scan');
|
||||||
static Future<String> scan() async => await _channel.invokeMethod('scan');
|
static Future<String> scan() async => await _channel.invokeMethod('scan');
|
Loading…
Reference in New Issue
Block a user