Minor change.

This commit is contained in:
Stonegate 2021-02-08 00:32:17 +08:00
parent 9ea2e59c71
commit 5b2a95cd2d
2 changed files with 72 additions and 75 deletions

View File

@ -150,7 +150,9 @@ class DiscoveryPageState extends State<DiscoveryPage> {
Widget _podcastCard(OnlinePodcast podcast, {VoidCallback onTap}) {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), color: context.primaryColor),
borderRadius: BorderRadius.circular(10), color: context.primaryColor,
border: Border.all(color: context.textColor.withOpacity(0.1), width: 1)
),
width: 120,
margin: EdgeInsets.fromLTRB(10, 10, 0, 10),
child: Material(

View File

@ -10,6 +10,7 @@ import 'package:flutter/services.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:provider/provider.dart';
import 'package:tsacdop/type/episodebrief.dart';
import 'package:webfeed/webfeed.dart';
import '../.env.dart';
@ -969,6 +970,73 @@ class _SearchResultDetailState extends State<SearchResultDetail>
}
}
Widget _episodesList() {
return FutureBuilder<List<OnlineEpisode>>(
future: _searchFuture,
builder: (context, snapshot) {
if (snapshot.hasData) {
var content = snapshot.data;
return ListView.builder(
physics: _animation.value != widget.maxHeight
? NeverScrollableScrollPhysics()
: null,
itemCount: content.length + 1,
itemBuilder: (context, index) {
if (index == content.length) {
return Container(
padding: const EdgeInsets.only(top: 10.0, bottom: 20.0),
alignment: Alignment.center,
child: SizedBox(
child: OutlineButton(
highlightedBorderColor: context.accentColor,
splashColor: context.accentColor.withOpacity(0.5),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(100)),
child: _loading
? SizedBox(
height: 20,
width: 20,
child: CircularProgressIndicator(
strokeWidth: 2,
))
: Text(context.s.loadMore),
onPressed: () {
if (widget.searchEngine ==
SearchEngine.listenNotes) {
_loading
? null
: setState(
() {
_loading = true;
_searchFuture = _getListenNotesEpisodes(
id: widget.onlinePodcast.id,
nextEpisodeDate: _nextEpisdoeDate);
},
);
}
}),
),
);
}
return ListTile(
title: Text(content[index].title),
tileColor: Colors.transparent,
subtitle: Text(
content[index].length == 0
? '${content[index].pubDate.toDate(context)}'
: '${content[index].length.toTime} | '
'${content[index].pubDate.toDate(context)}',
style: TextStyle(color: context.accentColor)),
);
},
);
}
return Center(
child: CircularProgressIndicator(),
);
});
}
@override
Widget build(BuildContext context) {
final s = context.s;
@ -1126,80 +1194,7 @@ class _SearchResultDetailState extends State<SearchResultDetail>
),
],
),
FutureBuilder<List<OnlineEpisode>>(
future: _searchFuture,
builder: (context, snapshot) {
if (snapshot.hasData) {
var content = snapshot.data;
return ListView.builder(
physics: _animation.value != widget.maxHeight
? NeverScrollableScrollPhysics()
: null,
itemCount: content.length + 1,
itemBuilder: (context, index) {
if (index == content.length) {
return Container(
padding: const EdgeInsets.only(
top: 10.0, bottom: 20.0),
alignment: Alignment.center,
child: SizedBox(
child: OutlineButton(
highlightedBorderColor:
context.accentColor,
splashColor: context.accentColor
.withOpacity(0.5),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(100))),
child: _loading
? SizedBox(
height: 20,
width: 20,
child:
CircularProgressIndicator(
strokeWidth: 2,
))
: Text(context.s.loadMore),
onPressed: () {
if (widget.searchEngine ==
SearchEngine.listenNotes) {
_loading
? null
: setState(
() {
_loading = true;
_searchFuture =
_getListenNotesEpisodes(
id: widget
.onlinePodcast
.id,
nextEpisodeDate:
_nextEpisdoeDate);
},
);
}
}),
),
);
}
return ListTile(
title: Text(content[index].title),
tileColor: Colors.transparent,
subtitle: Text(
content[index].length == 0
? '${content[index].pubDate.toDate(context)}'
: '${content[index].length.toTime} | '
'${content[index].pubDate.toDate(context)}',
style: TextStyle(
color: context.accentColor)),
);
},
);
}
return Center(
child: CircularProgressIndicator(),
);
})
_episodesList()
]),
),
)