of static method
Looks up the active FilamentFormFactor from the nearest FilamentLayout.
Falls back to a default FilamentBreakpoints if no FilamentLayout ancestor exists, allowing package widgets to work without the host providing one. The form factor is determined by comparing MediaQuery.sizeOf against the breakpoints.
Always uses MediaQuery.sizeOf to measure the current width, even if a FilamentLayout is present — the layout merely holds the breakpoints, not cached measurements.
Implementation
static FilamentFormFactor of(BuildContext context) {
final layout = context.dependOnInheritedWidgetOfExactType<FilamentLayout>();
final breakpoints = layout?.breakpoints ?? const FilamentBreakpoints();
final width = MediaQuery.sizeOf(context).width;
return breakpoints.of(width);
}