feat(ui): iPhone Liquid Glass redesign for Search, Favorites, and History, fix cheat sheet clearance and update sheet
Build and Release / Build Windows x64 (push) Has been cancelled
Build and Release / Build Windows x64 (push) Has been cancelled
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://github.com/RarDog/Lunaris/releases"><img src="https://img.shields.io/badge/Version-3.0.9-8A2BE2?style=for-the-badge&logo=semver&logoColor=white" alt="Version 3.0.9" /></a>
|
<a href="https://github.com/RarDog/Lunaris/releases"><img src="https://img.shields.io/badge/Version-3.1.0-8A2BE2?style=for-the-badge&logo=semver&logoColor=white" alt="Version 3.1.0" /></a>
|
||||||
<img src="https://img.shields.io/badge/Flutter-3.47+-02569B?style=for-the-badge&logo=flutter&logoColor=white" alt="Flutter" />
|
<img src="https://img.shields.io/badge/Flutter-3.47+-02569B?style=for-the-badge&logo=flutter&logoColor=white" alt="Flutter" />
|
||||||
<img src="https://img.shields.io/badge/Platform-Android%20%7C%20Linux%20%7C%20Windows-00C853?style=for-the-badge" alt="Platforms" />
|
<img src="https://img.shields.io/badge/Platform-Android%20%7C%20Linux%20%7C%20Windows-00C853?style=for-the-badge" alt="Platforms" />
|
||||||
<a href="https://github.com/RarDog/Lunaris/wiki"><img src="https://img.shields.io/badge/Wiki-Documentation-FF6F00?style=for-the-badge&logo=gitbook&logoColor=white" alt="Wiki" /></a>
|
<a href="https://github.com/RarDog/Lunaris/wiki"><img src="https://img.shields.io/badge/Wiki-Documentation-FF6F00?style=for-the-badge&logo=gitbook&logoColor=white" alt="Wiki" /></a>
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
const appDisplayVersion = '3.0.9';
|
const appDisplayVersion = '3.1.0';
|
||||||
const appBuildNumber = 60;
|
const appBuildNumber = 61;
|
||||||
const appReleaseChannel = 'Stable';
|
const appReleaseChannel = 'Stable';
|
||||||
|
|||||||
@@ -1,4 +1,14 @@
|
|||||||
const lunarisChangelog = [
|
const lunarisChangelog = [
|
||||||
|
LunarisChange(
|
||||||
|
version: '3.1.0',
|
||||||
|
title: 'iPhone Liquid Glass — Поиск, Избранное, История и исправление доступности',
|
||||||
|
bullets: [
|
||||||
|
'Liquid Glass редизайн разделов «Поиск», «Избранное» и «История»: матовые стеклянные карточки (BackdropFilter blur), полупрозрачные градиенты, зеркальные контуры и сквиркл-бейджи иконок в стиле iOS.',
|
||||||
|
'Исправление шпаргалки по поиску: увеличен нижний отступ прокрутки во всех списках и сетках до 140px + safe area, благодаря чему блок операторов и шпаргалка по поиску больше не перекрываются парящей навигационной панелью и легко нажимаются.',
|
||||||
|
'Исправление модального окна проверки обновлений: панель с выбором источников (GitHub и Gitea) открывается через корневой навигатор поверх всей навигации с безопасным отступом снизу, обеспечивая беспрепятственный доступ к обеим кнопкам.',
|
||||||
|
'Тактильный отклик и стеклянные пилюли: быстрые операторы, категории, недавние запросы, фильтры медиа и переключатели разделов получили матовое оформление и вибрационный отклик Haptic Feedback.',
|
||||||
|
],
|
||||||
|
),
|
||||||
LunarisChange(
|
LunarisChange(
|
||||||
version: '3.0.9',
|
version: '3.0.9',
|
||||||
title: 'Коррекция позиции кнопки настроек и отображения кнопок JSON и бэкапа',
|
title: 'Коррекция позиции кнопки настроек и отображения кнопок JSON и бэкапа',
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
|
import 'dart:ui';
|
||||||
|
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
|
||||||
@@ -176,7 +179,25 @@ class _FavoritesScreenState extends ConsumerState<FavoritesScreen> {
|
|||||||
// Search input bar if active
|
// Search input bar if active
|
||||||
if (_isSearching)
|
if (_isSearching)
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(16, 8, 16, 4),
|
padding: const EdgeInsets.fromLTRB(16, 6, 16, 6),
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(18),
|
||||||
|
child: BackdropFilter(
|
||||||
|
filter: ImageFilter.blur(sigmaX: 16, sigmaY: 16),
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Theme.of(context).brightness == Brightness.dark
|
||||||
|
? Theme.of(context).colorScheme.surfaceContainerHigh
|
||||||
|
.withValues(alpha: 0.55)
|
||||||
|
: Colors.white.withValues(alpha: 0.80),
|
||||||
|
borderRadius: BorderRadius.circular(18),
|
||||||
|
border: Border.all(
|
||||||
|
color: Theme.of(context).brightness == Brightness.dark
|
||||||
|
? Colors.white.withValues(alpha: 0.14)
|
||||||
|
: Colors.white.withValues(alpha: 0.85),
|
||||||
|
width: 1.1,
|
||||||
|
),
|
||||||
|
),
|
||||||
child: TextField(
|
child: TextField(
|
||||||
controller: _searchController,
|
controller: _searchController,
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
@@ -189,49 +210,97 @@ class _FavoritesScreenState extends ConsumerState<FavoritesScreen> {
|
|||||||
? IconButton(
|
? IconButton(
|
||||||
icon: const Icon(Icons.clear_rounded),
|
icon: const Icon(Icons.clear_rounded),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
HapticFeedback.lightImpact();
|
||||||
_searchController.clear();
|
_searchController.clear();
|
||||||
setState(() => _searchQuery = '');
|
setState(() => _searchQuery = '');
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: false,
|
||||||
contentPadding: const EdgeInsets.symmetric(
|
contentPadding: const EdgeInsets.symmetric(
|
||||||
horizontal: 16,
|
horizontal: 16,
|
||||||
vertical: 10,
|
vertical: 10,
|
||||||
),
|
),
|
||||||
border: OutlineInputBorder(
|
border: InputBorder.none,
|
||||||
borderRadius: BorderRadius.circular(16),
|
),
|
||||||
borderSide: BorderSide.none,
|
onChanged: (val) =>
|
||||||
|
setState(() => _searchQuery = val.trim()),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
onChanged: (val) => setState(() => _searchQuery = val.trim()),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
// Navigation Tabs
|
// Navigation Tabs with Liquid Glass container
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(16, 8, 16, 6),
|
padding: const EdgeInsets.fromLTRB(16, 6, 16, 6),
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(22),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.black.withValues(
|
||||||
|
alpha: Theme.of(context).brightness == Brightness.dark
|
||||||
|
? 0.20
|
||||||
|
: 0.04,
|
||||||
|
),
|
||||||
|
blurRadius: 10,
|
||||||
|
offset: const Offset(0, 2),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(22),
|
||||||
|
child: BackdropFilter(
|
||||||
|
filter: ImageFilter.blur(sigmaX: 16, sigmaY: 16),
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(22),
|
||||||
|
color: Theme.of(context).brightness == Brightness.dark
|
||||||
|
? Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.surfaceContainerHigh
|
||||||
|
.withValues(alpha: 0.50)
|
||||||
|
: Colors.white.withValues(alpha: 0.72),
|
||||||
|
border: Border.all(
|
||||||
|
color: Theme.of(context).brightness == Brightness.dark
|
||||||
|
? Colors.white.withValues(alpha: 0.12)
|
||||||
|
: Colors.white.withValues(alpha: 0.85),
|
||||||
|
width: 1.1,
|
||||||
|
),
|
||||||
|
),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: SegmentedButton<int>(
|
child: SegmentedButton<int>(
|
||||||
showSelectedIcon: false,
|
showSelectedIcon: false,
|
||||||
|
style: ButtonStyle(
|
||||||
|
visualDensity: VisualDensity.compact,
|
||||||
|
shape: WidgetStatePropertyAll(
|
||||||
|
RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
segments: [
|
segments: [
|
||||||
ButtonSegment(
|
ButtonSegment(
|
||||||
value: 0,
|
value: 0,
|
||||||
icon: const Icon(Icons.favorite_rounded, size: 18),
|
icon: const Icon(Icons.favorite_rounded, size: 18),
|
||||||
label: Text(
|
label: Text(
|
||||||
'${isRu ? 'Все' : 'All'} (${allPosts.length})',
|
'${isRu ? 'Все' : 'All'} (${allPosts.length})',
|
||||||
style: const TextStyle(fontSize: 12),
|
style: const TextStyle(
|
||||||
|
fontSize: 12, fontWeight: FontWeight.w600),
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
ButtonSegment(
|
ButtonSegment(
|
||||||
value: 1,
|
value: 1,
|
||||||
icon: const Icon(Icons.offline_pin_rounded, size: 18),
|
icon: const Icon(Icons.offline_pin_rounded,
|
||||||
|
size: 18),
|
||||||
label: Text(
|
label: Text(
|
||||||
'${isRu ? 'Офлайн' : 'Offline'} (${offlinePosts.length})',
|
'${isRu ? 'Офлайн' : 'Offline'} (${offlinePosts.length})',
|
||||||
style: const TextStyle(fontSize: 12),
|
style: const TextStyle(
|
||||||
|
fontSize: 12, fontWeight: FontWeight.w600),
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -240,13 +309,15 @@ class _FavoritesScreenState extends ConsumerState<FavoritesScreen> {
|
|||||||
icon: const Icon(Icons.groups_rounded, size: 18),
|
icon: const Icon(Icons.groups_rounded, size: 18),
|
||||||
label: Text(
|
label: Text(
|
||||||
'${isRu ? 'Авторы' : 'Artists'} (${artistGroups.length})',
|
'${isRu ? 'Авторы' : 'Artists'} (${artistGroups.length})',
|
||||||
style: const TextStyle(fontSize: 12),
|
style: const TextStyle(
|
||||||
|
fontSize: 12, fontWeight: FontWeight.w600),
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
selected: {_tabIndex},
|
selected: {_tabIndex},
|
||||||
onSelectionChanged: (value) {
|
onSelectionChanged: (value) {
|
||||||
|
HapticFeedback.selectionClick();
|
||||||
setState(() {
|
setState(() {
|
||||||
_tabIndex = value.first;
|
_tabIndex = value.first;
|
||||||
_selectedArtist = null;
|
_selectedArtist = null;
|
||||||
@@ -255,6 +326,10 @@ class _FavoritesScreenState extends ConsumerState<FavoritesScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
// Media Type Filter Chips (for Tab 0 and Tab 1)
|
// Media Type Filter Chips (for Tab 0 and Tab 1)
|
||||||
if (_tabIndex != 2)
|
if (_tabIndex != 2)
|
||||||
@@ -265,9 +340,12 @@ class _FavoritesScreenState extends ConsumerState<FavoritesScreen> {
|
|||||||
FilterChip(
|
FilterChip(
|
||||||
label: Text(isRu ? 'Все' : 'All'),
|
label: Text(isRu ? 'Все' : 'All'),
|
||||||
selected: _mediaFilter == FavoriteMediaType.all,
|
selected: _mediaFilter == FavoriteMediaType.all,
|
||||||
onSelected: (_) => setState(
|
onSelected: (_) {
|
||||||
|
HapticFeedback.selectionClick();
|
||||||
|
setState(
|
||||||
() => _mediaFilter = FavoriteMediaType.all,
|
() => _mediaFilter = FavoriteMediaType.all,
|
||||||
),
|
);
|
||||||
|
},
|
||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
@@ -275,9 +353,12 @@ class _FavoritesScreenState extends ConsumerState<FavoritesScreen> {
|
|||||||
avatar: const Icon(Icons.videocam_rounded, size: 16),
|
avatar: const Icon(Icons.videocam_rounded, size: 16),
|
||||||
label: Text(isRu ? 'Видео' : 'Videos'),
|
label: Text(isRu ? 'Видео' : 'Videos'),
|
||||||
selected: _mediaFilter == FavoriteMediaType.video,
|
selected: _mediaFilter == FavoriteMediaType.video,
|
||||||
onSelected: (_) => setState(
|
onSelected: (_) {
|
||||||
|
HapticFeedback.selectionClick();
|
||||||
|
setState(
|
||||||
() => _mediaFilter = FavoriteMediaType.video,
|
() => _mediaFilter = FavoriteMediaType.video,
|
||||||
),
|
);
|
||||||
|
},
|
||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
@@ -285,9 +366,12 @@ class _FavoritesScreenState extends ConsumerState<FavoritesScreen> {
|
|||||||
avatar: const Icon(Icons.image_rounded, size: 16),
|
avatar: const Icon(Icons.image_rounded, size: 16),
|
||||||
label: Text(isRu ? 'Фото' : 'Images'),
|
label: Text(isRu ? 'Фото' : 'Images'),
|
||||||
selected: _mediaFilter == FavoriteMediaType.image,
|
selected: _mediaFilter == FavoriteMediaType.image,
|
||||||
onSelected: (_) => setState(
|
onSelected: (_) {
|
||||||
|
HapticFeedback.selectionClick();
|
||||||
|
setState(
|
||||||
() => _mediaFilter = FavoriteMediaType.image,
|
() => _mediaFilter = FavoriteMediaType.image,
|
||||||
),
|
);
|
||||||
|
},
|
||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -490,33 +574,42 @@ class _FavoritesScreenState extends ConsumerState<FavoritesScreen> {
|
|||||||
}) {
|
}) {
|
||||||
final scheme = Theme.of(context).colorScheme;
|
final scheme = Theme.of(context).colorScheme;
|
||||||
|
|
||||||
return Container(
|
return _FavoritesLiquidCard(
|
||||||
margin: const EdgeInsets.fromLTRB(16, 4, 16, 8),
|
margin: const EdgeInsets.fromLTRB(16, 4, 16, 8),
|
||||||
padding: const EdgeInsets.all(14),
|
padding: const EdgeInsets.all(14),
|
||||||
decoration: BoxDecoration(
|
glowColor: scheme.primary,
|
||||||
color: scheme.surfaceContainerHigh,
|
|
||||||
borderRadius: BorderRadius.circular(18),
|
|
||||||
border: Border.all(
|
|
||||||
color: scheme.outlineVariant.withValues(alpha: 0.35),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(10),
|
width: 40,
|
||||||
|
height: 40,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: scheme.primaryContainer.withValues(alpha: 0.7),
|
gradient: LinearGradient(
|
||||||
borderRadius: BorderRadius.circular(12),
|
colors: [
|
||||||
|
scheme.primary,
|
||||||
|
scheme.primary.withValues(alpha: 0.85),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: scheme.primary.withValues(alpha: 0.35),
|
||||||
|
blurRadius: 7,
|
||||||
|
offset: const Offset(0, 2.5),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: const Center(
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.offline_pin_rounded,
|
Icons.offline_pin_rounded,
|
||||||
color: scheme.onPrimaryContainer,
|
color: Colors.white,
|
||||||
size: 22,
|
size: 22,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -526,6 +619,7 @@ class _FavoritesScreenState extends ConsumerState<FavoritesScreen> {
|
|||||||
'$downloadedCount ${isRu ? 'из' : 'of'} $totalCount ${isRu ? 'офлайн' : 'saved'}',
|
'$downloadedCount ${isRu ? 'из' : 'of'} $totalCount ${isRu ? 'офлайн' : 'saved'}',
|
||||||
style: Theme.of(context).textTheme.titleSmall?.copyWith(
|
style: Theme.of(context).textTheme.titleSmall?.copyWith(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
|
letterSpacing: -0.2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 2),
|
const SizedBox(height: 2),
|
||||||
@@ -553,6 +647,7 @@ class _FavoritesScreenState extends ConsumerState<FavoritesScreen> {
|
|||||||
if (pendingCount > 0)
|
if (pendingCount > 0)
|
||||||
FilledButton.tonalIcon(
|
FilledButton.tonalIcon(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
HapticFeedback.mediumImpact();
|
||||||
final dm = ref.read(downloadManagerServiceProvider);
|
final dm = ref.read(downloadManagerServiceProvider);
|
||||||
for (final p in pendingPosts) {
|
for (final p in pendingPosts) {
|
||||||
await dm.start(p);
|
await dm.start(p);
|
||||||
@@ -594,7 +689,7 @@ class _FavoritesScreenState extends ConsumerState<FavoritesScreen> {
|
|||||||
vertical: 6,
|
vertical: 6,
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: scheme.secondaryContainer.withValues(alpha: 0.5),
|
color: scheme.primary.withValues(alpha: 0.12),
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
@@ -610,8 +705,8 @@ class _FavoritesScreenState extends ConsumerState<FavoritesScreen> {
|
|||||||
isRu ? 'Всё готово' : 'Synced',
|
isRu ? 'Всё готово' : 'Synced',
|
||||||
style:
|
style:
|
||||||
Theme.of(context).textTheme.labelSmall?.copyWith(
|
Theme.of(context).textTheme.labelSmall?.copyWith(
|
||||||
color: scheme.onSecondaryContainer,
|
color: scheme.primary,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w700,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -666,27 +761,36 @@ class _FavoritesScreenState extends ConsumerState<FavoritesScreen> {
|
|||||||
ChoiceChip(
|
ChoiceChip(
|
||||||
label: Text(isRu ? 'По дате' : 'Date'),
|
label: Text(isRu ? 'По дате' : 'Date'),
|
||||||
selected: _offlineSort == OfflineSortOption.dateAddedDesc,
|
selected: _offlineSort == OfflineSortOption.dateAddedDesc,
|
||||||
onSelected: (_) => setState(
|
onSelected: (_) {
|
||||||
|
HapticFeedback.selectionClick();
|
||||||
|
setState(
|
||||||
() => _offlineSort = OfflineSortOption.dateAddedDesc,
|
() => _offlineSort = OfflineSortOption.dateAddedDesc,
|
||||||
),
|
);
|
||||||
|
},
|
||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 6),
|
const SizedBox(width: 6),
|
||||||
ChoiceChip(
|
ChoiceChip(
|
||||||
label: Text(isRu ? 'По размеру' : 'Size'),
|
label: Text(isRu ? 'По размеру' : 'Size'),
|
||||||
selected: _offlineSort == OfflineSortOption.sizeDesc,
|
selected: _offlineSort == OfflineSortOption.sizeDesc,
|
||||||
onSelected: (_) => setState(
|
onSelected: (_) {
|
||||||
|
HapticFeedback.selectionClick();
|
||||||
|
setState(
|
||||||
() => _offlineSort = OfflineSortOption.sizeDesc,
|
() => _offlineSort = OfflineSortOption.sizeDesc,
|
||||||
),
|
);
|
||||||
|
},
|
||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 6),
|
const SizedBox(width: 6),
|
||||||
ChoiceChip(
|
ChoiceChip(
|
||||||
label: Text(isRu ? 'По автору' : 'Artist'),
|
label: Text(isRu ? 'По автору' : 'Artist'),
|
||||||
selected: _offlineSort == OfflineSortOption.artist,
|
selected: _offlineSort == OfflineSortOption.artist,
|
||||||
onSelected: (_) => setState(
|
onSelected: (_) {
|
||||||
|
HapticFeedback.selectionClick();
|
||||||
|
setState(
|
||||||
() => _offlineSort = OfflineSortOption.artist,
|
() => _offlineSort = OfflineSortOption.artist,
|
||||||
),
|
);
|
||||||
|
},
|
||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -712,38 +816,50 @@ class _FavoritesScreenState extends ConsumerState<FavoritesScreen> {
|
|||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
// Artist Header Banner
|
// Artist Header Banner (Liquid Glass)
|
||||||
Container(
|
_FavoritesLiquidCard(
|
||||||
margin: const EdgeInsets.fromLTRB(16, 4, 16, 8),
|
margin: const EdgeInsets.fromLTRB(16, 4, 16, 8),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.surfaceContainerLow,
|
|
||||||
borderRadius: BorderRadius.circular(16),
|
|
||||||
border: Border.all(
|
|
||||||
color: Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.outlineVariant
|
|
||||||
.withValues(alpha: 0.3),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () => setState(() => _selectedArtist = null),
|
onPressed: () {
|
||||||
|
HapticFeedback.selectionClick();
|
||||||
|
setState(() => _selectedArtist = null);
|
||||||
|
},
|
||||||
icon: const Icon(Icons.arrow_back_rounded),
|
icon: const Icon(Icons.arrow_back_rounded),
|
||||||
tooltip: isRu ? 'Все авторы' : 'All artists',
|
tooltip: isRu ? 'Все авторы' : 'All artists',
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
CircleAvatar(
|
Container(
|
||||||
radius: 18,
|
width: 38,
|
||||||
backgroundColor: Theme.of(context).colorScheme.primaryContainer,
|
height: 38,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient: LinearGradient(
|
||||||
|
colors: [
|
||||||
|
Theme.of(context).colorScheme.primary,
|
||||||
|
Theme.of(context).colorScheme.tertiary,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.primary
|
||||||
|
.withValues(alpha: 0.35),
|
||||||
|
blurRadius: 6,
|
||||||
|
offset: const Offset(0, 2),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
selected.isNotEmpty ? selected[0].toUpperCase() : '?',
|
selected.isNotEmpty ? selected[0].toUpperCase() : '?',
|
||||||
style: TextStyle(
|
style: const TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: Theme.of(context).colorScheme.onPrimaryContainer,
|
color: Colors.white,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -756,6 +872,7 @@ class _FavoritesScreenState extends ConsumerState<FavoritesScreen> {
|
|||||||
selected,
|
selected,
|
||||||
style: Theme.of(context).textTheme.titleMedium?.copyWith(
|
style: Theme.of(context).textTheme.titleMedium?.copyWith(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
|
letterSpacing: -0.2,
|
||||||
),
|
),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
@@ -776,6 +893,7 @@ class _FavoritesScreenState extends ConsumerState<FavoritesScreen> {
|
|||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
HapticFeedback.selectionClick();
|
||||||
context.push('/search?q=${Uri.encodeComponent('artist:$selected')}');
|
context.push('/search?q=${Uri.encodeComponent('artist:$selected')}');
|
||||||
},
|
},
|
||||||
icon: const Icon(Icons.search_rounded, size: 16),
|
icon: const Icon(Icons.search_rounded, size: 16),
|
||||||
@@ -808,7 +926,9 @@ class _FavoritesScreenState extends ConsumerState<FavoritesScreen> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return ListView.separated(
|
return ListView.separated(
|
||||||
padding: const EdgeInsets.fromLTRB(16, 8, 16, 24),
|
// Extended bottom padding so the last artist cards scroll comfortably above the floating dock
|
||||||
|
padding: EdgeInsets.fromLTRB(
|
||||||
|
16, 8, 16, 140 + MediaQuery.paddingOf(context).bottom),
|
||||||
itemCount: entries.length,
|
itemCount: entries.length,
|
||||||
separatorBuilder: (_, __) => const SizedBox(height: 10),
|
separatorBuilder: (_, __) => const SizedBox(height: 10),
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
@@ -863,6 +983,83 @@ class _FavoritesScreenState extends ConsumerState<FavoritesScreen> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class _FavoritesLiquidCard extends StatelessWidget {
|
||||||
|
const _FavoritesLiquidCard({
|
||||||
|
required this.child,
|
||||||
|
this.padding,
|
||||||
|
this.glowColor,
|
||||||
|
this.margin,
|
||||||
|
});
|
||||||
|
|
||||||
|
final Widget child;
|
||||||
|
final EdgeInsetsGeometry? padding;
|
||||||
|
final EdgeInsetsGeometry? margin;
|
||||||
|
final Color? glowColor;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final theme = Theme.of(context);
|
||||||
|
final isDark = theme.brightness == Brightness.dark;
|
||||||
|
final accent = glowColor ?? theme.colorScheme.primary;
|
||||||
|
|
||||||
|
return Container(
|
||||||
|
margin: margin,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(22),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: isDark
|
||||||
|
? Colors.black.withValues(alpha: 0.30)
|
||||||
|
: accent.withValues(alpha: 0.07),
|
||||||
|
blurRadius: 16,
|
||||||
|
offset: const Offset(0, 5),
|
||||||
|
spreadRadius: -2,
|
||||||
|
),
|
||||||
|
BoxShadow(
|
||||||
|
color: accent.withValues(alpha: isDark ? 0.05 : 0.02),
|
||||||
|
blurRadius: 8,
|
||||||
|
offset: const Offset(0, 2),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(22),
|
||||||
|
child: BackdropFilter(
|
||||||
|
filter: ImageFilter.blur(sigmaX: 18, sigmaY: 18),
|
||||||
|
child: Container(
|
||||||
|
padding: padding ?? const EdgeInsets.all(16),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(22),
|
||||||
|
gradient: LinearGradient(
|
||||||
|
begin: Alignment.topLeft,
|
||||||
|
end: Alignment.bottomRight,
|
||||||
|
colors: isDark
|
||||||
|
? [
|
||||||
|
theme.colorScheme.surfaceContainerHigh
|
||||||
|
.withValues(alpha: 0.60),
|
||||||
|
theme.colorScheme.surfaceContainerLow
|
||||||
|
.withValues(alpha: 0.38),
|
||||||
|
]
|
||||||
|
: [
|
||||||
|
Colors.white.withValues(alpha: 0.88),
|
||||||
|
Colors.white.withValues(alpha: 0.72),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
border: Border.all(
|
||||||
|
color: isDark
|
||||||
|
? Colors.white.withValues(alpha: 0.14)
|
||||||
|
: Colors.white.withValues(alpha: 0.85),
|
||||||
|
width: 1.2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: child,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class _ArtistCard extends StatelessWidget {
|
class _ArtistCard extends StatelessWidget {
|
||||||
const _ArtistCard({
|
const _ArtistCard({
|
||||||
required this.artistName,
|
required this.artistName,
|
||||||
@@ -881,45 +1078,91 @@ class _ArtistCard extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final scheme = Theme.of(context).colorScheme;
|
final scheme = Theme.of(context).colorScheme;
|
||||||
|
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||||
|
|
||||||
return Card(
|
return Container(
|
||||||
elevation: 0,
|
decoration: BoxDecoration(
|
||||||
color: scheme.surfaceContainerLow,
|
borderRadius: BorderRadius.circular(22),
|
||||||
shape: RoundedRectangleBorder(
|
boxShadow: [
|
||||||
borderRadius: BorderRadius.circular(16),
|
BoxShadow(
|
||||||
side: BorderSide(
|
color: isDark
|
||||||
color: scheme.outlineVariant.withValues(alpha: 0.3),
|
? Colors.black.withValues(alpha: 0.28)
|
||||||
|
: scheme.primary.withValues(alpha: 0.06),
|
||||||
|
blurRadius: 14,
|
||||||
|
offset: const Offset(0, 4),
|
||||||
|
spreadRadius: -2,
|
||||||
),
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
clipBehavior: Clip.antiAlias,
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(22),
|
||||||
|
child: BackdropFilter(
|
||||||
|
filter: ImageFilter.blur(sigmaX: 16, sigmaY: 16),
|
||||||
|
child: Material(
|
||||||
|
color: Colors.transparent,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: onTap,
|
borderRadius: BorderRadius.circular(22),
|
||||||
child: Padding(
|
onTap: () {
|
||||||
|
HapticFeedback.selectionClick();
|
||||||
|
onTap();
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const EdgeInsets.all(12),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(22),
|
||||||
|
gradient: LinearGradient(
|
||||||
|
begin: Alignment.topLeft,
|
||||||
|
end: Alignment.bottomRight,
|
||||||
|
colors: isDark
|
||||||
|
? [
|
||||||
|
scheme.surfaceContainerHigh
|
||||||
|
.withValues(alpha: 0.58),
|
||||||
|
scheme.surfaceContainerLow
|
||||||
|
.withValues(alpha: 0.36),
|
||||||
|
]
|
||||||
|
: [
|
||||||
|
Colors.white.withValues(alpha: 0.88),
|
||||||
|
Colors.white.withValues(alpha: 0.72),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
border: Border.all(
|
||||||
|
color: isDark
|
||||||
|
? Colors.white.withValues(alpha: 0.13)
|
||||||
|
: Colors.white.withValues(alpha: 0.85),
|
||||||
|
width: 1.1,
|
||||||
|
),
|
||||||
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
// Artist Avatar
|
// Artist Squircle Avatar
|
||||||
Container(
|
Container(
|
||||||
width: 48,
|
width: 48,
|
||||||
height: 48,
|
height: 48,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
gradient: LinearGradient(
|
gradient: LinearGradient(
|
||||||
colors: [
|
colors: [
|
||||||
scheme.primaryContainer,
|
scheme.primary,
|
||||||
scheme.tertiaryContainer,
|
scheme.tertiary,
|
||||||
],
|
],
|
||||||
begin: Alignment.topLeft,
|
begin: Alignment.topLeft,
|
||||||
end: Alignment.bottomRight,
|
end: Alignment.bottomRight,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(14),
|
borderRadius: BorderRadius.circular(15),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: scheme.primary.withValues(alpha: 0.35),
|
||||||
|
blurRadius: 8,
|
||||||
|
offset: const Offset(0, 2.5),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
artistName.isNotEmpty ? artistName[0].toUpperCase() : '?',
|
artistName.isNotEmpty ? artistName[0].toUpperCase() : '?',
|
||||||
style: TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: scheme.onPrimaryContainer,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -934,25 +1177,26 @@ class _ArtistCard extends StatelessWidget {
|
|||||||
artistName,
|
artistName,
|
||||||
style: Theme.of(context).textTheme.titleMedium?.copyWith(
|
style: Theme.of(context).textTheme.titleMedium?.copyWith(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
|
letterSpacing: -0.2,
|
||||||
),
|
),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 2),
|
const SizedBox(height: 3),
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 8,
|
horizontal: 8,
|
||||||
vertical: 2,
|
vertical: 2,
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: scheme.secondaryContainer.withValues(alpha: 0.5),
|
color: scheme.primary.withValues(alpha: 0.12),
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
'$postsCount ${isRu ? 'работ' : 'posts'}',
|
'$postsCount ${isRu ? 'работ' : 'posts'}',
|
||||||
style: Theme.of(context).textTheme.labelSmall?.copyWith(
|
style: Theme.of(context).textTheme.labelSmall?.copyWith(
|
||||||
color: scheme.onSecondaryContainer,
|
color: scheme.primary,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w700,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -966,12 +1210,20 @@ class _ArtistCard extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
for (final url in previewUrls)
|
for (final url in previewUrls)
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 4),
|
padding: const EdgeInsets.only(left: 5),
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(10),
|
||||||
child: SizedBox(
|
child: Container(
|
||||||
width: 44,
|
width: 44,
|
||||||
height: 44,
|
height: 44,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(
|
||||||
|
color: isDark
|
||||||
|
? Colors.white.withValues(alpha: 0.10)
|
||||||
|
: scheme.outlineVariant.withValues(alpha: 0.25),
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
child: CachedNetworkImage(
|
child: CachedNetworkImage(
|
||||||
imageUrl: url,
|
imageUrl: url,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
@@ -992,15 +1244,19 @@ class _ArtistCard extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
const SizedBox(width: 6),
|
const SizedBox(width: 4),
|
||||||
Icon(
|
Icon(
|
||||||
Icons.chevron_right_rounded,
|
Icons.chevron_right_rounded,
|
||||||
color: scheme.onSurfaceVariant.withValues(alpha: 0.6),
|
size: 20,
|
||||||
|
color: scheme.onSurfaceVariant.withValues(alpha: 0.5),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
|
import 'dart:ui';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
|
||||||
@@ -47,6 +50,7 @@ class _SearchScreenState extends ConsumerState<SearchScreen> {
|
|||||||
final strings = AppStrings(settings.languageCode);
|
final strings = AppStrings(settings.languageCode);
|
||||||
final isRu = strings.ru;
|
final isRu = strings.ru;
|
||||||
final theme = Theme.of(context);
|
final theme = Theme.of(context);
|
||||||
|
final bottomInset = MediaQuery.paddingOf(context).bottom;
|
||||||
|
|
||||||
return AdaptiveScaffold(
|
return AdaptiveScaffold(
|
||||||
title: strings.search,
|
title: strings.search,
|
||||||
@@ -78,19 +82,12 @@ class _SearchScreenState extends ConsumerState<SearchScreen> {
|
|||||||
child: ConstrainedBox(
|
child: ConstrainedBox(
|
||||||
constraints: const BoxConstraints(maxWidth: 860),
|
constraints: const BoxConstraints(maxWidth: 860),
|
||||||
child: ListView(
|
child: ListView(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
// Extended bottom padding so the cheat sheet card is never obscured by the floating dock
|
||||||
|
padding: EdgeInsets.fromLTRB(16, 14, 16, 140 + bottomInset),
|
||||||
children: [
|
children: [
|
||||||
// 1. Search Bar with Quick Operators
|
// 1. Search Bar with Quick Operators
|
||||||
Container(
|
_SearchLiquidCard(
|
||||||
padding: const EdgeInsets.all(16),
|
glowColor: theme.colorScheme.primary,
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: theme.colorScheme.surfaceContainerLow,
|
|
||||||
borderRadius: BorderRadius.circular(20),
|
|
||||||
border: Border.all(
|
|
||||||
color: theme.colorScheme.outlineVariant
|
|
||||||
.withValues(alpha: 0.3),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
@@ -171,18 +168,58 @@ class _SearchScreenState extends ConsumerState<SearchScreen> {
|
|||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
|
|
||||||
// 2. Recent Searches Card
|
// 2. Recent Searches Card
|
||||||
_SearchSectionCard(
|
_SearchLiquidCard(
|
||||||
|
glowColor: const Color(0xFF6366F1),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
const _SearchIconBadge(
|
||||||
icon: Icons.history_rounded,
|
icon: Icons.history_rounded,
|
||||||
accentColor: const Color(0xFF6366F1),
|
color: Color(0xFF6366F1),
|
||||||
title: isRu ? 'Недавние запросы' : 'Recent searches',
|
),
|
||||||
badgeCount: data.recent
|
const SizedBox(width: 12),
|
||||||
.map((e) => e.query.trim().toLowerCase())
|
Expanded(
|
||||||
.where((q) => q.isNotEmpty)
|
child: Row(
|
||||||
.toSet()
|
mainAxisSize: MainAxisSize.min,
|
||||||
.length,
|
children: [
|
||||||
trailing: data.recent.isEmpty
|
Flexible(
|
||||||
? null
|
child: Text(
|
||||||
: TextButton(
|
isRu ? 'Недавние запросы' : 'Recent searches',
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: theme.textTheme.titleMedium?.copyWith(
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
fontSize: 15,
|
||||||
|
letterSpacing: -0.2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (data.recent.isNotEmpty) ...[
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 7, vertical: 2),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: const Color(0xFF6366F1)
|
||||||
|
.withValues(alpha: 0.16),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
'${data.recent.map((e) => e.query.trim().toLowerCase()).where((q) => q.isNotEmpty).toSet().length}',
|
||||||
|
style: theme.textTheme.labelSmall?.copyWith(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: const Color(0xFF6366F1),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (data.recent.isNotEmpty)
|
||||||
|
TextButton(
|
||||||
style: TextButton.styleFrom(
|
style: TextButton.styleFrom(
|
||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
@@ -190,9 +227,12 @@ class _SearchScreenState extends ConsumerState<SearchScreen> {
|
|||||||
minimumSize: Size.zero,
|
minimumSize: Size.zero,
|
||||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||||
),
|
),
|
||||||
onPressed: () => ref
|
onPressed: () {
|
||||||
|
HapticFeedback.selectionClick();
|
||||||
|
ref
|
||||||
.read(searchControllerProvider.notifier)
|
.read(searchControllerProvider.notifier)
|
||||||
.clearHistory(),
|
.clearHistory();
|
||||||
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
isRu ? 'Очистить' : 'Clear',
|
isRu ? 'Очистить' : 'Clear',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -202,7 +242,10 @@ class _SearchScreenState extends ConsumerState<SearchScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: RecentSearches(
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 14),
|
||||||
|
RecentSearches(
|
||||||
items: data.recent,
|
items: data.recent,
|
||||||
onTap: (query) =>
|
onTap: (query) =>
|
||||||
context.go('/?q=${Uri.encodeQueryComponent(query)}'),
|
context.go('/?q=${Uri.encodeQueryComponent(query)}'),
|
||||||
@@ -210,17 +253,39 @@ class _SearchScreenState extends ConsumerState<SearchScreen> {
|
|||||||
.read(searchControllerProvider.notifier)
|
.read(searchControllerProvider.notifier)
|
||||||
.deleteHistory(id),
|
.deleteHistory(id),
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
|
|
||||||
// 3. Explore Popular Categories & Tags
|
// 3. Explore Popular Categories & Tags
|
||||||
_SearchSectionCard(
|
_SearchLiquidCard(
|
||||||
icon: Icons.explore_rounded,
|
glowColor: const Color(0xFF10B981),
|
||||||
accentColor: const Color(0xFF10B981),
|
|
||||||
title: isRu ? 'Популярные категории' : 'Explore categories',
|
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
const _SearchIconBadge(
|
||||||
|
icon: Icons.explore_rounded,
|
||||||
|
color: Color(0xFF10B981),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 12),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
isRu ? 'Популярные категории' : 'Explore categories',
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: theme.textTheme.titleMedium?.copyWith(
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
fontSize: 15,
|
||||||
|
letterSpacing: -0.2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 16),
|
||||||
_CategoryTagRow(
|
_CategoryTagRow(
|
||||||
categoryName: isRu ? 'Тематика' : 'Theme & Ambience',
|
categoryName: isRu ? 'Тематика' : 'Theme & Ambience',
|
||||||
color: const Color(0xFF0EA5E9),
|
color: const Color(0xFF0EA5E9),
|
||||||
@@ -234,7 +299,7 @@ class _SearchScreenState extends ConsumerState<SearchScreen> {
|
|||||||
],
|
],
|
||||||
onTap: (tag) => _onTagTap(tag, data.query),
|
onTap: (tag) => _onTagTap(tag, data.query),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 14),
|
const SizedBox(height: 16),
|
||||||
_CategoryTagRow(
|
_CategoryTagRow(
|
||||||
categoryName:
|
categoryName:
|
||||||
isRu ? 'Персонажи и детали' : 'Characters & Attire',
|
isRu ? 'Персонажи и детали' : 'Characters & Attire',
|
||||||
@@ -250,7 +315,7 @@ class _SearchScreenState extends ConsumerState<SearchScreen> {
|
|||||||
],
|
],
|
||||||
onTap: (tag) => _onTagTap(tag, data.query),
|
onTap: (tag) => _onTagTap(tag, data.query),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 14),
|
const SizedBox(height: 16),
|
||||||
_CategoryTagRow(
|
_CategoryTagRow(
|
||||||
categoryName: isRu ? 'Провайдеры' : 'Providers',
|
categoryName: isRu ? 'Провайдеры' : 'Providers',
|
||||||
color: const Color(0xFF8B5CF6),
|
color: const Color(0xFF8B5CF6),
|
||||||
@@ -268,40 +333,33 @@ class _SearchScreenState extends ConsumerState<SearchScreen> {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
|
|
||||||
// 4. Search Tips / Cheat Sheet Card
|
// 4. Search Tips / Cheat Sheet Card (Full Liquid Glass Container)
|
||||||
Container(
|
_SearchLiquidCard(
|
||||||
decoration: BoxDecoration(
|
padding: EdgeInsets.zero,
|
||||||
color: theme.colorScheme.surfaceContainerLow,
|
glowColor: const Color(0xFFF59E0B),
|
||||||
borderRadius: BorderRadius.circular(20),
|
child: Theme(
|
||||||
border: Border.all(
|
data: theme.copyWith(dividerColor: Colors.transparent),
|
||||||
color: theme.colorScheme.outlineVariant
|
|
||||||
.withValues(alpha: 0.3),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: ExpansionTile(
|
child: ExpansionTile(
|
||||||
shape: const Border(),
|
shape: const Border(),
|
||||||
collapsedShape: const Border(),
|
collapsedShape: const Border(),
|
||||||
leading: Container(
|
tilePadding: const EdgeInsets.symmetric(
|
||||||
width: 32,
|
horizontal: 16, vertical: 4),
|
||||||
height: 32,
|
leading: const _SearchIconBadge(
|
||||||
decoration: BoxDecoration(
|
icon: Icons.lightbulb_rounded,
|
||||||
color: const Color(0xFFF59E0B).withValues(alpha: 0.15),
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
child: const Icon(
|
|
||||||
Icons.lightbulb_outline_rounded,
|
|
||||||
size: 18,
|
|
||||||
color: Color(0xFFF59E0B),
|
color: Color(0xFFF59E0B),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
title: Text(
|
title: Text(
|
||||||
isRu ? 'Шпаргалка по поиску' : 'Search tips & operators',
|
isRu ? 'Шпаргалка по поиску' : 'Search tips & operators',
|
||||||
style: theme.textTheme.titleSmall?.copyWith(
|
style: theme.textTheme.titleSmall?.copyWith(
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
|
letterSpacing: -0.2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
initiallyExpanded: _showTips,
|
initiallyExpanded: _showTips,
|
||||||
onExpansionChanged: (exp) => setState(() => _showTips = exp),
|
onExpansionChanged: (exp) {
|
||||||
|
HapticFeedback.selectionClick();
|
||||||
|
setState(() => _showTips = exp);
|
||||||
|
},
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
|
padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
|
||||||
@@ -348,6 +406,7 @@ class _SearchScreenState extends ConsumerState<SearchScreen> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -358,92 +417,116 @@ class _SearchScreenState extends ConsumerState<SearchScreen> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class _SearchSectionCard extends StatelessWidget {
|
class _SearchLiquidCard extends StatelessWidget {
|
||||||
const _SearchSectionCard({
|
const _SearchLiquidCard({
|
||||||
required this.icon,
|
|
||||||
required this.accentColor,
|
|
||||||
required this.title,
|
|
||||||
required this.child,
|
required this.child,
|
||||||
this.badgeCount,
|
this.padding,
|
||||||
this.trailing,
|
this.glowColor,
|
||||||
});
|
});
|
||||||
|
|
||||||
final IconData icon;
|
|
||||||
final Color accentColor;
|
|
||||||
final String title;
|
|
||||||
final Widget child;
|
final Widget child;
|
||||||
final int? badgeCount;
|
final EdgeInsetsGeometry? padding;
|
||||||
final Widget? trailing;
|
final Color? glowColor;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final theme = Theme.of(context);
|
final theme = Theme.of(context);
|
||||||
|
final isDark = theme.brightness == Brightness.dark;
|
||||||
|
final accent = glowColor ?? theme.colorScheme.primary;
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: theme.colorScheme.surfaceContainerLow,
|
borderRadius: BorderRadius.circular(24),
|
||||||
borderRadius: BorderRadius.circular(20),
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: isDark
|
||||||
|
? Colors.black.withValues(alpha: 0.35)
|
||||||
|
: accent.withValues(alpha: 0.08),
|
||||||
|
blurRadius: 18,
|
||||||
|
offset: const Offset(0, 6),
|
||||||
|
spreadRadius: -2,
|
||||||
|
),
|
||||||
|
BoxShadow(
|
||||||
|
color: accent.withValues(alpha: isDark ? 0.06 : 0.03),
|
||||||
|
blurRadius: 10,
|
||||||
|
offset: const Offset(0, 2),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(24),
|
||||||
|
child: BackdropFilter(
|
||||||
|
filter: ImageFilter.blur(sigmaX: 18, sigmaY: 18),
|
||||||
|
child: Container(
|
||||||
|
padding: padding ?? const EdgeInsets.all(16),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(24),
|
||||||
|
gradient: LinearGradient(
|
||||||
|
begin: Alignment.topLeft,
|
||||||
|
end: Alignment.bottomRight,
|
||||||
|
colors: isDark
|
||||||
|
? [
|
||||||
|
theme.colorScheme.surfaceContainerHigh
|
||||||
|
.withValues(alpha: 0.60),
|
||||||
|
theme.colorScheme.surfaceContainerLow
|
||||||
|
.withValues(alpha: 0.38),
|
||||||
|
]
|
||||||
|
: [
|
||||||
|
Colors.white.withValues(alpha: 0.88),
|
||||||
|
Colors.white.withValues(alpha: 0.72),
|
||||||
|
],
|
||||||
|
),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: theme.colorScheme.outlineVariant.withValues(alpha: 0.3),
|
color: isDark
|
||||||
|
? Colors.white.withValues(alpha: 0.14)
|
||||||
|
: Colors.white.withValues(alpha: 0.85),
|
||||||
|
width: 1.2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.all(16),
|
child: child,
|
||||||
child: Column(
|
),
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
),
|
||||||
children: [
|
),
|
||||||
Row(
|
);
|
||||||
children: [
|
}
|
||||||
Container(
|
}
|
||||||
width: 32,
|
|
||||||
height: 32,
|
class _SearchIconBadge extends StatelessWidget {
|
||||||
|
const _SearchIconBadge({
|
||||||
|
required this.icon,
|
||||||
|
required this.color,
|
||||||
|
});
|
||||||
|
|
||||||
|
final IconData icon;
|
||||||
|
final Color color;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
const size = 34.0;
|
||||||
|
const iconSize = 18.0;
|
||||||
|
return Container(
|
||||||
|
width: size,
|
||||||
|
height: size,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: accentColor.withValues(alpha: 0.14),
|
gradient: LinearGradient(
|
||||||
borderRadius: BorderRadius.circular(10),
|
begin: Alignment.topLeft,
|
||||||
),
|
end: Alignment.bottomRight,
|
||||||
child: Icon(icon, size: 18, color: accentColor),
|
colors: [
|
||||||
),
|
color,
|
||||||
const SizedBox(width: 10),
|
color.withValues(alpha: 0.86),
|
||||||
Expanded(
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
Flexible(
|
|
||||||
child: Text(
|
|
||||||
title,
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
style: theme.textTheme.titleMedium?.copyWith(
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
fontSize: 15,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (badgeCount != null && badgeCount! > 0) ...[
|
|
||||||
const SizedBox(width: 8),
|
|
||||||
Container(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 7, vertical: 2),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: accentColor.withValues(alpha: 0.15),
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
child: Text(
|
|
||||||
'$badgeCount',
|
|
||||||
style: theme.textTheme.labelSmall?.copyWith(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color: accentColor,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
borderRadius: BorderRadius.circular(size * 0.28),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: color.withValues(alpha: 0.35),
|
||||||
|
blurRadius: 7,
|
||||||
|
offset: const Offset(0, 2.5),
|
||||||
),
|
),
|
||||||
if (trailing != null) trailing!,
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 14),
|
child: Center(
|
||||||
child,
|
child: Icon(icon, size: iconSize, color: Colors.white),
|
||||||
],
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -465,19 +548,33 @@ class _QuickOperatorChip extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final theme = Theme.of(context);
|
final theme = Theme.of(context);
|
||||||
|
final isDark = theme.brightness == Brightness.dark;
|
||||||
|
|
||||||
return Material(
|
return Material(
|
||||||
color: color.withValues(alpha: 0.12),
|
color: Colors.transparent,
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(14),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(14),
|
||||||
onTap: onTap,
|
onTap: () {
|
||||||
|
HapticFeedback.selectionClick();
|
||||||
|
onTap();
|
||||||
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),
|
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(12),
|
color: color.withValues(alpha: isDark ? 0.16 : 0.10),
|
||||||
|
borderRadius: BorderRadius.circular(14),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: color.withValues(alpha: 0.35),
|
color: color.withValues(alpha: isDark ? 0.40 : 0.32),
|
||||||
|
width: 1.1,
|
||||||
),
|
),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: color.withValues(alpha: isDark ? 0.14 : 0.06),
|
||||||
|
blurRadius: 6,
|
||||||
|
offset: const Offset(0, 1.5),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
@@ -490,6 +587,7 @@ class _QuickOperatorChip extends StatelessWidget {
|
|||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
color: color,
|
color: color,
|
||||||
fontFamily: 'monospace',
|
fontFamily: 'monospace',
|
||||||
|
letterSpacing: -0.2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -516,44 +614,76 @@ class _CategoryTagRow extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final theme = Theme.of(context);
|
final theme = Theme.of(context);
|
||||||
|
final isDark = theme.brightness == Brightness.dark;
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 7,
|
||||||
|
height: 7,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: color,
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: color.withValues(alpha: 0.6),
|
||||||
|
blurRadius: 4,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
Text(
|
Text(
|
||||||
categoryName,
|
categoryName,
|
||||||
style: theme.textTheme.labelLarge?.copyWith(
|
style: theme.textTheme.labelLarge?.copyWith(
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w700,
|
||||||
color: theme.colorScheme.onSurfaceVariant,
|
color: theme.colorScheme.onSurface,
|
||||||
|
letterSpacing: -0.2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
Wrap(
|
Wrap(
|
||||||
spacing: 8,
|
spacing: 8,
|
||||||
runSpacing: 8,
|
runSpacing: 8,
|
||||||
children: [
|
children: [
|
||||||
for (final tag in tags)
|
for (final tag in tags)
|
||||||
Material(
|
Material(
|
||||||
color: theme.colorScheme.surfaceContainer,
|
color: Colors.transparent,
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(14),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(14),
|
||||||
onTap: () => onTap(tag),
|
onTap: () {
|
||||||
|
HapticFeedback.selectionClick();
|
||||||
|
onTap(tag);
|
||||||
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 10, vertical: 5),
|
horizontal: 11, vertical: 6),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(12),
|
color: isDark
|
||||||
|
? theme.colorScheme.surfaceContainerHighest
|
||||||
|
.withValues(alpha: 0.45)
|
||||||
|
: Colors.white.withValues(alpha: 0.60),
|
||||||
|
borderRadius: BorderRadius.circular(14),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: theme.colorScheme.outlineVariant
|
color: isDark
|
||||||
.withValues(alpha: 0.3),
|
? Colors.white.withValues(alpha: 0.10)
|
||||||
|
: theme.colorScheme.outlineVariant
|
||||||
|
.withValues(alpha: 0.35),
|
||||||
|
width: 1.0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: 6,
|
width: 5,
|
||||||
height: 6,
|
height: 5,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: color,
|
color: color,
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
@@ -563,7 +693,8 @@ class _CategoryTagRow extends StatelessWidget {
|
|||||||
Text(
|
Text(
|
||||||
tag,
|
tag,
|
||||||
style: theme.textTheme.bodySmall?.copyWith(
|
style: theme.textTheme.bodySmall?.copyWith(
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w600,
|
||||||
|
letterSpacing: -0.1,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -587,14 +718,23 @@ class _TipRow extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final theme = Theme.of(context);
|
final theme = Theme.of(context);
|
||||||
|
final isDark = theme.brightness == Brightness.dark;
|
||||||
|
|
||||||
return Row(
|
return Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: theme.colorScheme.surfaceContainerHighest,
|
color: isDark
|
||||||
borderRadius: BorderRadius.circular(6),
|
? theme.colorScheme.surfaceContainerHighest.withValues(alpha: 0.6)
|
||||||
|
: theme.colorScheme.surfaceContainerHighest.withValues(alpha: 0.8),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
border: Border.all(
|
||||||
|
color: isDark
|
||||||
|
? Colors.white.withValues(alpha: 0.08)
|
||||||
|
: theme.colorScheme.outlineVariant.withValues(alpha: 0.25),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
code,
|
code,
|
||||||
@@ -608,10 +748,14 @@ class _TipRow extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Expanded(
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 2),
|
||||||
child: Text(
|
child: Text(
|
||||||
description,
|
description,
|
||||||
style: theme.textTheme.bodySmall?.copyWith(
|
style: theme.textTheme.bodySmall?.copyWith(
|
||||||
color: theme.colorScheme.onSurfaceVariant,
|
color: theme.colorScheme.onSurfaceVariant,
|
||||||
|
height: 1.35,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
import '../../../../backend/backend.dart';
|
import '../../../../backend/backend.dart';
|
||||||
|
|
||||||
@@ -95,20 +96,40 @@ class _RecentSearchesState extends State<RecentSearches> {
|
|||||||
children: [
|
children: [
|
||||||
for (final item in visibleItems)
|
for (final item in visibleItems)
|
||||||
Material(
|
Material(
|
||||||
color: theme.colorScheme.surfaceContainer,
|
color: Colors.transparent,
|
||||||
borderRadius: BorderRadius.circular(16),
|
borderRadius: BorderRadius.circular(16),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
borderRadius: BorderRadius.circular(16),
|
borderRadius: BorderRadius.circular(16),
|
||||||
onTap: () => widget.onTap(item.query),
|
onTap: () {
|
||||||
|
HapticFeedback.selectionClick();
|
||||||
|
widget.onTap(item.query);
|
||||||
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsets.only(left: 10, right: 6, top: 6, bottom: 6),
|
const EdgeInsets.only(left: 10, right: 6, top: 6, bottom: 6),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
color: Theme.of(context).brightness == Brightness.dark
|
||||||
|
? theme.colorScheme.surfaceContainerHighest
|
||||||
|
.withValues(alpha: 0.45)
|
||||||
|
: Colors.white.withValues(alpha: 0.65),
|
||||||
borderRadius: BorderRadius.circular(16),
|
borderRadius: BorderRadius.circular(16),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: theme.colorScheme.outlineVariant
|
color: Theme.of(context).brightness == Brightness.dark
|
||||||
|
? Colors.white.withValues(alpha: 0.12)
|
||||||
|
: theme.colorScheme.outlineVariant
|
||||||
.withValues(alpha: 0.35),
|
.withValues(alpha: 0.35),
|
||||||
|
width: 1.0,
|
||||||
),
|
),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.black.withValues(
|
||||||
|
alpha: Theme.of(context).brightness == Brightness.dark
|
||||||
|
? 0.15
|
||||||
|
: 0.04),
|
||||||
|
blurRadius: 6,
|
||||||
|
offset: const Offset(0, 1.5),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
@@ -140,7 +161,7 @@ class _RecentSearchesState extends State<RecentSearches> {
|
|||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 6, vertical: 2),
|
horizontal: 6, vertical: 2),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: theme.colorScheme.primary.withValues(alpha: 0.12),
|
color: theme.colorScheme.primary.withValues(alpha: 0.14),
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
@@ -161,7 +182,10 @@ class _RecentSearchesState extends State<RecentSearches> {
|
|||||||
clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.antiAlias,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
customBorder: const CircleBorder(),
|
customBorder: const CircleBorder(),
|
||||||
onTap: () => widget.onDelete!(item.id),
|
onTap: () {
|
||||||
|
HapticFeedback.lightImpact();
|
||||||
|
widget.onDelete!(item.id);
|
||||||
|
},
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(4),
|
padding: const EdgeInsets.all(4),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
|
|||||||
@@ -976,42 +976,69 @@ class _SettingsContentState extends ConsumerState<_SettingsContent> {
|
|||||||
final isRu = settings.languageCode == 'ru';
|
final isRu = settings.languageCode == 'ru';
|
||||||
final theme = Theme.of(context);
|
final theme = Theme.of(context);
|
||||||
|
|
||||||
|
final isDark = theme.brightness == Brightness.dark;
|
||||||
|
|
||||||
final selectedSource = await showModalBottomSheet<UpdateSource>(
|
final selectedSource = await showModalBottomSheet<UpdateSource>(
|
||||||
context: context,
|
context: context,
|
||||||
|
useRootNavigator: true,
|
||||||
|
isScrollControlled: true,
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
builder: (sheetContext) {
|
builder: (sheetContext) {
|
||||||
return Container(
|
return ClipRRect(
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: theme.colorScheme.surface,
|
|
||||||
borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
|
borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
|
||||||
|
child: BackdropFilter(
|
||||||
|
filter: ImageFilter.blur(sigmaX: 24, sigmaY: 24),
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: isDark
|
||||||
|
? theme.colorScheme.surface.withValues(alpha: 0.88)
|
||||||
|
: Colors.white.withValues(alpha: 0.94),
|
||||||
|
borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
|
||||||
|
border: Border(
|
||||||
|
top: BorderSide(
|
||||||
|
color: isDark
|
||||||
|
? Colors.white.withValues(alpha: 0.18)
|
||||||
|
: Colors.white.withValues(alpha: 0.85),
|
||||||
|
width: 1.2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: SafeArea(
|
||||||
|
top: false,
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.fromLTRB(
|
||||||
|
20,
|
||||||
|
14,
|
||||||
|
20,
|
||||||
|
24 + MediaQuery.paddingOf(sheetContext).bottom,
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.fromLTRB(20, 12, 20, 28),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
Center(
|
Center(
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 36,
|
width: 38,
|
||||||
height: 4,
|
height: 4.5,
|
||||||
margin: const EdgeInsets.only(bottom: 16),
|
margin: const EdgeInsets.only(bottom: 16),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: theme.colorScheme.onSurfaceVariant.withValues(alpha: 0.3),
|
color: theme.colorScheme.onSurfaceVariant.withValues(alpha: 0.35),
|
||||||
borderRadius: BorderRadius.circular(2),
|
borderRadius: BorderRadius.circular(3),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
isRu ? 'Источник обновлений' : 'Update Source',
|
isRu ? 'Источник обновлений' : 'Update Source',
|
||||||
style: theme.textTheme.titleMedium?.copyWith(
|
style: theme.textTheme.titleMedium?.copyWith(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.w800,
|
||||||
|
letterSpacing: -0.3,
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 6),
|
const SizedBox(height: 6),
|
||||||
Text(
|
Text(
|
||||||
isRu
|
isRu
|
||||||
? 'Выберите сервер для загрузки обновлений'
|
? 'Выберите сервер для быстрой загрузки новой версии'
|
||||||
: 'Choose a server to download updates from',
|
: 'Choose a server to download updates from',
|
||||||
style: theme.textTheme.bodySmall?.copyWith(
|
style: theme.textTheme.bodySmall?.copyWith(
|
||||||
color: theme.colorScheme.onSurfaceVariant,
|
color: theme.colorScheme.onSurfaceVariant,
|
||||||
@@ -1022,28 +1049,55 @@ class _SettingsContentState extends ConsumerState<_SettingsContent> {
|
|||||||
|
|
||||||
// Option 1: GitHub (Recommended for speed)
|
// Option 1: GitHub (Recommended for speed)
|
||||||
Material(
|
Material(
|
||||||
color: theme.colorScheme.primaryContainer.withValues(alpha: 0.35),
|
color: isDark
|
||||||
borderRadius: BorderRadius.circular(16),
|
? theme.colorScheme.primaryContainer.withValues(alpha: 0.35)
|
||||||
|
: theme.colorScheme.primary.withValues(alpha: 0.08),
|
||||||
|
borderRadius: BorderRadius.circular(18),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
borderRadius: BorderRadius.circular(16),
|
borderRadius: BorderRadius.circular(18),
|
||||||
onTap: () => Navigator.pop(sheetContext, UpdateSource.github),
|
onTap: () {
|
||||||
child: Padding(
|
HapticFeedback.selectionClick();
|
||||||
|
Navigator.pop(sheetContext, UpdateSource.github);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(18),
|
||||||
|
border: Border.all(
|
||||||
|
color: isDark
|
||||||
|
? Colors.white.withValues(alpha: 0.15)
|
||||||
|
: theme.colorScheme.primary.withValues(alpha: 0.35),
|
||||||
|
width: 1.2,
|
||||||
|
),
|
||||||
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: 44,
|
width: 44,
|
||||||
height: 44,
|
height: 44,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: theme.colorScheme.primary.withValues(alpha: 0.15),
|
gradient: const LinearGradient(
|
||||||
borderRadius: BorderRadius.circular(12),
|
colors: [Color(0xFF6366F1), Color(0xFF4F46E5)],
|
||||||
|
begin: Alignment.topLeft,
|
||||||
|
end: Alignment.bottomRight,
|
||||||
),
|
),
|
||||||
|
borderRadius: BorderRadius.circular(13),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: const Color(0xFF6366F1).withValues(alpha: 0.40),
|
||||||
|
blurRadius: 10,
|
||||||
|
offset: const Offset(0, 3),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: const Center(
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.bolt_rounded,
|
Icons.bolt_rounded,
|
||||||
color: theme.colorScheme.primary,
|
color: Colors.white,
|
||||||
size: 24,
|
size: 24,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
const SizedBox(width: 14),
|
const SizedBox(width: 14),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -1054,24 +1108,24 @@ class _SettingsContentState extends ConsumerState<_SettingsContent> {
|
|||||||
Text(
|
Text(
|
||||||
'GitHub',
|
'GitHub',
|
||||||
style: theme.textTheme.titleSmall?.copyWith(
|
style: theme.textTheme.titleSmall?.copyWith(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.w700,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 6,
|
horizontal: 7,
|
||||||
vertical: 2,
|
vertical: 2.5,
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.green.withValues(alpha: 0.2),
|
color: Colors.green.withValues(alpha: 0.20),
|
||||||
borderRadius: BorderRadius.circular(6),
|
borderRadius: BorderRadius.circular(6),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
isRu ? 'Рекомендуется для скорости' : 'Recommended for speed',
|
isRu ? 'Рекомендуется' : 'Recommended',
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 10,
|
fontSize: 10.5,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.w700,
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -1081,7 +1135,7 @@ class _SettingsContentState extends ConsumerState<_SettingsContent> {
|
|||||||
const SizedBox(height: 3),
|
const SizedBox(height: 3),
|
||||||
Text(
|
Text(
|
||||||
isRu
|
isRu
|
||||||
? 'Прямая быстрая загрузка без ограничений'
|
? 'Прямая быстрая загрузка релизов без задержек'
|
||||||
: 'Direct fast download without limits',
|
: 'Direct fast download without limits',
|
||||||
style: theme.textTheme.bodySmall?.copyWith(
|
style: theme.textTheme.bodySmall?.copyWith(
|
||||||
color: theme.colorScheme.onSurfaceVariant,
|
color: theme.colorScheme.onSurfaceVariant,
|
||||||
@@ -1092,7 +1146,7 @@ class _SettingsContentState extends ConsumerState<_SettingsContent> {
|
|||||||
),
|
),
|
||||||
Icon(
|
Icon(
|
||||||
Icons.arrow_forward_ios_rounded,
|
Icons.arrow_forward_ios_rounded,
|
||||||
size: 14,
|
size: 15,
|
||||||
color: theme.colorScheme.onSurfaceVariant,
|
color: theme.colorScheme.onSurfaceVariant,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -1102,49 +1156,75 @@ class _SettingsContentState extends ConsumerState<_SettingsContent> {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
|
|
||||||
// Option 2: Gitea (Muted / neutral grey)
|
// Option 2: Gitea
|
||||||
Material(
|
Material(
|
||||||
color: theme.colorScheme.surfaceContainerHighest.withValues(alpha: 0.25),
|
color: isDark
|
||||||
borderRadius: BorderRadius.circular(16),
|
? theme.colorScheme.surfaceContainerHighest.withValues(alpha: 0.35)
|
||||||
|
: theme.colorScheme.surfaceContainerHighest.withValues(alpha: 0.40),
|
||||||
|
borderRadius: BorderRadius.circular(18),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
borderRadius: BorderRadius.circular(16),
|
borderRadius: BorderRadius.circular(18),
|
||||||
onTap: () => Navigator.pop(sheetContext, UpdateSource.gitea),
|
onTap: () {
|
||||||
child: Padding(
|
HapticFeedback.selectionClick();
|
||||||
|
Navigator.pop(sheetContext, UpdateSource.gitea);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(18),
|
||||||
|
border: Border.all(
|
||||||
|
color: isDark
|
||||||
|
? Colors.white.withValues(alpha: 0.12)
|
||||||
|
: theme.colorScheme.outlineVariant.withValues(alpha: 0.35),
|
||||||
|
width: 1.2,
|
||||||
|
),
|
||||||
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: 44,
|
width: 44,
|
||||||
height: 44,
|
height: 44,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: theme.colorScheme.onSurface.withValues(alpha: 0.08),
|
gradient: const LinearGradient(
|
||||||
borderRadius: BorderRadius.circular(12),
|
colors: [Color(0xFF0EA5E9), Color(0xFF0284C7)],
|
||||||
|
begin: Alignment.topLeft,
|
||||||
|
end: Alignment.bottomRight,
|
||||||
),
|
),
|
||||||
|
borderRadius: BorderRadius.circular(13),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: const Color(0xFF0EA5E9).withValues(alpha: 0.35),
|
||||||
|
blurRadius: 10,
|
||||||
|
offset: const Offset(0, 3),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: const Center(
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.dns_rounded,
|
Icons.dns_rounded,
|
||||||
color: theme.colorScheme.onSurfaceVariant,
|
color: Colors.white,
|
||||||
size: 22,
|
size: 22,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
const SizedBox(width: 14),
|
const SizedBox(width: 14),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Gitea',
|
'Gitea (Synapse)',
|
||||||
style: theme.textTheme.titleSmall?.copyWith(
|
style: theme.textTheme.titleSmall?.copyWith(
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w700,
|
||||||
color: theme.colorScheme.onSurfaceVariant,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 3),
|
const SizedBox(height: 3),
|
||||||
Text(
|
Text(
|
||||||
isRu
|
isRu
|
||||||
? 'Сервер релизов'
|
? 'Альтернативный независимый сервер релизов'
|
||||||
: 'Release server',
|
: 'Alternative independent release mirror',
|
||||||
style: theme.textTheme.bodySmall?.copyWith(
|
style: theme.textTheme.bodySmall?.copyWith(
|
||||||
color: theme.colorScheme.onSurfaceVariant.withValues(alpha: 0.7),
|
color: theme.colorScheme.onSurfaceVariant,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -1152,8 +1232,8 @@ class _SettingsContentState extends ConsumerState<_SettingsContent> {
|
|||||||
),
|
),
|
||||||
Icon(
|
Icon(
|
||||||
Icons.arrow_forward_ios_rounded,
|
Icons.arrow_forward_ios_rounded,
|
||||||
size: 14,
|
size: 15,
|
||||||
color: theme.colorScheme.onSurfaceVariant.withValues(alpha: 0.5),
|
color: theme.colorScheme.onSurfaceVariant,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -1162,6 +1242,10 @@ class _SettingsContentState extends ConsumerState<_SettingsContent> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
|
import 'dart:ui';
|
||||||
|
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
|
||||||
@@ -156,28 +159,56 @@ class _ViewedScreenState extends ConsumerState<ViewedScreen> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final bottomInset = MediaQuery.paddingOf(context).bottom;
|
||||||
|
|
||||||
return RefreshIndicator(
|
return RefreshIndicator(
|
||||||
onRefresh: () =>
|
onRefresh: () =>
|
||||||
ref.read(viewedControllerProvider.notifier).refresh(),
|
ref.read(viewedControllerProvider.notifier).refresh(),
|
||||||
child: ListView(
|
child: ListView(
|
||||||
padding: const EdgeInsets.fromLTRB(16, 8, 16, 24),
|
padding: EdgeInsets.fromLTRB(16, 8, 16, 140 + bottomInset),
|
||||||
children: [
|
children: [
|
||||||
for (final group in groups) ...[
|
for (final group in groups) ...[
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(4, 16, 4, 10),
|
padding: const EdgeInsets.fromLTRB(2, 16, 2, 10),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
Container(
|
||||||
Icons.calendar_today_rounded,
|
width: 28,
|
||||||
size: 16,
|
height: 28,
|
||||||
color: Theme.of(context).colorScheme.primary,
|
decoration: BoxDecoration(
|
||||||
|
gradient: LinearGradient(
|
||||||
|
colors: [
|
||||||
|
Theme.of(context).colorScheme.primary,
|
||||||
|
Theme.of(context).colorScheme.primary.withValues(alpha: 0.82),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
borderRadius: BorderRadius.circular(9),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.primary
|
||||||
|
.withValues(alpha: 0.32),
|
||||||
|
blurRadius: 6,
|
||||||
|
offset: const Offset(0, 2),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: const Center(
|
||||||
|
child: Icon(
|
||||||
|
Icons.calendar_today_rounded,
|
||||||
|
size: 14,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 10),
|
||||||
Text(
|
Text(
|
||||||
_localizedGroupLabel(group.label, isRu),
|
_localizedGroupLabel(group.label, isRu),
|
||||||
style:
|
style:
|
||||||
Theme.of(context).textTheme.titleSmall?.copyWith(
|
Theme.of(context).textTheme.titleSmall?.copyWith(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
|
letterSpacing: -0.2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
@@ -187,10 +218,24 @@ class _ViewedScreenState extends ConsumerState<ViewedScreen> {
|
|||||||
vertical: 2,
|
vertical: 2,
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context)
|
color: Theme.of(context).brightness == Brightness.dark
|
||||||
|
? Theme.of(context)
|
||||||
.colorScheme
|
.colorScheme
|
||||||
.surfaceContainerHighest,
|
.surfaceContainerHighest
|
||||||
|
.withValues(alpha: 0.5)
|
||||||
|
: Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.primary
|
||||||
|
.withValues(alpha: 0.12),
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
border: Border.all(
|
||||||
|
color: Theme.of(context).brightness == Brightness.dark
|
||||||
|
? Colors.white.withValues(alpha: 0.08)
|
||||||
|
: Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.primary
|
||||||
|
.withValues(alpha: 0.20),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
'${group.items.length}',
|
'${group.items.length}',
|
||||||
@@ -198,7 +243,10 @@ class _ViewedScreenState extends ConsumerState<ViewedScreen> {
|
|||||||
.textTheme
|
.textTheme
|
||||||
.labelSmall
|
.labelSmall
|
||||||
?.copyWith(
|
?.copyWith(
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w700,
|
||||||
|
color: Theme.of(context).brightness == Brightness.dark
|
||||||
|
? Theme.of(context).colorScheme.onSurfaceVariant
|
||||||
|
: Theme.of(context).colorScheme.primary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -299,40 +347,86 @@ class _ViewedPostTile extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final scheme = Theme.of(context).colorScheme;
|
final scheme = Theme.of(context).colorScheme;
|
||||||
|
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||||
final image = MediaUrlSelector.preview(post).firstOrNull;
|
final image = MediaUrlSelector.preview(post).firstOrNull;
|
||||||
final timeStr =
|
final timeStr =
|
||||||
'${viewedAt.hour.toString().padLeft(2, '0')}:${viewedAt.minute.toString().padLeft(2, '0')}';
|
'${viewedAt.hour.toString().padLeft(2, '0')}:${viewedAt.minute.toString().padLeft(2, '0')}';
|
||||||
|
|
||||||
return Card(
|
return Container(
|
||||||
elevation: 0,
|
margin: const EdgeInsets.only(bottom: 10),
|
||||||
color: scheme.surfaceContainerLow,
|
decoration: BoxDecoration(
|
||||||
margin: const EdgeInsets.only(bottom: 8),
|
borderRadius: BorderRadius.circular(20),
|
||||||
shape: RoundedRectangleBorder(
|
boxShadow: [
|
||||||
borderRadius: BorderRadius.circular(16),
|
BoxShadow(
|
||||||
side: BorderSide(
|
color: Colors.black.withValues(alpha: isDark ? 0.28 : 0.05),
|
||||||
color: scheme.outlineVariant.withValues(alpha: 0.3),
|
blurRadius: 14,
|
||||||
|
offset: const Offset(0, 4),
|
||||||
|
spreadRadius: -2,
|
||||||
),
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
clipBehavior: Clip.antiAlias,
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
child: BackdropFilter(
|
||||||
|
filter: ImageFilter.blur(sigmaX: 16, sigmaY: 16),
|
||||||
|
child: Material(
|
||||||
|
color: Colors.transparent,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: onOpen,
|
borderRadius: BorderRadius.circular(20),
|
||||||
child: Padding(
|
onTap: () {
|
||||||
|
HapticFeedback.selectionClick();
|
||||||
|
onOpen();
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
padding: const EdgeInsets.all(10),
|
padding: const EdgeInsets.all(10),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
gradient: LinearGradient(
|
||||||
|
begin: Alignment.topLeft,
|
||||||
|
end: Alignment.bottomRight,
|
||||||
|
colors: isDark
|
||||||
|
? [
|
||||||
|
scheme.surfaceContainerHigh
|
||||||
|
.withValues(alpha: 0.58),
|
||||||
|
scheme.surfaceContainerLow
|
||||||
|
.withValues(alpha: 0.36),
|
||||||
|
]
|
||||||
|
: [
|
||||||
|
Colors.white.withValues(alpha: 0.88),
|
||||||
|
Colors.white.withValues(alpha: 0.72),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
border: Border.all(
|
||||||
|
color: isDark
|
||||||
|
? Colors.white.withValues(alpha: 0.13)
|
||||||
|
: Colors.white.withValues(alpha: 0.85),
|
||||||
|
width: 1.1,
|
||||||
|
),
|
||||||
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
// Squircle Thumbnail
|
// Squircle Thumbnail
|
||||||
ClipRRect(
|
ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(13),
|
||||||
child: SizedBox(
|
child: Container(
|
||||||
width: 68,
|
width: 68,
|
||||||
height: 68,
|
height: 68,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(
|
||||||
|
color: isDark
|
||||||
|
? Colors.white.withValues(alpha: 0.10)
|
||||||
|
: scheme.outlineVariant.withValues(alpha: 0.30),
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(13),
|
||||||
|
),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
fit: StackFit.expand,
|
fit: StackFit.expand,
|
||||||
children: [
|
children: [
|
||||||
image == null
|
image == null
|
||||||
? Container(
|
? Container(
|
||||||
color: scheme.surfaceContainerHighest,
|
color: scheme.surfaceContainerHighest,
|
||||||
child: const Icon(Icons.image_not_supported_rounded),
|
child: const Icon(
|
||||||
|
Icons.image_not_supported_rounded),
|
||||||
)
|
)
|
||||||
: CachedNetworkImage(
|
: CachedNetworkImage(
|
||||||
imageUrl: image,
|
imageUrl: image,
|
||||||
@@ -356,7 +450,7 @@ class _ViewedPostTile extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.all(3),
|
padding: const EdgeInsets.all(3),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.black.withValues(alpha: 0.65),
|
color: Colors.black.withValues(alpha: 0.65),
|
||||||
borderRadius: BorderRadius.circular(4),
|
borderRadius: BorderRadius.circular(5),
|
||||||
),
|
),
|
||||||
child: const Icon(
|
child: const Icon(
|
||||||
Icons.play_arrow_rounded,
|
Icons.play_arrow_rounded,
|
||||||
@@ -380,13 +474,17 @@ class _ViewedPostTile extends StatelessWidget {
|
|||||||
Flexible(
|
Flexible(
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 6,
|
horizontal: 7,
|
||||||
vertical: 2,
|
vertical: 2,
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color:
|
color: scheme.primary
|
||||||
scheme.primaryContainer.withValues(alpha: 0.5),
|
.withValues(alpha: isDark ? 0.20 : 0.12),
|
||||||
borderRadius: BorderRadius.circular(6),
|
borderRadius: BorderRadius.circular(6),
|
||||||
|
border: Border.all(
|
||||||
|
color: scheme.primary.withValues(
|
||||||
|
alpha: isDark ? 0.30 : 0.20),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
post.providerName,
|
post.providerName,
|
||||||
@@ -396,8 +494,8 @@ class _ViewedPostTile extends StatelessWidget {
|
|||||||
.textTheme
|
.textTheme
|
||||||
.labelSmall
|
.labelSmall
|
||||||
?.copyWith(
|
?.copyWith(
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w700,
|
||||||
color: scheme.onPrimaryContainer,
|
color: scheme.primary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -410,6 +508,7 @@ class _ViewedPostTile extends StatelessWidget {
|
|||||||
.labelSmall
|
.labelSmall
|
||||||
?.copyWith(
|
?.copyWith(
|
||||||
color: scheme.onSurfaceVariant,
|
color: scheme.onSurfaceVariant,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -420,7 +519,8 @@ class _ViewedPostTile extends StatelessWidget {
|
|||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w600,
|
||||||
|
letterSpacing: -0.1,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (post.score != 0) ...[
|
if (post.score != 0) ...[
|
||||||
@@ -440,6 +540,7 @@ class _ViewedPostTile extends StatelessWidget {
|
|||||||
.labelSmall
|
.labelSmall
|
||||||
?.copyWith(
|
?.copyWith(
|
||||||
color: scheme.outline,
|
color: scheme.outline,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -452,24 +553,35 @@ class _ViewedPostTile extends StatelessWidget {
|
|||||||
IconButton(
|
IconButton(
|
||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
constraints: const BoxConstraints(minWidth: 36, minHeight: 36),
|
constraints:
|
||||||
|
const BoxConstraints(minWidth: 36, minHeight: 36),
|
||||||
tooltip: isFavorite
|
tooltip: isFavorite
|
||||||
? (isRu ? 'В избранном' : 'In favorites')
|
? (isRu ? 'В избранном' : 'In favorites')
|
||||||
: (isRu ? 'В избранное' : 'Add to favorites'),
|
: (isRu ? 'В избранное' : 'Add to favorites'),
|
||||||
onPressed: onFavorite,
|
onPressed: () {
|
||||||
|
HapticFeedback.selectionClick();
|
||||||
|
onFavorite();
|
||||||
|
},
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
isFavorite
|
isFavorite
|
||||||
? Icons.favorite_rounded
|
? Icons.favorite_rounded
|
||||||
: Icons.favorite_border_rounded,
|
: Icons.favorite_border_rounded,
|
||||||
color: isFavorite ? Colors.redAccent : scheme.onSurfaceVariant,
|
color: isFavorite
|
||||||
|
? Colors.redAccent
|
||||||
|
: scheme.onSurfaceVariant,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
constraints: const BoxConstraints(minWidth: 36, minHeight: 36),
|
constraints:
|
||||||
tooltip: isRu ? 'Удалить из истории' : 'Delete from history',
|
const BoxConstraints(minWidth: 36, minHeight: 36),
|
||||||
onPressed: onDelete,
|
tooltip:
|
||||||
|
isRu ? 'Удалить из истории' : 'Delete from history',
|
||||||
|
onPressed: () {
|
||||||
|
HapticFeedback.lightImpact();
|
||||||
|
onDelete();
|
||||||
|
},
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.close_rounded,
|
Icons.close_rounded,
|
||||||
size: 20,
|
size: 20,
|
||||||
@@ -480,6 +592,9 @@ class _ViewedPostTile extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ class PostMasonryGrid extends StatelessWidget {
|
|||||||
this.loading = false,
|
this.loading = false,
|
||||||
this.controller,
|
this.controller,
|
||||||
this.gridMode = 'masonry',
|
this.gridMode = 'masonry',
|
||||||
|
this.padding,
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -51,11 +52,19 @@ class PostMasonryGrid extends StatelessWidget {
|
|||||||
final bool loading;
|
final bool loading;
|
||||||
final ScrollController? controller;
|
final ScrollController? controller;
|
||||||
final String gridMode;
|
final String gridMode;
|
||||||
|
final EdgeInsetsGeometry? padding;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final mobile = Responsive.isMobile(context);
|
final mobile = Responsive.isMobile(context);
|
||||||
final pad = EdgeInsets.all(mobile ? 8 : 16);
|
final bottomInset = MediaQuery.paddingOf(context).bottom;
|
||||||
|
final pad = padding ??
|
||||||
|
EdgeInsets.fromLTRB(
|
||||||
|
mobile ? 8 : 16,
|
||||||
|
mobile ? 8 : 16,
|
||||||
|
mobile ? 8 : 16,
|
||||||
|
(mobile ? 8 : 16) + (mobile ? (120.0 + bottomInset) : 0.0),
|
||||||
|
);
|
||||||
final spacing = mobile ? 8.0 : 12.0;
|
final spacing = mobile ? 8.0 : 12.0;
|
||||||
|
|
||||||
Widget buildCard(Post post) {
|
Widget buildCard(Post post) {
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
name: gel_rule_app
|
name: gel_rule_app
|
||||||
description: Local backend/core layer for a Flutter booru browser app.
|
description: Local backend/core layer for a Flutter booru browser app.
|
||||||
publish_to: "none"
|
publish_to: "none"
|
||||||
version: 3.0.9+60
|
version: 3.1.0+61
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.3.0 <4.0.0"
|
sdk: ">=3.3.0 <4.0.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user