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:13:40 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2eeae06d04392a89df906b6dc1437e0386f20478
2eeae06d
1 parent
8123b4fc
move CalendarEvent to its own file
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
52 deletions
lib/mobile_scanner.dart
lib/src/objects/barcode.dart
lib/src/objects/calendar_event.dart
lib/mobile_scanner.dart
View file @
2eeae06
...
...
@@ -14,6 +14,7 @@ export 'src/mobile_scanner_controller.dart';
export
'src/mobile_scanner_exception.dart'
;
export
'src/objects/barcode.dart'
;
export
'src/objects/barcode_capture.dart'
;
export
'src/objects/calendar_event.dart'
;
export
'src/objects/driver_license.dart'
;
export
'src/objects/email.dart'
;
export
'src/objects/mobile_scanner_arguments.dart'
;
...
...
lib/src/objects/barcode.dart
View file @
2eeae06
...
...
@@ -7,6 +7,7 @@ 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'
;
...
...
@@ -118,58 +119,6 @@ class Barcode {
wifi
=
toWiFi
(
data
[
'wifi'
]
as
Map
?);
}
/// A calendar event extracted from QRCode.
class
CalendarEvent
{
/// Gets the description of the calendar event.
///
/// Returns null if not available.
final
String
?
description
;
/// Gets the start date time of the calendar event.
///
/// Returns null if not available.
final
DateTime
?
start
;
/// Gets the end date time of the calendar event.
///
/// Returns null if not available.
final
DateTime
?
end
;
/// Gets the location of the calendar event.
///
/// Returns null if not available.
final
String
?
location
;
/// Gets the organizer of the calendar event.
///
/// Returns null if not available.
final
String
?
organizer
;
/// Gets the status of the calendar event.
///
/// Returns null if not available.
final
String
?
status
;
/// Gets the summary of the calendar event.
///
/// Returns null if not available.
final
String
?
summary
;
/// Create a [CalendarEvent] from native data.
CalendarEvent
.
fromNative
(
Map
data
)
:
description
=
data
[
'description'
]
as
String
?,
start
=
data
[
'start'
]
!=
null
?
DateTime
.
tryParse
(
data
[
'start'
]
as
String
)
:
null
,
end
=
data
[
'end'
]
!=
null
?
DateTime
.
tryParse
(
data
[
'end'
]
as
String
)
:
null
,
location
=
data
[
'location'
]
as
String
?,
organizer
=
data
[
'organizer'
]
as
String
?,
status
=
data
[
'status'
]
as
String
?,
summary
=
data
[
'summary'
]
as
String
?;
}
/// A person's or organization's business card. For example a VCARD.
class
ContactInfo
{
/// Gets contact person's addresses.
...
...
lib/src/objects/calendar_event.dart
0 → 100644
View file @
2eeae06
/// A calendar event extracted from a QRCode.
class
CalendarEvent
{
/// Create a new [CalendarEvent] instance.
const
CalendarEvent
({
this
.
description
,
this
.
start
,
this
.
end
,
this
.
location
,
this
.
organizer
,
this
.
status
,
this
.
summary
,
});
/// Create a new [CalendarEvent] instance from a map.
factory
CalendarEvent
.
fromNative
(
Map
<
Object
?,
Object
?>
data
)
{
return
CalendarEvent
(
description:
data
[
'description'
]
as
String
?,
start:
DateTime
.
tryParse
(
data
[
'start'
]
as
String
?
??
''
),
end:
DateTime
.
tryParse
(
data
[
'end'
]
as
String
?
??
''
),
location:
data
[
'location'
]
as
String
?,
organizer:
data
[
'organizer'
]
as
String
?,
status:
data
[
'status'
]
as
String
?,
summary:
data
[
'summary'
]
as
String
?,
);
}
/// The description of the calendar event.
final
String
?
description
;
/// The start time of the calendar event.
final
DateTime
?
start
;
/// The end time of the calendar event.
final
DateTime
?
end
;
/// The location of the calendar event.
final
String
?
location
;
/// The organizer of the calendar event.
final
String
?
organizer
;
/// The status of the calendar event.
final
String
?
status
;
/// The summary of the calendar event.
final
String
?
summary
;
}
...
...
Please
register
or
login
to post a comment