Change sory by button style.

This commit is contained in:
stonegate 2020-10-09 12:20:54 +08:00
parent fddf9988a5
commit 9b6f7f05e2
1 changed files with 73 additions and 52 deletions

View File

@ -429,58 +429,58 @@ class _PodcastDetailState extends State<PodcastDetail> {
height: 30, height: 30,
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
SizedBox(width: 10), //SizedBox(width: 10),
_customPopupMenu( // _customPopupMenu(
tooltip: s.homeSubMenuSortBy, // tooltip: s.homeSubMenuSortBy,
child: Container( // child: Container(
height: 30, // height: 30,
decoration: BoxDecoration( // decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100.0), // borderRadius: BorderRadius.circular(100.0),
border: Border.all(color: context.primaryColorDark), // border: Border.all(color: context.primaryColorDark),
), // ),
padding: EdgeInsets.symmetric(horizontal: 10), // padding: EdgeInsets.symmetric(horizontal: 10),
child: Row( // child: Row(
mainAxisSize: MainAxisSize.min, // mainAxisSize: MainAxisSize.min,
children: <Widget>[ // children: <Widget>[
Text(s.homeSubMenuSortBy), // Text(s.homeSubMenuSortBy),
SizedBox(width: 5), // SizedBox(width: 5),
Icon( // Icon(
_reverse // _reverse
? LineIcons.hourglass_start_solid // ? LineIcons.hourglass_start_solid
: LineIcons.hourglass_end_solid, // : LineIcons.hourglass_end_solid,
size: 18, // size: 18,
) // )
], // ],
)), // )),
itemBuilder: [ // itemBuilder: [
PopupMenuItem( // PopupMenuItem(
value: 0, // value: 0,
child: Row( // child: Row(
children: [ // children: [
Text(s.newestFirst), // Text(s.newestFirst),
Spacer(), // Spacer(),
if (!_reverse) DotIndicator() // if (!_reverse) DotIndicator()
], // ],
), // ),
), // ),
PopupMenuItem( // PopupMenuItem(
value: 1, // value: 1,
child: Row( // child: Row(
children: [ // children: [
Text(s.oldestFirst), // Text(s.oldestFirst),
Spacer(), // Spacer(),
if (_reverse) DotIndicator() // if (_reverse) DotIndicator()
], // ],
), // ),
) // )
], // ],
onSelected: (value) { // onSelected: (value) {
if (value == 0) { // if (value == 0) {
setState(() => _reverse = false); // setState(() => _reverse = false);
} else if (value == 1) setState(() => _reverse = true); // } else if (value == 1) setState(() => _reverse = true);
}, // },
), // ),
SizedBox(width: 10), SizedBox(width: 15),
_customPopupMenu( _customPopupMenu(
tooltip: s.filter, tooltip: s.filter,
child: Container( child: Container(
@ -617,6 +617,27 @@ class _PodcastDetailState extends State<PodcastDetail> {
} }
}), }),
Spacer(), Spacer(),
Material(
color: Colors.transparent,
clipBehavior: Clip.hardEdge,
borderRadius: BorderRadius.circular(100),
child: SizedBox(
width: 30,
child: IconButton(
padding: EdgeInsets.zero,
tooltip: s.homeSubMenuSortBy,
icon: Icon(
_reverse
? LineIcons.hourglass_start_solid
: LineIcons.hourglass_end_solid,
color: _reverse ? context.accentColor : null,
),
iconSize: 18,
onPressed: () {
setState(() => _reverse = !_reverse);
},
),
)),
FutureBuilder<bool>( FutureBuilder<bool>(
future: _getHideListened(), future: _getHideListened(),
builder: (context, snapshot) { builder: (context, snapshot) {