-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
3 changed files
with
642 additions
and
646 deletions.
There are no files selected for viewing
90 changes: 90 additions & 0 deletions
90
lib/ui/screens/PlaylistNAlbum/components/playlist_content_section.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:get/get.dart'; | ||
|
||
import '../../../../models/playlist.dart'; | ||
import '../../../widgets/list_widget.dart'; | ||
import '../../../widgets/modification_list.dart'; | ||
import '../../../widgets/shimmer_widgets/song_list_shimmer.dart'; | ||
import '../../../widgets/sort_widget.dart'; | ||
import '../playlistnalbum_screen_controller.dart'; | ||
|
||
class PlaylistContentSection extends StatelessWidget { | ||
const PlaylistContentSection( | ||
{super.key, required this.content, required this.tag}); | ||
final dynamic content; | ||
final String tag; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final playListNAlbumScreenController = | ||
Get.find<PlayListNAlbumScreenController>(tag: tag); | ||
return Expanded( | ||
child: Column( | ||
children: [ | ||
Obx( | ||
() => SortWidget( | ||
tag: playListNAlbumScreenController.isAlbum | ||
? content.browseId | ||
: content.playlistId, | ||
isSearchFeatureRequired: true, | ||
isPlaylistRearrageFeatureRequired: | ||
!playListNAlbumScreenController.isAlbum && | ||
!content.isCloudPlaylist && | ||
content.playlistId != "LIBRP" && | ||
content.playlistId != "SongDownloads" && | ||
content.playlistId != "SongsCache", | ||
isSongDeletetioFeatureRequired: | ||
!playListNAlbumScreenController.isAlbum && | ||
!content.isCloudPlaylist, | ||
itemCountTitle: | ||
"${playListNAlbumScreenController.songList.length}", | ||
itemIcon: Icons.music_note_rounded, | ||
titleLeftPadding: 9, | ||
requiredSortTypes: buildSortTypeSet(false, true), | ||
onSort: (type, ascending) { | ||
playListNAlbumScreenController.onSort(type, ascending); | ||
}, | ||
onSearch: playListNAlbumScreenController.onSearch, | ||
onSearchClose: playListNAlbumScreenController.onSearchClose, | ||
onSearchStart: playListNAlbumScreenController.onSearchStart, | ||
startAdditionalOperation: | ||
playListNAlbumScreenController.startAdditionalOperation, | ||
selectAll: playListNAlbumScreenController.selectAll, | ||
performAdditionalOperation: | ||
playListNAlbumScreenController.performAdditionalOperation, | ||
cancelAdditionalOperation: | ||
playListNAlbumScreenController.cancelAdditionalOperation, | ||
), | ||
), | ||
Obx(() => playListNAlbumScreenController.isContentFetched.value | ||
? Obx(() => playListNAlbumScreenController.songList.isNotEmpty | ||
? (playListNAlbumScreenController | ||
.additionalOperationMode.value == | ||
OperationMode.none | ||
? ListWidget( | ||
playListNAlbumScreenController.songList.toList(), | ||
"Songs", | ||
true, | ||
isPlaylist: true, | ||
playlist: !playListNAlbumScreenController.isAlbum | ||
? content as Playlist | ||
: null, | ||
) | ||
: ModificationList( | ||
mode: playListNAlbumScreenController | ||
.additionalOperationMode.value, | ||
playListNAlbumScreenController: | ||
playListNAlbumScreenController, | ||
)) | ||
: Expanded( | ||
child: Center( | ||
child: Text("emptyPlaylist".tr, | ||
style: Theme.of(context).textTheme.titleSmall), | ||
), | ||
)) | ||
: const Expanded(child: SongListShimmer())) | ||
], | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.