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 ProtocolSdkMethodChannel
{
// Channel Name
static const String channelName = 'protocol_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 '../../../protocol_sdk_platform_interface.dart';
class ProtocolSdkMethodChannelDataSource
{
final ProtocolSdkPlatform platform;
ProtocolSdkMethodChannelDataSource(this.platform);
Future<String?> getPlatformVersion() async {
return await getPlatformVersion();
}
}

View File

@@ -0,0 +1,26 @@
/// Data Transfer Object
/// - 只負責資料傳輸 / 解析
/// - 結構可變
/// - 可以依賴 JSON / platform
class ProtocolSdkPermissionStatusDto {
final bool granted;
final bool permanentlyDenied;
final String? grantedAt; // 通常是 raw string
ProtocolSdkPermissionStatusDto({
required this.granted,
required this.permanentlyDenied,
this.grantedAt,
});
factory ProtocolSdkPermissionStatusDto.fromJson(
Map<String, dynamic> json,
) {
return ProtocolSdkPermissionStatusDto(
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/protocol_sdk_repository.dart';
import '../datasources/protocol_sdk_method_channel_datasource.dart';
class ProtocolSdkRepositoryImpl implements ProtocolSdkRepository
{
final ProtocolSdkMethodChannelDataSource _datasource;
const ProtocolSdkRepositoryImpl(this._datasource);
@override
Future<String?> platformVersion() {
return _datasource.getPlatformVersion();
}
}