
import '../../../protocol_sdk.dart';

import '../../../protocol_sdk_method_channel.dart';
import '../../../protocol_sdk_platform_interface.dart';

import '../../data/datasources/protocol_sdk_method_channel_datasource.dart';
import '../../data/repositories/protocol_sdk_repository_impl.dart';

import 'protocol_sdk_core.dart';
import 'protocol_sdk_api_impl.dart';

class ProtocolSdkWiring
{
  static ProtocolSdkApi build() {

    // platform instance（method channel）
    final platform = ProtocolSdkPlatform.instance;
    if (platform is MethodChannelProtocolSdk) {
      // platform.init(); // or defer to NotificationApiImpl.init
    }

    // data layer
    final ds =  ProtocolSdkMethodChannelDataSource(platform);
    final repo =  ProtocolSdkRepositoryImpl(ds);
    final core =  ProtocolSdkCore(platform: platform, repo: repo,);

    return ProtocolSdkApiImpl(core: core);
  }
}
