🍱 Regenerate app icons
This commit is contained in:
@@ -48,6 +48,8 @@ class LibraryScreen extends HookConsumerWidget {
|
||||
final selectedTrackIds = useState<Set<int>>({});
|
||||
final searchQuery = useState<String>('');
|
||||
final isSelectionMode = selectedTrackIds.value.isNotEmpty;
|
||||
final isLargeScreen = MediaQuery.of(context).size.width > 600;
|
||||
final selectedTab = isLargeScreen ? useState<int>(0) : null;
|
||||
|
||||
void toggleSelection(int id) {
|
||||
final newSet = Set<int>.from(selectedTrackIds.value);
|
||||
@@ -63,9 +65,8 @@ class LibraryScreen extends HookConsumerWidget {
|
||||
selectedTrackIds.value = {};
|
||||
}
|
||||
|
||||
return DefaultTabController(
|
||||
length: 3,
|
||||
child: Scaffold(
|
||||
if (isLargeScreen) {
|
||||
return Scaffold(
|
||||
appBar: isSelectionMode
|
||||
? AppBar(
|
||||
leading: IconButton(
|
||||
@@ -105,13 +106,6 @@ class LibraryScreen extends HookConsumerWidget {
|
||||
: AppBar(
|
||||
centerTitle: true,
|
||||
title: const Text('Library'),
|
||||
bottom: const TabBar(
|
||||
tabs: [
|
||||
Tab(text: 'Tracks', icon: Icon(Icons.audiotrack)),
|
||||
Tab(text: 'Albums', icon: Icon(Icons.album)),
|
||||
Tab(text: 'Playlists', icon: Icon(Icons.queue_music)),
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.add_circle_outline),
|
||||
@@ -164,224 +158,391 @@ class LibraryScreen extends HookConsumerWidget {
|
||||
const Gap(8),
|
||||
],
|
||||
),
|
||||
body: TabBarView(
|
||||
body: Row(
|
||||
children: [
|
||||
// Tracks Tab (Existing Logic)
|
||||
StreamBuilder<List<Track>>(
|
||||
stream: repo.watchAllTracks(),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.hasError) {
|
||||
return Center(child: Text('Error: ${snapshot.error}'));
|
||||
}
|
||||
if (!snapshot.hasData) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
final tracks = snapshot.data!;
|
||||
if (tracks.isEmpty) {
|
||||
return const Center(child: Text('No tracks yet. Add some!'));
|
||||
}
|
||||
|
||||
List<Track> filteredTracks;
|
||||
if (searchQuery.value.isEmpty) {
|
||||
filteredTracks = tracks;
|
||||
} else {
|
||||
final query = searchQuery.value.toLowerCase();
|
||||
filteredTracks = tracks.where((track) {
|
||||
if (track.title.toLowerCase().contains(query)) return true;
|
||||
if (track.artist?.toLowerCase().contains(query) ?? false)
|
||||
return true;
|
||||
if (track.album?.toLowerCase().contains(query) ?? false)
|
||||
return true;
|
||||
if (track.lyrics != null) {
|
||||
try {
|
||||
final lyricsData = LyricsData.fromJsonString(
|
||||
track.lyrics!,
|
||||
);
|
||||
for (final line in lyricsData.lines) {
|
||||
if (line.text.toLowerCase().contains(query))
|
||||
return true;
|
||||
}
|
||||
} catch (e) {
|
||||
// Ignore parsing errors
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}).toList();
|
||||
}
|
||||
|
||||
if (filteredTracks.isEmpty && searchQuery.value.isNotEmpty) {
|
||||
return const Center(
|
||||
child: Text('No tracks match your search.'),
|
||||
);
|
||||
}
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: TextField(
|
||||
onChanged: (value) => searchQuery.value = value,
|
||||
decoration: const InputDecoration(
|
||||
hintText: 'Search tracks...',
|
||||
prefixIcon: Icon(Icons.search),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: 72 + MediaQuery.paddingOf(context).bottom,
|
||||
),
|
||||
itemCount: filteredTracks.length,
|
||||
itemBuilder: (context, index) {
|
||||
final track = filteredTracks[index];
|
||||
final isSelected = selectedTrackIds.value.contains(
|
||||
track.id,
|
||||
);
|
||||
|
||||
if (isSelectionMode) {
|
||||
return ListTile(
|
||||
selected: isSelected,
|
||||
selectedTileColor: Colors.white10,
|
||||
leading: Checkbox(
|
||||
value: isSelected,
|
||||
onChanged: (_) => toggleSelection(track.id),
|
||||
),
|
||||
title: Text(
|
||||
track.title,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
subtitle: Text(
|
||||
'${track.artist ?? 'Unknown Artist'} • ${_formatDuration(track.duration)}',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
onTap: () => toggleSelection(track.id),
|
||||
);
|
||||
}
|
||||
|
||||
return Dismissible(
|
||||
key: Key('track_${track.id}'),
|
||||
direction: DismissDirection.endToStart,
|
||||
background: Container(
|
||||
color: Colors.red,
|
||||
alignment: Alignment.centerRight,
|
||||
padding: const EdgeInsets.only(right: 20),
|
||||
child: const Icon(
|
||||
Icons.delete,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
confirmDismiss: (direction) async {
|
||||
return await showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Delete Track?'),
|
||||
content: Text(
|
||||
'Are you sure you want to delete "${track.title}"? This cannot be undone.',
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () =>
|
||||
Navigator.of(context).pop(false),
|
||||
child: const Text('Cancel'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () =>
|
||||
Navigator.of(context).pop(true),
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: Colors.red,
|
||||
),
|
||||
child: const Text('Delete'),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
onDismissed: (direction) {
|
||||
ref
|
||||
.read(trackRepositoryProvider.notifier)
|
||||
.deleteTrack(track.id);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text('Deleted "${track.title}"'),
|
||||
),
|
||||
);
|
||||
},
|
||||
child: ListTile(
|
||||
leading: AspectRatio(
|
||||
aspectRatio: 1,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey[800],
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
image: track.artUri != null
|
||||
? DecorationImage(
|
||||
image: FileImage(
|
||||
File(track.artUri!),
|
||||
),
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
: null,
|
||||
),
|
||||
child: track.artUri == null
|
||||
? const Icon(
|
||||
Icons.music_note,
|
||||
color: Colors.white54,
|
||||
)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
title: Text(
|
||||
track.title,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
subtitle: Text(
|
||||
'${track.artist ?? 'Unknown Artist'} • ${_formatDuration(track.duration)}',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
trailing: isSelectionMode
|
||||
? null
|
||||
: IconButton(
|
||||
icon: const Icon(Icons.more_vert),
|
||||
onPressed: () {
|
||||
_showTrackOptions(context, ref, track);
|
||||
},
|
||||
),
|
||||
onTap: () {
|
||||
final audio = ref.read(audioHandlerProvider);
|
||||
audio.playTrack(track);
|
||||
},
|
||||
onLongPress: () {
|
||||
// Enter selection mode
|
||||
toggleSelection(track.id);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
NavigationRail(
|
||||
selectedIndex: selectedTab!.value,
|
||||
onDestinationSelected: (index) => selectedTab.value = index,
|
||||
destinations: const [
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.audiotrack),
|
||||
label: Text('Tracks'),
|
||||
),
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.album),
|
||||
label: Text('Albums'),
|
||||
),
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.queue_music),
|
||||
label: Text('Playlists'),
|
||||
),
|
||||
],
|
||||
),
|
||||
Expanded(
|
||||
child: _buildTabContent(
|
||||
selectedTab.value,
|
||||
ref,
|
||||
repo,
|
||||
selectedTrackIds,
|
||||
searchQuery,
|
||||
toggleSelection,
|
||||
isSelectionMode,
|
||||
),
|
||||
),
|
||||
|
||||
// Albums Tab
|
||||
const AlbumsTab(),
|
||||
|
||||
// Playlists Tab
|
||||
const PlaylistsTab(),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return DefaultTabController(
|
||||
length: 3,
|
||||
child: Scaffold(
|
||||
appBar: isSelectionMode
|
||||
? AppBar(
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: clearSelection,
|
||||
),
|
||||
title: Text('${selectedTrackIds.value.length} selected'),
|
||||
backgroundColor: Theme.of(context).primaryColorDark,
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.playlist_add),
|
||||
tooltip: 'Add to Playlist',
|
||||
onPressed: () {
|
||||
_batchAddToPlaylist(
|
||||
context,
|
||||
ref,
|
||||
selectedTrackIds.value.toList(),
|
||||
clearSelection,
|
||||
);
|
||||
},
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.delete),
|
||||
tooltip: 'Delete',
|
||||
onPressed: () {
|
||||
_batchDelete(
|
||||
context,
|
||||
ref,
|
||||
selectedTrackIds.value.toList(),
|
||||
clearSelection,
|
||||
);
|
||||
},
|
||||
),
|
||||
const Gap(8),
|
||||
],
|
||||
)
|
||||
: AppBar(
|
||||
centerTitle: true,
|
||||
title: const Text('Library'),
|
||||
bottom: const TabBar(
|
||||
tabs: [
|
||||
Tab(text: 'Tracks', icon: Icon(Icons.audiotrack)),
|
||||
Tab(text: 'Albums', icon: Icon(Icons.album)),
|
||||
Tab(text: 'Playlists', icon: Icon(Icons.queue_music)),
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.add_circle_outline),
|
||||
tooltip: 'Import Files',
|
||||
onPressed: () async {
|
||||
final result = await FilePicker.platform.pickFiles(
|
||||
type: FileType.custom,
|
||||
allowedExtensions: allAllowedExtensions,
|
||||
allowMultiple: true,
|
||||
);
|
||||
if (result != null && result.files.isNotEmpty) {
|
||||
final paths = result.files
|
||||
.map((f) => f.path)
|
||||
.whereType<String>()
|
||||
.toList();
|
||||
if (paths.isNotEmpty) {
|
||||
// Separate audio and lyrics files
|
||||
final audioPaths = paths.where((path) {
|
||||
final ext = p
|
||||
.extension(path)
|
||||
.toLowerCase()
|
||||
.replaceFirst('.', '');
|
||||
return audioExtensions.contains(ext);
|
||||
}).toList();
|
||||
final lyricsPaths = paths.where((path) {
|
||||
final ext = p
|
||||
.extension(path)
|
||||
.toLowerCase()
|
||||
.replaceFirst('.', '');
|
||||
return lyricsExtensions.contains(ext);
|
||||
}).toList();
|
||||
|
||||
// Import tracks if any
|
||||
if (audioPaths.isNotEmpty) {
|
||||
await repo.importFiles(audioPaths);
|
||||
}
|
||||
|
||||
// Import lyrics if any
|
||||
if (lyricsPaths.isNotEmpty) {
|
||||
await _batchImportLyricsFromPaths(
|
||||
context,
|
||||
ref,
|
||||
lyricsPaths,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
const Gap(8),
|
||||
],
|
||||
),
|
||||
body: TabBarView(
|
||||
children: [
|
||||
_buildTracksTab(
|
||||
ref,
|
||||
repo,
|
||||
selectedTrackIds,
|
||||
searchQuery,
|
||||
toggleSelection,
|
||||
isSelectionMode,
|
||||
),
|
||||
const AlbumsTab(),
|
||||
const PlaylistsTab(),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildTracksTab(
|
||||
WidgetRef ref,
|
||||
dynamic repo,
|
||||
ValueNotifier<Set<int>> selectedTrackIds,
|
||||
ValueNotifier<String> searchQuery,
|
||||
void Function(int) toggleSelection,
|
||||
bool isSelectionMode,
|
||||
) {
|
||||
return StreamBuilder<List<Track>>(
|
||||
stream: repo.watchAllTracks(),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.hasError) {
|
||||
return Center(child: Text('Error: ${snapshot.error}'));
|
||||
}
|
||||
if (!snapshot.hasData) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
final tracks = snapshot.data!;
|
||||
if (tracks.isEmpty) {
|
||||
return const Center(child: Text('No tracks yet. Add some!'));
|
||||
}
|
||||
|
||||
List<Track> filteredTracks;
|
||||
if (searchQuery.value.isEmpty) {
|
||||
filteredTracks = tracks;
|
||||
} else {
|
||||
final query = searchQuery.value.toLowerCase();
|
||||
filteredTracks = tracks.where((track) {
|
||||
if (track.title.toLowerCase().contains(query)) return true;
|
||||
if (track.artist?.toLowerCase().contains(query) ?? false)
|
||||
return true;
|
||||
if (track.album?.toLowerCase().contains(query) ?? false)
|
||||
return true;
|
||||
if (track.lyrics != null) {
|
||||
try {
|
||||
final lyricsData = LyricsData.fromJsonString(track.lyrics!);
|
||||
for (final line in lyricsData.lines) {
|
||||
if (line.text.toLowerCase().contains(query)) return true;
|
||||
}
|
||||
} catch (e) {
|
||||
// Ignore parsing errors
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}).toList();
|
||||
}
|
||||
|
||||
if (filteredTracks.isEmpty && searchQuery.value.isNotEmpty) {
|
||||
return const Center(child: Text('No tracks match your search.'));
|
||||
}
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: MediaQuery.of(context).size.width * 0.04,
|
||||
vertical: 16.0,
|
||||
),
|
||||
child: TextField(
|
||||
onChanged: (value) => searchQuery.value = value,
|
||||
decoration: const InputDecoration(
|
||||
hintText: 'Search tracks...',
|
||||
prefixIcon: Icon(Icons.search),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: 72 + MediaQuery.paddingOf(context).bottom,
|
||||
),
|
||||
itemCount: filteredTracks.length,
|
||||
itemBuilder: (context, index) {
|
||||
final track = filteredTracks[index];
|
||||
final isSelected = selectedTrackIds.value.contains(track.id);
|
||||
|
||||
if (isSelectionMode) {
|
||||
return ListTile(
|
||||
selected: isSelected,
|
||||
selectedTileColor: Colors.white10,
|
||||
leading: Checkbox(
|
||||
value: isSelected,
|
||||
onChanged: (_) => toggleSelection(track.id),
|
||||
),
|
||||
title: Text(
|
||||
track.title,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
subtitle: Text(
|
||||
'${track.artist ?? 'Unknown Artist'} • ${_formatDuration(track.duration)}',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
onTap: () => toggleSelection(track.id),
|
||||
);
|
||||
}
|
||||
|
||||
return Dismissible(
|
||||
key: Key('track_${track.id}'),
|
||||
direction: DismissDirection.endToStart,
|
||||
background: Container(
|
||||
color: Colors.red,
|
||||
alignment: Alignment.centerRight,
|
||||
padding: const EdgeInsets.only(right: 20),
|
||||
child: const Icon(Icons.delete, color: Colors.white),
|
||||
),
|
||||
confirmDismiss: (direction) async {
|
||||
return await showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Delete Track?'),
|
||||
content: Text(
|
||||
'Are you sure you want to delete "${track.title}"? This cannot be undone.',
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () =>
|
||||
Navigator.of(context).pop(false),
|
||||
child: const Text('Cancel'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () =>
|
||||
Navigator.of(context).pop(true),
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: Colors.red,
|
||||
),
|
||||
child: const Text('Delete'),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
onDismissed: (direction) {
|
||||
ref
|
||||
.read(trackRepositoryProvider.notifier)
|
||||
.deleteTrack(track.id);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('Deleted "${track.title}"')),
|
||||
);
|
||||
},
|
||||
child: ListTile(
|
||||
leading: AspectRatio(
|
||||
aspectRatio: 1,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey[800],
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
image: track.artUri != null
|
||||
? DecorationImage(
|
||||
image: FileImage(File(track.artUri!)),
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
: null,
|
||||
),
|
||||
child: track.artUri == null
|
||||
? const Icon(
|
||||
Icons.music_note,
|
||||
color: Colors.white54,
|
||||
)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
title: Text(
|
||||
track.title,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
subtitle: Text(
|
||||
'${track.artist ?? 'Unknown Artist'} • ${_formatDuration(track.duration)}',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
trailing: isSelectionMode
|
||||
? null
|
||||
: IconButton(
|
||||
icon: const Icon(Icons.more_vert),
|
||||
onPressed: () {
|
||||
_showTrackOptions(context, ref, track);
|
||||
},
|
||||
),
|
||||
onTap: () {
|
||||
final audio = ref.read(audioHandlerProvider);
|
||||
audio.playTrack(track);
|
||||
},
|
||||
onLongPress: () {
|
||||
// Enter selection mode
|
||||
toggleSelection(track.id);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildTabContent(
|
||||
int index,
|
||||
WidgetRef ref,
|
||||
dynamic repo,
|
||||
ValueNotifier<Set<int>> selectedTrackIds,
|
||||
ValueNotifier<String> searchQuery,
|
||||
void Function(int) toggleSelection,
|
||||
bool isSelectionMode,
|
||||
) {
|
||||
switch (index) {
|
||||
case 0:
|
||||
return _buildTracksTab(
|
||||
ref,
|
||||
repo,
|
||||
selectedTrackIds,
|
||||
searchQuery,
|
||||
toggleSelection,
|
||||
isSelectionMode,
|
||||
);
|
||||
case 1:
|
||||
return const AlbumsTab();
|
||||
case 2:
|
||||
return const PlaylistsTab();
|
||||
default:
|
||||
return const SizedBox();
|
||||
}
|
||||
}
|
||||
|
||||
void _showTrackOptions(BuildContext context, WidgetRef ref, Track track) {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
@@ -439,6 +600,7 @@ class LibraryScreen extends HookConsumerWidget {
|
||||
WidgetRef ref,
|
||||
Track track,
|
||||
) {
|
||||
final screenSize = MediaQuery.of(context).size;
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
@@ -448,8 +610,11 @@ class LibraryScreen extends HookConsumerWidget {
|
||||
// Or we can use a Consumer widget inside the dialog.
|
||||
return AlertDialog(
|
||||
title: const Text('Add to Playlist'),
|
||||
content: SizedBox(
|
||||
width: double.maxFinite,
|
||||
content: ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: screenSize.width * 0.8,
|
||||
maxHeight: screenSize.height * 0.6,
|
||||
),
|
||||
child: Consumer(
|
||||
builder: (context, ref, child) {
|
||||
final playlistsAsync = ref
|
||||
@@ -509,28 +674,32 @@ class LibraryScreen extends HookConsumerWidget {
|
||||
final titleController = TextEditingController(text: track.title);
|
||||
final artistController = TextEditingController(text: track.artist);
|
||||
final albumController = TextEditingController(text: track.album);
|
||||
final screenSize = MediaQuery.of(context).size;
|
||||
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: const Text('Edit Track'),
|
||||
content: Column(
|
||||
spacing: 16,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
TextField(
|
||||
controller: titleController,
|
||||
decoration: const InputDecoration(labelText: 'Title'),
|
||||
),
|
||||
TextField(
|
||||
controller: artistController,
|
||||
decoration: const InputDecoration(labelText: 'Artist'),
|
||||
),
|
||||
TextField(
|
||||
controller: albumController,
|
||||
decoration: const InputDecoration(labelText: 'Album'),
|
||||
),
|
||||
],
|
||||
content: ConstrainedBox(
|
||||
constraints: BoxConstraints(maxWidth: screenSize.width * 0.8),
|
||||
child: Column(
|
||||
spacing: 16,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
TextField(
|
||||
controller: titleController,
|
||||
decoration: const InputDecoration(labelText: 'Title'),
|
||||
),
|
||||
TextField(
|
||||
controller: artistController,
|
||||
decoration: const InputDecoration(labelText: 'Artist'),
|
||||
),
|
||||
TextField(
|
||||
controller: albumController,
|
||||
decoration: const InputDecoration(labelText: 'Album'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
@@ -570,13 +739,17 @@ class LibraryScreen extends HookConsumerWidget {
|
||||
List<int> trackIds,
|
||||
VoidCallback onSuccess,
|
||||
) {
|
||||
final screenSize = MediaQuery.of(context).size;
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Add to Playlist'),
|
||||
content: SizedBox(
|
||||
width: double.maxFinite,
|
||||
content: ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: screenSize.width * 0.8,
|
||||
maxHeight: screenSize.height * 0.6,
|
||||
),
|
||||
child: Consumer(
|
||||
builder: (context, ref, child) {
|
||||
final playlistsAsync = ref
|
||||
|
||||
Reference in New Issue
Block a user