Julian Steenbakker

style: flutter lints

import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:mobile_scanner/mobile_scanner.dart';
... ...
... ... @@ -20,7 +20,7 @@ class _AnalyzeViewState extends State<AnalyzeView>
// CameraController cameraController = CameraController(context, width: 320, height: 150);
String? barcode = null;
String? barcode;
@override
Widget build(BuildContext context) {
... ... @@ -37,13 +37,13 @@ class _AnalyzeViewState extends State<AnalyzeView>
this.barcode = barcode.rawValue;
if (barcode.corners != null) {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text('${barcode.rawValue}'),
content: Text(barcode.rawValue),
duration: const Duration(milliseconds: 200),
animation: null,
));
setState(() {
final List<Offset> points = [];
double factorWidth = args.size.width / 520;
// double factorWidth = args.size.width / 520;
// double factorHeight = wanted / args.size.height;
final size = MediaQuery.of(context).devicePixelRatio;
debugPrint('Size: ${barcode.corners}');
... ... @@ -109,7 +109,7 @@ class OpenPainter extends CustomPainter {
@override
void paint(Canvas canvas, Size size) {
var paint1 = Paint()
..color = Color(0xff63aa65)
..color = const Color(0xff63aa65)
..strokeWidth = 10;
//draw points on canvas
canvas.drawPoints(PointMode.points, points, paint1);
... ...
... ... @@ -5,11 +5,8 @@
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mobile_scanner_example/main.dart';
void main() {
testWidgets('Verify Platform version', (WidgetTester tester) async {
// Build our app and trigger a frame.
... ...
... ... @@ -132,8 +132,9 @@ class MobileScannerController {
final Map<String, dynamic>? startResult = await methodChannel
.invokeMapMethod<String, dynamic>('start', arguments);
if (startResult == null)
if (startResult == null) {
throw PlatformException(code: 'INITIALIZATION ERROR');
}
hasTorch = startResult['torchable'];
args.value = MobileScannerArguments(
... ...
... ... @@ -490,7 +490,7 @@ enum BarcodeFormat {
/// Barcode format constant for Data Matrix.
///
/// Constant Value: 16
data_matrix,
dataMatrix,
/// Barcode format constant for EAN-13.
///
... ... @@ -510,17 +510,17 @@ enum BarcodeFormat {
/// Barcode format constant for QR Code.
///
/// Constant Value: 256
qr_code,
qrCode,
/// Barcode format constant for UPC-A.
///
/// Constant Value: 512
upc_a,
upcA,
/// Barcode format constant for UPC-E.
///
/// Constant Value: 1024
upc_e,
upcE,
/// Barcode format constant for PDF-417.
///
... ...
... ... @@ -29,7 +29,7 @@ BarcodeFormat toFormat(int value) {
case 8:
return BarcodeFormat.codebar;
case 16:
return BarcodeFormat.data_matrix;
return BarcodeFormat.dataMatrix;
case 32:
return BarcodeFormat.ean13;
case 64:
... ... @@ -37,11 +37,11 @@ BarcodeFormat toFormat(int value) {
case 128:
return BarcodeFormat.itf;
case 256:
return BarcodeFormat.qr_code;
return BarcodeFormat.qrCode;
case 512:
return BarcodeFormat.upc_a;
return BarcodeFormat.upcA;
case 1024:
return BarcodeFormat.upc_e;
return BarcodeFormat.upcE;
case 2048:
return BarcodeFormat.pdf417;
case 4096:
... ...
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mobile_scanner/src/mobile_scanner.dart';
void main() {
const MethodChannel channel = MethodChannel('mobile_scanner');
... ...