I'm stuck with this error:
This expression has type 'void' and can't be used.
dynamic result = await context.pushNamed('location'); î
î
This expression has type 'void' and can't be used.
dynamic result = await context.pushNamed('location');
î
home.dart
onPressed: () async {
dynamic result = await context.pushNamed('location');
setState(() {
mydata = result;
});
},
î
location.dart
class _LocationState extends State<Location> {
...
void updateTime(index) async {
WorldTime instance = locations[index];
await instance.getTime();
context.goNamed('home', extra: instance);
}
}
world_time.dart
class WorldTime {
...
Future<void> getTime() async {
...
}
}
I use go_router but I don't know if it has anything to do with my problem.
I tried: Future<void> updateTime(index) async {
but I'm still getting the same error.