i have tried to turn Future to nullable and also the string but something goes wrong any help please?
floatingActionButton: FloatingActionButton(
onPressed: () {
getName().then((value) {
print(value);
throw("error!!!!!");
}).catchError((error) => print(error.toString()));
},
child: Icon(Icons.add),
),
out side the build method somewhere in my class
Future<String> getName() async =>'Some String';