Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
mobile_scanner
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Navaron Bracke
2023-10-12 19:39:05 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d45462795784ce385f639f6342448cc275cec430
d4546279
1 parent
cf60fe49
format & analyze
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
test/scan_window_test.dart
test/scan_window_test.dart
View file @
d454627
...
...
@@ -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
{
...
...
Please
register
or
login
to post a comment