then<T> function
Implementation
FutureOr<T> then<T>(String description, FutureOr<T> Function() body) {
final thens = Zone.current[thenKey] as List<String>?;
if (thens == null) throw Exception('Use gwt method');
final state = Zone.current[stateKey] as State;
state.key = thenKey;
thens.add(description);
final result = body();
if (result is Future) {
return Future.sync(() async => await result);
} else {
return result;
}
}