toEnd<T> method
Delays the execution of the given computation until the end of the event loop.
Useful for ensuring that certain computations are executed after the current event loop has completed.
Example:
await Get.toEnd(() async {
// Some asynchronous computation
});
Implementation
Future<T> toEnd<T>(FutureOr<T> Function() computation) async {
await Future<T>.delayed(Duration.zero);
final FutureOr<T> val = computation();
return val;
}