Navaron Bracke

move SMS to its own file

## NEXT
Improvements:
* The `type` of an `Email` is no longer null.
* The `type` of an `Email` is now non-null.
* The `phoneNumber` of an `SMS` is now non-null.
## 3.5.0
New Features:
... ...
... ... @@ -18,4 +18,5 @@ 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/sms.dart';
export 'src/objects/wifi.dart';
... ...
... ... @@ -9,6 +9,7 @@ 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/sms.dart';
import 'package:mobile_scanner/src/objects/wifi.dart';
/// Represents a single recognized barcode and its value.
... ... @@ -274,24 +275,6 @@ class Phone {
type = PhoneType.values[data['type'] as int];
}
/// A sms message from a 'SMS:' or similar QRCode type.
class SMS {
/// Gets the message content of the sms.
///
/// Returns null if not available.
final String? message;
/// Gets the phone number of the sms.
///
/// Returns null if not available.
final String? phoneNumber;
/// Create a [SMS] from native data.
SMS.fromNative(Map data)
: message = data['message'] as String?,
phoneNumber = data['phoneNumber'] as String?;
}
/// A URL and title from a 'MEBKM:' or similar QRCode type.
class UrlBookmark {
/// Gets the title of the bookmark.
... ...
/// An sms message from a `SMS:` or similar QRCode type.
class SMS {
/// Construct a new [SMS] instance.
const SMS({
this.message,
required this.phoneNumber,
});
/// Construct a new [SMS] instance from the given [data].
factory SMS.fromNative(Map<Object?, Object?> data) {
return SMS(
message: data['message'] as String?,
phoneNumber: data['phoneNumber'] as String? ?? '',
);
}
/// The message contained in the sms.
final String? message;
/// The phone number which sent the sms.
final String phoneNumber;
}
... ...