the error has been caught but why these errors
onPressed: () {
getName().then((value){
print(value);
print('The Last');
throw('000');
}).catchError((error){
print('error (${error.toString()}) has been caught');
});
},
this is function
Future<String> getName() async
{
return 'Basel Elazaly';
}
}
and these are output:
Unhandled Exception: Invalid argument(s) (onError): The error handler of Future.catchError must return a value of the future's type