Skip to content

Commit

Permalink
Add play button for navigate from song list page to pv playlist page
Browse files Browse the repository at this point in the history
  • Loading branch information
up2code committed Jan 13, 2021
1 parent 7322e71 commit 690d7fd
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 43 deletions.
37 changes: 22 additions & 15 deletions lib/src/pages/favorite_song_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,27 @@ class FavoriteSongPage extends GetView<FavoriteSongController> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: _buildTitle(context), actions: <Widget>[
_buildSearchAction(context),
IconButton(
icon: Icon(Icons.tune),
onPressed: () => Get.to(FavoriteSongFilterPage()))
]),
body: Obx(
() => (controller.initialLoading.value)
? CenterLoading()
: SongListView(
songs: controller.results().map((e) => e.song).toList(),
onSelect: this._onTapSong,
onReachLastItem: controller.onReachLastItem,
),
));
appBar: AppBar(title: _buildTitle(context), actions: <Widget>[
_buildSearchAction(context),
IconButton(
icon: Icon(Icons.tune),
onPressed: () => Get.to(FavoriteSongFilterPage()))
]),
body: Obx(
() => (controller.initialLoading.value)
? CenterLoading()
: SongListView(
songs: controller.results().map((e) => e.song).toList(),
onSelect: this._onTapSong,
onReachLastItem: controller.onReachLastItem,
),
),
floatingActionButton: FloatingActionButton(
onPressed: () => AppPages.openPVPlayListPage(
controller.results().map((e) => e.song).toList(),
title: 'favoriteSongs'.tr),
child: Icon(Icons.play_arrow),
),
);
}
}
28 changes: 15 additions & 13 deletions lib/src/pages/ranking_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,21 @@ class _RankingPageState extends State<RankingPage>
final theme = Theme.of(context);
return SafeArea(
child: Scaffold(
appBar: TabBar(
controller: _tabController,
tabs: _generateTabs(),
labelColor: theme.textSelectionColor,
unselectedLabelColor: theme.textTheme.headline6.color,
),
body: TabBarView(
controller: _tabController,
children: _generateRankingContent(),
),
floatingActionButton: FloatingActionButton(
onPressed: () => this._onTapPlaylist(),
child: Icon(Icons.play_arrow))),
appBar: TabBar(
controller: _tabController,
tabs: _generateTabs(),
labelColor: theme.textSelectionColor,
unselectedLabelColor: theme.textTheme.headline6.color,
),
body: TabBarView(
controller: _tabController,
children: _generateRankingContent(),
),
floatingActionButton: FloatingActionButton(
onPressed: () => this._onTapPlaylist(),
child: Icon(Icons.play_arrow),
),
),
);
}
}
Expand Down
36 changes: 21 additions & 15 deletions lib/src/pages/song_search_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,26 @@ class SongSearchPage extends GetView<SongSearchController> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: _buildTitle(context), actions: <Widget>[
_buildSearchAction(context),
IconButton(
icon: Icon(Icons.tune),
onPressed: () => Get.to(SongSearchFilterPage()))
]),
body: Obx(
() => (controller.initialLoading.value)
? CenterLoading()
: SongListView(
songs: controller.results.toList(),
onSelect: this._onSelect,
onReachLastItem: controller.onReachLastItem,
),
));
appBar: AppBar(title: _buildTitle(context), actions: <Widget>[
_buildSearchAction(context),
IconButton(
icon: Icon(Icons.tune),
onPressed: () => Get.to(SongSearchFilterPage()))
]),
body: Obx(
() => (controller.initialLoading.value)
? CenterLoading()
: SongListView(
songs: controller.results.toList(),
onSelect: this._onSelect,
onReachLastItem: controller.onReachLastItem,
),
),
floatingActionButton: FloatingActionButton(
onPressed: () => AppPages.openPVPlayListPage(controller.results(),
title: 'songs'.tr),
child: Icon(Icons.play_arrow),
),
);
}
}

0 comments on commit 690d7fd

Please sign in to comment.