mirror of
https://github.com/stonega/tsacdop
synced 2025-02-27 00:37:42 +01:00
Update settings performance.
This commit is contained in:
parent
deb987d71d
commit
cc0f5a4908
@ -37,7 +37,7 @@ class _PlayedHistoryState extends State<PlayedHistory>
|
|||||||
|
|
||||||
bool _loadMore = false;
|
bool _loadMore = false;
|
||||||
|
|
||||||
_loadMoreData() async {
|
Future<void> _loadMoreData() async {
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_loadMore = true;
|
_loadMore = true;
|
||||||
|
@ -185,13 +185,13 @@ class _LayoutSettingState extends State<LayoutSetting> {
|
|||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
height: 30.0,
|
height: 30.0,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 70),
|
padding: const EdgeInsets.symmetric(horizontal: 70),
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: Text(s.settingsPopupMenu,
|
child: Text(s.settingsPopupMenu,
|
||||||
style: Theme.of(context)
|
style: Theme.of(context)
|
||||||
.textTheme
|
.textTheme
|
||||||
.bodyText1
|
.bodyText1
|
||||||
.copyWith(color: Theme.of(context).accentColor)),
|
.copyWith(color: context.accentColor)),
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () => Navigator.push(
|
onTap: () => Navigator.push(
|
||||||
|
@ -22,7 +22,8 @@ List<Libries> fonts = [
|
|||||||
Libries('Libre Baskerville', font,
|
Libries('Libre Baskerville', font,
|
||||||
"https://fonts.google.com/specimen/Libre+Baskerville"),
|
"https://fonts.google.com/specimen/Libre+Baskerville"),
|
||||||
Libries('Teko', font, "https://fonts.google.com/specimen/Teko"),
|
Libries('Teko', font, "https://fonts.google.com/specimen/Teko"),
|
||||||
Libries('Martel', font, "https://fonts.google.com/specimen/Martel")
|
Libries('Martel', font, "https://fonts.google.com/specimen/Martel"),
|
||||||
|
Libries('Bitter', font, "https://fonts.google.com/specimen/Bitter")
|
||||||
];
|
];
|
||||||
|
|
||||||
List<Libries> plugins = [
|
List<Libries> plugins = [
|
||||||
|
@ -58,13 +58,8 @@ class _SettingsState extends State<Settings> {
|
|||||||
),
|
),
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
//physics: const AlwaysScrollableScrollPhysics(),
|
|
||||||
scrollDirection: Axis.vertical,
|
scrollDirection: Axis.vertical,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: <Widget>[
|
|
||||||
Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -81,31 +76,20 @@ class _SettingsState extends State<Settings> {
|
|||||||
.bodyText1
|
.bodyText1
|
||||||
.copyWith(color: context.accentColor)),
|
.copyWith(color: context.accentColor)),
|
||||||
),
|
),
|
||||||
ListView(
|
|
||||||
physics: ClampingScrollPhysics(),
|
|
||||||
shrinkWrap: true,
|
|
||||||
scrollDirection: Axis.vertical,
|
|
||||||
children: <Widget>[
|
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () => Navigator.push(
|
onTap: () => Navigator.push(context,
|
||||||
context,
|
MaterialPageRoute(builder: (context) => ThemeSetting())),
|
||||||
MaterialPageRoute(
|
contentPadding: EdgeInsets.symmetric(horizontal: 25.0),
|
||||||
builder: (context) => ThemeSetting())),
|
leading:
|
||||||
contentPadding:
|
Icon(LineIcons.adjust_solid, color: context.accentColor),
|
||||||
EdgeInsets.symmetric(horizontal: 25.0),
|
|
||||||
leading: Icon(LineIcons.adjust_solid,
|
|
||||||
color: context.accentColor),
|
|
||||||
title: Text(s.settingsAppearance),
|
title: Text(s.settingsAppearance),
|
||||||
subtitle: Text(s.settingsAppearanceDes),
|
subtitle: Text(s.settingsAppearanceDes),
|
||||||
),
|
),
|
||||||
Divider(height: 1),
|
Divider(height: 1),
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () => Navigator.push(
|
onTap: () => Navigator.push(context,
|
||||||
context,
|
MaterialPageRoute(builder: (context) => LayoutSetting())),
|
||||||
MaterialPageRoute(
|
contentPadding: EdgeInsets.symmetric(horizontal: 25.0),
|
||||||
builder: (context) => LayoutSetting())),
|
|
||||||
contentPadding:
|
|
||||||
EdgeInsets.symmetric(horizontal: 25.0),
|
|
||||||
leading: Icon(LineIcons.stop_circle_solid,
|
leading: Icon(LineIcons.stop_circle_solid,
|
||||||
color: Colors.blueAccent),
|
color: Colors.blueAccent),
|
||||||
title: Text(s.settingsLayout),
|
title: Text(s.settingsLayout),
|
||||||
@ -113,14 +97,10 @@ class _SettingsState extends State<Settings> {
|
|||||||
),
|
),
|
||||||
Divider(height: 1),
|
Divider(height: 1),
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () => Navigator.push(
|
onTap: () => Navigator.push(context,
|
||||||
context,
|
MaterialPageRoute(builder: (context) => PlaySetting())),
|
||||||
MaterialPageRoute(
|
contentPadding: EdgeInsets.symmetric(horizontal: 25.0),
|
||||||
builder: (context) => PlaySetting())),
|
leading: Icon(LineIcons.play_circle, color: Colors.redAccent),
|
||||||
contentPadding:
|
|
||||||
EdgeInsets.symmetric(horizontal: 25.0),
|
|
||||||
leading: Icon(LineIcons.play_circle,
|
|
||||||
color: Colors.redAccent),
|
|
||||||
title: Text(s.play),
|
title: Text(s.play),
|
||||||
subtitle: Text(s.settingsPlayDes),
|
subtitle: Text(s.settingsPlayDes),
|
||||||
),
|
),
|
||||||
@ -130,8 +110,7 @@ class _SettingsState extends State<Settings> {
|
|||||||
context,
|
context,
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (context) => SyncingSetting())),
|
builder: (context) => SyncingSetting())),
|
||||||
contentPadding:
|
contentPadding: EdgeInsets.symmetric(horizontal: 25.0),
|
||||||
EdgeInsets.symmetric(horizontal: 25.0),
|
|
||||||
leading: Icon(LineIcons.cloud_download_alt_solid,
|
leading: Icon(LineIcons.cloud_download_alt_solid,
|
||||||
color: Colors.yellow[700]),
|
color: Colors.yellow[700]),
|
||||||
title: Text(s.settingsSyncing),
|
title: Text(s.settingsSyncing),
|
||||||
@ -142,34 +121,26 @@ class _SettingsState extends State<Settings> {
|
|||||||
context,
|
context,
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (context) => StorageSetting())),
|
builder: (context) => StorageSetting())),
|
||||||
contentPadding:
|
contentPadding: EdgeInsets.symmetric(horizontal: 25.0),
|
||||||
EdgeInsets.symmetric(horizontal: 25.0),
|
leading: Icon(LineIcons.save, color: Colors.green[700]),
|
||||||
leading:
|
|
||||||
Icon(LineIcons.save, color: Colors.green[700]),
|
|
||||||
title: Text(s.settingStorage),
|
title: Text(s.settingStorage),
|
||||||
subtitle: Text(s.settingsStorageDes),
|
subtitle: Text(s.settingsStorageDes),
|
||||||
),
|
),
|
||||||
Divider(height: 1),
|
Divider(height: 1),
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () => Navigator.push(
|
onTap: () => Navigator.push(context,
|
||||||
context,
|
MaterialPageRoute(builder: (context) => PlayedHistory())),
|
||||||
MaterialPageRoute(
|
contentPadding: EdgeInsets.symmetric(horizontal: 25.0),
|
||||||
builder: (context) => PlayedHistory())),
|
leading: Icon(Icons.update, color: Colors.indigo[700]),
|
||||||
contentPadding:
|
|
||||||
EdgeInsets.symmetric(horizontal: 25.0),
|
|
||||||
leading:
|
|
||||||
Icon(Icons.update, color: Colors.indigo[700]),
|
|
||||||
title: Text(s.settingsHistory),
|
title: Text(s.settingsHistory),
|
||||||
subtitle: Text(s.settingsHistoryDes),
|
subtitle: Text(s.settingsHistoryDes),
|
||||||
),
|
),
|
||||||
Divider(height: 1),
|
Divider(height: 1),
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () => generalSheet(context,
|
onTap: () => generalSheet(context,
|
||||||
title: s.settingsLanguages,
|
title: s.settingsLanguages, child: LanguagesSetting())
|
||||||
child: LanguagesSetting())
|
|
||||||
.then((value) => setState(() {})),
|
.then((value) => setState(() {})),
|
||||||
contentPadding:
|
contentPadding: EdgeInsets.symmetric(horizontal: 25.0),
|
||||||
EdgeInsets.symmetric(horizontal: 25.0),
|
|
||||||
leading: Icon(LineIcons.language_solid,
|
leading: Icon(LineIcons.language_solid,
|
||||||
color: Colors.purpleAccent),
|
color: Colors.purpleAccent),
|
||||||
title: Text(s.settingsLanguages),
|
title: Text(s.settingsLanguages),
|
||||||
@ -179,30 +150,19 @@ class _SettingsState extends State<Settings> {
|
|||||||
ListTile(
|
ListTile(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
//_exportOmpl(context);
|
//_exportOmpl(context);
|
||||||
Navigator.push(
|
Navigator.push(context,
|
||||||
context,
|
MaterialPageRoute(builder: (context) => DataBackup()));
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (context) => DataBackup()));
|
|
||||||
},
|
},
|
||||||
contentPadding:
|
contentPadding: EdgeInsets.symmetric(horizontal: 25.0),
|
||||||
EdgeInsets.symmetric(horizontal: 25.0),
|
|
||||||
leading: Icon(LineIcons.file_code_solid,
|
leading: Icon(LineIcons.file_code_solid,
|
||||||
color: Colors.lightGreen[700]),
|
color: Colors.lightGreen[700]),
|
||||||
title: Text(s.settingsBackup),
|
title: Text(s.settingsBackup),
|
||||||
subtitle: Text(s.settingsBackupDes),
|
subtitle: Text(s.settingsBackupDes),
|
||||||
),
|
),
|
||||||
Divider(height: 1),
|
Divider(height: 1),
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.all(10.0),
|
padding: EdgeInsets.all(10.0),
|
||||||
),
|
),
|
||||||
Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: <Widget>[
|
|
||||||
Container(
|
Container(
|
||||||
height: 30.0,
|
height: 30.0,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 70),
|
padding: EdgeInsets.symmetric(horizontal: 70),
|
||||||
@ -213,18 +173,10 @@ class _SettingsState extends State<Settings> {
|
|||||||
.bodyText1
|
.bodyText1
|
||||||
.copyWith(color: Theme.of(context).accentColor)),
|
.copyWith(color: Theme.of(context).accentColor)),
|
||||||
),
|
),
|
||||||
ListView(
|
|
||||||
physics: ClampingScrollPhysics(),
|
|
||||||
shrinkWrap: true,
|
|
||||||
scrollDirection: Axis.vertical,
|
|
||||||
children: <Widget>[
|
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () => Navigator.push(
|
onTap: () => Navigator.push(context,
|
||||||
context,
|
MaterialPageRoute(builder: (context) => Libries())),
|
||||||
MaterialPageRoute(
|
contentPadding: EdgeInsets.symmetric(horizontal: 25.0),
|
||||||
builder: (context) => Libries())),
|
|
||||||
contentPadding:
|
|
||||||
EdgeInsets.symmetric(horizontal: 25.0),
|
|
||||||
leading: Icon(LineIcons.book_open_solid,
|
leading: Icon(LineIcons.book_open_solid,
|
||||||
color: Colors.purple[700]),
|
color: Colors.purple[700]),
|
||||||
title: Text(s.settingsLibraries),
|
title: Text(s.settingsLibraries),
|
||||||
@ -239,14 +191,10 @@ class _SettingsState extends State<Settings> {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
_feedbackItem(
|
_feedbackItem(LineIcons.github, s.feedbackGithub,
|
||||||
LineIcons.github,
|
|
||||||
s.feedbackGithub,
|
|
||||||
'https://github.com/stonega/tsacdop/issues'),
|
'https://github.com/stonega/tsacdop/issues'),
|
||||||
Divider(height: 1),
|
Divider(height: 1),
|
||||||
_feedbackItem(
|
_feedbackItem(LineIcons.telegram, s.feedbackTelegram,
|
||||||
LineIcons.telegram,
|
|
||||||
s.feedbackTelegram,
|
|
||||||
'https://t.me/joinchat/Bk3LkRpTHy40QYC78PK7Qg'),
|
'https://t.me/joinchat/Bk3LkRpTHy40QYC78PK7Qg'),
|
||||||
Divider(height: 1),
|
Divider(height: 1),
|
||||||
_feedbackItem(
|
_feedbackItem(
|
||||||
@ -254,18 +202,14 @@ class _SettingsState extends State<Settings> {
|
|||||||
s.feedbackEmail,
|
s.feedbackEmail,
|
||||||
'mailto:<tsacdop.app@gmail.com>?subject=Tsacdop Feedback'),
|
'mailto:<tsacdop.app@gmail.com>?subject=Tsacdop Feedback'),
|
||||||
Divider(height: 1),
|
Divider(height: 1),
|
||||||
_feedbackItem(
|
_feedbackItem(LineIcons.google_play, s.feedbackPlay,
|
||||||
LineIcons.google_play,
|
|
||||||
s.feedbackPlay,
|
|
||||||
'https://play.google.com/store/apps/details?id=com.stonegate.tsacdop'),
|
'https://play.google.com/store/apps/details?id=com.stonegate.tsacdop'),
|
||||||
Divider(height: 1),
|
Divider(height: 1),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
contentPadding:
|
contentPadding: EdgeInsets.symmetric(horizontal: 25.0),
|
||||||
EdgeInsets.symmetric(horizontal: 25.0),
|
leading: Icon(LineIcons.bug_solid, color: Colors.pink[700]),
|
||||||
leading: Icon(LineIcons.bug_solid,
|
|
||||||
color: Colors.pink[700]),
|
|
||||||
title: Text(s.settingsFeedback),
|
title: Text(s.settingsFeedback),
|
||||||
subtitle: Text(s.settingsFeedbackDes),
|
subtitle: Text(s.settingsFeedbackDes),
|
||||||
),
|
),
|
||||||
@ -274,8 +218,7 @@ class _SettingsState extends State<Settings> {
|
|||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
FeatureDiscovery.clearPreferences(
|
FeatureDiscovery.clearPreferences(context, const <String>{
|
||||||
context, const <String>{
|
|
||||||
addFeature,
|
addFeature,
|
||||||
menuFeature,
|
menuFeature,
|
||||||
playlistFeature,
|
playlistFeature,
|
||||||
@ -290,10 +233,9 @@ class _SettingsState extends State<Settings> {
|
|||||||
gravity: ToastGravity.BOTTOM,
|
gravity: ToastGravity.BOTTOM,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
contentPadding:
|
contentPadding: EdgeInsets.symmetric(horizontal: 25.0),
|
||||||
EdgeInsets.symmetric(horizontal: 25.0),
|
leading:
|
||||||
leading: Icon(LineIcons.capsules_solid,
|
Icon(LineIcons.capsules_solid, color: Colors.pinkAccent),
|
||||||
color: Colors.pinkAccent),
|
|
||||||
title: Text(s.settingsDiscovery),
|
title: Text(s.settingsDiscovery),
|
||||||
),
|
),
|
||||||
Divider(height: 1),
|
Divider(height: 1),
|
||||||
@ -303,22 +245,17 @@ class _SettingsState extends State<Settings> {
|
|||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (context) =>
|
builder: (context) =>
|
||||||
SlideIntro(goto: Goto.settings))),
|
SlideIntro(goto: Goto.settings))),
|
||||||
contentPadding:
|
contentPadding: EdgeInsets.symmetric(horizontal: 25.0),
|
||||||
EdgeInsets.symmetric(horizontal: 25.0),
|
leading:
|
||||||
leading: Icon(LineIcons.columns_solid,
|
Icon(LineIcons.columns_solid, color: Colors.blueGrey),
|
||||||
color: Colors.blueGrey),
|
|
||||||
title: Text(s.settingsAppIntro),
|
title: Text(s.settingsAppIntro),
|
||||||
),
|
),
|
||||||
Divider(height: 1),
|
Divider(height: 1),
|
||||||
],
|
|
||||||
),
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.all(10.0),
|
padding: EdgeInsets.all(10.0),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user