Skip to content

Commit

Permalink
settings page
Browse files Browse the repository at this point in the history
  • Loading branch information
danemadsen committed Aug 3, 2024
1 parent eff21da commit 44c2a1d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
8 changes: 4 additions & 4 deletions lib/classes/providers/app_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class AppData extends ChangeNotifier {
}

prefs.setInt("llm_type", model.type.index);
notifyListeners();
notify();
}

void switchOpenAI() async {
Expand All @@ -275,7 +275,7 @@ class AppData extends ChangeNotifier {
}

prefs.setInt("llm_type", model.type.index);
notifyListeners();
notify();
}

void switchOllama() async {
Expand Down Expand Up @@ -318,7 +318,7 @@ class AppData extends ChangeNotifier {
}

prefs.setInt("llm_type", model.type.index);
notifyListeners();
notify();
}

void switchGemini() async {
Expand All @@ -339,6 +339,6 @@ class AppData extends ChangeNotifier {
}

prefs.setInt("llm_type", model.type.index);
notifyListeners();
notify();
}
}
2 changes: 1 addition & 1 deletion lib/ui/mobile/buttons/menu_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class _MenuButtonState extends State<MenuButton> {
contentPadding: const EdgeInsets.symmetric(horizontal: 8.0),
title: Text(modelName),
onTap: () {
model.name = modelName;
LargeLanguageModel.of(context).name = modelName;
},
tileColor: model.name == modelName ? Theme.of(context).colorScheme.secondary : null,
);
Expand Down
25 changes: 18 additions & 7 deletions lib/ui/mobile/pages/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,30 @@ class _SettingsPageState extends State<SettingsPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: const GenericAppBar(title: "App Settings"),
body: buildColumn(),
body: SingleChildScrollView(
child: buildColumn(),
),
);
}

Widget buildColumn() {
return Column(
children: [
SwitchListTile(
title: const Text("Auto Text to Speech"),
value: AppPreferences.of(context).autoTextToSpeech,
onChanged: (value) {
AppPreferences.of(context).autoTextToSpeech = value;
},
Padding(
padding: const EdgeInsets.all(8),
child: Row(
children: [
const Expanded(
child: Text("Auto Text to Speech"),
),
Switch(
value: AppPreferences.of(context).autoTextToSpeech,
onChanged: (value) {
AppPreferences.of(context).autoTextToSpeech = value;
},
)
],
),
),
const Padding(
padding: EdgeInsets.all(8),
Expand Down
2 changes: 1 addition & 1 deletion packages/maid_llm
Submodule maid_llm updated 1 files
+0 −4 src/maid_llm.cpp

0 comments on commit 44c2a1d

Please sign in to comment.