import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../../../ui/adaptive/host.dart'; const searchBoundsKey = ValueKey('search.bounds'); /// The server's note that a result set was cut short, in the host's muted /// caption style with an info icon. class SearchBoundsNote extends StatelessWidget { const SearchBoundsNote({super.key, required this.text}); final String text; @override Widget build(BuildContext context) { final cupertino = usesCupertinoHost(context); final TextStyle? style; final IconData icon; if (cupertino) { icon = CupertinoIcons.info_circle; style = CupertinoTheme.of(context).textTheme.textStyle.copyWith( fontSize: 13, color: CupertinoColors.secondaryLabel.resolveFrom(context), ); } else { icon = Icons.info_outline; final theme = Theme.of(context); style = theme.textTheme.bodySmall?.copyWith( color: theme.colorScheme.onSurfaceVariant, ); } return Padding( padding: const EdgeInsets.symmetric(horizontal: 4), child: Row( crossAxisAlignment: CrossAxisAlignment.start, spacing: 8, children: [ Icon(icon, size: 16, color: style?.color), Expanded(child: Text(text, style: style)), ], ), ); } }