MethodChannelUssd constructor

MethodChannelUssd({
  1. required dynamic onSuccess(
    1. String
    ),
  2. required dynamic onFailed(
    1. String
    ),
})

Implementation

MethodChannelUssd({required this.onSuccess, required this.onFailed}) {
  methodChannel.setMethodCallHandler((call) async {
    if (call.method == "failed") {
      onFailed(call.arguments['data']);
    }
    if (call.method == "success") {
      onSuccess(call.arguments['data']);
    }
  });
}