Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit fe4ab72

Browse files
Vande Perre NathanPiotrFLEURY
authored andcommitted
Fixed: #318
1 parent 015ac92 commit fe4ab72

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
148148
- Camera : fixed error on camera cancel
149149
- Sort : fixed tolowercase error
150150
- iOS : fixed copy/paste menu
151+
- Voice recognition : user can now use voice recognition on iOS
151152

152153
### Security
153154

lib/pages/items_page.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,6 @@ class EditItemPageState extends State<EditItemPage> {
121121
WidgetsBinding.instance.addPostFrameCallback((_) => getData());
122122
super.initState();
123123
_itemNameFocusNode.requestFocus();
124-
initializeSpeech();
125-
}
126-
127-
initializeSpeech() async {
128-
isInitialized = await speech.initialize();
129124
}
130125

131126
void getData() {
@@ -409,8 +404,11 @@ class EditItemPageState extends State<EditItemPage> {
409404
}
410405

411406
recordAudio() async {
407+
isInitialized = await speech.initialize();
412408
if (isInitialized) {
413409
String result = await buildRecordPopup();
410+
speech.cancel();
411+
speech.stop();
414412
_name = result;
415413
setState(() {
416414
itemNameController.text = result;

lib/widgets/widget_voice_record.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,13 @@ class WidgetVoiceRecordState extends State<WidgetVoiceRecord> {
4747
: getString(context, "talk"),
4848
style: TextStyle(color: WHITE),
4949
),
50-
IconButton(
51-
icon: Icon(Icons.check),
50+
FlatButton(
51+
child: Icon(
52+
Icons.check,
53+
color: _colorsApp.buttonColor,
54+
),
5255
color: WHITE,
5356
onPressed: () async {
54-
await widget.speech.cancel();
55-
await widget.speech.stop();
5657
Navigator.of(context).pop(_recordResult);
5758
},
5859
)

0 commit comments

Comments
 (0)