import 'package:cipher_guard_sdk/src/presentation/facade/cipher_guard_sdk_api.dart';
import 'package:cipher_guard_sdk/src/presentation/wiring/cipher_guard_sdk_core.dart';
import 'package:cipher_guard_sdk/src/data/datasources/encryption_flutter_service.dart';
import 'package:cipher_guard_sdk/src/data/repositories/encryption_repository_impl.dart';
import 'package:cipher_guard_sdk/src/presentation/wiring/cipher_guard_sdk_api_impl.dart';

/// SDK 依赖注入容器
class CipherGuardSdkWiring {
  /// 构建 SDK 实例
  static CipherGuardSdkApi build() {
    final flutterService = EncryptionFlutterService();
    final repository = EncryptionRepositoryImpl(flutterService);
    final platform = _CipherGuardPlatformImpl();
    final core = CipherGuardSdkCore(
      encryptionRepo: repository,
      platform: platform,
    );
    return CipherGuardSdkApiImpl(core: core);
  }
}

class _CipherGuardPlatformImpl implements CipherGuardPlatform {
  @override
  Future<String?> getPlatformVersion() async => 'Flutter Native';
}
