Some checks failed
Build Android APK / 编译 libcore.aar (push) Has been cancelled
Build Android APK / 编译 Android APK (release) (push) Has been cancelled
Build Android APK / 创建 GitHub Release (push) Has been cancelled
Build Multi-Platform / 编译 libcore (iOS/tvOS) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Android) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Windows) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (macOS) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Linux) (push) Has been cancelled
Build Multi-Platform / 构建 Android APK (push) Has been cancelled
Build Multi-Platform / 构建 Windows (push) Has been cancelled
Build Multi-Platform / 构建 macOS (push) Has been cancelled
Build Multi-Platform / 构建 Linux (push) Has been cancelled
Build Multi-Platform / 构建 iOS (push) Has been cancelled
Build Multi-Platform / 创建 Release (push) Has been cancelled
Build Windows / 编译 libcore (Windows) (push) Has been cancelled
Build Windows / build (push) Has been cancelled
31 lines
907 B
Dart
Executable File
31 lines
907 B
Dart
Executable File
/// 是否订阅(区分设备和邮箱)
|
|
class KRCheckSubscription {
|
|
/// 当前设备订阅状态
|
|
final bool deviceSubscribed;
|
|
|
|
/// 邮箱订阅状态
|
|
final bool emailSubscribed;
|
|
|
|
/// 构造函数,默认 false
|
|
KRCheckSubscription({
|
|
this.deviceSubscribed = false,
|
|
this.emailSubscribed = false,
|
|
});
|
|
|
|
/// 从 JSON 创建对象
|
|
KRCheckSubscription.fromJson(Map<String, dynamic>? json)
|
|
: deviceSubscribed = (json?['device_status'] == true || json?['deviceStatus'] == "true") ? true : false,
|
|
emailSubscribed = (json?['email_status'] == true || json?['emailStatus'] == "true") ? true : false;
|
|
|
|
/// 转换成 JSON
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
'deviceStatus': deviceSubscribed,
|
|
'emailStatus': emailSubscribed,
|
|
};
|
|
}
|
|
|
|
/// 判断邮箱和设备是否都已订阅
|
|
bool get isFullySubscribed => deviceSubscribed && emailSubscribed;
|
|
}
|