diff --git a/assets/screenshots/flutter_28.png b/assets/screenshots/flutter_28.png index 84fee01..8bf793a 100644 Binary files a/assets/screenshots/flutter_28.png and b/assets/screenshots/flutter_28.png differ diff --git a/lib/main.dart b/lib/main.dart index c86f516..07b928d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -118,6 +118,9 @@ class _AppState extends State { if ((await Permission.bluetoothConnect.isGranted) && (await Permission.microphone.isGranted)) { voiceSupported = await speech.initialize(); + } else { + prefs!.setBool("voiceModeEnabled", false); + voiceSupported = false; } SharedPreferences.setPrefix("ollama."); @@ -1225,28 +1228,44 @@ class _MainAppState extends State { child: Column( mainAxisSize: MainAxisSize.min, children: [ - SizedBox( - width: double.infinity, - child: OutlinedButton.icon( - onPressed: () async { - selectionHaptic(); - Navigator.of(context) - .pop(); - setMainState = setState; - settingsOpen = true; - logoVisible = false; - Navigator.of(context).push( - MaterialPageRoute( - builder: - (context) => - const ScreenVoice())); - }, - icon: const Icon(Icons - .headphones_rounded), - label: Text(AppLocalizations - .of(context)! - .settingsTitleVoice))), - const SizedBox(height: 8), + (prefs?.getBool( + "voiceModeEnabled") ?? + false) + ? SizedBox( + width: double.infinity, + child: + OutlinedButton.icon( + onPressed: + () async { + selectionHaptic(); + Navigator.of( + context) + .pop(); + setMainState = + setState; + settingsOpen = + true; + logoVisible = + false; + Navigator.of( + context) + .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( width: double.infinity, child: OutlinedButton.icon( diff --git a/lib/settings/about.dart b/lib/settings/about.dart index 69775ca..2461fcd 100644 --- a/lib/settings/about.dart +++ b/lib/settings/about.dart @@ -86,7 +86,7 @@ class _ScreenSettingsAboutState extends State { // const SizedBox(height: 16), button( AppLocalizations.of(context)! - .settingsVersion(currentVersion ?? "0.0.1"), + .settingsVersion(currentVersion ?? ""), Icons.verified_rounded, null), (updateStatus == "notAvailable")