Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions lib/modules/home/sections/genres/genre_card_playlist_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:spotube/components/image/universal_image.dart';
import 'package:spotube/extensions/image.dart';
import 'package:spotube/extensions/string.dart';
import 'package:spotube/provider/spotify/spotify.dart';
import 'package:spotube/utils/platform.dart';
import 'package:stroke_text/stroke_text.dart';

class GenreSectionCardPlaylistCard extends HookConsumerWidget {
Expand All @@ -21,8 +22,10 @@ class GenreSectionCardPlaylistCard extends HookConsumerWidget {
Widget build(BuildContext context, ref) {
final theme = Theme.of(context);

final w = kIsDesktop ? 20 : 0;

return Container(
width: 115 * theme.scaling,
width: (115 + w) * theme.scaling,
decoration: BoxDecoration(
color: theme.colorScheme.background.withAlpha(75),
borderRadius: theme.borderRadiusMd,
Expand Down Expand Up @@ -65,7 +68,7 @@ class GenreSectionCardPlaylistCard extends HookConsumerWidget {
ref.watch(playlistImageProvider(playlist.id!));
return SizedBox(
height: 100 * theme.scaling,
width: 100 * theme.scaling,
width: (100 + w) * theme.scaling,
child: Stack(
children: [
Positioned.fill(
Expand Down Expand Up @@ -107,14 +110,14 @@ class GenreSectionCardPlaylistCard extends HookConsumerWidget {
),
fit: BoxFit.cover,
height: 100 * theme.scaling,
width: 100 * theme.scaling,
width: (100 + w) * theme.scaling,
),
),
Text(
playlist.name!,
maxLines: 2,
maxLines: 1,
overflow: TextOverflow.ellipsis,
).semiBold().small(),
).xSmall().bold(),
if (playlist.description != null)
Text(
playlist.description?.unescapeHtml().cleanHtml() ?? "",
Expand Down
162 changes: 85 additions & 77 deletions lib/modules/library/local_folder/local_folder_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,91 +99,99 @@ class LocalFolderItem extends HookConsumerWidget {
itemCount: tracks.length,
itemBuilder: (context, index) {
final track = tracks[index];
return UniversalImage(
path: (track.album?.images).asUrlString(
placeholder: ImagePlaceholder.albumArt,
return Expanded(
child: UniversalImage(
path: (track.album?.images).asUrlString(
placeholder: ImagePlaceholder.albumArt,
),
fit: BoxFit.cover,
),
fit: BoxFit.cover,
);
},
),
),
const Gap(8),
Stack(
children: [
Column(
mainAxisSize: MainAxisSize.min,
children: [
Center(
child: Text(
isDownloadFolder
? context.l10n.downloads
: isCacheFolder
? context.l10n.cache_folder.capitalize()
: basename(folder),
style: const TextStyle(fontWeight: FontWeight.bold),
textAlign: TextAlign.center,
maxLines: 1,
overflow: TextOverflow.ellipsis,
Expanded(
child: Stack(
children: [
Column(
mainAxisSize: MainAxisSize.min,
children: [
Center(
child: Flexible(
child: Text(
isDownloadFolder
? context.l10n.downloads
: isCacheFolder
? context.l10n.cache_folder.capitalize()
: basename(folder),
style: const TextStyle(fontWeight: FontWeight.bold),
textAlign: TextAlign.center,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
),
),
Wrap(
spacing: 2,
runSpacing: 2,
children: [
for (final MapEntry(key: index, value: segment)
in segments.asMap().entries)
Text.rich(
TextSpan(
children: [
if (index != 0) const TextSpan(text: "/ "),
TextSpan(text: segment),
],
),
maxLines: 2,
).xSmall().muted(),
],
),
],
),
if (!isDownloadFolder && !isCacheFolder)
Align(
alignment: Alignment.topRight,
child: IconButton.ghost(
icon: const Icon(Icons.more_vert),
size: ButtonSize.small,
onPressed: () {
showDropdown(
context: context,
builder: (context) {
return DropdownMenu(
children: [
MenuButton(
leading: Icon(SpotubeIcons.folderRemove,
color: colorScheme.destructive),
child:
Text(context.l10n.remove_library_location),
onPressed: (context) {
final libraryLocations = ref
.read(userPreferencesProvider)
.localLibraryLocation;
ref
.read(userPreferencesProvider.notifier)
.setLocalLibraryLocation(
libraryLocations
.where((e) => e != folder)
.toList(),
);
},
)
],
);
},
);
},
),
Flexible(
child: Wrap(
spacing: 2,
runSpacing: 2,
children: [
for (final MapEntry(key: index, value: segment)
in segments.asMap().entries)
Text.rich(
TextSpan(
children: [
if (index != 0) const TextSpan(text: "/ "),
TextSpan(text: segment)
],
),
maxLines: 2,
).xSmall().muted(),
],
),
),
],
),
],
if (!isDownloadFolder && !isCacheFolder)
Align(
alignment: Alignment.topRight,
child: IconButton.ghost(
icon: const Icon(Icons.more_vert),
size: ButtonSize.small,
onPressed: () {
showDropdown(
context: context,
builder: (context) {
return DropdownMenu(
children: [
MenuButton(
leading: Icon(SpotubeIcons.folderRemove,
color: colorScheme.destructive),
child: Text(
context.l10n.remove_library_location),
onPressed: (context) {
final libraryLocations = ref
.read(userPreferencesProvider)
.localLibraryLocation;
ref
.read(userPreferencesProvider.notifier)
.setLocalLibraryLocation(
libraryLocations
.where((e) => e != folder)
.toList(),
);
},
)
],
);
},
);
},
),
),
],
),
),
const Spacer(),
],
Expand Down