builder method
Responsive widget builder for conditional rendering
Builds different widgets based on the current breakpoint. Provides error handling for builder exceptions.
Implementation
Widget builder({
required Widget Function(FSBreakpoint breakpoint) builder,
Widget? fallback,
}) {
try {
return builder(breakpoint);
} catch (e) {
assert(false, 'Error in responsive builder: $e');
return fallback ?? const SizedBox.shrink();
}
}