content: // Flutter imports:
  import 'package:flutter/material.dart';
  
  // Package imports:
  import 'package:flutter_riverpod/flutter_riverpod.dart';
  
  // Project imports:
  import '../../core/boorus/defaults/widgets.dart';
  import '../../core/boorus/engine/engine.dart';
  import '../../core/configs/config.dart';
  import '../../core/configs/config/providers.dart';
  import '../../core/configs/create/widgets.dart';
  import '../../core/configs/manage/widgets.dart';
  import '../../core/downloads/filename/types.dart';
  import '../../core/posts/details_parts/types.dart';
  import '../../core/posts/post/providers.dart';
  import '../../core/search/search/routes.dart';
  import '../../core/search/search/widgets.dart';
  import '../../core/widgets/widgets.dart';
  import '../../foundation/html.dart';
  import 'configs/widgets.dart';
  
  class GelbooruV1Builder extends BaseBooruBuilder {
    GelbooruV1Builder();
  
    @override
    CreateConfigPageBuilder get createConfigPageBuilder =>
        (
          context,
          id, {
          backgroundColor,
        }) => CreateBooruConfigScope(
          id: id,
          config: BooruConfig.defaultConfig(
            booruType: id.booruType,
            url: id.url,
            customDownloadFileNameFormat: kDefaultCustomDownloadFileNameFormat,
          ),
          child: CreateGelbooruV1ConfigPage(
            backgroundColor: backgroundColor,
          ),
        );
  
    @override
    UpdateConfigPageBuilder get updateConfigPageBuilder =>
        (
          context,
          id, {
          backgroundColor,
          initialTab,
        }) => UpdateBooruConfigScope(
          id: id,
          child: CreateGelbooruV1ConfigPage(
            backgroundColor: backgroundColor,
            initialTab: initialTab,
          ),
        );
  
    @override
    SearchPageBuilder get searchPageBuilder =>
        (context, params) => GelbooruV1SearchPage(
          params: params,
        );
  
    @override
    final PostDetailsUIBuilder postDetailsUIBuilder =
        kFallbackPostDetailsUIBuilder;
  
    @override
    CreateUnknownBooruWidgetsBuilder get unknownBooruWidgetsBuilder =>
        (context) => const AnonUnknownBooruWidgets();
  }
  
  class GelbooruV1SearchPage extends ConsumerWidget {
    const GelbooruV1SearchPage({
      required this.params,
      super.key,
    });
  
    final SearchParams params;
  
    @override
    Widget build(BuildContext context, WidgetRef ref) {
      final postRepo = ref.watch(postRepoProvider(ref.watchConfigSearch));
  
      return SearchPageScaffold(
        landingViewBuilder: (controller) => DefaultMobileSearchLandingView(
          notice: InfoContainer(
            contentBuilder: (context) => const AppHtml(
              data: 'The app will use <b>Gelbooru</b> for tag completion.',
            ),
          ),
          controller: controller,
        ),
        params: params,
        fetcher: (page, controller) => postRepo.getPostsFromController(
          controller.tagSet,
          page,
        ),
      );
    }
  }
  