getResponse method

Future<T?> getResponse()

Implementation

Future<T?> getResponse()
{
    Future<DataPackage?> response = super.getResponseUntyped();
    response.then((dataPackage)
    {
        print("Got response ${dataPackage!}");

        T? result = null;

        if(dataPackage != null)
        {
            print("data package is not null");
            result = _getReturnData(dataPackage!);
        }
        print("Result is ${result}");
        _typedCompleter.complete(result);
    }).catchError((error){
        _typedCompleter.complete(null);
    });

    return _typedCompleter.future;
}