Update grid view UI.

This commit is contained in:
stonegate 2020-09-14 23:18:13 +08:00
parent 8ea216468a
commit e1fe91983e
2 changed files with 35 additions and 42 deletions

View File

@ -36,7 +36,7 @@ class _ScrollPodcastsState extends State<ScrollPodcasts>
int _groupIndex = 0;
AnimationController _controller;
TweenSequence _slideTween;
_getSlideTween(double value) => TweenSequence<double>([
TweenSequence<double> _getSlideTween(double value) => TweenSequence<double>([
TweenSequenceItem(
tween: Tween<double>(begin: 0.0, end: value), weight: 3 / 5),
TweenSequenceItem(tween: ConstantTween<double>(value), weight: 1 / 5),
@ -80,7 +80,7 @@ class _ScrollPodcastsState extends State<ScrollPodcasts>
@override
Widget build(BuildContext context) {
var width = MediaQuery.of(context).size.width;
final width = MediaQuery.of(context).size.width;
final s = context.s;
return Selector<GroupList, Tuple3<List<PodcastGroup>, bool, bool>>(
selector: (_, groupList) =>
@ -907,27 +907,27 @@ class ShowEpisode extends StatelessWidget {
episodes[index].pubDate),
overflow: TextOverflow.visible,
style: TextStyle(
height: 1,
fontSize: _width / 35,
color: c,
fontStyle: FontStyle.italic,
),
),
Spacer(),
episodes[index].duration != 0
? Container(
alignment: Alignment.center,
child: Text(
episodes[index]
.duration
.toTime,
style: TextStyle(
fontSize: _width / 35,
// color: _c,
// fontStyle: FontStyle.italic,
),
),
)
: Center(),
if (episodes[index].duration != 0)
Align(
alignment: Alignment.center,
child: Text(
episodes[index]
.duration
.toTime,
style: TextStyle(
fontSize: _width / 35,
// color: _c,
// fontStyle: FontStyle.italic,
),
),
),
episodes[index].duration == 0 ||
episodes[index]
.enclosureLength ==
@ -940,25 +940,22 @@ class ShowEpisode extends StatelessWidget {
'|',
style: TextStyle(
fontSize: _width / 35,
// color: _c,
// fontStyle: FontStyle.italic,
),
),
episodes[index].enclosureLength !=
null &&
episodes[index]
.enclosureLength !=
0
? Container(
alignment: Alignment.center,
child: Text(
'${(episodes[index].enclosureLength) ~/ 1000000}MB',
style: TextStyle(
fontSize:
_width / 35),
),
)
: Center(),
if (episodes[index]
.enclosureLength !=
null &&
episodes[index]
.enclosureLength !=
0)
Container(
alignment: Alignment.center,
child: Text(
'${(episodes[index].enclosureLength) ~/ 1000000}MB',
style: TextStyle(
fontSize: _width / 35),
),
),
],
)),
],

View File

@ -194,7 +194,9 @@ class EpisodeGrid extends StatelessWidget {
Text(
episode.pubDate.toDate(context),
overflow: TextOverflow.visible,
textAlign: TextAlign.center,
style: TextStyle(
height: 1,
fontSize: context.width / 35,
color: color,
fontStyle: FontStyle.italic),
@ -468,10 +470,6 @@ class EpisodeGrid extends StatelessWidget {
episode: episodes[index],
color: c),
Spacer(),
/// _listenIndicater(context,
// episode: episodes[index],
// isListened: snapshot.data),
_isNewIndicator(episodes[index]),
_downloadIndicater(context,
episode: episodes[index],
@ -517,7 +515,7 @@ class EpisodeGrid extends StatelessWidget {
Spacer(),
if (layout != Layout.three &&
episodes[index].duration != 0)
Container(
Align(
alignment: Alignment.center,
child: Text(
episodes[index].duration.toTime,
@ -535,8 +533,6 @@ class EpisodeGrid extends StatelessWidget {
'|',
style: TextStyle(
fontSize: _width / 35,
// color: _c,
// fontStyle: FontStyle.italic,
),
),
if (layout != Layout.three &&
@ -544,7 +540,7 @@ class EpisodeGrid extends StatelessWidget {
null &&
episodes[index].enclosureLength !=
0)
Container(
Align(
alignment: Alignment.center,
child: Text(
'${(episodes[index].enclosureLength) ~/ 1000000}MB',