|
|
|
|
@ -461,19 +461,55 @@ class _RecipesScreenState extends State<RecipesScreen> with WidgetsBindingObserv
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Scaffold(
|
|
|
|
|
appBar: AppBar(
|
|
|
|
|
toolbarHeight: (_isSearching && _selectedTags.isNotEmpty) ? 80 : null,
|
|
|
|
|
title: _isSearching
|
|
|
|
|
? TextField(
|
|
|
|
|
? Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 4),
|
|
|
|
|
child: TextField(
|
|
|
|
|
controller: _searchController,
|
|
|
|
|
autofocus: true,
|
|
|
|
|
decoration: const InputDecoration(
|
|
|
|
|
hintText: 'Search recipes...',
|
|
|
|
|
border: InputBorder.none,
|
|
|
|
|
hintStyle: TextStyle(color: Colors.white70),
|
|
|
|
|
contentPadding: EdgeInsets.symmetric(vertical: 8, horizontal: 8),
|
|
|
|
|
),
|
|
|
|
|
style: const TextStyle(color: Colors.white),
|
|
|
|
|
onChanged: (_) => _filterRecipes(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (_selectedTags.isNotEmpty)
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(top: 2, bottom: 4, left: 4, right: 4),
|
|
|
|
|
child: RichText(
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
|
text: TextSpan(
|
|
|
|
|
style: const TextStyle(
|
|
|
|
|
fontSize: 11,
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
),
|
|
|
|
|
children: [
|
|
|
|
|
const TextSpan(
|
|
|
|
|
text: 'Tag: ',
|
|
|
|
|
style: TextStyle(color: Colors.grey),
|
|
|
|
|
),
|
|
|
|
|
TextSpan(
|
|
|
|
|
text: _selectedTags.join(', '),
|
|
|
|
|
style: const TextStyle(color: Colors.green),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: const Text('All Recipes'),
|
|
|
|
|
titleSpacing: _isSearching ? 0 : null,
|
|
|
|
|
elevation: 0,
|
|
|
|
|
bottom: _buildTagFilterBar(),
|
|
|
|
|
actions: [
|
|
|
|
|
@ -667,18 +703,18 @@ class _RecipesScreenState extends State<RecipesScreen> with WidgetsBindingObserv
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
|
Text(
|
|
|
|
|
_searchController.text.isEmpty
|
|
|
|
|
? 'No recipes yet'
|
|
|
|
|
: 'No recipes found',
|
|
|
|
|
(_searchController.text.isNotEmpty || _selectedTags.isNotEmpty)
|
|
|
|
|
? 'No recipes found'
|
|
|
|
|
: 'No recipes yet',
|
|
|
|
|
style: Theme.of(context).textTheme.titleLarge?.copyWith(
|
|
|
|
|
color: Colors.grey[600],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
|
Text(
|
|
|
|
|
_searchController.text.isEmpty
|
|
|
|
|
? 'Tap the + button to create your first recipe'
|
|
|
|
|
: 'Try a different search term',
|
|
|
|
|
(_searchController.text.isNotEmpty || _selectedTags.isNotEmpty)
|
|
|
|
|
? 'Try a different search term'
|
|
|
|
|
: 'Tap the + button to create your first recipe',
|
|
|
|
|
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
|
|
|
|
color: Colors.grey[500],
|
|
|
|
|
),
|
|
|
|
|
|