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 17:17:49 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
acdcfb0dba7514022cd750fd6f7a6452985f6cd4
acdcfb0d
1 parent
2eeae06d
move WiFi to its own file
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
25 deletions
lib/mobile_scanner.dart
lib/src/objects/barcode.dart
lib/src/objects/wifi.dart
lib/mobile_scanner.dart
View file @
acdcfb0
...
...
@@ -18,3 +18,4 @@ export 'src/objects/calendar_event.dart';
export
'src/objects/driver_license.dart'
;
export
'src/objects/email.dart'
;
export
'src/objects/mobile_scanner_arguments.dart'
;
export
'src/objects/wifi.dart'
;
...
...
lib/src/objects/barcode.dart
View file @
acdcfb0
...
...
@@ -5,11 +5,11 @@ import 'package:mobile_scanner/src/barcode_utility.dart';
import
'package:mobile_scanner/src/enums/address_type.dart'
;
import
'package:mobile_scanner/src/enums/barcode_format.dart'
;
import
'package:mobile_scanner/src/enums/barcode_type.dart'
;
import
'package:mobile_scanner/src/enums/encryption_type.dart'
;
import
'package:mobile_scanner/src/enums/phone_type.dart'
;
import
'package:mobile_scanner/src/objects/calendar_event.dart'
;
import
'package:mobile_scanner/src/objects/driver_license.dart'
;
import
'package:mobile_scanner/src/objects/email.dart'
;
import
'package:mobile_scanner/src/objects/wifi.dart'
;
/// Represents a single recognized barcode and its value.
class
Barcode
{
...
...
@@ -309,27 +309,3 @@ class UrlBookmark {
:
title
=
data
[
'title'
]
as
String
?,
url
=
data
[
'url'
]
as
String
?;
}
/// A wifi network parameters from a 'WIFI:' or similar QRCode type.
class
WiFi
{
/// Gets the encryption type of the WIFI.
///
/// See all [EncryptionType].
final
EncryptionType
encryptionType
;
/// Gets the ssid of the WIFI.
///
/// Returns null if not available.
final
String
?
ssid
;
/// Gets the password of the WIFI.
///
/// Returns null if not available.
final
String
?
password
;
/// Create a [WiFi] from native data.
WiFi
.
fromNative
(
Map
data
)
:
encryptionType
=
EncryptionType
.
values
[
data
[
'encryptionType'
]
as
int
],
ssid
=
data
[
'ssid'
]
as
String
?,
password
=
data
[
'password'
]
as
String
?;
}
...
...
lib/src/objects/wifi.dart
0 → 100644
View file @
acdcfb0
import
'package:mobile_scanner/src/enums/barcode_type.dart'
;
import
'package:mobile_scanner/src/enums/encryption_type.dart'
;
/// Wireless network information from [BarcodeType.wifi] barcodes.
class
WiFi
{
/// Construct a new [WiFi] instance.
const
WiFi
({
this
.
encryptionType
=
EncryptionType
.
none
,
this
.
ssid
,
this
.
password
,
});
/// Construct a new [WiFi] instance from the given [data].
factory
WiFi
.
fromNative
(
Map
<
Object
?,
Object
?>
data
)
{
return
WiFi
(
encryptionType:
EncryptionType
.
fromRawValue
(
data
[
'encryptionType'
]
as
int
?
??
0
,
),
ssid:
data
[
'ssid'
]
as
String
?,
password:
data
[
'password'
]
as
String
?,
);
}
/// The encryption type of the wireless network.
final
EncryptionType
encryptionType
;
/// The ssid of the wireless network.
final
String
?
ssid
;
/// The password of the wireless network.
final
String
?
password
;
}
...
...
Please
register
or
login
to post a comment