Skip to content

Commit

Permalink
use track list tile on playback history
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaphasilor committed Jul 31, 2024
1 parent 9521619 commit 4aa9336
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 23 deletions.
47 changes: 26 additions & 21 deletions lib/components/PlaybackHistoryScreen/playback_history_list.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:finamp/components/AlbumScreen/song_list_tile.dart';
import 'package:finamp/components/global_snackbar.dart';
import 'package:finamp/models/finamp_models.dart';
import 'package:finamp/services/audio_service_helper.dart';
Expand Down Expand Up @@ -47,28 +48,32 @@ class PlaybackHistoryList extends StatelessWidget {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12.0),
),
child: PlaybackHistoryListTile(
actualIndex: actualIndex,
item: group.value[actualIndex],
audioServiceHelper: audioServiceHelper,
onTap: () {
GlobalSnackbar.message(
(scaffold) => AppLocalizations.of(context)!
.startingInstantMix,
isConfirmation: true,
);
// child: PlaybackHistoryListTile(
// actualIndex: actualIndex,
// item: group.value[actualIndex],
// audioServiceHelper: audioServiceHelper,
// onTap: () {
// GlobalSnackbar.message(
// (scaffold) => AppLocalizations.of(context)!
// .startingInstantMix,
// isConfirmation: true,
// );

audioServiceHelper
.startInstantMixForItem(
jellyfin_models.BaseItemDto.fromJson(group
.value[actualIndex]
.item
.item
.extras?["itemJson"]))
.catchError((e) {
GlobalSnackbar.error(e);
});
},
// audioServiceHelper
// .startInstantMixForItem(
// jellyfin_models.BaseItemDto.fromJson(group
// .value[actualIndex]
// .item
// .item
// .extras?["itemJson"]))
// .catchError((e) {
// GlobalSnackbar.error(e);
// });
// },
// ),
child: SongListTile(
index: Future.value(actualIndex),
item: group.value[actualIndex].item.baseItem!,
),
);

Expand Down
6 changes: 4 additions & 2 deletions lib/screens/playback_history_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import 'package:finamp/components/PlaybackHistoryScreen/share_offline_listens_bu
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';

import '../components/now_playing_bar.dart';

class PlaybackHistoryScreen extends StatelessWidget {
const PlaybackHistoryScreen({Key? key}) : super(key: key);

Expand All @@ -23,10 +25,10 @@ class PlaybackHistoryScreen extends StatelessWidget {
],
),
body: const Padding(
padding: EdgeInsets.only(left: 8.0, right: 8.0, top: 16.0, bottom: 0.0),
padding: EdgeInsets.only(left: 0.0, right: 0.0, top: 16.0, bottom: 0.0),
child: PlaybackHistoryList(),
),
//bottomNavigationBar: const NowPlayingBar(),
bottomNavigationBar: const NowPlayingBar(),
);
}
}

0 comments on commit 4aa9336

Please sign in to comment.