
import '../../../rtc_sdk.dart';

import '../../../rtc_sdk_method_channel.dart';
import '../../../rtc_sdk_platform_interface.dart';

import '../../data/datasources/rtc_sdk_method_channel_datasource.dart';
import '../../data/repositories/rtc_sdk_repository_impl.dart';

import 'rtc_sdk_core.dart';
import 'rtc_sdk_api_impl.dart';

class RtcSdkWiring
{
  static RtcSdkApi build() {

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

    // data layer
    final ds =  RtcSdkMethodChannelDataSource(platform);
    final repo =  RtcSdkRepositoryImpl(ds);
    final core =  RtcSdkCore(platform: platform, repo: repo,);

    return RtcSdkApiImpl(core: core);
  }
}
