Resorted settings, toggle's text can change value
This commit is contained in:
parent
2e1f8c1935
commit
ec55ccde3e
|
@ -222,6 +222,46 @@
|
||||||
"description": "Text displayed when behavior settings are not updated for older chats",
|
"description": "Text displayed when behavior settings are not updated for older chats",
|
||||||
"context": "Visible in the settings view"
|
"context": "Visible in the settings view"
|
||||||
},
|
},
|
||||||
|
"settingsShowModelTags": "Model-Tags anzeigen",
|
||||||
|
"@settingsShowModelTags": {
|
||||||
|
"description": "Text displayed as description for show model tags toggle",
|
||||||
|
"context": "Visible in the settings view"
|
||||||
|
},
|
||||||
|
"settingsResetOnModelChange": "Zurücksetzen bei Modelländerung",
|
||||||
|
"@settingsResetOnModelChange": {
|
||||||
|
"description": "Text displayed as description for reset on model change toggle",
|
||||||
|
"context": "Visible in the settings view"
|
||||||
|
},
|
||||||
|
"settingsGenerateTitles": "Titel generieren",
|
||||||
|
"@settingsGenerateTitles": {
|
||||||
|
"description": "Text displayed as description for generate titles toggle",
|
||||||
|
"context": "Visible in the settings view"
|
||||||
|
},
|
||||||
|
"settingsEnableEditing": "Nachrichtenbearbeitung aktivieren",
|
||||||
|
"@settingsEnableEditing": {
|
||||||
|
"description": "Text displayed as description for enable editing toggle",
|
||||||
|
"context": "Visible in the settings view"
|
||||||
|
},
|
||||||
|
"settingsAskBeforeDelete": "Vor Löschung des Chats fragen",
|
||||||
|
"@settingsAskBeforeDelete": {
|
||||||
|
"description": "Text displayed as description for ask before deletion toggle",
|
||||||
|
"context": "Visible in the settings view"
|
||||||
|
},
|
||||||
|
"settingsShowTips": "Tipps in der Seitenleiste anzeigen",
|
||||||
|
"@settingsShowTips": {
|
||||||
|
"description": "Text displayed as description for show tips toggle",
|
||||||
|
"context": "Visible in the settings view"
|
||||||
|
},
|
||||||
|
"settingsRequestTypeStream": "Stream",
|
||||||
|
"@settingsRequestTypeStream": {
|
||||||
|
"description": "Text displayed as description for stream request type. Do not translate if not required!",
|
||||||
|
"context": "Visible in the settings view"
|
||||||
|
},
|
||||||
|
"settingsRequestTypeRequest": "Request",
|
||||||
|
"@settingsRequestTypeRequest": {
|
||||||
|
"description": "Text displayed as description for request request type. Do not translate if not required!",
|
||||||
|
"context": "Visible in the settings view"
|
||||||
|
},
|
||||||
"settingsBrightnessSystem": "System",
|
"settingsBrightnessSystem": "System",
|
||||||
"@settingsBrightnessSystem": {
|
"@settingsBrightnessSystem": {
|
||||||
"description": "Text displayed as description for system brightness option",
|
"description": "Text displayed as description for system brightness option",
|
||||||
|
@ -257,46 +297,6 @@
|
||||||
"description": "Text displayed for cancel button, should be capitalized",
|
"description": "Text displayed for cancel button, should be capitalized",
|
||||||
"context": "Visible in the settings view"
|
"context": "Visible in the settings view"
|
||||||
},
|
},
|
||||||
"settingsGenerateTitles": "Titel generieren",
|
|
||||||
"@settingsGenerateTitles": {
|
|
||||||
"description": "Text displayed as description for generate titles toggle",
|
|
||||||
"context": "Visible in the settings view"
|
|
||||||
},
|
|
||||||
"settingsAskBeforeDelete": "Vor Löschung des Chats fragen",
|
|
||||||
"@settingsAskBeforeDelete": {
|
|
||||||
"description": "Text displayed as description for ask before deletion toggle",
|
|
||||||
"context": "Visible in the settings view"
|
|
||||||
},
|
|
||||||
"settingsResetOnModelChange": "Zurücksetzen bei Modelländerung",
|
|
||||||
"@settingsResetOnModelChange": {
|
|
||||||
"description": "Text displayed as description for reset on model change toggle",
|
|
||||||
"context": "Visible in the settings view"
|
|
||||||
},
|
|
||||||
"settingsEnableEditing": "Nachrichtenbearbeitung aktivieren",
|
|
||||||
"@settingsEnableEditing": {
|
|
||||||
"description": "Text displayed as description for enable editing toggle",
|
|
||||||
"context": "Visible in the settings view"
|
|
||||||
},
|
|
||||||
"settingsShowTips": "Tipps in der Seitenleiste anzeigen",
|
|
||||||
"@settingsShowTips": {
|
|
||||||
"description": "Text displayed as description for show tips toggle",
|
|
||||||
"context": "Visible in the settings view"
|
|
||||||
},
|
|
||||||
"settingsShowModelTags": "Model-Tags anzeigen",
|
|
||||||
"@settingsShowModelTags": {
|
|
||||||
"description": "Text displayed as description for show model tags toggle",
|
|
||||||
"context": "Visible in the settings view"
|
|
||||||
},
|
|
||||||
"settingsRequestTypeStream": "Stream",
|
|
||||||
"@settingsRequestTypeStream": {
|
|
||||||
"description": "Text displayed as description for stream request type. Do not translate if not required!",
|
|
||||||
"context": "Visible in the settings view"
|
|
||||||
},
|
|
||||||
"settingsRequestTypeRequest": "Request",
|
|
||||||
"@settingsRequestTypeRequest": {
|
|
||||||
"description": "Text displayed as description for request request type. Do not translate if not required!",
|
|
||||||
"context": "Visible in the settings view"
|
|
||||||
},
|
|
||||||
"settingsExportChats": "Chats exportieren",
|
"settingsExportChats": "Chats exportieren",
|
||||||
"@settingsExportChats": {
|
"@settingsExportChats": {
|
||||||
"description": "Text displayed as description for export chats button",
|
"description": "Text displayed as description for export chats button",
|
||||||
|
@ -342,6 +342,11 @@
|
||||||
"description": "Warning displayed for export and import options",
|
"description": "Warning displayed for export and import options",
|
||||||
"context": "Visible in the settings view"
|
"context": "Visible in the settings view"
|
||||||
},
|
},
|
||||||
|
"settingsCheckForUpdates": "Beim Öffnen nach Updates suchen",
|
||||||
|
"@settingsCheckForUpdates": {
|
||||||
|
"description": "Text displayed as description for check for updates toggle",
|
||||||
|
"context": "Visible in the settings view"
|
||||||
|
},
|
||||||
"settingsUpdateCheck": "Nach Updates suchen",
|
"settingsUpdateCheck": "Nach Updates suchen",
|
||||||
"@settingsUpdateCheck": {
|
"@settingsUpdateCheck": {
|
||||||
"description": "Text displayed as description for check for updates button",
|
"description": "Text displayed as description for check for updates button",
|
||||||
|
@ -403,11 +408,6 @@
|
||||||
"description": "Text displayed for cancel button, should be capitalized",
|
"description": "Text displayed for cancel button, should be capitalized",
|
||||||
"context": "Visible in the settings view"
|
"context": "Visible in the settings view"
|
||||||
},
|
},
|
||||||
"settingsCheckForUpdates": "Nach Updates suchen",
|
|
||||||
"@settingsCheckForUpdates": {
|
|
||||||
"description": "Text displayed as description for check for updates toggle",
|
|
||||||
"context": "Visible in the settings view"
|
|
||||||
},
|
|
||||||
"settingsGithub": "GitHub",
|
"settingsGithub": "GitHub",
|
||||||
"@settingsGithub": {
|
"@settingsGithub": {
|
||||||
"description": "Text displayed as description for GitHub button",
|
"description": "Text displayed as description for GitHub button",
|
||||||
|
@ -422,5 +422,16 @@
|
||||||
"@settingsMainDeveloper": {
|
"@settingsMainDeveloper": {
|
||||||
"description": "Text displayed as description for main developer button",
|
"description": "Text displayed as description for main developer button",
|
||||||
"context": "Visible in the settings view"
|
"context": "Visible in the settings view"
|
||||||
|
},
|
||||||
|
"settingsVersion": "Ollama App v{version}",
|
||||||
|
"@settingsVersion": {
|
||||||
|
"description": "Text displayed as description for version",
|
||||||
|
"context": "Visible in the settings view",
|
||||||
|
"placeholders": {
|
||||||
|
"version": {
|
||||||
|
"type": "String",
|
||||||
|
"description": "Version number of the app"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -222,6 +222,46 @@
|
||||||
"description": "Text displayed when behavior settings are not updated for older chats",
|
"description": "Text displayed when behavior settings are not updated for older chats",
|
||||||
"context": "Visible in the settings view"
|
"context": "Visible in the settings view"
|
||||||
},
|
},
|
||||||
|
"settingsShowModelTags": "Show model tags",
|
||||||
|
"@settingsShowModelTags": {
|
||||||
|
"description": "Text displayed as description for show model tags toggle",
|
||||||
|
"context": "Visible in the settings view"
|
||||||
|
},
|
||||||
|
"settingsResetOnModelChange": "Reset on model change",
|
||||||
|
"@settingsResetOnModelChange": {
|
||||||
|
"description": "Text displayed as description for reset on model change toggle",
|
||||||
|
"context": "Visible in the settings view"
|
||||||
|
},
|
||||||
|
"settingsGenerateTitles": "Generate titles",
|
||||||
|
"@settingsGenerateTitles": {
|
||||||
|
"description": "Text displayed as description for generate titles toggle",
|
||||||
|
"context": "Visible in the settings view"
|
||||||
|
},
|
||||||
|
"settingsEnableEditing": "Enable editing of messages",
|
||||||
|
"@settingsEnableEditing": {
|
||||||
|
"description": "Text displayed as description for enable editing toggle",
|
||||||
|
"context": "Visible in the settings view"
|
||||||
|
},
|
||||||
|
"settingsAskBeforeDelete": "Ask before chat deletion",
|
||||||
|
"@settingsAskBeforeDelete": {
|
||||||
|
"description": "Text displayed as description for ask before deletion toggle",
|
||||||
|
"context": "Visible in the settings view"
|
||||||
|
},
|
||||||
|
"settingsShowTips": "Show tips in sidebar",
|
||||||
|
"@settingsShowTips": {
|
||||||
|
"description": "Text displayed as description for show tips toggle",
|
||||||
|
"context": "Visible in the settings view"
|
||||||
|
},
|
||||||
|
"settingsRequestTypeStream": "Stream",
|
||||||
|
"@settingsRequestTypeStream": {
|
||||||
|
"description": "Text displayed as description for stream request type. Do not translate if not required!",
|
||||||
|
"context": "Visible in the settings view"
|
||||||
|
},
|
||||||
|
"settingsRequestTypeRequest": "Request",
|
||||||
|
"@settingsRequestTypeRequest": {
|
||||||
|
"description": "Text displayed as description for request request type. Do not translate if not required!",
|
||||||
|
"context": "Visible in the settings view"
|
||||||
|
},
|
||||||
"settingsBrightnessSystem": "System",
|
"settingsBrightnessSystem": "System",
|
||||||
"@settingsBrightnessSystem": {
|
"@settingsBrightnessSystem": {
|
||||||
"description": "Text displayed as description for system brightness option",
|
"description": "Text displayed as description for system brightness option",
|
||||||
|
@ -257,46 +297,6 @@
|
||||||
"description": "Text displayed for cancel button, should be capitalized",
|
"description": "Text displayed for cancel button, should be capitalized",
|
||||||
"context": "Visible in the settings view"
|
"context": "Visible in the settings view"
|
||||||
},
|
},
|
||||||
"settingsGenerateTitles": "Generate titles",
|
|
||||||
"@settingsGenerateTitles": {
|
|
||||||
"description": "Text displayed as description for generate titles toggle",
|
|
||||||
"context": "Visible in the settings view"
|
|
||||||
},
|
|
||||||
"settingsAskBeforeDelete": "Ask before chat deletion",
|
|
||||||
"@settingsAskBeforeDelete": {
|
|
||||||
"description": "Text displayed as description for ask before deletion toggle",
|
|
||||||
"context": "Visible in the settings view"
|
|
||||||
},
|
|
||||||
"settingsResetOnModelChange": "Reset on model change",
|
|
||||||
"@settingsResetOnModelChange": {
|
|
||||||
"description": "Text displayed as description for reset on model change toggle",
|
|
||||||
"context": "Visible in the settings view"
|
|
||||||
},
|
|
||||||
"settingsEnableEditing": "Enable editing of messages",
|
|
||||||
"@settingsEnableEditing": {
|
|
||||||
"description": "Text displayed as description for enable editing toggle",
|
|
||||||
"context": "Visible in the settings view"
|
|
||||||
},
|
|
||||||
"settingsShowTips": "Show tips in sidebar",
|
|
||||||
"@settingsShowTips": {
|
|
||||||
"description": "Text displayed as description for show tips toggle",
|
|
||||||
"context": "Visible in the settings view"
|
|
||||||
},
|
|
||||||
"settingsShowModelTags": "Show model tags",
|
|
||||||
"@settingsShowModelTags": {
|
|
||||||
"description": "Text displayed as description for show model tags toggle",
|
|
||||||
"context": "Visible in the settings view"
|
|
||||||
},
|
|
||||||
"settingsRequestTypeStream": "Stream",
|
|
||||||
"@settingsRequestTypeStream": {
|
|
||||||
"description": "Text displayed as description for stream request type. Do not translate if not required!",
|
|
||||||
"context": "Visible in the settings view"
|
|
||||||
},
|
|
||||||
"settingsRequestTypeRequest": "Request",
|
|
||||||
"@settingsRequestTypeRequest": {
|
|
||||||
"description": "Text displayed as description for request request type. Do not translate if not required!",
|
|
||||||
"context": "Visible in the settings view"
|
|
||||||
},
|
|
||||||
"settingsExportChats": "Export chats",
|
"settingsExportChats": "Export chats",
|
||||||
"@settingsExportChats": {
|
"@settingsExportChats": {
|
||||||
"description": "Text displayed as description for export chats button",
|
"description": "Text displayed as description for export chats button",
|
||||||
|
@ -342,6 +342,11 @@
|
||||||
"description": "Warning displayed for export and import options",
|
"description": "Warning displayed for export and import options",
|
||||||
"context": "Visible in the settings view"
|
"context": "Visible in the settings view"
|
||||||
},
|
},
|
||||||
|
"settingsCheckForUpdates": "Check for updates on open",
|
||||||
|
"@settingsCheckForUpdates": {
|
||||||
|
"description": "Text displayed as description for check for updates toggle",
|
||||||
|
"context": "Visible in the settings view"
|
||||||
|
},
|
||||||
"settingsUpdateCheck": "Check for updates",
|
"settingsUpdateCheck": "Check for updates",
|
||||||
"@settingsUpdateCheck": {
|
"@settingsUpdateCheck": {
|
||||||
"description": "Text displayed as description for check for updates button",
|
"description": "Text displayed as description for check for updates button",
|
||||||
|
@ -403,11 +408,6 @@
|
||||||
"description": "Text displayed for cancel button, should be capitalized",
|
"description": "Text displayed for cancel button, should be capitalized",
|
||||||
"context": "Visible in the settings view"
|
"context": "Visible in the settings view"
|
||||||
},
|
},
|
||||||
"settingsCheckForUpdates": "Check for updates",
|
|
||||||
"@settingsCheckForUpdates": {
|
|
||||||
"description": "Text displayed as description for check for updates toggle",
|
|
||||||
"context": "Visible in the settings view"
|
|
||||||
},
|
|
||||||
"settingsGithub": "GitHub",
|
"settingsGithub": "GitHub",
|
||||||
"@settingsGithub": {
|
"@settingsGithub": {
|
||||||
"description": "Text displayed as description for GitHub button",
|
"description": "Text displayed as description for GitHub button",
|
||||||
|
|
|
@ -21,36 +21,45 @@ Widget toggle(BuildContext context, String text, bool value,
|
||||||
Function(bool value) onChanged) {
|
Function(bool value) onChanged) {
|
||||||
var space = ""; // Invisible character: U+2063
|
var space = ""; // Invisible character: U+2063
|
||||||
var spacePlus = " $space";
|
var spacePlus = " $space";
|
||||||
return Padding(
|
return InkWell(
|
||||||
padding: const EdgeInsets.only(top: 4, bottom: 4),
|
splashFactory: NoSplash.splashFactory,
|
||||||
child: Stack(children: [
|
highlightColor: Colors.transparent,
|
||||||
Padding(
|
hoverColor: Colors.transparent,
|
||||||
padding: const EdgeInsets.only(left: 16, right: 16, top: 12),
|
onTap: () {
|
||||||
child: Divider(
|
onChanged(!value);
|
||||||
|
},
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 8, bottom: 8),
|
||||||
|
child: Stack(children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 16, right: 16, top: 12),
|
||||||
|
child: Divider(
|
||||||
|
color: (Theme.of(context).brightness == Brightness.light)
|
||||||
|
? Colors.grey[300]
|
||||||
|
: Colors.grey[900])),
|
||||||
|
Row(mainAxisSize: MainAxisSize.max, children: [
|
||||||
|
Expanded(
|
||||||
|
child: Text(text + spacePlus,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
maxLines: 1,
|
||||||
|
style: TextStyle(
|
||||||
|
backgroundColor:
|
||||||
|
(Theme.of(context).brightness == Brightness.light)
|
||||||
|
? (theme ?? ThemeData()).colorScheme.surface
|
||||||
|
: (themeDark ?? ThemeData.dark())
|
||||||
|
.colorScheme
|
||||||
|
.surface))),
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.only(left: 16),
|
||||||
color: (Theme.of(context).brightness == Brightness.light)
|
color: (Theme.of(context).brightness == Brightness.light)
|
||||||
? Colors.grey[300]
|
? (theme ?? ThemeData()).colorScheme.surface
|
||||||
: Colors.grey[900])),
|
: (themeDark ?? ThemeData.dark()).colorScheme.surface,
|
||||||
Row(mainAxisSize: MainAxisSize.max, children: [
|
child: SizedBox(
|
||||||
Expanded(
|
height: 40,
|
||||||
child: Text(text + spacePlus,
|
child: Switch(value: value, onChanged: onChanged)))
|
||||||
overflow: TextOverflow.ellipsis,
|
]),
|
||||||
maxLines: 1,
|
|
||||||
style: TextStyle(
|
|
||||||
backgroundColor:
|
|
||||||
(Theme.of(context).brightness == Brightness.light)
|
|
||||||
? (theme ?? ThemeData()).colorScheme.surface
|
|
||||||
: (themeDark ?? ThemeData.dark())
|
|
||||||
.colorScheme
|
|
||||||
.surface))),
|
|
||||||
Container(
|
|
||||||
padding: const EdgeInsets.only(left: 16),
|
|
||||||
color: (Theme.of(context).brightness == Brightness.light)
|
|
||||||
? (theme ?? ThemeData()).colorScheme.surface
|
|
||||||
: (themeDark ?? ThemeData.dark()).colorScheme.surface,
|
|
||||||
child: SizedBox(
|
|
||||||
height: 40, child: Switch(value: value, onChanged: onChanged)))
|
|
||||||
]),
|
]),
|
||||||
]),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,6 +75,17 @@ Widget title(String text, {double top = 16, double bottom = 16}) {
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget titleDivider({double top = 16, double bottom = 16}) {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.only(left: 8, right: 8, top: top, bottom: bottom),
|
||||||
|
child: const Row(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Expanded(child: Divider()),
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
Widget button(String text, IconData icon, void Function()? onPressed,
|
Widget button(String text, IconData icon, void Function()? onPressed,
|
||||||
{Color? color}) {
|
{Color? color}) {
|
||||||
return InkWell(
|
return InkWell(
|
||||||
|
@ -346,15 +366,12 @@ class _ScreenSettingsState extends State<ScreenSettings> {
|
||||||
"monospace"))
|
"monospace"))
|
||||||
],
|
],
|
||||||
)))),
|
)))),
|
||||||
const Padding(
|
titleDivider(bottom: 4),
|
||||||
padding: EdgeInsets.only(
|
|
||||||
left: 8, right: 8, top: 16, bottom: 4),
|
|
||||||
child: Divider()),
|
|
||||||
button(
|
button(
|
||||||
AppLocalizations.of(context)!
|
AppLocalizations.of(context)!
|
||||||
.settingsTitleBehavior,
|
.settingsTitleBehavior,
|
||||||
Icons.psychology_rounded, () {
|
Icons.psychology_rounded, () {
|
||||||
HapticFeedback.selectionClick();
|
HapticFeedback.selectionClick();
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
|
@ -365,7 +382,7 @@ class _ScreenSettingsState extends State<ScreenSettings> {
|
||||||
AppLocalizations.of(context)!
|
AppLocalizations.of(context)!
|
||||||
.settingsTitleInterface,
|
.settingsTitleInterface,
|
||||||
Icons.web_asset_rounded, () {
|
Icons.web_asset_rounded, () {
|
||||||
HapticFeedback.selectionClick();
|
HapticFeedback.selectionClick();
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
|
@ -375,7 +392,7 @@ class _ScreenSettingsState extends State<ScreenSettings> {
|
||||||
button(
|
button(
|
||||||
AppLocalizations.of(context)!.settingsTitleExport,
|
AppLocalizations.of(context)!.settingsTitleExport,
|
||||||
Icons.share_rounded, () {
|
Icons.share_rounded, () {
|
||||||
HapticFeedback.selectionClick();
|
HapticFeedback.selectionClick();
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
|
@ -385,7 +402,7 @@ class _ScreenSettingsState extends State<ScreenSettings> {
|
||||||
button(
|
button(
|
||||||
AppLocalizations.of(context)!.settingsTitleAbout,
|
AppLocalizations.of(context)!.settingsTitleAbout,
|
||||||
Icons.help_rounded, () {
|
Icons.help_rounded, () {
|
||||||
HapticFeedback.selectionClick();
|
HapticFeedback.selectionClick();
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
|
|
|
@ -89,6 +89,18 @@ class _ScreenSettingsAboutState extends State<ScreenSettingsAbout> {
|
||||||
.settingsVersion(currentVersion ?? "0.0.1"),
|
.settingsVersion(currentVersion ?? "0.0.1"),
|
||||||
Icons.verified_rounded,
|
Icons.verified_rounded,
|
||||||
null),
|
null),
|
||||||
|
(updateStatus == "notAvailable")
|
||||||
|
? const SizedBox.shrink()
|
||||||
|
: toggle(
|
||||||
|
context,
|
||||||
|
AppLocalizations.of(context)!
|
||||||
|
.settingsCheckForUpdates,
|
||||||
|
(prefs!.getBool("checkUpdateOnSettingsOpen") ??
|
||||||
|
false), (value) {
|
||||||
|
HapticFeedback.selectionClick();
|
||||||
|
prefs!.setBool("checkUpdateOnSettingsOpen", value);
|
||||||
|
setState(() {});
|
||||||
|
}),
|
||||||
(updateStatus == "notAvailable")
|
(updateStatus == "notAvailable")
|
||||||
? const SizedBox.shrink()
|
? const SizedBox.shrink()
|
||||||
: button(
|
: button(
|
||||||
|
@ -132,18 +144,7 @@ class _ScreenSettingsAboutState extends State<ScreenSettingsAbout> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
(updateStatus == "notAvailable")
|
titleDivider(),
|
||||||
? const SizedBox.shrink()
|
|
||||||
: toggle(
|
|
||||||
context,
|
|
||||||
AppLocalizations.of(context)!
|
|
||||||
.settingsCheckForUpdates,
|
|
||||||
(prefs!.getBool("checkUpdateOnSettingsOpen") ??
|
|
||||||
false), (value) {
|
|
||||||
HapticFeedback.selectionClick();
|
|
||||||
prefs!.setBool("checkUpdateOnSettingsOpen", value);
|
|
||||||
setState(() {});
|
|
||||||
}),
|
|
||||||
button(AppLocalizations.of(context)!.settingsGithub,
|
button(AppLocalizations.of(context)!.settingsGithub,
|
||||||
SimpleIcons.github, () {
|
SimpleIcons.github, () {
|
||||||
HapticFeedback.selectionClick();
|
HapticFeedback.selectionClick();
|
||||||
|
|
|
@ -72,7 +72,7 @@ class _ScreenSettingsExportState extends State<ScreenSettingsExport> {
|
||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ListView(children: [
|
child: ListView(children: [
|
||||||
const SizedBox(height: 16),
|
// const SizedBox(height: 16),
|
||||||
button(AppLocalizations.of(context)!.settingsExportChats,
|
button(AppLocalizations.of(context)!.settingsExportChats,
|
||||||
Icons.upload_rounded, () async {
|
Icons.upload_rounded, () async {
|
||||||
HapticFeedback.selectionClick();
|
HapticFeedback.selectionClick();
|
||||||
|
|
|
@ -71,6 +71,82 @@ class _ScreenSettingsInterfaceState extends State<ScreenSettingsInterface> {
|
||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ListView(children: [
|
child: ListView(children: [
|
||||||
|
// const SizedBox(height: 16),
|
||||||
|
toggle(
|
||||||
|
context,
|
||||||
|
AppLocalizations.of(context)!.settingsShowModelTags,
|
||||||
|
(prefs!.getBool("modelTags") ?? false), (value) {
|
||||||
|
HapticFeedback.selectionClick();
|
||||||
|
prefs!.setBool("modelTags", value);
|
||||||
|
setState(() {});
|
||||||
|
}),
|
||||||
|
toggle(
|
||||||
|
context,
|
||||||
|
AppLocalizations.of(context)!
|
||||||
|
.settingsResetOnModelChange,
|
||||||
|
(prefs!.getBool("resetOnModelSelect") ?? true),
|
||||||
|
(value) {
|
||||||
|
HapticFeedback.selectionClick();
|
||||||
|
prefs!.setBool("resetOnModelSelect", value);
|
||||||
|
setState(() {});
|
||||||
|
}),
|
||||||
|
titleDivider(),
|
||||||
|
toggle(
|
||||||
|
context,
|
||||||
|
AppLocalizations.of(context)!.settingsGenerateTitles,
|
||||||
|
(prefs!.getBool("generateTitles") ?? true), (value) {
|
||||||
|
HapticFeedback.selectionClick();
|
||||||
|
prefs!.setBool("generateTitles", value);
|
||||||
|
setState(() {});
|
||||||
|
}),
|
||||||
|
toggle(
|
||||||
|
context,
|
||||||
|
AppLocalizations.of(context)!.settingsEnableEditing,
|
||||||
|
(prefs!.getBool("enableEditing") ?? true), (value) {
|
||||||
|
HapticFeedback.selectionClick();
|
||||||
|
prefs!.setBool("enableEditing", value);
|
||||||
|
setState(() {});
|
||||||
|
}),
|
||||||
|
toggle(
|
||||||
|
context,
|
||||||
|
AppLocalizations.of(context)!.settingsAskBeforeDelete,
|
||||||
|
(prefs!.getBool("askBeforeDeletion") ?? false),
|
||||||
|
(value) {
|
||||||
|
HapticFeedback.selectionClick();
|
||||||
|
prefs!.setBool("askBeforeDeletion", value);
|
||||||
|
setState(() {});
|
||||||
|
}),
|
||||||
|
toggle(
|
||||||
|
context,
|
||||||
|
AppLocalizations.of(context)!.settingsShowTips,
|
||||||
|
(prefs!.getBool("tips") ?? true), (value) {
|
||||||
|
HapticFeedback.selectionClick();
|
||||||
|
prefs!.setBool("tips", value);
|
||||||
|
setState(() {});
|
||||||
|
}),
|
||||||
|
titleDivider(bottom: 20),
|
||||||
|
SegmentedButton(
|
||||||
|
segments: [
|
||||||
|
ButtonSegment(
|
||||||
|
value: "stream",
|
||||||
|
label: Text(AppLocalizations.of(context)!
|
||||||
|
.settingsRequestTypeStream),
|
||||||
|
icon: const Icon(Icons.stream_rounded)),
|
||||||
|
ButtonSegment(
|
||||||
|
value: "request",
|
||||||
|
label: Text(AppLocalizations.of(context)!
|
||||||
|
.settingsRequestTypeRequest),
|
||||||
|
icon: const Icon(Icons.send_rounded))
|
||||||
|
],
|
||||||
|
selected: {
|
||||||
|
prefs!.getString("requestType") ?? "stream"
|
||||||
|
},
|
||||||
|
onSelectionChanged: (p0) {
|
||||||
|
HapticFeedback.selectionClick();
|
||||||
|
setState(() {
|
||||||
|
prefs!.setString("requestType", p0.elementAt(0));
|
||||||
|
});
|
||||||
|
}),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
SegmentedButton(
|
SegmentedButton(
|
||||||
segments: [
|
segments: [
|
||||||
|
@ -151,81 +227,6 @@ class _ScreenSettingsInterfaceState extends State<ScreenSettingsInterface> {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
const SizedBox(height: 16),
|
|
||||||
toggle(
|
|
||||||
context,
|
|
||||||
AppLocalizations.of(context)!.settingsGenerateTitles,
|
|
||||||
(prefs!.getBool("generateTitles") ?? true), (value) {
|
|
||||||
HapticFeedback.selectionClick();
|
|
||||||
prefs!.setBool("generateTitles", value);
|
|
||||||
setState(() {});
|
|
||||||
}),
|
|
||||||
toggle(
|
|
||||||
context,
|
|
||||||
AppLocalizations.of(context)!.settingsAskBeforeDelete,
|
|
||||||
(prefs!.getBool("askBeforeDeletion") ?? false),
|
|
||||||
(value) {
|
|
||||||
HapticFeedback.selectionClick();
|
|
||||||
prefs!.setBool("askBeforeDeletion", value);
|
|
||||||
setState(() {});
|
|
||||||
}),
|
|
||||||
toggle(
|
|
||||||
context,
|
|
||||||
AppLocalizations.of(context)!
|
|
||||||
.settingsResetOnModelChange,
|
|
||||||
(prefs!.getBool("resetOnModelSelect") ?? true),
|
|
||||||
(value) {
|
|
||||||
HapticFeedback.selectionClick();
|
|
||||||
prefs!.setBool("resetOnModelSelect", value);
|
|
||||||
setState(() {});
|
|
||||||
}),
|
|
||||||
toggle(
|
|
||||||
context,
|
|
||||||
AppLocalizations.of(context)!.settingsEnableEditing,
|
|
||||||
(prefs!.getBool("enableEditing") ?? true), (value) {
|
|
||||||
HapticFeedback.selectionClick();
|
|
||||||
prefs!.setBool("enableEditing", value);
|
|
||||||
setState(() {});
|
|
||||||
}),
|
|
||||||
toggle(
|
|
||||||
context,
|
|
||||||
AppLocalizations.of(context)!.settingsShowTips,
|
|
||||||
(prefs!.getBool("tips") ?? true), (value) {
|
|
||||||
HapticFeedback.selectionClick();
|
|
||||||
prefs!.setBool("tips", value);
|
|
||||||
setState(() {});
|
|
||||||
}),
|
|
||||||
toggle(
|
|
||||||
context,
|
|
||||||
AppLocalizations.of(context)!.settingsShowModelTags,
|
|
||||||
(prefs!.getBool("modelTags") ?? false), (value) {
|
|
||||||
HapticFeedback.selectionClick();
|
|
||||||
prefs!.setBool("modelTags", value);
|
|
||||||
setState(() {});
|
|
||||||
}),
|
|
||||||
const SizedBox(height: 16),
|
|
||||||
SegmentedButton(
|
|
||||||
segments: [
|
|
||||||
ButtonSegment(
|
|
||||||
value: "stream",
|
|
||||||
label: Text(AppLocalizations.of(context)!
|
|
||||||
.settingsRequestTypeStream),
|
|
||||||
icon: const Icon(Icons.stream_rounded)),
|
|
||||||
ButtonSegment(
|
|
||||||
value: "request",
|
|
||||||
label: Text(AppLocalizations.of(context)!
|
|
||||||
.settingsRequestTypeRequest),
|
|
||||||
icon: const Icon(Icons.send_rounded))
|
|
||||||
],
|
|
||||||
selected: {
|
|
||||||
prefs!.getString("requestType") ?? "stream"
|
|
||||||
},
|
|
||||||
onSelectionChanged: (p0) {
|
|
||||||
HapticFeedback.selectionClick();
|
|
||||||
setState(() {
|
|
||||||
prefs!.setString("requestType", p0.elementAt(0));
|
|
||||||
});
|
|
||||||
})
|
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16)
|
const SizedBox(height: 16)
|
||||||
|
|
Loading…
Reference in New Issue