Update bottom sheet UI.
This commit is contained in:
parent
074f31e7cd
commit
ee940dda5e
|
@ -193,6 +193,7 @@ class _PodcastSettingState extends State<PodcastSetting> {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final s = context.s;
|
final s = context.s;
|
||||||
final groupList = context.watch<GroupList>();
|
final groupList = context.watch<GroupList>();
|
||||||
|
final textStyle = context.textTheme.bodyText1;
|
||||||
return Column(
|
return Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
@ -203,9 +204,10 @@ class _PodcastSettingState extends State<PodcastSetting> {
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
return ListTile(
|
return ListTile(
|
||||||
onTap: () => _setAutoDownload(!snapshot.data),
|
onTap: () => _setAutoDownload(!snapshot.data),
|
||||||
|
dense: true,
|
||||||
leading: SizedBox(
|
leading: SizedBox(
|
||||||
height: 22,
|
height: 18,
|
||||||
width: 24,
|
width: 18,
|
||||||
child: CustomPaint(
|
child: CustomPaint(
|
||||||
painter: DownloadPainter(
|
painter: DownloadPainter(
|
||||||
color: context.brightness == Brightness.light
|
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(
|
trailing: Transform.scale(
|
||||||
scale: 0.9,
|
scale: 0.8,
|
||||||
child:
|
child:
|
||||||
Switch(value: snapshot.data, onChanged: _setAutoDownload),
|
Switch(value: snapshot.data, onChanged: _setAutoDownload),
|
||||||
),
|
),
|
||||||
|
@ -229,11 +231,12 @@ class _PodcastSettingState extends State<PodcastSetting> {
|
||||||
initialData: false,
|
initialData: false,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
return ListTile(
|
return ListTile(
|
||||||
|
dense: true,
|
||||||
onTap: () => _setNeverUpdate(!snapshot.data),
|
onTap: () => _setNeverUpdate(!snapshot.data),
|
||||||
leading: Icon(Icons.lock),
|
leading: Icon(Icons.lock, size: 18),
|
||||||
title: Text(s.neverAutoUpdate),
|
title: Text(s.neverAutoUpdate, style: textStyle),
|
||||||
trailing: Transform.scale(
|
trailing: Transform.scale(
|
||||||
scale: 0.9,
|
scale: 0.8,
|
||||||
child:
|
child:
|
||||||
Switch(value: snapshot.data, onChanged: _setNeverUpdate),
|
Switch(value: snapshot.data, onChanged: _setNeverUpdate),
|
||||||
),
|
),
|
||||||
|
@ -252,8 +255,9 @@ class _PodcastSettingState extends State<PodcastSetting> {
|
||||||
_showStartTimePicker = !_showStartTimePicker;
|
_showStartTimePicker = !_showStartTimePicker;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
leading: Icon(Icons.fast_forward),
|
dense: true,
|
||||||
title: Text(s.skipSecondsAtStart),
|
leading: Icon(Icons.fast_forward, size: 18),
|
||||||
|
title: Text(s.skipSecondsAtStart, style: textStyle),
|
||||||
trailing: Padding(
|
trailing: Padding(
|
||||||
padding: const EdgeInsets.only(right: 10.0),
|
padding: const EdgeInsets.only(right: 10.0),
|
||||||
child: Text(snapshot.data.toTime),
|
child: Text(snapshot.data.toTime),
|
||||||
|
@ -271,47 +275,15 @@ class _PodcastSettingState extends State<PodcastSetting> {
|
||||||
if (mounted) setState(() => _showStartTimePicker = false);
|
if (mounted) setState(() => _showStartTimePicker = false);
|
||||||
},
|
},
|
||||||
onChange: (value) => _secondsStart = value.inSeconds),
|
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(
|
ListTile(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (_coverStatus != RefreshCoverStatus.start) {
|
if (_coverStatus != RefreshCoverStatus.start) {
|
||||||
_refreshArtWork();
|
_refreshArtWork();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
title: Text(s.refreshArtwork),
|
dense: true,
|
||||||
leading: Icon(Icons.refresh),
|
title: Text(s.refreshArtwork, style: textStyle),
|
||||||
|
leading: Icon(Icons.refresh, size: 18),
|
||||||
trailing: Padding(
|
trailing: Padding(
|
||||||
padding: const EdgeInsets.only(right: 15.0),
|
padding: const EdgeInsets.only(right: 15.0),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
|
@ -328,12 +300,13 @@ class _PodcastSettingState extends State<PodcastSetting> {
|
||||||
_markConfirm = !_markConfirm;
|
_markConfirm = !_markConfirm;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
dense: true,
|
||||||
title: Text(s.menuMarkAllListened,
|
title: Text(s.menuMarkAllListened,
|
||||||
style: TextStyle(
|
style: textStyle.copyWith(
|
||||||
color: context.accentColor, fontWeight: FontWeight.bold)),
|
color: context.accentColor, fontWeight: FontWeight.bold)),
|
||||||
leading: SizedBox(
|
leading: SizedBox(
|
||||||
height: 22,
|
height: 18,
|
||||||
width: 24,
|
width: 18,
|
||||||
child: CustomPaint(
|
child: CustomPaint(
|
||||||
painter: ListenedAllPainter(
|
painter: ListenedAllPainter(
|
||||||
context.brightness == Brightness.light
|
context.brightness == Brightness.light
|
||||||
|
@ -391,9 +364,11 @@ class _PodcastSettingState extends State<PodcastSetting> {
|
||||||
_removeConfirm = !_removeConfirm;
|
_removeConfirm = !_removeConfirm;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
dense: true,
|
||||||
title: Text(s.remove,
|
title: Text(s.remove,
|
||||||
style: TextStyle(color: Colors.red, fontWeight: FontWeight.bold)),
|
style: textStyle.copyWith(
|
||||||
leading: Icon(Icons.delete, color: Colors.red),
|
color: Colors.red, fontWeight: FontWeight.bold)),
|
||||||
|
leading: Icon(Icons.delete, color: Colors.red, size:18),
|
||||||
),
|
),
|
||||||
if (_removeConfirm)
|
if (_removeConfirm)
|
||||||
Container(
|
Container(
|
||||||
|
|
|
@ -51,13 +51,14 @@ class _LanguagesSettingState extends State<LanguagesSetting> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final textStyle = context.textTheme.bodyText1;
|
||||||
final s = context.s;
|
final s = context.s;
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
s.systemDefault,
|
s.systemDefault,
|
||||||
style: TextStyle(
|
style: textStyle.copyWith(
|
||||||
color: Intl.systemLocale.contains(Intl.getCurrentLocale())
|
color: Intl.systemLocale.contains(Intl.getCurrentLocale())
|
||||||
? context.accentColor
|
? context.accentColor
|
||||||
: null),
|
: null),
|
||||||
|
@ -68,7 +69,7 @@ class _LanguagesSettingState extends State<LanguagesSetting> {
|
||||||
),
|
),
|
||||||
Divider(height: 1),
|
Divider(height: 1),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text('English'),
|
title: Text('English',style: textStyle),
|
||||||
onTap: () => _setLocale(Locale('en')),
|
onTap: () => _setLocale(Locale('en')),
|
||||||
contentPadding: const EdgeInsets.only(left: 20, right: 20),
|
contentPadding: const EdgeInsets.only(left: 20, right: 20),
|
||||||
trailing: Radio<Locale>(
|
trailing: Radio<Locale>(
|
||||||
|
@ -77,7 +78,7 @@ class _LanguagesSettingState extends State<LanguagesSetting> {
|
||||||
onChanged: _setLocale)),
|
onChanged: _setLocale)),
|
||||||
Divider(height: 1),
|
Divider(height: 1),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text('简体中文'),
|
title: Text('简体中文', style: textStyle),
|
||||||
onTap: () => _setLocale(Locale('zh_Hans')),
|
onTap: () => _setLocale(Locale('zh_Hans')),
|
||||||
contentPadding: const EdgeInsets.only(left: 20, right: 20),
|
contentPadding: const EdgeInsets.only(left: 20, right: 20),
|
||||||
trailing: Radio<Locale>(
|
trailing: Radio<Locale>(
|
||||||
|
@ -87,7 +88,7 @@ class _LanguagesSettingState extends State<LanguagesSetting> {
|
||||||
)),
|
)),
|
||||||
Divider(height: 1),
|
Divider(height: 1),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text('Français'),
|
title: Text('Français', style: textStyle),
|
||||||
onTap: () => _setLocale(Locale('fr')),
|
onTap: () => _setLocale(Locale('fr')),
|
||||||
contentPadding: const EdgeInsets.only(left: 20, right: 20),
|
contentPadding: const EdgeInsets.only(left: 20, right: 20),
|
||||||
trailing: Radio<Locale>(
|
trailing: Radio<Locale>(
|
||||||
|
@ -97,7 +98,7 @@ class _LanguagesSettingState extends State<LanguagesSetting> {
|
||||||
),
|
),
|
||||||
Divider(height: 1),
|
Divider(height: 1),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text('Español'),
|
title: Text('Español',style: textStyle),
|
||||||
onTap: () => _setLocale(Locale('es')),
|
onTap: () => _setLocale(Locale('es')),
|
||||||
contentPadding: const EdgeInsets.only(left: 20, right: 20),
|
contentPadding: const EdgeInsets.only(left: 20, right: 20),
|
||||||
trailing: Radio<Locale>(
|
trailing: Radio<Locale>(
|
||||||
|
@ -107,7 +108,7 @@ class _LanguagesSettingState extends State<LanguagesSetting> {
|
||||||
),
|
),
|
||||||
Divider(height: 1),
|
Divider(height: 1),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text('Português'),
|
title: Text('Português',style: textStyle),
|
||||||
onTap: () => _setLocale(Locale('pt')),
|
onTap: () => _setLocale(Locale('pt')),
|
||||||
contentPadding: const EdgeInsets.only(left: 20, right: 20),
|
contentPadding: const EdgeInsets.only(left: 20, right: 20),
|
||||||
trailing: Radio<Locale>(
|
trailing: Radio<Locale>(
|
||||||
|
@ -117,7 +118,7 @@ class _LanguagesSettingState extends State<LanguagesSetting> {
|
||||||
),
|
),
|
||||||
Divider(height: 1),
|
Divider(height: 1),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text('Italiano'),
|
title: Text('Italiano', style: textStyle),
|
||||||
onTap: () => _setLocale(Locale('it')),
|
onTap: () => _setLocale(Locale('it')),
|
||||||
contentPadding: const EdgeInsets.only(left: 20, right: 20),
|
contentPadding: const EdgeInsets.only(left: 20, right: 20),
|
||||||
trailing: Radio<Locale>(
|
trailing: Radio<Locale>(
|
||||||
|
|
Loading…
Reference in New Issue