content: // Flutter imports:
  import 'package:flutter/widgets.dart';
  
  // Package imports:
  import 'package:flutter_riverpod/flutter_riverpod.dart';
  
  // Project imports:
  import '../../../../boorus/engine/providers.dart';
  import '../../../../configs/ref.dart';
  import '../../../../router.dart';
  import '../routes/params.dart';
  
  class SearchPage extends ConsumerWidget {
    const SearchPage({super.key});
  
    @override
    Widget build(BuildContext context, WidgetRef ref) {
      final booruBuilder = ref.watch(booruBuilderProvider(ref.watchConfigAuth));
      final builder = booruBuilder?.searchPageBuilder;
  
      final params =
          InheritedInitialSearchQuery.maybeOf(context)?.params ??
          const SearchParams();
  
      return builder != null
          ? builder(context, params)
          : const UnimplementedPage();
    }
  }
  
  class InheritedInitialSearchQuery extends InheritedWidget {
    const InheritedInitialSearchQuery({
      required this.params,
      required super.child,
      super.key,
    });
  
    final SearchParams params;
  
    static InheritedInitialSearchQuery? of(BuildContext context) {
      return context
          .dependOnInheritedWidgetOfExactType<InheritedInitialSearchQuery>();
    }
  
    static InheritedInitialSearchQuery? maybeOf(BuildContext context) {
      return context
          .dependOnInheritedWidgetOfExactType<InheritedInitialSearchQuery>();
    }
  
    @override
    bool updateShouldNotify(InheritedInitialSearchQuery oldWidget) {
      return params != oldWidget.params;
    }
  }
  