From 44886a6b105881edd47f5dd4fbed84c3a41c375f Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Wed, 21 Oct 2026 22:19:18 +0100 Subject: [PATCH] fix(app): choose search controls from the actual host app class --- app/lib/features/search/search_screen.dart | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/lib/features/search/search_screen.dart b/app/lib/features/search/search_screen.dart index 3c2e80ce..adaae3e7 100644 --- a/app/lib/features/search/search_screen.dart +++ b/app/lib/features/search/search_screen.dart @@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../../core/api_gateway.dart'; +import '../../ui/adaptive/host.dart'; import 'data/search_repository.dart'; import 'domain/search_controller.dart'; import 'domain/search_models.dart'; @@ -100,12 +101,14 @@ class _SearchScreenState extends State { @override Widget build(BuildContext context) { + // Follow the actual host app class first: a CupertinoApp supplies no + // Material theme, so reading only the platform would pick Material controls + // inside a Cupertino host on macOS/iOS. final cupertino = widget.cupertino ?? - switch (Theme.of(context).platform) { - TargetPlatform.iOS || TargetPlatform.macOS => true, - _ => false, - }; + (usesCupertinoHost(context) || + Theme.of(context).platform == TargetPlatform.iOS || + Theme.of(context).platform == TargetPlatform.macOS); return cupertino ? _cupertinoScreen() : _materialScreen(); }