Minor change.

This commit is contained in:
stonegate 2020-10-10 21:43:45 +08:00
parent 5e6b5981c7
commit 88ce52dcae
2 changed files with 101 additions and 95 deletions

View File

@ -543,7 +543,7 @@ class __PlaylistButtonState extends State<_PlaylistButton> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var audio = context.watch<AudioPlayerNotifier>(); final audio = context.watch<AudioPlayerNotifier>();
final s = context.s; final s = context.s;
return Material( return Material(
color: Colors.transparent, color: Colors.transparent,

View File

@ -103,108 +103,114 @@ class _PopupMenuState extends State<PopupMenu> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
var refreshWorker = Provider.of<RefreshWorker>(context, listen: false); var refreshWorker = Provider.of<RefreshWorker>(context, listen: false);
final s = context.s; final s = context.s;
return PopupMenuButton<int>( return Material(
shape: RoundedRectangleBorder( color: Colors.transparent,
borderRadius: BorderRadius.all(Radius.circular(10))), borderRadius: BorderRadius.circular(100),
elevation: 1, clipBehavior: Clip.hardEdge,
tooltip: s.menu, child: PopupMenuButton<int>(
itemBuilder: (context) => [ shape: RoundedRectangleBorder(
PopupMenuItem( borderRadius: BorderRadius.all(Radius.circular(10))),
value: 1, elevation: 1,
child: Container( tooltip: s.menu,
padding: EdgeInsets.only(left: 10), itemBuilder: (context) => [
child: Row( PopupMenuItem(
crossAxisAlignment: CrossAxisAlignment.start, value: 1,
children: <Widget>[ child: Container(
Icon(LineIcons.cloud_download_alt_solid), padding: EdgeInsets.only(left: 10),
Padding( child: Row(
padding: EdgeInsets.symmetric(horizontal: 5.0), crossAxisAlignment: CrossAxisAlignment.start,
), children: <Widget>[
Column( Icon(LineIcons.cloud_download_alt_solid),
crossAxisAlignment: CrossAxisAlignment.start, Padding(
children: <Widget>[ padding: EdgeInsets.symmetric(horizontal: 5.0),
Text( ),
s.homeToprightMenuRefreshAll, Column(
), crossAxisAlignment: CrossAxisAlignment.start,
FutureBuilder<String>( children: <Widget>[
future: _getRefreshDate(context), Text(
builder: (_, snapshot) { s.homeToprightMenuRefreshAll,
if (snapshot.hasData) { ),
return Text( FutureBuilder<String>(
snapshot.data, future: _getRefreshDate(context),
style: TextStyle(color: Colors.red, fontSize: 12), builder: (_, snapshot) {
); if (snapshot.hasData) {
} else { return Text(
return Center(); snapshot.data,
} style:
}) TextStyle(color: Colors.red, fontSize: 12),
], );
), } else {
], return Center();
}
})
],
),
],
),
), ),
), ),
), PopupMenuItem(
PopupMenuItem( value: 2,
value: 2, child: Container(
child: Container( padding: EdgeInsets.only(left: 10),
padding: EdgeInsets.only(left: 10), child: Row(
child: Row( children: <Widget>[
children: <Widget>[ Icon(LineIcons.paperclip_solid),
Icon(LineIcons.paperclip_solid), Padding(
Padding( padding: EdgeInsets.symmetric(horizontal: 5.0),
padding: EdgeInsets.symmetric(horizontal: 5.0), ),
), Text(s.homeToprightMenuImportOMPL),
Text(s.homeToprightMenuImportOMPL), ],
], ),
), ),
), ),
), PopupMenuItem(
PopupMenuItem( value: 4,
value: 4, child: Container(
child: Container( padding: EdgeInsets.only(left: 10),
padding: EdgeInsets.only(left: 10), child: Row(
child: Row( children: <Widget>[
children: <Widget>[ Icon(LineIcons.cog_solid),
Icon(LineIcons.cog_solid), Padding(
Padding( padding: EdgeInsets.symmetric(horizontal: 5.0),
padding: EdgeInsets.symmetric(horizontal: 5.0), ),
), Text(s.settings),
Text(s.settings), ],
], ),
), ),
), ),
), PopupMenuItem(
PopupMenuItem( value: 5,
value: 5, child: Container(
child: Container( padding: EdgeInsets.only(left: 10),
padding: EdgeInsets.only(left: 10), child: Row(
child: Row( children: <Widget>[
children: <Widget>[ Icon(LineIcons.info_circle_solid),
Icon(LineIcons.info_circle_solid), Padding(
Padding( padding: EdgeInsets.symmetric(horizontal: 5.0),
padding: EdgeInsets.symmetric(horizontal: 5.0), ),
), Text(s.homeToprightMenuAbout),
Text(s.homeToprightMenuAbout), ],
], ),
), ),
), ),
), ],
], onSelected: (value) {
onSelected: (value) { if (value == 5) {
if (value == 5) { Navigator.push(
Navigator.push( context, MaterialPageRoute(builder: (context) => AboutApp()));
context, MaterialPageRoute(builder: (context) => AboutApp())); } else if (value == 2) {
} else if (value == 2) { _getFilePath();
_getFilePath(); } else if (value == 1) {
} else if (value == 1) { refreshWorker.start([]);
refreshWorker.start([]); } else if (value == 3) {
} else if (value == 3) { // setting.theme != 2 ? setting.setTheme(2) : setting.setTheme(1);
// setting.theme != 2 ? setting.setTheme(2) : setting.setTheme(1); } else if (value == 4) {
} else if (value == 4) { Navigator.push(
Navigator.push( context, MaterialPageRoute(builder: (context) => Settings()));
context, MaterialPageRoute(builder: (context) => Settings())); }
} },
}, ),
); );
} }
} }