record static method

void record(
  1. GlassAdaptiveDiagnostic diagnostic
)

Records diagnostic as the latest known adaptive-quality state and registers the service extension on first use.

Pass this directly as GlassAdaptiveScope.onDiagnostic.

Implementation

static void record(GlassAdaptiveDiagnostic diagnostic) {
  _last = diagnostic;
  if (_registered) return;
  _registered = true;
  developer.registerExtension(
    'ext.flutter_liquid_glass_widgets.adaptiveScope',
    _handleQuery,
  );
}