Rename BarcodeScan class to BarcodeScanner

This commit is contained in:
Matthew Smith 2017-10-29 16:35:38 -07:00
parent 8906a076bf
commit 79a702761f
2 changed files with 3 additions and 3 deletions

View File

@ -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);
} }
} }

View File

@ -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');