
import '../../../notification_sdk.dart';

import '../../../notification_sdk_method_channel.dart';
import '../../../notification_sdk_platform_interface.dart';

import '../../data/datasources/notification_sdk_method_channel_datasource.dart';
import '../../data/repositories/notification_sdk_repository_impl.dart';

import 'notification_sdk_core.dart';
import 'notification_sdk_api_impl.dart';

class NotificationSdkWiring
{
  static NotificationSdkApi build() {

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

    // data layer
    final ds =  NotificationSdkMethodChannelDataSource(platform);
    final repo =  NotificationSdkRepositoryImpl(ds);
    final core =  NotificationSdkCore(platform: platform, repo: repo,);

    return NotificationSdkApiImpl(core: core);
  }
}
