Initial project

This commit is contained in:
Cody
2026-03-06 14:56:17 +08:00
parent 977b627b15
commit bf9e099747
1180 changed files with 50973 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
class NotificationSdkMethodChannel
{
// Channel Name
static const String channelName = 'notification_sdk';
//---------------- Flutter call native ----------------
static const String requestPermission = 'requestPermission';
//---------------- Flutter call native ----------------
//---------------- native call Flutter ----------------
//---------------- native call Flutter ----------------
}

View File

@@ -0,0 +1,14 @@
import '../../../notification_sdk_platform_interface.dart';
class NotificationSdkMethodChannelDataSource
{
final NotificationSdkPlatform platform;
NotificationSdkMethodChannelDataSource(this.platform);
Future<String?> getPlatformVersion() async {
return await getPlatformVersion();
}
}

View File

@@ -0,0 +1,26 @@
/// Data Transfer Object
/// - 只負責資料傳輸 / 解析
/// - 結構可變
/// - 可以依賴 JSON / platform
class NotificationSdkPermissionStatusDto {
final bool granted;
final bool permanentlyDenied;
final String? grantedAt; // 通常是 raw string
NotificationSdkPermissionStatusDto({
required this.granted,
required this.permanentlyDenied,
this.grantedAt,
});
factory NotificationSdkPermissionStatusDto.fromJson(
Map<String, dynamic> json,
) {
return NotificationSdkPermissionStatusDto(
granted: json['granted'] as bool,
permanentlyDenied: json['permanentlyDenied'] as bool,
grantedAt: json['grantedAt'] as String?,
);
}
}

View File

@@ -0,0 +1,16 @@
//Repository Impl
import '../../domain/repositories/notification_sdk_repository.dart';
import '../datasources/notification_sdk_method_channel_datasource.dart';
class NotificationSdkRepositoryImpl implements NotificationSdkRepository
{
final NotificationSdkMethodChannelDataSource _datasource;
const NotificationSdkRepositoryImpl(this._datasource);
@override
Future<String?> platformVersion() {
return _datasource.getPlatformVersion();
}
}