feat: desktop horizontal mouse-wheel scroll & fix PC video player blue screen (v3.6.3)
This commit is contained in:
@@ -1,4 +1,13 @@
|
|||||||
const prismaChangelog = [
|
const prismaChangelog = [
|
||||||
|
PrismaChange(
|
||||||
|
version: '3.6.3',
|
||||||
|
title: 'Горизонтальный скролл колесиком мыши на ПК и исправление синего экрана в видеоплеере',
|
||||||
|
bullets: [
|
||||||
|
'Горизонтальная прокрутка колесиком мыши в настройках: верхняя панель категорий настроек теперь плавно прокручивается колесиком мыши строго при наведении курсора.',
|
||||||
|
'Горизонтальная прокрутка колесиком мыши в авторах: полоса любимых авторов и лента их медиа теперь поддерживают быструю прокрутку колесиком мыши при наведении курсора.',
|
||||||
|
'Устранение «синего экрана» в видеоплеере на ПК: исправлена нативная инициализация MediaKit перед запуском Flutter-движка и настроен оптимальный режим аппаратного ускорения для десктопных платформ.',
|
||||||
|
],
|
||||||
|
),
|
||||||
PrismaChange(
|
PrismaChange(
|
||||||
version: '3.6.2',
|
version: '3.6.2',
|
||||||
title: 'Комплексная оптимизация памяти на телефоне и ПК, полное отключение зума колесиком',
|
title: 'Комплексная оптимизация памяти на телефоне и ПК, полное отключение зума колесиком',
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'dart:async';
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.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';
|
||||||
@@ -1328,7 +1329,7 @@ class _FavoriteArtistsModalState extends State<_FavoriteArtistsModal> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class _FavoriteArtistsSection extends ConsumerWidget {
|
class _FavoriteArtistsSection extends StatefulWidget {
|
||||||
const _FavoriteArtistsSection({
|
const _FavoriteArtistsSection({
|
||||||
required this.favorites,
|
required this.favorites,
|
||||||
required this.selectedKey,
|
required this.selectedKey,
|
||||||
@@ -1344,8 +1345,23 @@ class _FavoriteArtistsSection extends ConsumerWidget {
|
|||||||
final ValueChanged<FavoriteArtistItem> onRemoveFavorite;
|
final ValueChanged<FavoriteArtistItem> onRemoveFavorite;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
State<_FavoriteArtistsSection> createState() =>
|
||||||
if (favorites.isEmpty) {
|
_FavoriteArtistsSectionState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _FavoriteArtistsSectionState extends State<_FavoriteArtistsSection> {
|
||||||
|
final ScrollController _scrollController = ScrollController();
|
||||||
|
bool _isHovered = false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_scrollController.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
if (widget.favorites.isEmpty) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(16, 4, 16, 8),
|
padding: const EdgeInsets.fromLTRB(16, 4, 16, 8),
|
||||||
child: _ArtistsLiquidCard(
|
child: _ArtistsLiquidCard(
|
||||||
@@ -1368,9 +1384,9 @@ class _FavoriteArtistsSection extends ConsumerWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
final selected = favorites.firstWhere(
|
final selected = widget.favorites.firstWhere(
|
||||||
(f) => f.key == selectedKey,
|
(f) => f.key == widget.selectedKey,
|
||||||
orElse: () => favorites.first,
|
orElse: () => widget.favorites.first,
|
||||||
);
|
);
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
@@ -1385,14 +1401,14 @@ class _FavoriteArtistsSection extends ConsumerWidget {
|
|||||||
const Icon(Icons.star_rounded, color: Colors.amber, size: 20),
|
const Icon(Icons.star_rounded, color: Colors.amber, size: 20),
|
||||||
const SizedBox(width: 6),
|
const SizedBox(width: 6),
|
||||||
Text(
|
Text(
|
||||||
'Любимые авторы (${favorites.length})',
|
'Любимые авторы (${widget.favorites.length})',
|
||||||
style: Theme.of(context).textTheme.titleSmall?.copyWith(
|
style: Theme.of(context).textTheme.titleSmall?.copyWith(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => onOpenArtist(selected),
|
onPressed: () => widget.onOpenArtist(selected),
|
||||||
style: TextButton.styleFrom(
|
style: TextButton.styleFrom(
|
||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||||
@@ -1409,113 +1425,136 @@ class _FavoriteArtistsSection extends ConsumerWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
SizedBox(
|
MouseRegion(
|
||||||
height: 88,
|
onEnter: (_) => _isHovered = true,
|
||||||
child: ListView.separated(
|
onExit: (_) => _isHovered = false,
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 4),
|
child: Listener(
|
||||||
scrollDirection: Axis.horizontal,
|
onPointerSignal: (event) {
|
||||||
itemCount: favorites.length,
|
if (!_isHovered ||
|
||||||
separatorBuilder: (_, __) => const SizedBox(width: 10),
|
event is! PointerScrollEvent ||
|
||||||
itemBuilder: (context, index) {
|
!_scrollController.hasClients) {
|
||||||
final fav = favorites[index];
|
return;
|
||||||
final isSelected = fav.key == selected.key;
|
}
|
||||||
final sColor = _serviceColor(fav.service);
|
final delta = event.scrollDelta.dy != 0
|
||||||
|
? event.scrollDelta.dy
|
||||||
return InkWell(
|
: event.scrollDelta.dx;
|
||||||
borderRadius: BorderRadius.circular(16),
|
if (delta == 0) return;
|
||||||
onTap: () => onSelect(fav),
|
final target = (_scrollController.offset + delta * 1.5).clamp(
|
||||||
child: AnimatedContainer(
|
0.0,
|
||||||
duration: const Duration(milliseconds: 200),
|
_scrollController.position.maxScrollExtent,
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 6),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: isSelected
|
|
||||||
? Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.primaryContainer
|
|
||||||
.withValues(alpha: 0.45)
|
|
||||||
: Colors.transparent,
|
|
||||||
borderRadius: BorderRadius.circular(16),
|
|
||||||
border: Border.all(
|
|
||||||
color: isSelected
|
|
||||||
? Theme.of(context).colorScheme.primary
|
|
||||||
: Colors.transparent,
|
|
||||||
width: 1.5,
|
|
||||||
),
|
|
||||||
boxShadow: isSelected
|
|
||||||
? [
|
|
||||||
BoxShadow(
|
|
||||||
color: Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.primary
|
|
||||||
.withValues(alpha: 0.25),
|
|
||||||
blurRadius: 8,
|
|
||||||
),
|
|
||||||
]
|
|
||||||
: null,
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
width: 44,
|
|
||||||
height: 44,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(14),
|
|
||||||
border: Border.all(
|
|
||||||
color: isSelected
|
|
||||||
? Theme.of(context).colorScheme.primary
|
|
||||||
: sColor.withValues(alpha: 0.4),
|
|
||||||
width: 1.2,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: ClipRRect(
|
|
||||||
borderRadius: BorderRadius.circular(13),
|
|
||||||
child: fav.avatarUrl != null &&
|
|
||||||
fav.avatarUrl!.isNotEmpty
|
|
||||||
? CachedNetworkImage(
|
|
||||||
imageUrl: fav.avatarUrl!,
|
|
||||||
memCacheWidth: 120,
|
|
||||||
memCacheHeight: 120,
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
placeholder: (_, __) => const Icon(
|
|
||||||
Icons.person_rounded,
|
|
||||||
size: 20),
|
|
||||||
errorWidget: (_, __, ___) => const Icon(
|
|
||||||
Icons.person_rounded,
|
|
||||||
size: 20),
|
|
||||||
)
|
|
||||||
: Center(
|
|
||||||
child: Text(
|
|
||||||
fav.name.isNotEmpty
|
|
||||||
? fav.name[0].toUpperCase()
|
|
||||||
: '?',
|
|
||||||
style: const TextStyle(
|
|
||||||
fontWeight: FontWeight.bold),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 4),
|
|
||||||
SizedBox(
|
|
||||||
width: 68,
|
|
||||||
child: Text(
|
|
||||||
fav.name,
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 11,
|
|
||||||
fontWeight: isSelected
|
|
||||||
? FontWeight.bold
|
|
||||||
: FontWeight.normal,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
_scrollController.jumpTo(target);
|
||||||
},
|
},
|
||||||
|
child: SizedBox(
|
||||||
|
height: 88,
|
||||||
|
child: ListView.separated(
|
||||||
|
controller: _scrollController,
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 4),
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
itemCount: widget.favorites.length,
|
||||||
|
separatorBuilder: (_, __) => const SizedBox(width: 10),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final fav = widget.favorites[index];
|
||||||
|
final isSelected = fav.key == selected.key;
|
||||||
|
final sColor = _serviceColor(fav.service);
|
||||||
|
|
||||||
|
return InkWell(
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
onTap: () => widget.onSelect(fav),
|
||||||
|
child: AnimatedContainer(
|
||||||
|
duration: const Duration(milliseconds: 200),
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 6),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: isSelected
|
||||||
|
? Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.primaryContainer
|
||||||
|
.withValues(alpha: 0.45)
|
||||||
|
: Colors.transparent,
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
border: Border.all(
|
||||||
|
color: isSelected
|
||||||
|
? Theme.of(context).colorScheme.primary
|
||||||
|
: Colors.transparent,
|
||||||
|
width: 1.5,
|
||||||
|
),
|
||||||
|
boxShadow: isSelected
|
||||||
|
? [
|
||||||
|
BoxShadow(
|
||||||
|
color: Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.primary
|
||||||
|
.withValues(alpha: 0.25),
|
||||||
|
blurRadius: 8,
|
||||||
|
),
|
||||||
|
]
|
||||||
|
: null,
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 44,
|
||||||
|
height: 44,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(14),
|
||||||
|
border: Border.all(
|
||||||
|
color: isSelected
|
||||||
|
? Theme.of(context).colorScheme.primary
|
||||||
|
: sColor.withValues(alpha: 0.4),
|
||||||
|
width: 1.2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(13),
|
||||||
|
child: fav.avatarUrl != null &&
|
||||||
|
fav.avatarUrl!.isNotEmpty
|
||||||
|
? CachedNetworkImage(
|
||||||
|
imageUrl: fav.avatarUrl!,
|
||||||
|
memCacheWidth: 120,
|
||||||
|
memCacheHeight: 120,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
placeholder: (_, __) => const Icon(
|
||||||
|
Icons.person_rounded,
|
||||||
|
size: 20),
|
||||||
|
errorWidget: (_, __, ___) => const Icon(
|
||||||
|
Icons.person_rounded,
|
||||||
|
size: 20),
|
||||||
|
)
|
||||||
|
: Center(
|
||||||
|
child: Text(
|
||||||
|
fav.name.isNotEmpty
|
||||||
|
? fav.name[0].toUpperCase()
|
||||||
|
: '?',
|
||||||
|
style: const TextStyle(
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
SizedBox(
|
||||||
|
width: 68,
|
||||||
|
child: Text(
|
||||||
|
fav.name,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 11,
|
||||||
|
fontWeight: isSelected
|
||||||
|
? FontWeight.bold
|
||||||
|
: FontWeight.normal,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 6),
|
const SizedBox(height: 6),
|
||||||
@@ -1527,18 +1566,34 @@ class _FavoriteArtistsSection extends ConsumerWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class _FavoriteArtistMediaStrip extends ConsumerWidget {
|
class _FavoriteArtistMediaStrip extends ConsumerStatefulWidget {
|
||||||
const _FavoriteArtistMediaStrip({required this.artist});
|
const _FavoriteArtistMediaStrip({required this.artist});
|
||||||
|
|
||||||
final FavoriteArtistItem artist;
|
final FavoriteArtistItem artist;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
ConsumerState<_FavoriteArtistMediaStrip> createState() =>
|
||||||
|
_FavoriteArtistMediaStripState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _FavoriteArtistMediaStripState
|
||||||
|
extends ConsumerState<_FavoriteArtistMediaStrip> {
|
||||||
|
final ScrollController _scrollController = ScrollController();
|
||||||
|
bool _isHovered = false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_scrollController.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
final query = ArtistWorkQuery(
|
final query = ArtistWorkQuery(
|
||||||
providerId: artist.providerId,
|
providerId: widget.artist.providerId,
|
||||||
service: artist.service,
|
service: widget.artist.service,
|
||||||
artistId: artist.id,
|
artistId: widget.artist.id,
|
||||||
artistName: artist.name,
|
artistName: widget.artist.name,
|
||||||
);
|
);
|
||||||
final asyncPosts = ref.watch(artistPostsProvider(query));
|
final asyncPosts = ref.watch(artistPostsProvider(query));
|
||||||
|
|
||||||
@@ -1566,78 +1621,101 @@ class _FavoriteArtistMediaStrip extends ConsumerWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return SizedBox(
|
return MouseRegion(
|
||||||
height: 96,
|
onEnter: (_) => _isHovered = true,
|
||||||
child: ListView.separated(
|
onExit: (_) => _isHovered = false,
|
||||||
scrollDirection: Axis.horizontal,
|
child: Listener(
|
||||||
itemCount: posts.length.clamp(0, 15),
|
onPointerSignal: (event) {
|
||||||
separatorBuilder: (_, __) => const SizedBox(width: 8),
|
if (!_isHovered ||
|
||||||
itemBuilder: (context, index) {
|
event is! PointerScrollEvent ||
|
||||||
final post = posts[index];
|
!_scrollController.hasClients) {
|
||||||
final isVideo = MediaUrlSelector.isVideo(post);
|
return;
|
||||||
return InkWell(
|
}
|
||||||
borderRadius: BorderRadius.circular(14),
|
final delta = event.scrollDelta.dy != 0
|
||||||
onTap: () => AppNavigator.openPost(
|
? event.scrollDelta.dy
|
||||||
context,
|
: event.scrollDelta.dx;
|
||||||
post: post,
|
if (delta == 0) return;
|
||||||
postsList: posts,
|
final target = (_scrollController.offset + delta * 1.5).clamp(
|
||||||
),
|
0.0,
|
||||||
child: Container(
|
_scrollController.position.maxScrollExtent,
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(14),
|
|
||||||
border: Border.all(
|
|
||||||
color: Colors.white.withValues(alpha: 0.15),
|
|
||||||
width: 1.0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: ClipRRect(
|
|
||||||
borderRadius: BorderRadius.circular(13),
|
|
||||||
child: Stack(
|
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
width: 96,
|
|
||||||
height: 96,
|
|
||||||
child: CachedNetworkImage(
|
|
||||||
imageUrl: post.previewUrl.isNotEmpty
|
|
||||||
? post.previewUrl
|
|
||||||
: post.sampleUrl,
|
|
||||||
memCacheWidth: 200,
|
|
||||||
memCacheHeight: 200,
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
placeholder: (_, __) => ColoredBox(
|
|
||||||
color: Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.surfaceContainerHighest,
|
|
||||||
),
|
|
||||||
errorWidget: (_, __, ___) => ColoredBox(
|
|
||||||
color: Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.surfaceContainerHighest,
|
|
||||||
child: const Icon(Icons.broken_image_rounded,
|
|
||||||
size: 24),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (isVideo)
|
|
||||||
Positioned(
|
|
||||||
bottom: 6,
|
|
||||||
right: 6,
|
|
||||||
child: Container(
|
|
||||||
padding: const EdgeInsets.all(4),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.black.withValues(alpha: 0.7),
|
|
||||||
shape: BoxShape.circle,
|
|
||||||
),
|
|
||||||
child: const Icon(Icons.play_arrow_rounded,
|
|
||||||
color: Colors.white, size: 14),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
_scrollController.jumpTo(target);
|
||||||
},
|
},
|
||||||
|
child: SizedBox(
|
||||||
|
height: 96,
|
||||||
|
child: ListView.separated(
|
||||||
|
controller: _scrollController,
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
itemCount: posts.length.clamp(0, 15),
|
||||||
|
separatorBuilder: (_, __) => const SizedBox(width: 8),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final post = posts[index];
|
||||||
|
final isVideo = MediaUrlSelector.isVideo(post);
|
||||||
|
return InkWell(
|
||||||
|
borderRadius: BorderRadius.circular(14),
|
||||||
|
onTap: () => AppNavigator.openPost(
|
||||||
|
context,
|
||||||
|
post: post,
|
||||||
|
postsList: posts,
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(14),
|
||||||
|
border: Border.all(
|
||||||
|
color: Colors.white.withValues(alpha: 0.15),
|
||||||
|
width: 1.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(13),
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
width: 96,
|
||||||
|
height: 96,
|
||||||
|
child: CachedNetworkImage(
|
||||||
|
imageUrl: post.previewUrl.isNotEmpty
|
||||||
|
? post.previewUrl
|
||||||
|
: post.sampleUrl,
|
||||||
|
memCacheWidth: 200,
|
||||||
|
memCacheHeight: 200,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
placeholder: (_, __) => ColoredBox(
|
||||||
|
color: Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.surfaceContainerHighest,
|
||||||
|
),
|
||||||
|
errorWidget: (_, __, ___) => ColoredBox(
|
||||||
|
color: Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.surfaceContainerHighest,
|
||||||
|
child: const Icon(Icons.broken_image_rounded,
|
||||||
|
size: 24),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (isVideo)
|
||||||
|
Positioned(
|
||||||
|
bottom: 6,
|
||||||
|
right: 6,
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.all(4),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.black.withValues(alpha: 0.7),
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
),
|
||||||
|
child: const Icon(Icons.play_arrow_rounded,
|
||||||
|
color: Colors.white, size: 14),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -448,7 +448,9 @@ class _PostMediaViewerState extends State<PostMediaViewer>
|
|||||||
_player!,
|
_player!,
|
||||||
configuration: VideoControllerConfiguration(
|
configuration: VideoControllerConfiguration(
|
||||||
enableHardwareAcceleration: !_softwareDecodingFallback,
|
enableHardwareAcceleration: !_softwareDecodingFallback,
|
||||||
hwdec: _softwareDecodingFallback ? 'no' : 'auto-safe',
|
hwdec: _softwareDecodingFallback
|
||||||
|
? 'no'
|
||||||
|
: (Platform.isAndroid ? 'auto-safe' : 'auto'),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
_applyVolume();
|
_applyVolume();
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
|
|
||||||
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart' hide appBuildNumber;
|
import 'package:flutter/services.dart' hide appBuildNumber;
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
@@ -1439,7 +1440,7 @@ class _SettingsIconBadge extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class _CategoryQuickNav extends StatelessWidget {
|
class _CategoryQuickNav extends StatefulWidget {
|
||||||
const _CategoryQuickNav({
|
const _CategoryQuickNav({
|
||||||
required this.categories,
|
required this.categories,
|
||||||
required this.onSelect,
|
required this.onSelect,
|
||||||
@@ -1449,103 +1450,143 @@ class _CategoryQuickNav extends StatelessWidget {
|
|||||||
categories;
|
categories;
|
||||||
final ValueChanged<GlobalKey> onSelect;
|
final ValueChanged<GlobalKey> onSelect;
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<_CategoryQuickNav> createState() => _CategoryQuickNavState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CategoryQuickNavState extends State<_CategoryQuickNav> {
|
||||||
|
final ScrollController _scrollController = ScrollController();
|
||||||
|
bool _isHovered = false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_scrollController.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
@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 isDark = theme.brightness == Brightness.dark;
|
||||||
|
|
||||||
return SizedBox(
|
return MouseRegion(
|
||||||
height: 44,
|
onEnter: (_) => _isHovered = true,
|
||||||
child: ListView.separated(
|
onExit: (_) => _isHovered = false,
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
child: Listener(
|
||||||
scrollDirection: Axis.horizontal,
|
onPointerSignal: (event) {
|
||||||
itemCount: categories.length,
|
if (!_isHovered ||
|
||||||
separatorBuilder: (_, __) => const SizedBox(width: 8),
|
event is! PointerScrollEvent ||
|
||||||
itemBuilder: (context, index) {
|
!_scrollController.hasClients) {
|
||||||
final cat = categories[index];
|
return;
|
||||||
return Container(
|
}
|
||||||
decoration: BoxDecoration(
|
final delta = event.scrollDelta.dy != 0
|
||||||
borderRadius: BorderRadius.circular(22),
|
? event.scrollDelta.dy
|
||||||
boxShadow: [
|
: event.scrollDelta.dx;
|
||||||
BoxShadow(
|
if (delta == 0) return;
|
||||||
color: isDark
|
final target = (_scrollController.offset + delta * 1.5).clamp(
|
||||||
? Colors.black.withValues(alpha: 0.25)
|
0.0,
|
||||||
: cat.color.withValues(alpha: 0.12),
|
_scrollController.position.maxScrollExtent,
|
||||||
blurRadius: 8,
|
);
|
||||||
offset: const Offset(0, 2.5),
|
_scrollController.jumpTo(target);
|
||||||
|
},
|
||||||
|
child: SizedBox(
|
||||||
|
height: 44,
|
||||||
|
child: ListView.separated(
|
||||||
|
controller: _scrollController,
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
itemCount: widget.categories.length,
|
||||||
|
separatorBuilder: (_, __) => const SizedBox(width: 8),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final cat = widget.categories[index];
|
||||||
|
return Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(22),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: isDark
|
||||||
|
? Colors.black.withValues(alpha: 0.25)
|
||||||
|
: cat.color.withValues(alpha: 0.12),
|
||||||
|
blurRadius: 8,
|
||||||
|
offset: const Offset(0, 2.5),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
child: ClipRRect(
|
||||||
),
|
borderRadius: BorderRadius.circular(22),
|
||||||
child: ClipRRect(
|
child: BackdropFilter(
|
||||||
borderRadius: BorderRadius.circular(22),
|
filter: ImageFilter.blur(sigmaX: 16, sigmaY: 16),
|
||||||
child: BackdropFilter(
|
child: Material(
|
||||||
filter: ImageFilter.blur(sigmaX: 16, sigmaY: 16),
|
color: isDark
|
||||||
child: Material(
|
? theme.colorScheme.surfaceContainerHigh
|
||||||
color: isDark
|
.withValues(alpha: 0.60)
|
||||||
? theme.colorScheme.surfaceContainerHigh.withValues(alpha: 0.60)
|
: Colors.white.withValues(alpha: 0.82),
|
||||||
: Colors.white.withValues(alpha: 0.82),
|
child: InkWell(
|
||||||
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),
|
borderRadius: BorderRadius.circular(22),
|
||||||
border: Border.all(
|
onTap: () {
|
||||||
color: isDark
|
HapticFeedback.selectionClick();
|
||||||
? Colors.white.withValues(alpha: 0.18)
|
widget.onSelect(cat.key);
|
||||||
: Colors.white.withValues(alpha: 0.85),
|
},
|
||||||
width: 1.1,
|
child: Container(
|
||||||
),
|
padding: const EdgeInsets.symmetric(
|
||||||
),
|
horizontal: 12, vertical: 7),
|
||||||
child: Row(
|
decoration: BoxDecoration(
|
||||||
mainAxisSize: MainAxisSize.min,
|
borderRadius: BorderRadius.circular(22),
|
||||||
children: [
|
border: Border.all(
|
||||||
Container(
|
color: isDark
|
||||||
width: 24,
|
? Colors.white.withValues(alpha: 0.18)
|
||||||
height: 24,
|
: Colors.white.withValues(alpha: 0.85),
|
||||||
decoration: BoxDecoration(
|
width: 1.1,
|
||||||
gradient: LinearGradient(
|
),
|
||||||
begin: Alignment.topLeft,
|
),
|
||||||
end: Alignment.bottomRight,
|
child: Row(
|
||||||
colors: [
|
mainAxisSize: MainAxisSize.min,
|
||||||
cat.color,
|
children: [
|
||||||
cat.color.withValues(alpha: 0.82),
|
Container(
|
||||||
],
|
width: 24,
|
||||||
),
|
height: 24,
|
||||||
borderRadius: BorderRadius.circular(7),
|
decoration: BoxDecoration(
|
||||||
boxShadow: [
|
gradient: LinearGradient(
|
||||||
BoxShadow(
|
begin: Alignment.topLeft,
|
||||||
color: cat.color.withValues(alpha: 0.35),
|
end: Alignment.bottomRight,
|
||||||
blurRadius: 5,
|
colors: [
|
||||||
offset: const Offset(0, 1.5),
|
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,
|
||||||
child: Center(
|
size: 14, color: Colors.white),
|
||||||
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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
),
|
||||||
Text(
|
|
||||||
cat.label,
|
|
||||||
style: theme.textTheme.labelLarge?.copyWith(
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
letterSpacing: -0.2,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
),
|
},
|
||||||
);
|
),
|
||||||
},
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
import 'package:media_kit/media_kit.dart';
|
||||||
|
|
||||||
import 'app/app.dart';
|
import 'app/app.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
MediaKit.ensureInitialized();
|
||||||
// Optimize image cache to prevent memory bloat and OOM crashes
|
// Optimize image cache to prevent memory bloat and OOM crashes
|
||||||
PaintingBinding.instance.imageCache.maximumSizeBytes = 180 * 1024 * 1024; // 180 MB
|
PaintingBinding.instance.imageCache.maximumSizeBytes = 180 * 1024 * 1024; // 180 MB
|
||||||
PaintingBinding.instance.imageCache.maximumSize = 120; // 120 images
|
PaintingBinding.instance.imageCache.maximumSize = 120; // 120 images
|
||||||
|
|||||||
@@ -580,7 +580,7 @@ class _DesktopShellState extends State<_DesktopShell>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
'v3.6.2',
|
'v3.6.3',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 10,
|
fontSize: 10,
|
||||||
fontWeight:
|
fontWeight:
|
||||||
|
|||||||
+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.6.2+84
|
version: 3.6.3+85
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.3.0 <4.0.0"
|
sdk: ">=3.3.0 <4.0.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user