Navaron Bracke

format & analyze

... ... @@ -3,7 +3,9 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:mobile_scanner/src/scan_window_calculation.dart';
void main() {
group('Scan window relative to texture', () {
group(
'Scan window relative to texture',
() {
group('Widget (landscape) smaller than texture (portrait)', () {
const textureSize = Size(480.0, 640.0);
const widgetSize = Size(432.0, 256.0);
... ... @@ -42,7 +44,12 @@ void main() {
test('wl tp: BoxFit.fitWidth', () {
ctx.testScanWindow(
BoxFit.fitWidth,
const Rect.fromLTRB(0.25, 0.38888888888888895, 0.75, 0.6111111111111112),
const Rect.fromLTRB(
0.25,
0.38888888888888895,
0.75,
0.6111111111111112,
),
);
});
... ... @@ -50,7 +57,12 @@ void main() {
// equal to fitWidth
ctx.testScanWindow(
BoxFit.cover,
const Rect.fromLTRB(0.25, 0.38888888888888895, 0.75, 0.6111111111111112),
const Rect.fromLTRB(
0.25,
0.38888888888888895,
0.75,
0.6111111111111112,
),
);
});
... ... @@ -71,7 +83,8 @@ void main() {
});
});
group('Widget (landscape) smaller than texture and texture (landscape)', () {
group('Widget (landscape) smaller than texture and texture (landscape)',
() {
const textureSize = Size(640.0, 480.0);
const widgetSize = Size(320.0, 120.0);
final ctx = ScanWindowTestContext(
... ... @@ -137,7 +150,8 @@ void main() {
);
});
});
});
},
);
}
class ScanWindowTestContext {
... ...