diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index a86958b..4282cea 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ diff --git a/android/app/src/main/ic_launcher-playstore.png b/android/app/src/main/ic_launcher-playstore.png new file mode 100644 index 0000000..c94f6c2 Binary files /dev/null and b/android/app/src/main/ic_launcher-playstore.png differ diff --git a/android/app/src/main/res/drawable/ic_launcher_foreground.xml b/android/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..40f176e --- /dev/null +++ b/android/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..7353dbd --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..7353dbd --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png index db77bb4..b4390a8 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..58ad4a3 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png index 17987b7..45efdcd 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..77a19a1 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 09d4391..1b056fc 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..f5ee23b Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index d5f1c8d..c5dbace 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..b87d92a Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 4d6372e..4b13e5c 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..5c06ccd Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/values/ic_launcher_background.xml b/android/app/src/main/res/values/ic_launcher_background.xml new file mode 100644 index 0000000..a8f12a4 --- /dev/null +++ b/android/app/src/main/res/values/ic_launcher_background.xml @@ -0,0 +1,4 @@ + + + #5722EC + \ No newline at end of file diff --git a/assets/Chanel.png b/assets/Chanel.png deleted file mode 100644 index d6b8d00..0000000 Binary files a/assets/Chanel.png and /dev/null differ diff --git a/assets/OneOfWun.png b/assets/OneOfWun.png deleted file mode 100644 index bbd3059..0000000 Binary files a/assets/OneOfWun.png and /dev/null differ diff --git a/assets/dino.png b/assets/dino.png deleted file mode 100644 index 79eecaa..0000000 Binary files a/assets/dino.png and /dev/null differ diff --git a/assets/hexathon.png b/assets/hexathon.png deleted file mode 100644 index f320ae7..0000000 Binary files a/assets/hexathon.png and /dev/null differ diff --git a/assets/icon.svg b/assets/icon.svg new file mode 100644 index 0000000..6e8bd83 --- /dev/null +++ b/assets/icon.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/assets/splash.svg b/assets/splash.svg new file mode 100644 index 0000000..427501d --- /dev/null +++ b/assets/splash.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/wt.png b/assets/wt.png deleted file mode 100644 index b2218f8..0000000 Binary files a/assets/wt.png and /dev/null differ diff --git a/lib/providers/admin_screen_provider.dart b/lib/providers/admin_screen_provider.dart index f37c265..aa994b5 100644 --- a/lib/providers/admin_screen_provider.dart +++ b/lib/providers/admin_screen_provider.dart @@ -1,7 +1,9 @@ +import 'dart:convert'; import 'dart:developer'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'package:spotify_collab_app/providers/playlist_provider.dart'; import 'package:spotify_collab_app/utils/api_util.dart'; import 'package:spotify_collab_app/view/models/songs_response.dart'; @@ -97,4 +99,25 @@ class SongsNotifier extends StateNotifier { } return false; } + + Future deleteSong( + String playlistUuid, String songUri) async { + try { + final response = await apiUtil.delete('/v1/songs', data: { + 'playlist_uuid': playlistUuid, + 'song_uri': songUri, + }); + log(jsonEncode(response.data)); + + if (response.statusCode == 200) { + fetchSongs(playlistUuid); + return DeleteStatus.success; + } + + return DeleteStatus.failure; + } catch (e) { + log(e.toString()); + return DeleteStatus.error; + } + } } diff --git a/lib/providers/create_screen_provider.dart b/lib/providers/create_screen_provider.dart index ccf6eb4..df210a4 100644 --- a/lib/providers/create_screen_provider.dart +++ b/lib/providers/create_screen_provider.dart @@ -2,8 +2,6 @@ import 'dart:io'; import 'package:dio/dio.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'dart:developer'; - import 'package:spotify_collab_app/utils/api_util.dart'; class CreateScreenNotifier extends StateNotifier> { @@ -23,8 +21,6 @@ class CreateScreenNotifier extends StateNotifier> { formData, ); - log(response.toString()); - if (response.statusCode == 200 && response.data["message"] == "playlist successfully created") { state = const AsyncValue.data(null); diff --git a/lib/providers/playlist_provider.dart b/lib/providers/playlist_provider.dart index ee180e5..13916a0 100644 --- a/lib/providers/playlist_provider.dart +++ b/lib/providers/playlist_provider.dart @@ -48,7 +48,7 @@ class HomeScreenInfo { } } -enum DeletePlaylistStatus { success, failure, error } +enum DeleteStatus { success, failure, error } class PlaylistNotifier extends StateNotifier { PlaylistNotifier() @@ -98,7 +98,7 @@ class PlaylistNotifier extends StateNotifier { } } - Future deletePlaylist(String playlistUuid) async { + Future deletePlaylist(String playlistUuid) async { try { final response = await apiUtil.delete('/v1/playlists/$playlistUuid'); log(jsonEncode(response.data)); @@ -118,13 +118,13 @@ class PlaylistNotifier extends StateNotifier { state = state.copyWith( ownedPlaylists: ownedPlaylists, memberPlaylists: memberPlaylists); - return DeletePlaylistStatus.success; + return DeleteStatus.success; } } - return DeletePlaylistStatus.failure; + return DeleteStatus.failure; } catch (e) { log(e.toString()); - return DeletePlaylistStatus.error; + return DeleteStatus.error; } } diff --git a/lib/utils/api_util.dart b/lib/utils/api_util.dart index 1e3efa9..ce136ba 100644 --- a/lib/utils/api_util.dart +++ b/lib/utils/api_util.dart @@ -74,9 +74,14 @@ class ApiUtil { } } - Future delete(String endpoint) async { + Future delete(String endpoint, {dynamic data}) async { try { - Response response = await dio.delete(endpoint); + Response response; + if (data != null) { + response = await dio.delete(endpoint, data: data); + } else { + response = await dio.delete(endpoint); + } await _updateTokenFromMetadata(response.data); return response; } catch (e) { diff --git a/lib/view/screens/admin_screen.dart b/lib/view/screens/admin_screen.dart index 01e562e..67c7c2e 100644 --- a/lib/view/screens/admin_screen.dart +++ b/lib/view/screens/admin_screen.dart @@ -90,114 +90,94 @@ class _AdminScreenState extends ConsumerState ), actions: [ (GoRouterState.of(context).extra as Map)['owner'] - ? PopupMenuButton( - icon: const Icon( - Icons.more_vert, - color: Color(0xffD1D2D9), - size: 16, - ), - itemBuilder: (BuildContext context) => - >[ - const PopupMenuItem( - value: 'delete', - child: Row( - children: [ - Icon(Icons.delete_outline, color: Colors.red), - SizedBox(width: 8), - Text('Delete', - style: TextStyle(color: Colors.red)), - ], - ), - ), - ], - onSelected: (String value) { - if (value == 'delete') { - showDialog( - context: context, - builder: (context) => AlertDialog( - title: const Text('Delete Playlist'), - content: const Text( - 'Are you sure you want to delete this playlist?'), - actions: [ - TextButton( - onPressed: () => Navigator.pop(context), - child: const Text('Cancel'), - ), - TextButton( - onPressed: () async { - final status = await ref - .read(playlistProvider.notifier) - .deletePlaylist(ref - .read(playlistProvider.notifier) - .selectedPlaylistUuid!); + ? IconButton( + icon: const Icon(Icons.delete_outline, color: Colors.red), + onPressed: () { + showDialog( + context: context, + builder: (context) => AlertDialog( + title: const Text('Delete Playlist'), + content: const Text( + 'Are you sure you want to delete this playlist?'), + actions: [ + TextButton( + onPressed: () => Navigator.pop(context), + child: const Text('Cancel'), + ), + TextButton( + onPressed: () async { + final status = await ref + .read(playlistProvider.notifier) + .deletePlaylist(ref + .read(playlistProvider.notifier) + .selectedPlaylistUuid!); - if (!context.mounted) return; + if (!context.mounted) return; - switch (status) { - case DeletePlaylistStatus.success: - ScaffoldMessenger.of(context) - .showSnackBar( - const SnackBar( - content: Text( - 'Playlist deleted successfully', - style: TextStyle( - fontFamily: 'Gotham', - color: Colors.white, - fontWeight: FontWeight.w600, - fontSize: 14, - ), + switch (status) { + case DeleteStatus.success: + ScaffoldMessenger.of(context) + .showSnackBar( + const SnackBar( + content: Text( + 'Playlist deleted successfully', + style: TextStyle( + fontFamily: 'Gotham', + color: Colors.white, + fontWeight: FontWeight.w600, + fontSize: 14, ), - backgroundColor: Colors.green, ), - ); - context.pop(); - context.pop(); - break; - case DeletePlaylistStatus.failure: - ScaffoldMessenger.of(context) - .showSnackBar( - const SnackBar( - content: Text( - 'Failed to delete playlist', - style: TextStyle( - fontFamily: 'Gotham', - color: Colors.white, - fontWeight: FontWeight.w600, - fontSize: 14, - ), + backgroundColor: Colors.green, + ), + ); + context.pop(); + context.pop(); + break; + case DeleteStatus.failure: + ScaffoldMessenger.of(context) + .showSnackBar( + const SnackBar( + content: Text( + 'Failed to delete playlist', + style: TextStyle( + fontFamily: 'Gotham', + color: Colors.white, + fontWeight: FontWeight.w600, + fontSize: 14, ), - backgroundColor: Colors.red, ), - ); - context.pop(); - break; - case DeletePlaylistStatus.error: - ScaffoldMessenger.of(context) - .showSnackBar( - const SnackBar( - content: Text( - 'Error occurred while deleting playlist', - style: TextStyle( - fontFamily: 'Gotham', - color: Colors.white, - fontWeight: FontWeight.w600, - fontSize: 14, - ), + backgroundColor: Colors.red, + ), + ); + context.pop(); + break; + case DeleteStatus.error: + ScaffoldMessenger.of(context) + .showSnackBar( + const SnackBar( + content: Text( + 'Error occurred while deleting playlist', + style: TextStyle( + fontFamily: 'Gotham', + color: Colors.white, + fontWeight: FontWeight.w600, + fontSize: 14, ), - backgroundColor: Colors.red, ), - ); - context.pop(); - break; - } - }, - child: const Text('Delete', - style: TextStyle(color: Colors.red)), - ), - ], - ), - ); - } + backgroundColor: Colors.red, + ), + ); + context.pop(); + break; + } + }, + child: const Text('Delete', + style: TextStyle(color: Colors.red)), + ), + ], + ), + ); }, ) : const SizedBox.shrink() @@ -265,7 +245,7 @@ class _AdminScreenState extends ConsumerState fontWeight: FontWeight.w600, ), ), - ), + ) ], ), const Divider( diff --git a/lib/view/screens/splash_screen.dart b/lib/view/screens/splash_screen.dart index 2d79a97..69fe023 100644 --- a/lib/view/screens/splash_screen.dart +++ b/lib/view/screens/splash_screen.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:go_router/go_router.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -14,7 +15,16 @@ class SplashScreenState extends ConsumerState { @override void initState() { super.initState(); - _checkForToken(); + _initialize(); + } + + Future _initialize() async { + await wait(); + await _checkForToken(); + } + + Future wait() async { + await Future.delayed(const Duration(seconds: 1)); } Future _checkForToken() async { @@ -32,10 +42,10 @@ class SplashScreenState extends ConsumerState { @override Widget build(BuildContext context) { - return const Scaffold( - body: Center( - child: CircularProgressIndicator(), - ), + return SvgPicture.asset( + 'assets/splash.svg', + height: MediaQuery.of(context).size.height, + width: MediaQuery.of(context).size.width, ); } } diff --git a/lib/view/widgets/music_list_item.dart b/lib/view/widgets/music_list_item.dart index 4d5077b..7bd41dc 100644 --- a/lib/view/widgets/music_list_item.dart +++ b/lib/view/widgets/music_list_item.dart @@ -2,6 +2,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:go_router/go_router.dart'; import 'package:shimmer/shimmer.dart'; import 'package:spotify_collab_app/providers/admin_screen_provider.dart'; import 'package:spotify_collab_app/providers/playlist_provider.dart'; @@ -40,119 +41,123 @@ class MusicListItem extends ConsumerWidget { final songsNotifier = ref.read(songsProvider.notifier); final playlistsProvider = ref.watch(playlistProvider.notifier); return ListTile( - contentPadding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8), - leading: isParticipant - ? ClipRRect( - borderRadius: BorderRadius.circular(50), - child: Container( - width: 50, - height: 50, - decoration: BoxDecoration( - gradient: LinearGradient( - colors: [ - getRandomColor(), - Colors.black, - ], - begin: Alignment.topLeft, - end: Alignment.bottomRight, + contentPadding: + const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8), + leading: isParticipant + ? ClipRRect( + borderRadius: BorderRadius.circular(50), + child: Container( + width: 50, + height: 50, + decoration: BoxDecoration( + gradient: LinearGradient( + colors: [ + getRandomColor(), + Colors.black, + ], + begin: Alignment.topLeft, + end: Alignment.bottomRight, + ), + shape: BoxShape.circle, ), - shape: BoxShape.circle, - ), - child: Center( - child: Text( - title[0].toUpperCase(), - style: TextStyle( - color: const Color(0xFFFFFFFF) - .withAlpha((0.8 * 255).toInt()), - fontWeight: FontWeight.bold, - fontSize: 24, + child: Center( + child: Text( + title[0].toUpperCase(), + style: TextStyle( + color: const Color(0xFFFFFFFF) + .withAlpha((0.8 * 255).toInt()), + fontWeight: FontWeight.bold, + fontSize: 24, + ), ), ), ), - ), - ) - : Container( - width: 50, - height: 50, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8.0), - ), - child: Image.network( - imageUrl!, - loadingBuilder: (context, child, loadingProgress) { - if (loadingProgress == null) return child; - return Shimmer.fromColors( - baseColor: Colors.grey[800]!, - highlightColor: Colors.grey[600]!, - child: Container( + ) + : Container( + width: 50, + height: 50, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.0), + ), + child: Image.network( + imageUrl!, + loadingBuilder: (context, child, loadingProgress) { + if (loadingProgress == null) return child; + return Shimmer.fromColors( + baseColor: Colors.grey[800]!, + highlightColor: Colors.grey[600]!, + child: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.0), + ), + ), + ); + }, + errorBuilder: (context, error, stackTrace) { + return Container( decoration: BoxDecoration( - color: Colors.white, + color: Colors.grey[800], borderRadius: BorderRadius.circular(8.0), ), - ), - ); - }, - errorBuilder: (context, error, stackTrace) { - return Container( - decoration: BoxDecoration( - color: Colors.grey[800], - borderRadius: BorderRadius.circular(8.0), - ), - child: const Icon(Icons.error_outline, color: Colors.white), - ); - }, + child: + const Icon(Icons.error_outline, color: Colors.white), + ); + }, + ), ), - ), - title: Text( - title, - style: const TextStyle( - fontFamily: 'Gotham', - fontWeight: FontWeight.w700, - color: Colors.white, - fontSize: 14, + title: Text( + title, + style: const TextStyle( + fontFamily: 'Gotham', + fontWeight: FontWeight.w700, + color: Colors.white, + fontSize: 14, + ), ), - ), - subtitle: isParticipant - ? null - : Text( - subtitle ?? '', - style: const TextStyle( - fontFamily: 'Gotham', - fontWeight: FontWeight.w300, - color: Colors.grey, - fontSize: 10, + subtitle: isParticipant + ? null + : Text( + subtitle ?? '', + style: const TextStyle( + fontFamily: 'Gotham', + fontWeight: FontWeight.w300, + color: Colors.grey, + fontSize: 10, + ), ), - ), - trailing: isRequest - ? Row( - mainAxisSize: MainAxisSize.min, - children: [ - IconButton( - icon: const Icon(Icons.close, color: Colors.red), - onPressed: () async { - final success = await songsNotifier.rejectSong( - playlistsProvider.selectedPlaylistUuid!, id!); - if (context.mounted) { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( - success ? 'Song rejected' : 'Failed to reject song', - style: const TextStyle( - fontFamily: 'Gotham', - color: Colors.white, - fontWeight: FontWeight.w600, - fontSize: 14, + trailing: isRequest + ? Row( + mainAxisSize: MainAxisSize.min, + children: [ + IconButton( + icon: const Icon(Icons.close, color: Colors.red), + onPressed: () async { + final success = await songsNotifier.rejectSong( + playlistsProvider.selectedPlaylistUuid!, id!); + if (context.mounted) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + success + ? 'Song rejected' + : 'Failed to reject song', + style: const TextStyle( + fontFamily: 'Gotham', + color: Colors.white, + fontWeight: FontWeight.w600, + fontSize: 14, + ), ), + backgroundColor: success + ? Colors.green + : Colors.red.withOpacity(0.8), ), - backgroundColor: success - ? Colors.green - : Colors.red.withOpacity(0.8), - ), - ); - } - }, - ), - IconButton( + ); + } + }, + ), + IconButton( icon: const Icon(Icons.check, color: Colors.green), onPressed: () async { final success = await songsNotifier.acceptSong( @@ -177,21 +182,106 @@ class MusicListItem extends ConsumerWidget { ), ); } - }), - ], - ) - : isParticipant - ? null - : InkWell( - onTap: () {}, - child: InkWell( - onTap: () {}, - child: const Icon( - Icons.more_vert, - color: Color(0xff737373), - ), + }, ), - ), - ); + ], + ) + : isParticipant + ? null + : (GoRouterState.of(context).extra + as Map)['owner'] + ? IconButton( + icon: + const Icon(Icons.delete_outline, color: Colors.red), + onPressed: () { + showDialog( + context: context, + builder: (context) => AlertDialog( + title: const Text('Delete Song'), + content: const Text( + 'Are you sure you want to delete this song?'), + actions: [ + TextButton( + onPressed: () => Navigator.pop(context), + child: const Text('Cancel'), + ), + TextButton( + onPressed: () async { + final status = + await songsNotifier.deleteSong( + ref + .read(playlistProvider.notifier) + .selectedPlaylistUuid!, + id!, + ); + + if (!context.mounted) return; + + switch (status) { + case DeleteStatus.success: + ScaffoldMessenger.of(context) + .showSnackBar( + const SnackBar( + content: Text( + 'Song deleted successfully', + style: TextStyle( + fontFamily: 'Gotham', + color: Colors.white, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + ), + backgroundColor: Colors.green, + ), + ); + context.pop(); + break; + case DeleteStatus.failure: + ScaffoldMessenger.of(context) + .showSnackBar( + const SnackBar( + content: Text( + 'Failed to delete song', + style: TextStyle( + fontFamily: 'Gotham', + color: Colors.white, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + ), + backgroundColor: Colors.red, + ), + ); + context.pop(); + break; + case DeleteStatus.error: + ScaffoldMessenger.of(context) + .showSnackBar( + const SnackBar( + content: Text( + 'Error occurred while deleting song', + style: TextStyle( + fontFamily: 'Gotham', + color: Colors.white, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + ), + backgroundColor: Colors.red, + ), + ); + context.pop(); + break; + } + }, + child: const Text('Delete', + style: TextStyle(color: Colors.red)), + ), + ], + ), + ); + }, + ) + : const SizedBox.shrink()); } } diff --git a/lib/view/widgets/playlist_card.dart b/lib/view/widgets/playlist_card.dart index cfd138a..1e03fab 100644 --- a/lib/view/widgets/playlist_card.dart +++ b/lib/view/widgets/playlist_card.dart @@ -121,6 +121,10 @@ class PlaylistCard extends ConsumerWidget { }, style: TextButton.styleFrom( padding: EdgeInsets.zero, + minimumSize: const Size(97, 31), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8.0), + ), ), child: Text( isActive ? "Manage" : "View",