withRegistrationsAsync<T> static method
Future<T>
withRegistrationsAsync<T>(
- Iterable<
ChartRegistration> registrations, - Future<
T> body(), { - bool clearBefore = false,
Async variant of withRegistrations.
Implementation
static Future<T> withRegistrationsAsync<T>(
Iterable<ChartRegistration> registrations,
Future<T> Function() body, {
bool clearBefore = false,
}) async {
final previous = snapshot();
try {
if (clearBefore) clear();
registerAll(registrations);
return await body();
} finally {
restore(previous);
}
}