Only allow voice if enabled
This commit is contained in:
parent
1b9225fdb8
commit
09fda2b004
Binary file not shown.
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 56 KiB |
|
@ -118,6 +118,9 @@ class _AppState extends State<App> {
|
||||||
if ((await Permission.bluetoothConnect.isGranted) &&
|
if ((await Permission.bluetoothConnect.isGranted) &&
|
||||||
(await Permission.microphone.isGranted)) {
|
(await Permission.microphone.isGranted)) {
|
||||||
voiceSupported = await speech.initialize();
|
voiceSupported = await speech.initialize();
|
||||||
|
} else {
|
||||||
|
prefs!.setBool("voiceModeEnabled", false);
|
||||||
|
voiceSupported = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SharedPreferences.setPrefix("ollama.");
|
SharedPreferences.setPrefix("ollama.");
|
||||||
|
@ -1225,28 +1228,44 @@ class _MainAppState extends State<MainApp> {
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
(prefs?.getBool(
|
||||||
width: double.infinity,
|
"voiceModeEnabled") ??
|
||||||
child: OutlinedButton.icon(
|
false)
|
||||||
onPressed: () async {
|
? SizedBox(
|
||||||
selectionHaptic();
|
width: double.infinity,
|
||||||
Navigator.of(context)
|
child:
|
||||||
.pop();
|
OutlinedButton.icon(
|
||||||
setMainState = setState;
|
onPressed:
|
||||||
settingsOpen = true;
|
() async {
|
||||||
logoVisible = false;
|
selectionHaptic();
|
||||||
Navigator.of(context).push(
|
Navigator.of(
|
||||||
MaterialPageRoute(
|
context)
|
||||||
builder:
|
.pop();
|
||||||
(context) =>
|
setMainState =
|
||||||
const ScreenVoice()));
|
setState;
|
||||||
},
|
settingsOpen =
|
||||||
icon: const Icon(Icons
|
true;
|
||||||
.headphones_rounded),
|
logoVisible =
|
||||||
label: Text(AppLocalizations
|
false;
|
||||||
.of(context)!
|
Navigator.of(
|
||||||
.settingsTitleVoice))),
|
context)
|
||||||
const SizedBox(height: 8),
|
.push(MaterialPageRoute(
|
||||||
|
builder:
|
||||||
|
(context) =>
|
||||||
|
const ScreenVoice()));
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons
|
||||||
|
.headphones_rounded),
|
||||||
|
label: Text(
|
||||||
|
AppLocalizations.of(
|
||||||
|
context)!
|
||||||
|
.settingsTitleVoice)))
|
||||||
|
: const SizedBox.shrink(),
|
||||||
|
(prefs?.getBool(
|
||||||
|
"voiceModeEnabled") ??
|
||||||
|
false)
|
||||||
|
? const SizedBox(height: 8)
|
||||||
|
: const SizedBox.shrink(),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: OutlinedButton.icon(
|
child: OutlinedButton.icon(
|
||||||
|
|
|
@ -86,7 +86,7 @@ class _ScreenSettingsAboutState extends State<ScreenSettingsAbout> {
|
||||||
// const SizedBox(height: 16),
|
// const SizedBox(height: 16),
|
||||||
button(
|
button(
|
||||||
AppLocalizations.of(context)!
|
AppLocalizations.of(context)!
|
||||||
.settingsVersion(currentVersion ?? "0.0.1"),
|
.settingsVersion(currentVersion ?? ""),
|
||||||
Icons.verified_rounded,
|
Icons.verified_rounded,
|
||||||
null),
|
null),
|
||||||
(updateStatus == "notAvailable")
|
(updateStatus == "notAvailable")
|
||||||
|
|
Loading…
Reference in New Issue