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-23 20:48:39 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ca42c7e6568b35e826e4876e91c5effb107a0fe7
ca42c7e6
1 parent
c95a2975
add size attribute to BarcodeCapture; make width/height of barcode capture non-null
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
15 deletions
CHANGELOG.md
lib/src/objects/barcode_capture.dart
CHANGELOG.md
View file @
ca42c7e
...
...
@@ -7,6 +7,8 @@ Improvements:
*
The
`phones` and `urls` of `ContactInfo`
are now non-null.
*
The
`url` of a `UrlBookmark`
is now non-null.
*
The
`type` of `Phone`
is now non-null.
*
The
`width` and `height` of `BarcodeCapture`
are now non-null.
*
The
`BarcodeCapture` class now exposes a `size`
.
## 3.5.0
New Features:
...
...
lib/src/objects/barcode_capture.dart
View file @
ca42c7e
import
'dart:typed_data'
;
import
'dart:ui'
;
import
'package:mobile_scanner/src/objects/barcode.dart'
;
/// The return object after a frame is scanned.
///
/// [barcodes] A list with barcodes. A scanned frame can contain multiple
/// barcodes.
/// [image] If enabled, an image of the scanned frame.
/// This class represents a scanned barcode.
class
BarcodeCapture
{
/// Create a new [BarcodeCapture] instance.
BarcodeCapture
({
this
.
barcodes
=
const
<
Barcode
>[],
double
?
height
,
this
.
image
,
this
.
raw
,
double
?
width
,
})
:
size
=
width
==
null
&&
height
==
null
?
Size
.
zero
:
Size
(
width
!,
height
!);
/// The list of scanned barcodes.
final
List
<
Barcode
>
barcodes
;
final
dynamic
raw
;
/// The bytes of the image that is embedded in the barcode.
///
/// This null if [MobileScannerController.returnImage] is false.
final
Uint8List
?
image
;
final
double
?
width
;
/// The raw data of the scanned barcode.
final
dynamic
raw
;
// TODO: this should be `Object?` instead of dynamic
final
double
?
height
;
/// The size of the scanned barcode.
final
Size
size
;
BarcodeCapture
({
required
this
.
barcodes
,
required
this
.
raw
,
this
.
image
,
this
.
width
,
this
.
height
,
});
/// The width of the scanned barcode.
///
/// Prefer using `size.width` instead,
/// as this getter will be removed in the future.
double
get
width
=>
size
.
width
;
/// The height of the scanned barcode.
///
/// Prefer using `size.height` instead,
/// as this getter will be removed in the future.
double
get
height
=>
size
.
height
;
}
...
...
Please
register
or
login
to post a comment