of static method

Returns the closest BeforeAfterTheme instance given the context.

Implementation

static BeforeAfterTheme of(BuildContext context) {
  final theme = Theme.of(context).extension<BeforeAfterTheme>();
  return theme ?? const BeforeAfterTheme();
}