Compare commits

..
4 Commits
Author SHA1 Message Date
RarDog ec594595c9 fix: adjust settings button position and backup/json buttons layout (v3.0.9)
Build and Release / Build Windows x64 (push) Has been cancelled
2026-09-04 18:42:00 +03:00
RarDog 586e3fc4db feat: iPhone-style liquid glass settings and floating button (v3.0.8)
Build and Release / Build Windows x64 (push) Has been cancelled
2026-09-04 18:32:16 +03:00
RarDog 61c2d0561c feat: liquid glass bottom navigation bar with animated pill and tap micro-animations (v3.0.7)
Build and Release / Build Windows x64 (push) Has been cancelled
2026-09-04 18:19:58 +03:00
RarDog dff2cd806d feat: improve recent searches and tags visibility, deduplication and UI (v3.0.6)
Build and Release / Build Windows x64 (push) Has been cancelled
2026-09-04 18:06:46 +03:00
10 changed files with 869 additions and 192 deletions
+1 -1
View File
@@ -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.5-8A2BE2?style=for-the-badge&logo=semver&logoColor=white" alt="Version 3.0.5" /></a> <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>
<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>
+2 -2
View File
@@ -1,3 +1,3 @@
const appDisplayVersion = '3.0.5'; const appDisplayVersion = '3.0.9';
const appBuildNumber = 56; const appBuildNumber = 60;
const appReleaseChannel = 'Stable'; const appReleaseChannel = 'Stable';
+39
View File
@@ -1,4 +1,43 @@
const lunarisChangelog = [ const lunarisChangelog = [
LunarisChange(
version: '3.0.9',
title: 'Коррекция позиции кнопки настроек и отображения кнопок JSON и бэкапа',
bullets: [
'Оптимальная позиция кнопки настроек: парящая стеклянная кнопка опущена прямо к нижней навигационной панели, без избыточного завышения над карточками контента.',
'Полная видимость кнопок JSON и бэкапа: добавлен увеличенный нижний отступ прокрутки в настройках, чтобы панель навигации не перекрывала кнопки при скролле до конца.',
'Улучшенный дизайн и сетка кнопок экспорта/импорта: кнопки бэкапа и JSON организованы в симметричные аккуратные строки с яркими акцентными бейджами.',
],
),
LunarisChange(
version: '3.0.8',
title: 'iPhone Liquid Glass — раздел «Настройки» и парящая стеклянная кнопка',
bullets: [
'Парящая стеклянная кнопка настроек (Liquid Glass Floating Button): круглая сфера из матового стекла с эффектом BackdropFilter blur, зеркальным радиальным градиентом, подсветкой ободка, пружинящей анимацией масштабирования и вращения при нажатии.',
'Карточки настроек в стиле Liquid Glass (1:1 iOS): группы настроек переработаны в матовые стеклянные карточки с мягким градиентом, зеркальной рамкой и многослойными тенями глубины.',
'Иконки разделов и пунктов в стиле iOS: яркие сквиркл-бейджи с акцентными градиентами, мягким свечением и четкими белыми иконками, как в нативных настройках iPhone.',
'Стеклянная быстрая навигация по категориям: зафиксированная панель категорий с размытием фона и тактильным откликом при переключении разделов.',
],
),
LunarisChange(
version: '3.0.7',
title: 'Liquid Glass Navigation Bar — парящая стеклянная панель и анимированная пилюля',
bullets: [
'Парящая панель Liquid Glass: нижняя панель навигации преобразована в парящий стеклянный док со скруглением, полупрозрачным градиентом и размытием фона (BackdropFilter blur).',
'Плавающая пилюля-индикатор (Liquid Pill): плавный анимированный бегунок перетекает под активную вкладку со сглаженной пружинящей физикой (easeOutBack).',
'Микроанимации нажатия и тактильный отклик: иконки мягко сжимаются при тапе и отпружинивают назад с легким тактильным виброоткликом (Haptic Feedback).',
'Глубина контента: контент ленты, поиска и галереи плавно просвечивает и размывается под стеклянной панелью при прокрутке.',
],
),
LunarisChange(
version: '3.0.6',
title: 'Улучшение недавних запросов и отображения тегов',
bullets: [
'Полная видимость тегов и запросов: сняты тесные ограничения ширины (140px), теги и поисковые запросы теперь отображаются целиком без усечения.',
'Устранение дубликатов в истории: автоматическая дедупликация поисковых запросов в базе данных и интерфейсе. Устранены повторяющиеся пары запросов с пустыми счетчиками.',
'Исправление заголовка карточки поиска: заголовок «Недавние запросы» и счетчик больше не обрезаются на экранах смартфонов.',
'Удобное удаление: увеличенная область нажатия для кнопки удаления (крестика) предотвращает случайные нажатия на сам запрос.',
],
),
LunarisChange( LunarisChange(
version: '3.0.5', version: '3.0.5',
title: 'Интерактивные ссылки на соцсети и авторов в объявлениях и описаниях', title: 'Интерактивные ссылки на соцсети и авторов в объявлениях и описаниях',
@@ -12,6 +12,15 @@ class SearchRepository {
Future<Result<void>> save(SearchHistory history, {int maxItems = 500}) { Future<Result<void>> save(SearchHistory history, {int maxItems = 500}) {
return _databaseService.safeWrite((isar) async { return _databaseService.safeWrite((isar) async {
final norm = history.query.trim().toLowerCase();
// Remove any existing duplicate records with same query
final all = await isar.searchHistoryEntitys.where().findAll();
for (final item in all) {
if (item.query.trim().toLowerCase() == norm) {
await isar.searchHistoryEntitys.delete(item.isarId);
}
}
await isar.searchHistoryEntitys.put( await isar.searchHistoryEntitys.put(
SearchHistoryEntity() SearchHistoryEntity()
..historyId = history.id ..historyId = history.id
@@ -42,13 +51,40 @@ class SearchRepository {
return _databaseService.safeRead((isar) async { return _databaseService.safeRead((isar) async {
final items = await isar.searchHistoryEntitys.where().findAll(); final items = await isar.searchHistoryEntitys.where().findAll();
items.sort((a, b) => b.searchedAt.compareTo(a.searchedAt)); items.sort((a, b) => b.searchedAt.compareTo(a.searchedAt));
final limited = limit == null ? items : items.take(limit);
final seen = <String>{};
final deduplicated = <SearchHistoryEntity>[];
for (final item in items) {
final key = item.query.trim().toLowerCase();
if (key.isEmpty) continue;
if (seen.add(key)) {
deduplicated.add(item);
}
}
final limited = limit == null ? deduplicated : deduplicated.take(limit);
return limited.map((entity) => entity.toModel()).toList(); return limited.map((entity) => entity.toModel()).toList();
}); });
} }
Future<Result<bool>> delete(String historyId) { Future<Result<bool>> delete(String historyId) {
return _databaseService.safeWrite((isar) async { return _databaseService.safeWrite((isar) async {
final target = await isar.searchHistoryEntitys
.where()
.filter()
.historyIdEqualTo(historyId)
.findFirst();
if (target != null) {
final norm = target.query.trim().toLowerCase();
final all = await isar.searchHistoryEntitys.where().findAll();
for (final item in all) {
if (item.query.trim().toLowerCase() == norm ||
item.historyId == historyId) {
await isar.searchHistoryEntitys.delete(item.isarId);
}
}
return true;
}
return await isar.searchHistoryEntitys.deleteByHistoryId(historyId); return await isar.searchHistoryEntitys.deleteByHistoryId(historyId);
}); });
} }
@@ -123,14 +123,18 @@ class FeedController extends AsyncNotifier<FeedState> {
final settingsRes = await ref.read(settingsServiceProvider).getSettings(); final settingsRes = await ref.read(settingsServiceProvider).getSettings();
final settings = final settings =
settingsRes is Success<AppSettings> ? settingsRes.data : AppSettings.defaults; settingsRes is Success<AppSettings> ? settingsRes.data : AppSettings.defaults;
await ref try {
.read(searchServiceProvider) await refresh();
.saveSearch(query, 0, maxHistory: settings.searchHistoryLimit); final count = state.value?.posts.length ?? 0;
await refresh(); await ref
final count = state.value?.posts.length ?? 0; .read(searchServiceProvider)
await ref .saveSearch(query, count, maxHistory: settings.searchHistoryLimit);
.read(searchServiceProvider) } catch (_) {
.saveSearch(query, count, maxHistory: settings.searchHistoryLimit); await ref
.read(searchServiceProvider)
.saveSearch(query, 0, maxHistory: settings.searchHistoryLimit);
rethrow;
}
} }
Future<void> updateTagSuggestions(String query) async { Future<void> updateTagSuggestions(String query) async {
@@ -175,10 +175,21 @@ class _SearchScreenState extends ConsumerState<SearchScreen> {
icon: Icons.history_rounded, icon: Icons.history_rounded,
accentColor: const Color(0xFF6366F1), accentColor: const Color(0xFF6366F1),
title: isRu ? 'Недавние запросы' : 'Recent searches', title: isRu ? 'Недавние запросы' : 'Recent searches',
badgeCount: data.recent.length, badgeCount: data.recent
.map((e) => e.query.trim().toLowerCase())
.where((q) => q.isNotEmpty)
.toSet()
.length,
trailing: data.recent.isEmpty trailing: data.recent.isEmpty
? null ? null
: TextButton( : TextButton(
style: TextButton.styleFrom(
visualDensity: VisualDensity.compact,
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 4),
minimumSize: Size.zero,
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
onPressed: () => ref onPressed: () => ref
.read(searchControllerProvider.notifier) .read(searchControllerProvider.notifier)
.clearHistory(), .clearHistory(),
@@ -390,9 +401,10 @@ class _SearchSectionCard extends StatelessWidget {
), ),
child: Icon(icon, size: 18, color: accentColor), child: Icon(icon, size: 18, color: accentColor),
), ),
const SizedBox(width: 12), const SizedBox(width: 10),
Expanded( Expanded(
child: Row( child: Row(
mainAxisSize: MainAxisSize.min,
children: [ children: [
Flexible( Flexible(
child: Text( child: Text(
@@ -401,6 +413,7 @@ class _SearchSectionCard extends StatelessWidget {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: theme.textTheme.titleMedium?.copyWith( style: theme.textTheme.titleMedium?.copyWith(
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 15,
), ),
), ),
), ),
@@ -408,7 +421,7 @@ class _SearchSectionCard extends StatelessWidget {
const SizedBox(width: 8), const SizedBox(width: 8),
Container( Container(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 8, vertical: 2), horizontal: 7, vertical: 2),
decoration: BoxDecoration( decoration: BoxDecoration(
color: accentColor.withValues(alpha: 0.15), color: accentColor.withValues(alpha: 0.15),
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
@@ -47,8 +47,44 @@ class _RecentSearchesState extends State<RecentSearches> {
); );
} }
// Deduplicate items by normalized query
final seen = <String>{};
final uniqueItems = <SearchHistory>[];
for (final item in widget.items) {
final key = item.query.trim().toLowerCase();
if (key.isEmpty) continue;
if (seen.add(key)) {
uniqueItems.add(item);
}
}
if (uniqueItems.isEmpty) {
return Container(
padding: const EdgeInsets.symmetric(vertical: 24, horizontal: 16),
alignment: Alignment.center,
child: Column(
children: [
Icon(
Icons.history_toggle_off_rounded,
size: 40,
color: theme.colorScheme.onSurfaceVariant.withValues(alpha: 0.5),
),
const SizedBox(height: 10),
Text(
'История поиска пуста',
style: theme.textTheme.bodyMedium?.copyWith(
color: theme.colorScheme.onSurfaceVariant,
),
),
],
),
);
}
final visibleItems = final visibleItems =
_expanded ? widget.items : widget.items.take(20).toList(); _expanded ? uniqueItems : uniqueItems.take(20).toList();
final screenW = MediaQuery.sizeOf(context).width;
final maxQueryWidth = (screenW - 200).clamp(180.0, 480.0);
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@@ -66,7 +102,7 @@ class _RecentSearchesState extends State<RecentSearches> {
onTap: () => widget.onTap(item.query), onTap: () => widget.onTap(item.query),
child: Container( child: Container(
padding: padding:
const EdgeInsets.symmetric(horizontal: 12, vertical: 6), const EdgeInsets.only(left: 10, right: 6, top: 6, bottom: 6),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
border: Border.all( border: Border.all(
@@ -79,18 +115,22 @@ class _RecentSearchesState extends State<RecentSearches> {
children: [ children: [
Icon( Icon(
Icons.history_rounded, Icons.history_rounded,
size: 14, size: 15,
color: theme.colorScheme.primary, color: theme.colorScheme.primary,
), ),
const SizedBox(width: 6), const SizedBox(width: 6),
ConstrainedBox( ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 140), constraints: BoxConstraints(maxWidth: maxQueryWidth),
child: Text( child: Tooltip(
item.query, message: item.query,
maxLines: 1, waitDuration: const Duration(milliseconds: 600),
overflow: TextOverflow.ellipsis, child: Text(
style: theme.textTheme.bodyMedium?.copyWith( item.query,
fontWeight: FontWeight.w500, maxLines: 1,
overflow: TextOverflow.ellipsis,
style: theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
),
), ),
), ),
), ),
@@ -100,14 +140,14 @@ 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.secondaryContainer, color: theme.colorScheme.primary.withValues(alpha: 0.12),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
child: Text( child: Text(
'${item.resultCount}', '${item.resultCount}',
style: theme.textTheme.labelSmall?.copyWith( style: theme.textTheme.labelSmall?.copyWith(
color: theme.colorScheme.onSecondaryContainer, color: theme.colorScheme.primary,
fontSize: 10, fontSize: 11,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
@@ -115,14 +155,21 @@ class _RecentSearchesState extends State<RecentSearches> {
], ],
if (widget.onDelete != null) ...[ if (widget.onDelete != null) ...[
const SizedBox(width: 4), const SizedBox(width: 4),
GestureDetector( Material(
onTap: () => widget.onDelete!(item.id), color: Colors.transparent,
child: Padding( shape: const CircleBorder(),
padding: const EdgeInsets.all(2), clipBehavior: Clip.antiAlias,
child: Icon( child: InkWell(
Icons.close_rounded, customBorder: const CircleBorder(),
size: 14, onTap: () => widget.onDelete!(item.id),
color: theme.colorScheme.onSurfaceVariant, child: Padding(
padding: const EdgeInsets.all(4),
child: Icon(
Icons.close_rounded,
size: 15,
color: theme.colorScheme.onSurfaceVariant
.withValues(alpha: 0.75),
),
), ),
), ),
), ),
@@ -134,7 +181,7 @@ class _RecentSearchesState extends State<RecentSearches> {
), ),
], ],
), ),
if (widget.items.length > 20) ...[ if (uniqueItems.length > 20) ...[
const SizedBox(height: 10), const SizedBox(height: 10),
Center( Center(
child: TextButton.icon( child: TextButton.icon(
@@ -148,7 +195,7 @@ class _RecentSearchesState extends State<RecentSearches> {
label: Text( label: Text(
_expanded _expanded
? 'Свернуть' ? 'Свернуть'
: 'Показать все (${widget.items.length})', : 'Показать все (${uniqueItems.length})',
), ),
), ),
), ),
@@ -1,4 +1,5 @@
import 'dart:io'; import 'dart:io';
import 'dart:ui';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart' hide appBuildNumber; import 'package:flutter/services.dart' hide appBuildNumber;
@@ -150,24 +151,33 @@ class _SettingsContentState extends ConsumerState<_SettingsContent> {
return Column( return Column(
children: [ children: [
// Pinned Top Category Quick Navigation // Pinned Top Category Quick Navigation (Frosted Glass)
Container( ClipRect(
padding: const EdgeInsets.symmetric(vertical: 8), child: BackdropFilter(
decoration: BoxDecoration( filter: ImageFilter.blur(sigmaX: 18, sigmaY: 18),
color: theme.scaffoldBackgroundColor, child: Container(
border: Border( padding: const EdgeInsets.symmetric(vertical: 8),
bottom: BorderSide( decoration: BoxDecoration(
color: theme.colorScheme.outlineVariant.withValues(alpha: 0.25), color: theme.scaffoldBackgroundColor.withValues(
alpha: theme.brightness == Brightness.dark ? 0.76 : 0.82,
),
border: Border(
bottom: BorderSide(
color: theme.brightness == Brightness.dark
? Colors.white.withValues(alpha: 0.08)
: Colors.black.withValues(alpha: 0.06),
),
),
), ),
), child: Align(
), alignment: Alignment.center,
child: Align( child: ConstrainedBox(
alignment: Alignment.center, constraints: const BoxConstraints(maxWidth: 860),
child: ConstrainedBox( child: _CategoryQuickNav(
constraints: const BoxConstraints(maxWidth: 860), categories: navCategories,
child: _CategoryQuickNav( onSelect: _scrollTo,
categories: navCategories, ),
onSelect: _scrollTo, ),
), ),
), ),
), ),
@@ -177,7 +187,12 @@ class _SettingsContentState extends ConsumerState<_SettingsContent> {
Expanded( Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
controller: _scrollController, controller: _scrollController,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), padding: EdgeInsets.fromLTRB(
16,
12,
16,
120 + MediaQuery.paddingOf(context).bottom,
),
child: Align( child: Align(
alignment: Alignment.topCenter, alignment: Alignment.topCenter,
child: ConstrainedBox( child: ConstrainedBox(
@@ -1297,6 +1312,49 @@ class _SettingsContentState extends ConsumerState<_SettingsContent> {
// Settings 2.0 Modern Components // Settings 2.0 Modern Components
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
class _SettingsIconBadge extends StatelessWidget {
const _SettingsIconBadge({
required this.icon,
required this.color,
this.size = 34,
this.iconSize = 18,
});
final IconData icon;
final Color color;
final double size;
final double iconSize;
@override
Widget build(BuildContext context) {
return Container(
width: size,
height: size,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
color,
color.withValues(alpha: 0.86),
],
),
borderRadius: BorderRadius.circular(size * 0.28),
boxShadow: [
BoxShadow(
color: color.withValues(alpha: 0.35),
blurRadius: 7,
offset: const Offset(0, 2.5),
),
],
),
child: Center(
child: Icon(icon, size: iconSize, color: Colors.white),
),
);
}
}
class _CategoryQuickNav extends StatelessWidget { class _CategoryQuickNav extends StatelessWidget {
const _CategoryQuickNav({ const _CategoryQuickNav({
required this.categories, required this.categories,
@@ -1310,8 +1368,10 @@ class _CategoryQuickNav 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 SizedBox( return SizedBox(
height: 40, height: 44,
child: ListView.separated( child: ListView.separated(
padding: const EdgeInsets.symmetric(horizontal: 16), padding: const EdgeInsets.symmetric(horizontal: 16),
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
@@ -1319,32 +1379,84 @@ class _CategoryQuickNav extends StatelessWidget {
separatorBuilder: (_, __) => const SizedBox(width: 8), separatorBuilder: (_, __) => const SizedBox(width: 8),
itemBuilder: (context, index) { itemBuilder: (context, index) {
final cat = categories[index]; final cat = categories[index];
return Material( return Container(
color: theme.colorScheme.surfaceContainer, decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(22),
child: InkWell( boxShadow: [
borderRadius: BorderRadius.circular(20), BoxShadow(
onTap: () => onSelect(cat.key), color: isDark
child: Container( ? Colors.black.withValues(alpha: 0.25)
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 8), : cat.color.withValues(alpha: 0.12),
decoration: BoxDecoration( blurRadius: 8,
borderRadius: BorderRadius.circular(20), offset: const Offset(0, 2.5),
border: Border.all(
color: theme.colorScheme.outlineVariant.withValues(alpha: 0.35),
),
), ),
child: Row( ],
mainAxisSize: MainAxisSize.min, ),
children: [ child: ClipRRect(
Icon(cat.icon, size: 16, color: cat.color), borderRadius: BorderRadius.circular(22),
const SizedBox(width: 8), child: BackdropFilter(
Text( filter: ImageFilter.blur(sigmaX: 16, sigmaY: 16),
cat.label, child: Material(
style: theme.textTheme.labelLarge?.copyWith( color: isDark
fontWeight: FontWeight.w600, ? theme.colorScheme.surfaceContainerHigh.withValues(alpha: 0.60)
: Colors.white.withValues(alpha: 0.82),
child: InkWell(
borderRadius: BorderRadius.circular(22),
onTap: () {
HapticFeedback.selectionClick();
onSelect(cat.key);
},
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 7),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(22),
border: Border.all(
color: isDark
? Colors.white.withValues(alpha: 0.18)
: Colors.white.withValues(alpha: 0.85),
width: 1.1,
),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Container(
width: 24,
height: 24,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
cat.color,
cat.color.withValues(alpha: 0.82),
],
),
borderRadius: BorderRadius.circular(7),
boxShadow: [
BoxShadow(
color: cat.color.withValues(alpha: 0.35),
blurRadius: 5,
offset: const Offset(0, 1.5),
),
],
),
child: Center(
child: Icon(cat.icon, size: 14, color: Colors.white),
),
),
const SizedBox(width: 8),
Text(
cat.label,
style: theme.textTheme.labelLarge?.copyWith(
fontWeight: FontWeight.w600,
letterSpacing: -0.2,
),
),
],
), ),
), ),
], ),
), ),
), ),
), ),
@@ -1373,50 +1485,95 @@ class _SettingsCardGroup 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 Container( return Container(
key: sectionKey, key: sectionKey,
margin: const EdgeInsets.only(bottom: 16), margin: const EdgeInsets.only(bottom: 18),
decoration: BoxDecoration( decoration: BoxDecoration(
color: theme.colorScheme.surfaceContainerLow, borderRadius: BorderRadius.circular(24),
borderRadius: BorderRadius.circular(20), boxShadow: [
border: Border.all( BoxShadow(
color: theme.colorScheme.outlineVariant.withValues(alpha: 0.3), color: isDark
), ? Colors.black.withValues(alpha: 0.40)
: accentColor.withValues(alpha: 0.08),
blurRadius: 20,
offset: const Offset(0, 6),
spreadRadius: -2,
),
BoxShadow(
color: accentColor.withValues(alpha: isDark ? 0.08 : 0.04),
blurRadius: 10,
offset: const Offset(0, 2),
),
],
), ),
clipBehavior: Clip.antiAlias, child: ClipRRect(
child: Column( borderRadius: BorderRadius.circular(24),
crossAxisAlignment: CrossAxisAlignment.stretch, child: BackdropFilter(
children: [ filter: ImageFilter.blur(sigmaX: 20, sigmaY: 20),
// Header child: Container(
Padding( decoration: BoxDecoration(
padding: const EdgeInsets.fromLTRB(16, 16, 16, 10), borderRadius: BorderRadius.circular(24),
child: Row( gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: isDark
? [
theme.colorScheme.surfaceContainerHigh.withValues(alpha: 0.60),
theme.colorScheme.surfaceContainerLow.withValues(alpha: 0.40),
]
: [
Colors.white.withValues(alpha: 0.88),
Colors.white.withValues(alpha: 0.72),
],
),
border: Border.all(
color: isDark
? Colors.white.withValues(alpha: 0.15)
: Colors.white.withValues(alpha: 0.85),
width: 1.2,
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
// iOS Liquid Glass Card Header
Padding(
padding: const EdgeInsets.fromLTRB(16, 16, 16, 12),
child: Row(
children: [
_SettingsIconBadge(
icon: icon,
color: accentColor,
size: 34,
iconSize: 19,
),
const SizedBox(width: 14),
Expanded(
child: Text(
title,
style: theme.textTheme.titleMedium?.copyWith(
fontWeight: FontWeight.w700,
letterSpacing: -0.3,
),
),
),
],
),
),
Container( Container(
width: 32, height: 1,
height: 32, margin: const EdgeInsets.symmetric(horizontal: 16),
decoration: BoxDecoration( color: isDark
color: accentColor.withValues(alpha: 0.14), ? Colors.white.withValues(alpha: 0.08)
borderRadius: BorderRadius.circular(10), : theme.colorScheme.outlineVariant.withValues(alpha: 0.25),
),
child: Icon(icon, size: 18, color: accentColor),
),
const SizedBox(width: 12),
Expanded(
child: Text(
title,
style: theme.textTheme.titleMedium?.copyWith(
fontWeight: FontWeight.w700,
letterSpacing: -0.2,
),
),
), ),
...children,
], ],
), ),
), ),
const Divider(height: 1, thickness: 1, indent: 0, endIndent: 0), ),
...children,
],
), ),
); );
} }
@@ -1427,12 +1584,15 @@ class _SettingsDivider extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final isDark = Theme.of(context).brightness == Brightness.dark;
return Divider( return Divider(
height: 1, height: 1,
thickness: 0.7, thickness: 0.7,
indent: 68, indent: 64,
endIndent: 16, endIndent: 16,
color: Theme.of(context).colorScheme.outlineVariant.withValues(alpha: 0.25), color: isDark
? Colors.white.withValues(alpha: 0.07)
: Theme.of(context).colorScheme.outlineVariant.withValues(alpha: 0.25),
); );
} }
} }
@@ -1463,14 +1623,11 @@ class _SettingsTile extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
child: Row( child: Row(
children: [ children: [
Container( _SettingsIconBadge(
width: 38, icon: icon,
height: 38, color: iconColor,
decoration: BoxDecoration( size: 34,
color: iconColor.withValues(alpha: 0.12), iconSize: 18,
borderRadius: BorderRadius.circular(12),
),
child: Icon(icon, size: 20, color: iconColor),
), ),
const SizedBox(width: 14), const SizedBox(width: 14),
Expanded( Expanded(
@@ -1536,14 +1693,11 @@ class _SettingsSegmentedTile<T> extends StatelessWidget {
children: [ children: [
Row( Row(
children: [ children: [
Container( _SettingsIconBadge(
width: 38, icon: icon,
height: 38, color: iconColor,
decoration: BoxDecoration( size: 34,
color: iconColor.withValues(alpha: 0.12), iconSize: 18,
borderRadius: BorderRadius.circular(12),
),
child: Icon(icon, size: 20, color: iconColor),
), ),
const SizedBox(width: 14), const SizedBox(width: 14),
Expanded( Expanded(
@@ -1653,14 +1807,11 @@ class _SettingsStepperTile extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10), padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
child: Row( child: Row(
children: [ children: [
Container( _SettingsIconBadge(
width: 38, icon: icon,
height: 38, color: iconColor,
decoration: BoxDecoration( size: 34,
color: iconColor.withValues(alpha: 0.12), iconSize: 18,
borderRadius: BorderRadius.circular(12),
),
child: Icon(icon, size: 20, color: iconColor),
), ),
const SizedBox(width: 14), const SizedBox(width: 14),
Expanded( Expanded(
@@ -1753,18 +1904,11 @@ class _SettingsFolderStructureTile extends StatelessWidget {
children: [ children: [
Row( Row(
children: [ children: [
Container( const _SettingsIconBadge(
width: 38, icon: Icons.folder_copy_rounded,
height: 38, color: Color(0xFF0EA5E9),
decoration: BoxDecoration( size: 34,
color: const Color(0xFF0EA5E9).withValues(alpha: 0.12), iconSize: 18,
borderRadius: BorderRadius.circular(12),
),
child: const Icon(
Icons.folder_copy_rounded,
size: 20,
color: Color(0xFF0EA5E9),
),
), ),
const SizedBox(width: 14), const SizedBox(width: 14),
Expanded( Expanded(
@@ -2408,35 +2552,64 @@ class _HeroBrandBanner extends StatelessWidget {
Text( Text(
isRu ? 'Резервное копирование и экспорт' : 'Backup & JSON Export', isRu ? 'Резервное копирование и экспорт' : 'Backup & JSON Export',
style: theme.textTheme.titleSmall?.copyWith( style: theme.textTheme.titleSmall?.copyWith(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w700,
color: theme.colorScheme.onSurfaceVariant, letterSpacing: -0.2,
), ),
), ),
const SizedBox(height: 12), const SizedBox(height: 12),
Wrap( Column(
spacing: 10, crossAxisAlignment: CrossAxisAlignment.stretch,
runSpacing: 10,
alignment: WrapAlignment.center,
children: [ children: [
OutlinedButton.icon( Row(
onPressed: onExportBackup, children: [
icon: const Icon(Icons.file_upload_rounded, size: 18), Expanded(
label: Text(isRu ? 'Экспорт бэкапа' : 'Export backup'), child: OutlinedButton.icon(
onPressed: onExportBackup,
icon: const Icon(Icons.file_upload_rounded, size: 18),
label: Text(
isRu ? 'Экспорт бэкапа' : 'Export backup',
overflow: TextOverflow.ellipsis,
),
),
),
const SizedBox(width: 10),
Expanded(
child: OutlinedButton.icon(
onPressed: onImportBackup,
icon: const Icon(Icons.file_download_rounded, size: 18),
label: Text(
isRu ? 'Импорт бэкапа' : 'Import backup',
overflow: TextOverflow.ellipsis,
),
),
),
],
), ),
OutlinedButton.icon( const SizedBox(height: 10),
onPressed: onImportBackup, Row(
icon: const Icon(Icons.file_download_rounded, size: 18), children: [
label: Text(isRu ? 'Импорт бэкапа' : 'Import backup'), Expanded(
), child: FilledButton.tonalIcon(
OutlinedButton.icon( onPressed: onExportJson,
onPressed: onExportJson, icon: const Icon(Icons.data_object_rounded, size: 18),
icon: const Icon(Icons.upload_file_rounded, size: 18), label: Text(
label: const Text('JSON Export'), isRu ? 'JSON Экспорт' : 'JSON Export',
), overflow: TextOverflow.ellipsis,
OutlinedButton.icon( ),
onPressed: onImportJson, ),
icon: const Icon(Icons.download_for_offline_rounded, size: 18), ),
label: const Text('JSON Import'), const SizedBox(width: 10),
Expanded(
child: FilledButton.tonalIcon(
onPressed: onImportJson,
icon: const Icon(Icons.download_for_offline_rounded, size: 18),
label: Text(
isRu ? 'JSON Импорт' : 'JSON Import',
overflow: TextOverflow.ellipsis,
),
),
),
],
), ),
], ],
), ),
+380 -15
View File
@@ -1,3 +1,4 @@
import 'dart:ui';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
@@ -281,29 +282,393 @@ class _MobileShell extends StatelessWidget {
? location == '/' ? location == '/'
: location.startsWith(item.location), : location.startsWith(item.location),
); );
final bottomInset = 76.0 + MediaQuery.paddingOf(context).bottom;
return Scaffold( return Scaffold(
body: child, extendBody: true,
body: MediaQuery(
data: MediaQuery.of(context).copyWith(
padding: MediaQuery.of(context).padding.copyWith(
bottom: bottomInset,
),
),
child: child,
),
floatingActionButton: location == '/settings' floatingActionButton: location == '/settings'
? null ? null
: FloatingActionButton.small( : Padding(
heroTag: 'mobile-settings', padding: const EdgeInsets.only(bottom: 0, right: 2),
tooltip: ru child: _LiquidGlassSettingsButton(
? '\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438' ru: ru,
: 'Settings', onTap: () => context.go('/settings'),
onPressed: () => context.go('/settings'), ),
child: const Icon(Icons.settings_rounded),
), ),
floatingActionButtonLocation: FloatingActionButtonLocation.endFloat, floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
bottomNavigationBar: NavigationBar( bottomNavigationBar: _LiquidGlassBottomBar(
selectedIndex: selected < 0 ? 0 : selected, selectedIndex: selected < 0 ? 0 : selected,
onDestinationSelected: (index) => context.go(items[index].location), onDestinationSelected: (index) => context.go(items[index].location),
destinations: [ items: items,
for (final item in items) ru: ru,
NavigationDestination( ),
icon: Icon(item.icon), );
label: item.mobileLabelFor(ru), }
}
class _LiquidGlassBottomBar extends StatefulWidget {
const _LiquidGlassBottomBar({
required this.selectedIndex,
required this.onDestinationSelected,
required this.items,
required this.ru,
});
final int selectedIndex;
final ValueChanged<int> onDestinationSelected;
final List<_Destination> items;
final bool ru;
@override
State<_LiquidGlassBottomBar> createState() => _LiquidGlassBottomBarState();
}
class _LiquidGlassBottomBarState extends State<_LiquidGlassBottomBar> {
int? _pressedIndex;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final isDark = theme.brightness == Brightness.dark;
final scheme = theme.colorScheme;
final count = widget.items.length;
if (count == 0) return const SizedBox.shrink();
return SafeArea(
top: false,
left: false,
right: false,
child: Padding(
padding: const EdgeInsets.fromLTRB(14, 0, 14, 10),
child: LayoutBuilder(
builder: (context, constraints) {
final barWidth = constraints.maxWidth;
final itemWidth = barWidth / count;
final pillWidth = (itemWidth - 6).clamp(36.0, 64.0);
final pillLeft =
widget.selectedIndex * itemWidth + (itemWidth - pillWidth) / 2;
return Container(
height: 64,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(28),
boxShadow: [
BoxShadow(
color: Colors.black.withValues(alpha: isDark ? 0.38 : 0.09),
blurRadius: 22,
offset: const Offset(0, 8),
spreadRadius: -2,
),
if (isDark)
BoxShadow(
color: scheme.primary.withValues(alpha: 0.07),
blurRadius: 18,
offset: const Offset(0, 2),
),
],
),
child: ClipRRect(
borderRadius: BorderRadius.circular(28),
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 20, sigmaY: 20),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(28),
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: isDark
? [
scheme.surfaceContainerHigh
.withValues(alpha: 0.70),
scheme.surface.withValues(alpha: 0.82),
]
: [
Colors.white.withValues(alpha: 0.84),
Colors.white.withValues(alpha: 0.68),
],
),
border: Border.all(
color: isDark
? Colors.white.withValues(alpha: 0.16)
: Colors.white.withValues(alpha: 0.75),
width: 1.2,
),
),
child: Stack(
alignment: Alignment.centerLeft,
children: [
// Animated sliding liquid pill indicator
AnimatedPositioned(
duration: const Duration(milliseconds: 300),
curve: Curves.easeOutBack,
left: pillLeft,
top: 7,
child: Container(
width: pillWidth,
height: 32,
decoration: BoxDecoration(
color: scheme.primaryContainer.withValues(
alpha: isDark ? 0.75 : 0.88,
),
borderRadius: BorderRadius.circular(16),
border: Border.all(
color: scheme.primary.withValues(
alpha: isDark ? 0.35 : 0.22,
),
width: 1,
),
boxShadow: [
BoxShadow(
color: scheme.primary.withValues(
alpha: isDark ? 0.22 : 0.12,
),
blurRadius: 10,
offset: const Offset(0, 2),
),
],
),
),
),
// Navigation item buttons
Row(
children: [
for (var i = 0; i < count; i++)
Expanded(
child: _LiquidNavItem(
destination: widget.items[i],
label: widget.items[i]
.mobileLabelFor(widget.ru),
isSelected: widget.selectedIndex == i,
isPressed: _pressedIndex == i,
onTapDown: () =>
setState(() => _pressedIndex = i),
onTapUp: () =>
setState(() => _pressedIndex = null),
onTapCancel: () =>
setState(() => _pressedIndex = null),
onTap: () {
HapticFeedback.lightImpact();
widget.onDestinationSelected(i);
},
),
),
],
),
],
),
),
),
),
);
},
),
),
);
}
}
class _LiquidNavItem extends StatelessWidget {
const _LiquidNavItem({
required this.destination,
required this.label,
required this.isSelected,
required this.isPressed,
required this.onTapDown,
required this.onTapUp,
required this.onTapCancel,
required this.onTap,
});
final _Destination destination;
final String label;
final bool isSelected;
final bool isPressed;
final VoidCallback onTapDown;
final VoidCallback onTapUp;
final VoidCallback onTapCancel;
final VoidCallback onTap;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final scheme = theme.colorScheme;
final isDark = theme.brightness == Brightness.dark;
final targetScale = isPressed ? 0.86 : (isSelected ? 1.05 : 1.0);
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTapDown: (_) => onTapDown(),
onTapUp: (_) => onTapUp(),
onTapCancel: onTapCancel,
onTap: onTap,
child: Center(
child: AnimatedScale(
scale: targetScale,
duration: const Duration(milliseconds: 180),
curve: Curves.easeOutCubic,
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
height: 32,
child: Center(
child: AnimatedSwitcher(
duration: const Duration(milliseconds: 200),
transitionBuilder: (child, anim) => ScaleTransition(
scale: anim,
child: child,
),
child: Icon(
destination.icon,
key: ValueKey('${destination.id}_$isSelected'),
size: isSelected ? 22 : 20,
color: isSelected
? scheme.onPrimaryContainer
: (isDark
? scheme.onSurfaceVariant
.withValues(alpha: 0.78)
: scheme.onSurfaceVariant
.withValues(alpha: 0.85)),
),
),
),
),
const SizedBox(height: 2),
AnimatedDefaultTextStyle(
duration: const Duration(milliseconds: 200),
style: TextStyle(
fontSize: 10.5,
fontWeight:
isSelected ? FontWeight.w700 : FontWeight.w500,
color: isSelected
? (isDark ? scheme.primary : scheme.onSurface)
: scheme.onSurfaceVariant.withValues(alpha: 0.75),
letterSpacing: -0.2,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
child: Text(label),
),
],
),
),
),
);
}
}
class _LiquidGlassSettingsButton extends StatefulWidget {
const _LiquidGlassSettingsButton({
required this.ru,
required this.onTap,
});
final bool ru;
final VoidCallback onTap;
@override
State<_LiquidGlassSettingsButton> createState() =>
_LiquidGlassSettingsButtonState();
}
class _LiquidGlassSettingsButtonState extends State<_LiquidGlassSettingsButton> {
bool _pressed = false;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final isDark = theme.brightness == Brightness.dark;
final scheme = theme.colorScheme;
return Tooltip(
message: widget.ru ? 'Настройки' : 'Settings',
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTapDown: (_) => setState(() => _pressed = true),
onTapUp: (_) => setState(() => _pressed = false),
onTapCancel: () => setState(() => _pressed = false),
onTap: () {
HapticFeedback.mediumImpact();
widget.onTap();
},
child: AnimatedScale(
scale: _pressed ? 0.88 : 1.0,
duration: const Duration(milliseconds: 160),
curve: Curves.easeOutCubic,
child: Container(
width: 48,
height: 48,
decoration: BoxDecoration(
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
color: Colors.black.withValues(alpha: isDark ? 0.38 : 0.12),
blurRadius: 18,
offset: const Offset(0, 6),
spreadRadius: -1,
),
BoxShadow(
color: scheme.primary.withValues(alpha: isDark ? 0.20 : 0.12),
blurRadius: 12,
offset: const Offset(0, 2),
),
],
), ),
], child: ClipOval(
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 20, sigmaY: 20),
child: Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
gradient: RadialGradient(
center: const Alignment(-0.3, -0.4),
radius: 1.1,
colors: isDark
? [
scheme.surfaceContainerHigh.withValues(alpha: 0.85),
scheme.surface.withValues(alpha: 0.75),
]
: [
Colors.white.withValues(alpha: 0.92),
Colors.white.withValues(alpha: 0.70),
],
),
border: Border.all(
color: isDark
? Colors.white.withValues(alpha: 0.24)
: Colors.white.withValues(alpha: 0.85),
width: 1.4,
),
),
child: Center(
child: AnimatedRotation(
turns: _pressed ? 0.125 : 0.0,
duration: const Duration(milliseconds: 250),
curve: Curves.easeOutBack,
child: Icon(
Icons.settings_rounded,
size: 23,
color: scheme.primary,
),
),
),
),
),
),
),
),
), ),
); );
} }
+1 -1
View File
@@ -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.5+56 version: 3.0.9+60
environment: environment:
sdk: ">=3.3.0 <4.0.0" sdk: ">=3.3.0 <4.0.0"