Initial project
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
/// Domain Entity
|
||||
/// - 表達「通知權限狀態」這個業務概念
|
||||
/// - 穩定、可被 Facade 回傳
|
||||
/// - 不要包含 JSON / platform / plugin
|
||||
class MediaSdkPermissionStatus {
|
||||
final bool isGranted;
|
||||
final bool isPermanentlyDenied;
|
||||
final DateTime? grantedAt;
|
||||
|
||||
const MediaSdkPermissionStatus({
|
||||
required this.isGranted,
|
||||
required this.isPermanentlyDenied,
|
||||
this.grantedAt,
|
||||
});
|
||||
|
||||
/// 純業務邏輯允許
|
||||
bool get canRequestAgain => !isGranted && !isPermanentlyDenied;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// Repository Interface(Domain)
|
||||
|
||||
abstract class MediaSdkRepository {
|
||||
Future<String?> platformVersion();
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
//UseCase
|
||||
|
||||
import '../repositories/media_sdk_repository.dart';
|
||||
|
||||
class PlatformVersion
|
||||
{
|
||||
final MediaSdkRepository _repository;
|
||||
|
||||
const PlatformVersion(this._repository);
|
||||
|
||||
Future<String?> call() {
|
||||
return _repository.platformVersion();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user