mirror of
https://github.com/stonega/tsacdop
synced 2025-02-18 04:20:37 +01:00
Change dropdown menu UI with custom dropdown widget.
Add scrollbar in libried page.
This commit is contained in:
parent
c9de380180
commit
f1989a0565
@ -74,7 +74,7 @@ If no api key added, the search function in the app won't work. But you can stil
|
|||||||
|
|
||||||
* Local storage
|
* Local storage
|
||||||
- sqflite
|
- sqflite
|
||||||
- share_preference
|
- shared_preferences
|
||||||
* Audio
|
* Audio
|
||||||
- just_audio
|
- just_audio
|
||||||
- audio_service
|
- audio_service
|
||||||
|
@ -16,7 +16,7 @@ import '../util/pageroute.dart';
|
|||||||
import '../util/colorize.dart';
|
import '../util/colorize.dart';
|
||||||
import '../util/context_extension.dart';
|
import '../util/context_extension.dart';
|
||||||
import '../util/custompaint.dart';
|
import '../util/custompaint.dart';
|
||||||
import '../util/customslider.dart';
|
import '../util/custom_slider.dart';
|
||||||
import '../episodes/episode_detail.dart';
|
import '../episodes/episode_detail.dart';
|
||||||
import 'playlist.dart';
|
import 'playlist.dart';
|
||||||
import 'audiopanel.dart';
|
import 'audiopanel.dart';
|
||||||
|
@ -11,7 +11,7 @@ import 'package:tuple/tuple.dart';
|
|||||||
|
|
||||||
import '../state/audio_state.dart';
|
import '../state/audio_state.dart';
|
||||||
import '../util/context_extension.dart';
|
import '../util/context_extension.dart';
|
||||||
import '../util/customslider.dart';
|
import '../util/custom_slider.dart';
|
||||||
import '../util/pageroute.dart';
|
import '../util/pageroute.dart';
|
||||||
|
|
||||||
final List<BoxShadow> _customShadow = [
|
final List<BoxShadow> _customShadow = [
|
||||||
|
@ -49,6 +49,7 @@ class _LanguagesSettingState extends State<LanguagesSetting> {
|
|||||||
await S.load(Locale(Intl.systemLocale));
|
await S.load(Locale(Intl.systemLocale));
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
|
contentPadding: const EdgeInsets.only(left: 75, right: 20),
|
||||||
trailing: Radio<Locale>(
|
trailing: Radio<Locale>(
|
||||||
value: Locale(Intl.systemLocale),
|
value: Locale(Intl.systemLocale),
|
||||||
groupValue: Locale(Intl.getCurrentLocale()),
|
groupValue: Locale(Intl.getCurrentLocale()),
|
||||||
@ -64,6 +65,7 @@ class _LanguagesSettingState extends State<LanguagesSetting> {
|
|||||||
await S.load(Locale('en'));
|
await S.load(Locale('en'));
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
|
contentPadding: const EdgeInsets.only(left: 75, right: 20),
|
||||||
trailing: Radio<Locale>(
|
trailing: Radio<Locale>(
|
||||||
value: Locale('en'),
|
value: Locale('en'),
|
||||||
groupValue: Locale(Intl.getCurrentLocale()),
|
groupValue: Locale(Intl.getCurrentLocale()),
|
||||||
@ -79,6 +81,7 @@ class _LanguagesSettingState extends State<LanguagesSetting> {
|
|||||||
await S.load(Locale('zh_Hans'));
|
await S.load(Locale('zh_Hans'));
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
|
contentPadding: const EdgeInsets.only(left: 75, right: 20),
|
||||||
trailing: Radio<Locale>(
|
trailing: Radio<Locale>(
|
||||||
value: Locale('zh_Hans'),
|
value: Locale('zh_Hans'),
|
||||||
groupValue: Locale(Intl.getCurrentLocale()),
|
groupValue: Locale(Intl.getCurrentLocale()),
|
||||||
@ -91,6 +94,7 @@ class _LanguagesSettingState extends State<LanguagesSetting> {
|
|||||||
ListTile(
|
ListTile(
|
||||||
onTap: () => _launchUrl(
|
onTap: () => _launchUrl(
|
||||||
'mailto:<tsacdop.app@gmail.com>?subject=Tsacdop localization project'),
|
'mailto:<tsacdop.app@gmail.com>?subject=Tsacdop localization project'),
|
||||||
|
contentPadding: const EdgeInsets.only(left: 75, right: 20),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
"If you'd like to contribute to support more languages, please contact me."),
|
"If you'd like to contribute to support more languages, please contact me."),
|
||||||
trailing: IconButton(
|
trailing: IconButton(
|
||||||
|
@ -29,84 +29,87 @@ class Libries extends StatelessWidget {
|
|||||||
backgroundColor: Theme.of(context).primaryColor,
|
backgroundColor: Theme.of(context).primaryColor,
|
||||||
),
|
),
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: SingleChildScrollView(
|
child: Scrollbar(
|
||||||
scrollDirection: Axis.vertical,
|
child: SingleChildScrollView(
|
||||||
child: Column(
|
scrollDirection: Axis.vertical,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: <Widget>[
|
mainAxisSize: MainAxisSize.min,
|
||||||
Padding(
|
children: <Widget>[
|
||||||
padding: EdgeInsets.all(10.0),
|
Padding(
|
||||||
),
|
padding: EdgeInsets.all(10.0),
|
||||||
Container(
|
),
|
||||||
height: 30.0,
|
Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 70),
|
height: 30.0,
|
||||||
alignment: Alignment.centerLeft,
|
padding: EdgeInsets.symmetric(horizontal: 70),
|
||||||
child: Text('Google',
|
alignment: Alignment.centerLeft,
|
||||||
style: Theme.of(context)
|
child: Text('Google',
|
||||||
.textTheme
|
style: Theme.of(context)
|
||||||
.bodyText1
|
.textTheme
|
||||||
.copyWith(color: Theme.of(context).accentColor)),
|
.bodyText1
|
||||||
),
|
.copyWith(color: Theme.of(context).accentColor)),
|
||||||
Column(
|
),
|
||||||
children: google.map<Widget>(
|
Column(
|
||||||
(e) {
|
children: google.map<Widget>(
|
||||||
return ListTile(
|
|
||||||
contentPadding: EdgeInsets.symmetric(horizontal: 80),
|
|
||||||
onTap: () => _launchUrl(e.link),
|
|
||||||
title: Text(e.name),
|
|
||||||
subtitle: Text(e.license),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
).toList(),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
height: 30.0,
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 70),
|
|
||||||
alignment: Alignment.centerLeft,
|
|
||||||
child: Text(context.s.fonts,
|
|
||||||
style: Theme.of(context)
|
|
||||||
.textTheme
|
|
||||||
.bodyText1
|
|
||||||
.copyWith(color: Theme.of(context).accentColor)),
|
|
||||||
),
|
|
||||||
Column(
|
|
||||||
children: fonts.map<Widget>(
|
|
||||||
(e) {
|
|
||||||
return ListTile(
|
|
||||||
contentPadding: EdgeInsets.symmetric(horizontal: 80),
|
|
||||||
onTap: () => _launchUrl(e.link),
|
|
||||||
title: Text(e.name),
|
|
||||||
subtitle: Text(e.license),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
).toList(),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
height: 30.0,
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 70),
|
|
||||||
alignment: Alignment.centerLeft,
|
|
||||||
child: Text(context.s.plugins,
|
|
||||||
style: Theme.of(context)
|
|
||||||
.textTheme
|
|
||||||
.bodyText1
|
|
||||||
.copyWith(color: Theme.of(context).accentColor)),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
child: Column(
|
|
||||||
children: plugins.map<Widget>(
|
|
||||||
(e) {
|
(e) {
|
||||||
return ListTile(
|
return ListTile(
|
||||||
onTap: () => _launchUrl(e.link),
|
|
||||||
contentPadding: EdgeInsets.symmetric(horizontal: 80),
|
contentPadding: EdgeInsets.symmetric(horizontal: 80),
|
||||||
|
onTap: () => _launchUrl(e.link),
|
||||||
title: Text(e.name),
|
title: Text(e.name),
|
||||||
subtitle: Text(e.license),
|
subtitle: Text(e.license),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
).toList(),
|
).toList(),
|
||||||
),
|
),
|
||||||
),
|
Container(
|
||||||
],
|
height: 30.0,
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 70),
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
child: Text(context.s.fonts,
|
||||||
|
style: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.bodyText1
|
||||||
|
.copyWith(color: Theme.of(context).accentColor)),
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
children: fonts.map<Widget>(
|
||||||
|
(e) {
|
||||||
|
return ListTile(
|
||||||
|
contentPadding: EdgeInsets.symmetric(horizontal: 80),
|
||||||
|
onTap: () => _launchUrl(e.link),
|
||||||
|
title: Text(e.name),
|
||||||
|
subtitle: Text(e.license),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
).toList(),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: 30.0,
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 70),
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
child: Text(context.s.plugins,
|
||||||
|
style: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.bodyText1
|
||||||
|
.copyWith(color: Theme.of(context).accentColor)),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
child: Column(
|
||||||
|
children: plugins.map<Widget>(
|
||||||
|
(e) {
|
||||||
|
return ListTile(
|
||||||
|
onTap: () => _launchUrl(e.link),
|
||||||
|
contentPadding:
|
||||||
|
EdgeInsets.symmetric(horizontal: 80),
|
||||||
|
title: Text(e.name),
|
||||||
|
subtitle: Text(e.license),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
).toList(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -12,6 +12,7 @@ import '../state/setting_state.dart';
|
|||||||
import '../home/audioplayer.dart';
|
import '../home/audioplayer.dart';
|
||||||
import '../util/general_dialog.dart';
|
import '../util/general_dialog.dart';
|
||||||
import '../util/context_extension.dart';
|
import '../util/context_extension.dart';
|
||||||
|
import '../util/custom_dropdown.dart';
|
||||||
|
|
||||||
String stringForMins(int mins) {
|
String stringForMins(int mins) {
|
||||||
if (mins == null) return null;
|
if (mins == null) return null;
|
||||||
@ -320,10 +321,11 @@ class PlaySetting extends StatelessWidget {
|
|||||||
subtitle: Text(s.settingsSTDefautTimeDes),
|
subtitle: Text(s.settingsSTDefautTimeDes),
|
||||||
trailing: Selector<SettingState, int>(
|
trailing: Selector<SettingState, int>(
|
||||||
selector: (_, settings) => settings.defaultSleepTimer,
|
selector: (_, settings) => settings.defaultSleepTimer,
|
||||||
builder: (_, data, __) => DropdownButton(
|
builder: (_, data, __) => MyDropdownButton(
|
||||||
hint: Text(s.minsCount(data)),
|
hint: Text(s.minsCount(data)),
|
||||||
underline: Center(),
|
underline: Center(),
|
||||||
elevation: 1,
|
elevation: 1,
|
||||||
|
displayItemCount: 5,
|
||||||
isDense: true,
|
isDense: true,
|
||||||
value: data,
|
value: data,
|
||||||
onChanged: (int value) =>
|
onChanged: (int value) =>
|
||||||
|
@ -5,6 +5,7 @@ import 'package:tuple/tuple.dart';
|
|||||||
|
|
||||||
import '../state/setting_state.dart';
|
import '../state/setting_state.dart';
|
||||||
import '../util/context_extension.dart';
|
import '../util/context_extension.dart';
|
||||||
|
import '../util/custom_dropdown.dart';
|
||||||
|
|
||||||
class SyncingSetting extends StatelessWidget {
|
class SyncingSetting extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
@ -91,10 +92,11 @@ class SyncingSetting extends StatelessWidget {
|
|||||||
const EdgeInsets.only(left: 80.0, right: 20),
|
const EdgeInsets.only(left: 80.0, right: 20),
|
||||||
title: Text(s.settingsUpdateInterval),
|
title: Text(s.settingsUpdateInterval),
|
||||||
subtitle: Text(s.settingsUpdateIntervalDes),
|
subtitle: Text(s.settingsUpdateIntervalDes),
|
||||||
trailing: DropdownButton(
|
trailing: MyDropdownButton(
|
||||||
hint: Text(s.hoursCount(data.item2)),
|
hint: Text(s.hoursCount(data.item2)),
|
||||||
underline: Center(),
|
underline: Center(),
|
||||||
elevation: 1,
|
elevation: 1,
|
||||||
|
displayItemCount: 5,
|
||||||
value: data.item2,
|
value: data.item2,
|
||||||
onChanged: data.item1
|
onChanged: data.item1
|
||||||
? (value) async {
|
? (value) async {
|
||||||
|
@ -111,14 +111,14 @@ class GroupList extends ChangeNotifier {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_initGroup() async {
|
// _initGroup() async {
|
||||||
storage.getGroups().then((loadgroups) async {
|
// storage.getGroups().then((loadgroups) async {
|
||||||
_groups.addAll(loadgroups.map((e) => PodcastGroup.fromEntity(e)));
|
// _groups.addAll(loadgroups.map((e) => PodcastGroup.fromEntity(e)));
|
||||||
await Future.forEach(_groups, (group) async {
|
// await Future.forEach(_groups, (group) async {
|
||||||
await group.getPodcasts();
|
// await group.getPodcasts();
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void addListener(VoidCallback listener) {
|
void addListener(VoidCallback listener) {
|
||||||
|
1602
lib/util/custom_dropdown.dart
Normal file
1602
lib/util/custom_dropdown.dart
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user