Change dropdown menu UI with custom dropdown widget.

Add scrollbar in libried page.
This commit is contained in:
stonegate 2020-07-09 00:18:32 +08:00
parent c9de380180
commit f1989a0565
10 changed files with 1695 additions and 82 deletions

View File

@ -74,7 +74,7 @@ If no api key added, the search function in the app won't work. But you can stil
* Local storage
- sqflite
- share_preference
- shared_preferences
* Audio
- just_audio
- audio_service

View File

@ -16,7 +16,7 @@ import '../util/pageroute.dart';
import '../util/colorize.dart';
import '../util/context_extension.dart';
import '../util/custompaint.dart';
import '../util/customslider.dart';
import '../util/custom_slider.dart';
import '../episodes/episode_detail.dart';
import 'playlist.dart';
import 'audiopanel.dart';

View File

@ -11,7 +11,7 @@ import 'package:tuple/tuple.dart';
import '../state/audio_state.dart';
import '../util/context_extension.dart';
import '../util/customslider.dart';
import '../util/custom_slider.dart';
import '../util/pageroute.dart';
final List<BoxShadow> _customShadow = [

View File

@ -49,6 +49,7 @@ class _LanguagesSettingState extends State<LanguagesSetting> {
await S.load(Locale(Intl.systemLocale));
setState(() {});
},
contentPadding: const EdgeInsets.only(left: 75, right: 20),
trailing: Radio<Locale>(
value: Locale(Intl.systemLocale),
groupValue: Locale(Intl.getCurrentLocale()),
@ -64,6 +65,7 @@ class _LanguagesSettingState extends State<LanguagesSetting> {
await S.load(Locale('en'));
setState(() {});
},
contentPadding: const EdgeInsets.only(left: 75, right: 20),
trailing: Radio<Locale>(
value: Locale('en'),
groupValue: Locale(Intl.getCurrentLocale()),
@ -79,6 +81,7 @@ class _LanguagesSettingState extends State<LanguagesSetting> {
await S.load(Locale('zh_Hans'));
setState(() {});
},
contentPadding: const EdgeInsets.only(left: 75, right: 20),
trailing: Radio<Locale>(
value: Locale('zh_Hans'),
groupValue: Locale(Intl.getCurrentLocale()),
@ -91,6 +94,7 @@ class _LanguagesSettingState extends State<LanguagesSetting> {
ListTile(
onTap: () => _launchUrl(
'mailto:<tsacdop.app@gmail.com>?subject=Tsacdop localization project'),
contentPadding: const EdgeInsets.only(left: 75, right: 20),
subtitle: Text(
"If you'd like to contribute to support more languages, please contact me."),
trailing: IconButton(

View File

@ -29,6 +29,7 @@ class Libries extends StatelessWidget {
backgroundColor: Theme.of(context).primaryColor,
),
body: SafeArea(
child: Scrollbar(
child: SingleChildScrollView(
scrollDirection: Axis.vertical,
child: Column(
@ -98,7 +99,8 @@ class Libries extends StatelessWidget {
(e) {
return ListTile(
onTap: () => _launchUrl(e.link),
contentPadding: EdgeInsets.symmetric(horizontal: 80),
contentPadding:
EdgeInsets.symmetric(horizontal: 80),
title: Text(e.name),
subtitle: Text(e.license),
);
@ -111,6 +113,7 @@ class Libries extends StatelessWidget {
),
),
),
),
);
}
}

View File

@ -12,6 +12,7 @@ import '../state/setting_state.dart';
import '../home/audioplayer.dart';
import '../util/general_dialog.dart';
import '../util/context_extension.dart';
import '../util/custom_dropdown.dart';
String stringForMins(int mins) {
if (mins == null) return null;
@ -320,10 +321,11 @@ class PlaySetting extends StatelessWidget {
subtitle: Text(s.settingsSTDefautTimeDes),
trailing: Selector<SettingState, int>(
selector: (_, settings) => settings.defaultSleepTimer,
builder: (_, data, __) => DropdownButton(
builder: (_, data, __) => MyDropdownButton(
hint: Text(s.minsCount(data)),
underline: Center(),
elevation: 1,
displayItemCount: 5,
isDense: true,
value: data,
onChanged: (int value) =>

View File

@ -5,6 +5,7 @@ import 'package:tuple/tuple.dart';
import '../state/setting_state.dart';
import '../util/context_extension.dart';
import '../util/custom_dropdown.dart';
class SyncingSetting extends StatelessWidget {
@override
@ -91,10 +92,11 @@ class SyncingSetting extends StatelessWidget {
const EdgeInsets.only(left: 80.0, right: 20),
title: Text(s.settingsUpdateInterval),
subtitle: Text(s.settingsUpdateIntervalDes),
trailing: DropdownButton(
trailing: MyDropdownButton(
hint: Text(s.hoursCount(data.item2)),
underline: Center(),
elevation: 1,
displayItemCount: 5,
value: data.item2,
onChanged: data.item1
? (value) async {

View File

@ -111,14 +111,14 @@ class GroupList extends ChangeNotifier {
}
}
_initGroup() async {
storage.getGroups().then((loadgroups) async {
_groups.addAll(loadgroups.map((e) => PodcastGroup.fromEntity(e)));
await Future.forEach(_groups, (group) async {
await group.getPodcasts();
});
});
}
// _initGroup() async {
// storage.getGroups().then((loadgroups) async {
// _groups.addAll(loadgroups.map((e) => PodcastGroup.fromEntity(e)));
// await Future.forEach(_groups, (group) async {
// await group.getPodcasts();
// });
// });
// }
@override
void addListener(VoidCallback listener) {

File diff suppressed because it is too large Load Diff