Minor change.

This commit is contained in:
stonega 2020-11-06 22:08:26 +08:00
parent b5aad31c15
commit 0a8f622f85
10 changed files with 189 additions and 152 deletions

View File

@ -5,7 +5,7 @@ import 'package:line_icons/line_icons.dart';
import '../util/extension_helper.dart';
import '../widgets/custom_widget.dart';
const String version = '0.5.0';
const String version = '0.5.1';
class AboutApp extends StatefulWidget {
@override

View File

@ -149,7 +149,7 @@ class _HomeState extends State<Home> with SingleTickerProviderStateMixin {
s.featureDiscoverySearchDes,
child: IconButton(
tooltip: s.add,
splashRadius: 25,
splashRadius: 20,
icon:
Icon(Icons.add_circle_outline),
onPressed: () async {
@ -189,7 +189,10 @@ class _HomeState extends State<Home> with SingleTickerProviderStateMixin {
title: s.featureDiscoveryOMPL,
description:
s.featureDiscoveryOMPLDes,
child: PopupMenu()),
child: Padding(
padding: const EdgeInsets.only(right: 5.0),
child: PopupMenu(),
)),
],
),
),

View File

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

View File

@ -86,7 +86,7 @@ class MyHomePageDelegate extends SearchDelegate<int> {
},
child: IconButton(
tooltip: context.s.back,
splashRadius: 25,
splashRadius: 20,
icon: AnimatedIcon(
icon: AnimatedIcons.menu_arrow,
progress: transitionAnimation,
@ -115,7 +115,7 @@ class MyHomePageDelegate extends SearchDelegate<int> {
if (query.isNotEmpty)
IconButton(
tooltip: context.s.clear,
splashRadius: 25,
splashRadius: 20,
icon: const Icon(Icons.clear),
onPressed: () {
query = '';

View File

@ -16,6 +16,7 @@ import 'state/refresh_podcast.dart';
import 'state/search_state.dart';
import 'state/setting_state.dart';
///Initial theme settings
final SettingState themeSetting = SettingState();
Future main() async {
timeDilation = 1.0;
@ -52,7 +53,7 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Consumer<SettingState>(
builder: (_, setting, __) {
builder: (_, setting, child) {
return FeatureDiscovery(
child: MaterialApp(
themeMode: setting.theme,
@ -67,12 +68,11 @@ class MyApp extends StatelessWidget {
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: S.delegate.supportedLocales,
home: setting.showIntro
? SlideIntro(goto: Goto.home)
: FeatureDiscovery(child: Home()),
home: setting.showIntro ? SlideIntro(goto: Goto.home) : child,
),
);
},
child: FeatureDiscovery(child: Home()),
);
}
}

View File

@ -336,12 +336,12 @@ class _PodcastDetailState extends State<PodcastDetail> {
String tooltip,
List<PopupMenuEntry<int>> itemBuilder,
Function(int) onSelected,
bool clip = true}) =>
}) =>
Material(
key: UniqueKey(),
color: Colors.transparent,
borderRadius: BorderRadius.circular(100),
clipBehavior: clip ? Clip.hardEdge : Clip.none,
clipBehavior: Clip.hardEdge,
child: PopupMenuButton<int>(
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
@ -358,7 +358,7 @@ class _PodcastDetailState extends State<PodcastDetail> {
return _customPopupMenu(
tooltip: s.menu,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
padding: EdgeInsets.all(10),
child: Container(
width: 30,
height: 30,

View File

@ -178,7 +178,7 @@ class _PodcastManageState extends State<PodcastManage>
description: s.featureDiscoveryGroupDes,
buttonColor: Colors.cyan[500],
child: IconButton(
splashRadius: 25,
splashRadius: 20,
onPressed: () => showGeneralDialog(
context: context,
barrierDismissible: true,

View File

@ -205,20 +205,23 @@ class _PodcastSettingState extends State<PodcastSetting> {
return ListTile(
onTap: () => _setAutoDownload(!snapshot.data),
dense: true,
leading: SizedBox(
height: 18,
width: 18,
child: CustomPaint(
painter: DownloadPainter(
color: context.brightness == Brightness.light
? Colors.grey[600]
: Colors.white,
fraction: 0,
progressColor: context.accentColor,
title: Row(
children: [
SizedBox(
height: 18,
width: 18,
child: CustomPaint(
painter: DownloadPainter(
color: context.textColor,
fraction: 0,
progressColor: context.accentColor,
),
),
),
),
SizedBox(width: 20),
Text(s.autoDownload, style: textStyle),
],
),
title: Text(s.autoDownload, style: textStyle),
trailing: Transform.scale(
scale: 0.8,
child:
@ -233,8 +236,13 @@ class _PodcastSettingState extends State<PodcastSetting> {
return ListTile(
dense: true,
onTap: () => _setNeverUpdate(!snapshot.data),
leading: Icon(Icons.lock, size: 18),
title: Text(s.neverAutoUpdate, style: textStyle),
title: Row(
children: [
Icon(Icons.lock, size: 18),
SizedBox(width: 20),
Text(s.neverAutoUpdate, style: textStyle),
],
),
trailing: Transform.scale(
scale: 0.8,
child:
@ -256,8 +264,13 @@ class _PodcastSettingState extends State<PodcastSetting> {
});
},
dense: true,
leading: Icon(Icons.fast_forward, size: 18),
title: Text(s.skipSecondsAtStart, style: textStyle),
title: Row(
children: [
Icon(Icons.fast_forward, size: 18),
SizedBox(width: 20),
Text(s.skipSecondsAtStart, style: textStyle),
],
),
trailing: Padding(
padding: const EdgeInsets.only(right: 10.0),
child: Text(snapshot.data.toTime),
@ -282,8 +295,13 @@ class _PodcastSettingState extends State<PodcastSetting> {
}
},
dense: true,
title: Text(s.refreshArtwork, style: textStyle),
leading: Icon(Icons.refresh, size: 18),
title: Row(
children: [
Icon(Icons.refresh, size: 18),
SizedBox(width: 20),
Text(s.refreshArtwork, style: textStyle),
],
),
trailing: Padding(
padding: const EdgeInsets.only(right: 15.0),
child: SizedBox(
@ -301,19 +319,23 @@ class _PodcastSettingState extends State<PodcastSetting> {
});
},
dense: true,
title: Text(s.menuMarkAllListened,
style: textStyle.copyWith(
color: context.accentColor, fontWeight: FontWeight.bold)),
leading: SizedBox(
height: 18,
width: 18,
child: CustomPaint(
painter: ListenedAllPainter(
context.brightness == Brightness.light
? Colors.grey[600]
: Colors.white,
stroke: 2),
),
title: Row(
children: [
SizedBox(
height: 18,
width: 18,
child: CustomPaint(
painter: ListenedAllPainter(
context.accentColor,
stroke: 2),
),
),
SizedBox(width: 20),
Text(s.menuMarkAllListened,
style: textStyle.copyWith(
color: context.accentColor,
fontWeight: FontWeight.bold)),
],
),
trailing: Padding(
padding: const EdgeInsets.only(right: 10.0),
@ -365,10 +387,15 @@ class _PodcastSettingState extends State<PodcastSetting> {
});
},
dense: true,
title: Text(s.remove,
style: textStyle.copyWith(
color: Colors.red, fontWeight: FontWeight.bold)),
leading: Icon(Icons.delete, color: Colors.red, size:18),
title: Row(
children: [
Icon(Icons.delete, color: Colors.red, size: 18),
SizedBox(width: 20),
Text(s.remove,
style: textStyle.copyWith(
color: Colors.red, fontWeight: FontWeight.bold)),
],
),
),
if (_removeConfirm)
Container(

View File

@ -31,14 +31,16 @@ class _SettingsState extends State<Settings> {
Navigator.pop(context);
},
dense: true,
leading: Icon(
icon,
size: 20,
),
title: Text(
name,
maxLines: 2,
style: context.textTheme.bodyText2,
title: Row(
children: [
Icon(icon, size: 20),
SizedBox(width: 20),
Text(
name,
maxLines: 2,
style: context.textTheme.bodyText2,
),
],
),
);

View File

@ -1211,7 +1211,7 @@ class CustomBackButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return IconButton(
splashRadius: 25,
splashRadius: 20,
icon: const BackButtonIcon(),
tooltip: context.s.back,
onPressed: () {