import 'dart:async'; extension ObjectExtension on T { T apply(void Function(T obj) fn) { fn(this); return this; } Future applyFuture(FutureOr Function(T obj) fn) async { await fn(this); return this; } }