data property

T? data
getter/setter pair

data member of the class is a general purpose member with datatype

To define the specific type of the member data try using:

CallOutcome<String> outcome = await function(); //Where definition of function is also like

Future<CallOutcome

  try{
    //make your network or db calls here
    //check if the response returned was successful or not
    ...
    ...
    if(response.statusCode == 200){
      return CallOutcome<String>(data:"Some String");
    }else{
      return CallOutcome<String>(exception: Exception(response.statusCode.toString()));
    }
  }on Exception catch(e){
    ...
    return CallOutcome<String>(exception: e);
  }
}

Implementation

T? data;