mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-12 23:45:18 +00:00
feat(search): horizontal swipe scroll support for Desktop platform
This commit is contained in:
parent
427954150a
commit
d5ff927c72
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart' hide Page;
|
import 'package:flutter/material.dart' hide Page;
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
@ -147,19 +148,28 @@ class Search extends HookConsumerWidget {
|
|||||||
style: Theme.of(context).textTheme.headline5,
|
style: Theme.of(context).textTheme.headline5,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Scrollbar(
|
ScrollConfiguration(
|
||||||
controller: albumController,
|
behavior:
|
||||||
child: SingleChildScrollView(
|
ScrollConfiguration.of(context).copyWith(
|
||||||
scrollDirection: Axis.horizontal,
|
dragDevices: {
|
||||||
|
PointerDeviceKind.touch,
|
||||||
|
PointerDeviceKind.mouse,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
child: Scrollbar(
|
||||||
controller: albumController,
|
controller: albumController,
|
||||||
child: Row(
|
child: SingleChildScrollView(
|
||||||
children: albums.map((album) {
|
scrollDirection: Axis.horizontal,
|
||||||
return AlbumCard(
|
controller: albumController,
|
||||||
TypeConversionUtils.simpleAlbum_X_Album(
|
child: Row(
|
||||||
album,
|
children: albums.map((album) {
|
||||||
),
|
return AlbumCard(
|
||||||
);
|
TypeConversionUtils.simpleAlbum_X_Album(
|
||||||
}).toList(),
|
album,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -170,21 +180,30 @@ class Search extends HookConsumerWidget {
|
|||||||
style: Theme.of(context).textTheme.headline5,
|
style: Theme.of(context).textTheme.headline5,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Scrollbar(
|
ScrollConfiguration(
|
||||||
controller: artistController,
|
behavior:
|
||||||
child: SingleChildScrollView(
|
ScrollConfiguration.of(context).copyWith(
|
||||||
scrollDirection: Axis.horizontal,
|
dragDevices: {
|
||||||
|
PointerDeviceKind.touch,
|
||||||
|
PointerDeviceKind.mouse,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
child: Scrollbar(
|
||||||
controller: artistController,
|
controller: artistController,
|
||||||
child: Row(
|
child: SingleChildScrollView(
|
||||||
children: artists
|
scrollDirection: Axis.horizontal,
|
||||||
.map(
|
controller: artistController,
|
||||||
(artist) => Container(
|
child: Row(
|
||||||
margin: const EdgeInsets.symmetric(
|
children: artists
|
||||||
horizontal: 15),
|
.map(
|
||||||
child: ArtistCard(artist),
|
(artist) => Container(
|
||||||
),
|
margin: const EdgeInsets.symmetric(
|
||||||
)
|
horizontal: 15),
|
||||||
.toList(),
|
child: ArtistCard(artist),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.toList(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -195,20 +214,30 @@ class Search extends HookConsumerWidget {
|
|||||||
style: Theme.of(context).textTheme.headline5,
|
style: Theme.of(context).textTheme.headline5,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Scrollbar(
|
ScrollConfiguration(
|
||||||
scrollbarOrientation: breakpoint > Breakpoints.md
|
behavior:
|
||||||
? ScrollbarOrientation.bottom
|
ScrollConfiguration.of(context).copyWith(
|
||||||
: ScrollbarOrientation.top,
|
dragDevices: {
|
||||||
controller: playlistController,
|
PointerDeviceKind.touch,
|
||||||
child: SingleChildScrollView(
|
PointerDeviceKind.mouse,
|
||||||
scrollDirection: Axis.horizontal,
|
},
|
||||||
|
),
|
||||||
|
child: Scrollbar(
|
||||||
|
scrollbarOrientation:
|
||||||
|
breakpoint > Breakpoints.md
|
||||||
|
? ScrollbarOrientation.bottom
|
||||||
|
: ScrollbarOrientation.top,
|
||||||
controller: playlistController,
|
controller: playlistController,
|
||||||
child: Row(
|
child: SingleChildScrollView(
|
||||||
children: playlists
|
scrollDirection: Axis.horizontal,
|
||||||
.map(
|
controller: playlistController,
|
||||||
(playlist) => PlaylistCard(playlist),
|
child: Row(
|
||||||
)
|
children: playlists
|
||||||
.toList(),
|
.map(
|
||||||
|
(playlist) => PlaylistCard(playlist),
|
||||||
|
)
|
||||||
|
.toList(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user