Update bottom sheet UI.

This commit is contained in:
stonega 2020-10-29 21:25:42 +08:00
parent 074f31e7cd
commit ee940dda5e
2 changed files with 32 additions and 56 deletions

View File

@ -193,6 +193,7 @@ class _PodcastSettingState extends State<PodcastSetting> {
Widget build(BuildContext context) {
final s = context.s;
final groupList = context.watch<GroupList>();
final textStyle = context.textTheme.bodyText1;
return Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
@ -203,9 +204,10 @@ class _PodcastSettingState extends State<PodcastSetting> {
builder: (context, snapshot) {
return ListTile(
onTap: () => _setAutoDownload(!snapshot.data),
dense: true,
leading: SizedBox(
height: 22,
width: 24,
height: 18,
width: 18,
child: CustomPaint(
painter: DownloadPainter(
color: context.brightness == Brightness.light
@ -216,9 +218,9 @@ class _PodcastSettingState extends State<PodcastSetting> {
),
),
),
title: Text(s.autoDownload),
title: Text(s.autoDownload, style: textStyle),
trailing: Transform.scale(
scale: 0.9,
scale: 0.8,
child:
Switch(value: snapshot.data, onChanged: _setAutoDownload),
),
@ -229,11 +231,12 @@ class _PodcastSettingState extends State<PodcastSetting> {
initialData: false,
builder: (context, snapshot) {
return ListTile(
dense: true,
onTap: () => _setNeverUpdate(!snapshot.data),
leading: Icon(Icons.lock),
title: Text(s.neverAutoUpdate),
leading: Icon(Icons.lock, size: 18),
title: Text(s.neverAutoUpdate, style: textStyle),
trailing: Transform.scale(
scale: 0.9,
scale: 0.8,
child:
Switch(value: snapshot.data, onChanged: _setNeverUpdate),
),
@ -252,8 +255,9 @@ class _PodcastSettingState extends State<PodcastSetting> {
_showStartTimePicker = !_showStartTimePicker;
});
},
leading: Icon(Icons.fast_forward),
title: Text(s.skipSecondsAtStart),
dense: true,
leading: Icon(Icons.fast_forward, size: 18),
title: Text(s.skipSecondsAtStart, style: textStyle),
trailing: Padding(
padding: const EdgeInsets.only(right: 10.0),
child: Text(snapshot.data.toTime),
@ -271,47 +275,15 @@ class _PodcastSettingState extends State<PodcastSetting> {
if (mounted) setState(() => _showStartTimePicker = false);
},
onChange: (value) => _secondsStart = value.inSeconds),
// FutureBuilder<int>(
// future: _getSkipSecondEnd(widget.podcastLocal.id),
// initialData: 0,
// builder: (context, snapshot) => ListTile(
// onTap: () {
// _secondsEnd = 0;
// setState(() {
// _removeConfirm = false;
// _markConfirm = false;
// _showStartTimePicker = false;
// _showEndTimePicker = !_showEndTimePicker;
// });
// },
// leading: Icon(Icons.fast_rewind),
// title: Text(s.skipSecondsAtEnd),
// trailing: Padding(
// padding: const EdgeInsets.only(right: 10.0),
// child: Text(snapshot.data.toTime),
// ),
// ),
// ),
// if (_showEndTimePicker)
// _TimePicker(
// onCancel: () {
// _secondsEnd = 0;
// setState(() => _showEndTimePicker = false);
// },
// onConfirm: () async {
// await _saveSkipSecondsEnd(_secondsEnd);
// setState(() => _showEndTimePicker = false);
// },
// onChange: (value) => _secondsEnd = value.inSeconds,
// ),
ListTile(
onTap: () {
if (_coverStatus != RefreshCoverStatus.start) {
_refreshArtWork();
}
},
title: Text(s.refreshArtwork),
leading: Icon(Icons.refresh),
dense: true,
title: Text(s.refreshArtwork, style: textStyle),
leading: Icon(Icons.refresh, size: 18),
trailing: Padding(
padding: const EdgeInsets.only(right: 15.0),
child: SizedBox(
@ -328,12 +300,13 @@ class _PodcastSettingState extends State<PodcastSetting> {
_markConfirm = !_markConfirm;
});
},
dense: true,
title: Text(s.menuMarkAllListened,
style: TextStyle(
style: textStyle.copyWith(
color: context.accentColor, fontWeight: FontWeight.bold)),
leading: SizedBox(
height: 22,
width: 24,
height: 18,
width: 18,
child: CustomPaint(
painter: ListenedAllPainter(
context.brightness == Brightness.light
@ -391,9 +364,11 @@ class _PodcastSettingState extends State<PodcastSetting> {
_removeConfirm = !_removeConfirm;
});
},
dense: true,
title: Text(s.remove,
style: TextStyle(color: Colors.red, fontWeight: FontWeight.bold)),
leading: Icon(Icons.delete, color: Colors.red),
style: textStyle.copyWith(
color: Colors.red, fontWeight: FontWeight.bold)),
leading: Icon(Icons.delete, color: Colors.red, size:18),
),
if (_removeConfirm)
Container(

View File

@ -51,13 +51,14 @@ class _LanguagesSettingState extends State<LanguagesSetting> {
@override
Widget build(BuildContext context) {
final textStyle = context.textTheme.bodyText1;
final s = context.s;
return Column(
children: [
ListTile(
title: Text(
s.systemDefault,
style: TextStyle(
style: textStyle.copyWith(
color: Intl.systemLocale.contains(Intl.getCurrentLocale())
? context.accentColor
: null),
@ -68,7 +69,7 @@ class _LanguagesSettingState extends State<LanguagesSetting> {
),
Divider(height: 1),
ListTile(
title: Text('English'),
title: Text('English',style: textStyle),
onTap: () => _setLocale(Locale('en')),
contentPadding: const EdgeInsets.only(left: 20, right: 20),
trailing: Radio<Locale>(
@ -77,7 +78,7 @@ class _LanguagesSettingState extends State<LanguagesSetting> {
onChanged: _setLocale)),
Divider(height: 1),
ListTile(
title: Text('简体中文'),
title: Text('简体中文', style: textStyle),
onTap: () => _setLocale(Locale('zh_Hans')),
contentPadding: const EdgeInsets.only(left: 20, right: 20),
trailing: Radio<Locale>(
@ -87,7 +88,7 @@ class _LanguagesSettingState extends State<LanguagesSetting> {
)),
Divider(height: 1),
ListTile(
title: Text('Français'),
title: Text('Français', style: textStyle),
onTap: () => _setLocale(Locale('fr')),
contentPadding: const EdgeInsets.only(left: 20, right: 20),
trailing: Radio<Locale>(
@ -97,7 +98,7 @@ class _LanguagesSettingState extends State<LanguagesSetting> {
),
Divider(height: 1),
ListTile(
title: Text('Español'),
title: Text('Español',style: textStyle),
onTap: () => _setLocale(Locale('es')),
contentPadding: const EdgeInsets.only(left: 20, right: 20),
trailing: Radio<Locale>(
@ -107,7 +108,7 @@ class _LanguagesSettingState extends State<LanguagesSetting> {
),
Divider(height: 1),
ListTile(
title: Text('Português'),
title: Text('Português',style: textStyle),
onTap: () => _setLocale(Locale('pt')),
contentPadding: const EdgeInsets.only(left: 20, right: 20),
trailing: Radio<Locale>(
@ -117,7 +118,7 @@ class _LanguagesSettingState extends State<LanguagesSetting> {
),
Divider(height: 1),
ListTile(
title: Text('Italiano'),
title: Text('Italiano', style: textStyle),
onTap: () => _setLocale(Locale('it')),
contentPadding: const EdgeInsets.only(left: 20, right: 20),
trailing: Radio<Locale>(