qr scanner initial
This commit is contained in:
@@ -25,6 +25,7 @@ import 'package:weblibre/features/bangs/data/models/bang_data.dart';
|
||||
import 'package:weblibre/features/geckoview/features/search/domain/providers/engine_suggestions.dart';
|
||||
import 'package:weblibre/features/user/domain/providers.dart';
|
||||
import 'package:weblibre/presentation/widgets/auto_suggest_text_field.dart';
|
||||
import 'package:weblibre/presentation/widgets/qr_scanner_button.dart';
|
||||
import 'package:weblibre/presentation/widgets/speech_to_text_button.dart';
|
||||
import 'package:weblibre/presentation/widgets/url_icon.dart';
|
||||
|
||||
@@ -122,10 +123,22 @@ class SearchField extends HookConsumerWidget {
|
||||
},
|
||||
icon: const Icon(Icons.clear),
|
||||
)
|
||||
: SpeechToTextButton(
|
||||
onTextReceived: (data) {
|
||||
textEditingController.text = data.toString();
|
||||
},
|
||||
: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
QrScannerButton(
|
||||
onScanResult: (scanResult) {
|
||||
if (scanResult?.code != null) {
|
||||
textEditingController.text = scanResult!.code!;
|
||||
}
|
||||
},
|
||||
),
|
||||
SpeechToTextButton(
|
||||
onTextReceived: (data) {
|
||||
textEditingController.text = data;
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
onTapOutside: unfocusOnTapOutside
|
||||
|
||||
Reference in New Issue
Block a user