mirror of
https://github.com/stonega/tsacdop
synced 2025-02-26 16:27:39 +01:00
Support open podcasts page insteam of group page.
This commit is contained in:
parent
4fe335ff69
commit
bcaab84b8f
@ -10,6 +10,7 @@ import 'package:focused_menu/modals.dart';
|
|||||||
import 'package:line_icons/line_icons.dart';
|
import 'package:line_icons/line_icons.dart';
|
||||||
import 'package:permission_handler/permission_handler.dart';
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:tsacdop/state/setting_state.dart';
|
||||||
import 'package:tuple/tuple.dart' as tuple;
|
import 'package:tuple/tuple.dart' as tuple;
|
||||||
|
|
||||||
import '../episodes/episode_detail.dart';
|
import '../episodes/episode_detail.dart';
|
||||||
@ -30,7 +31,6 @@ import '../util/hide_player_route.dart';
|
|||||||
import '../util/pageroute.dart';
|
import '../util/pageroute.dart';
|
||||||
import '../widgets/custom_widget.dart';
|
import '../widgets/custom_widget.dart';
|
||||||
import '../widgets/general_dialog.dart';
|
import '../widgets/general_dialog.dart';
|
||||||
import 'home.dart';
|
|
||||||
|
|
||||||
class ScrollPodcasts extends StatefulWidget {
|
class ScrollPodcasts extends StatefulWidget {
|
||||||
@override
|
@override
|
||||||
@ -115,11 +115,11 @@ class _ScrollPodcastsState extends State<ScrollPodcasts>
|
|||||||
var groups = data.item1;
|
var groups = data.item1;
|
||||||
var import = data.item2;
|
var import = data.item2;
|
||||||
return groups.isEmpty
|
return groups.isEmpty
|
||||||
? Container(
|
? SizedBox(
|
||||||
height: (width - 20) / 3 + 140,
|
height: (width - 20) / 3 + 140,
|
||||||
)
|
)
|
||||||
: groups[_groupIndex].podcastList.length == 0
|
: groups[_groupIndex].podcastList.length == 0
|
||||||
? Container(
|
? SizedBox(
|
||||||
height: (width - 20) / 3 + 140,
|
height: (width - 20) / 3 + 140,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
@ -184,7 +184,12 @@ class _ScrollPodcastsState extends State<ScrollPodcasts>
|
|||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
SlideLeftRoute(
|
SlideLeftRoute(
|
||||||
page: PodcastManage()),
|
page: context
|
||||||
|
.read<
|
||||||
|
SettingState>()
|
||||||
|
.openAllPodcastDefalt
|
||||||
|
? PodcastList()
|
||||||
|
: PodcastManage()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -344,7 +349,12 @@ class _ScrollPodcastsState extends State<ScrollPodcasts>
|
|||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
SlideLeftRoute(
|
SlideLeftRoute(
|
||||||
page: PodcastManage()),
|
page: context
|
||||||
|
.read<
|
||||||
|
SettingState>()
|
||||||
|
.openAllPodcastDefalt
|
||||||
|
? PodcastList()
|
||||||
|
: PodcastManage()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -455,12 +465,7 @@ class _ScrollPodcastsState extends State<ScrollPodcasts>
|
|||||||
hide: true),
|
hide: true),
|
||||||
duration: Duration(
|
duration: Duration(
|
||||||
milliseconds: 300),
|
milliseconds: 300),
|
||||||
)
|
));
|
||||||
// SlideLeftRoute(
|
|
||||||
// page: PodcastDetail(
|
|
||||||
// podcastLocal: podcastLocal,
|
|
||||||
// )),
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
child: PodcastPreview(
|
child: PodcastPreview(
|
||||||
podcastLocal: podcastLocal,
|
podcastLocal: podcastLocal,
|
||||||
|
@ -7,6 +7,7 @@ import 'package:flutter/services.dart';
|
|||||||
import 'package:fluttertoast/fluttertoast.dart';
|
import 'package:fluttertoast/fluttertoast.dart';
|
||||||
import 'package:line_icons/line_icons.dart';
|
import 'package:line_icons/line_icons.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:tsacdop/state/setting_state.dart';
|
||||||
|
|
||||||
import '../state/podcast_group.dart';
|
import '../state/podcast_group.dart';
|
||||||
import '../util/extension_helper.dart';
|
import '../util/extension_helper.dart';
|
||||||
@ -189,11 +190,17 @@ class _PodcastManageState extends State<PodcastManage>
|
|||||||
AddGroup()),
|
AddGroup()),
|
||||||
icon: Icon(Icons.add_circle_outline)),
|
icon: Icon(Icons.add_circle_outline)),
|
||||||
),
|
),
|
||||||
IconButton(
|
Selector<SettingState, bool>(
|
||||||
|
selector: (_, setting) => setting.openAllPodcastDefalt,
|
||||||
|
builder: (_, data, __) {
|
||||||
|
return !data
|
||||||
|
? IconButton(
|
||||||
splashRadius: 20,
|
splashRadius: 20,
|
||||||
onPressed: () =>
|
onPressed: () => Navigator.push(
|
||||||
Navigator.push(context, ScaleRoute(page: PodcastList())),
|
context, ScaleRoute(page: PodcastList())),
|
||||||
icon: Icon(Icons.all_out)),
|
icon: Icon(Icons.all_out))
|
||||||
|
: Center();
|
||||||
|
})
|
||||||
// _OrderMenu(),
|
// _OrderMenu(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -7,6 +7,7 @@ import 'package:flutter/rendering.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_html/flutter_html.dart';
|
import 'package:flutter_html/flutter_html.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:tsacdop/class/settingstate.dart';
|
||||||
|
|
||||||
import '../local_storage/sqflite_localpodcast.dart';
|
import '../local_storage/sqflite_localpodcast.dart';
|
||||||
import '../state/podcast_group.dart';
|
import '../state/podcast_group.dart';
|
||||||
@ -16,6 +17,7 @@ import '../util/pageroute.dart';
|
|||||||
import '../widgets/custom_widget.dart';
|
import '../widgets/custom_widget.dart';
|
||||||
import '../widgets/general_dialog.dart';
|
import '../widgets/general_dialog.dart';
|
||||||
import 'podcast_detail.dart';
|
import 'podcast_detail.dart';
|
||||||
|
import 'podcast_manage.dart';
|
||||||
import 'podcast_settings.dart';
|
import 'podcast_settings.dart';
|
||||||
|
|
||||||
class AboutPodcast extends StatefulWidget {
|
class AboutPodcast extends StatefulWidget {
|
||||||
@ -51,8 +53,7 @@ class _AboutPodcastState extends State<AboutPodcast> {
|
|||||||
var _groupList = Provider.of<GroupList>(context, listen: false);
|
var _groupList = Provider.of<GroupList>(context, listen: false);
|
||||||
final s = context.s;
|
final s = context.s;
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0)),
|
||||||
borderRadius: BorderRadius.all(Radius.circular(10.0))),
|
|
||||||
titlePadding: EdgeInsets.only(
|
titlePadding: EdgeInsets.only(
|
||||||
top: 20, left: 20, right: context.width / 3, bottom: 20),
|
top: 20, left: 20, right: context.width / 3, bottom: 20),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
@ -117,7 +118,19 @@ class _PodcastListState extends State<PodcastList> {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text(context.s.podcast(2)),
|
title: Text(context.s.podcast(2)),
|
||||||
leading: CustomBackButton(),
|
leading: CustomBackButton(),
|
||||||
centerTitle: true,
|
actions: [
|
||||||
|
Selector<SettingState, bool>(
|
||||||
|
selector: (_, setting) => setting.openAllPodcastDefalt,
|
||||||
|
builder: (_, data, __) {
|
||||||
|
return data
|
||||||
|
? IconButton(
|
||||||
|
splashRadius: 20,
|
||||||
|
icon: Icon(Icons.all_out),
|
||||||
|
onPressed: () => Navigator.push(
|
||||||
|
context, ScaleRoute(page: PodcastManage())))
|
||||||
|
: Center();
|
||||||
|
})
|
||||||
|
],
|
||||||
),
|
),
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -142,7 +155,7 @@ class _PodcastListState extends State<PodcastList> {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
ScaleRoute(
|
SlideLeftRoute(
|
||||||
page: PodcastDetail(
|
page: PodcastDetail(
|
||||||
podcastLocal: snapshot.data[index],
|
podcastLocal: snapshot.data[index],
|
||||||
)),
|
)),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user