mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 16:05:18 +00:00
bug 2344: Bottom Overflow in Browse & Local Library on Desktop
- Wrapped `Wrap` in `Flexible` to prevent overflow issues inside `Stack` - Now the folder path text adapts better to different screen sizes - Improved overall UI consistency and responsiveness Tested visually only on **Linux Desktop** Fixes #2344 https://github.com/KRTirtho/spotube/issues/2344
This commit is contained in:
parent
227909787d
commit
9163f1abe0
@ -99,91 +99,99 @@ class LocalFolderItem extends HookConsumerWidget {
|
|||||||
itemCount: tracks.length,
|
itemCount: tracks.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final track = tracks[index];
|
final track = tracks[index];
|
||||||
return UniversalImage(
|
return Expanded(
|
||||||
path: (track.album?.images).asUrlString(
|
child: UniversalImage(
|
||||||
placeholder: ImagePlaceholder.albumArt,
|
path: (track.album?.images).asUrlString(
|
||||||
|
placeholder: ImagePlaceholder.albumArt,
|
||||||
|
),
|
||||||
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
fit: BoxFit.cover,
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Gap(8),
|
const Gap(8),
|
||||||
Stack(
|
Expanded(
|
||||||
children: [
|
child: Stack(
|
||||||
Column(
|
children: [
|
||||||
mainAxisSize: MainAxisSize.min,
|
Column(
|
||||||
children: [
|
mainAxisSize: MainAxisSize.min,
|
||||||
Center(
|
children: [
|
||||||
child: Text(
|
Center(
|
||||||
isDownloadFolder
|
child: Flexible(
|
||||||
? context.l10n.downloads
|
child: Text(
|
||||||
: isCacheFolder
|
isDownloadFolder
|
||||||
? context.l10n.cache_folder.capitalize()
|
? context.l10n.downloads
|
||||||
: basename(folder),
|
: isCacheFolder
|
||||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
? context.l10n.cache_folder.capitalize()
|
||||||
textAlign: TextAlign.center,
|
: basename(folder),
|
||||||
maxLines: 1,
|
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||||
overflow: TextOverflow.ellipsis,
|
textAlign: TextAlign.center,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
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(),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
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(),
|
const Spacer(),
|
||||||
],
|
],
|
||||||
|
Loading…
Reference in New Issue
Block a user