buildContext static method
Returns either the provided context or the globally registered fallback.
Implementation
static BuildContext buildContext([BuildContext? context]) {
final resolved =
context ?? instance._navigatorKey?.currentContext ?? instance._context;
if (resolved == null) {
throw StateError(
'Call DraftModeUIContext.init(navigatorKey: ...) or '
'DraftModeUIContext.init(context: ...)',
);
}
return resolved;
}