unhandled exception in then().catchError in Flutter
onPressed: () { getName().then((value) { print(value); print('YNWA'); throw('ERORRRRRR!'); }).catchError((error){ print('error is : ${error.toString()}'); }); }, and here is a method Future<String> getName() async { return 'Basel Elazaly'; } } why there is unhandled exception?