|
|
|
@ -5,6 +5,9 @@ import 'package:speech_to_text/speech_recognition_error.dart';
|
|
|
|
import 'package:speech_to_text/speech_recognition_result.dart';
|
|
|
|
import 'package:speech_to_text/speech_recognition_result.dart';
|
|
|
|
import 'package:speech_to_text/speech_to_text.dart';
|
|
|
|
import 'package:speech_to_text/speech_to_text.dart';
|
|
|
|
import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
|
|
import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
|
|
|
|
|
|
import 'package:test_sa/extensions/context_extension.dart';
|
|
|
|
|
|
|
|
import 'package:test_sa/new_views/app_style/app_color.dart';
|
|
|
|
|
|
|
|
import 'package:test_sa/new_views/app_style/app_text_style.dart';
|
|
|
|
import 'package:test_sa/views/app_style/sizing.dart';
|
|
|
|
import 'package:test_sa/views/app_style/sizing.dart';
|
|
|
|
import 'package:test_sa/views/widgets/buttons/app_icon_button2.dart';
|
|
|
|
import 'package:test_sa/views/widgets/buttons/app_icon_button2.dart';
|
|
|
|
import 'package:test_sa/views/widgets/titles/app_sub_title.dart';
|
|
|
|
import 'package:test_sa/views/widgets/titles/app_sub_title.dart';
|
|
|
|
@ -82,18 +85,26 @@ class _SpeechToTextButtonState extends State<SpeechToTextButton> {
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
padding: const EdgeInsets.only(left: 12, right: 12),
|
|
|
|
padding: const EdgeInsets.only(left: 12, right: 12),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: const Color(0xfff5f5f5),
|
|
|
|
color: context.isDark && (widget.enabled == false)
|
|
|
|
border: Border.all(
|
|
|
|
? AppColor.neutral50
|
|
|
|
color: const Color(0xffefefef),
|
|
|
|
: (widget.enabled == false)
|
|
|
|
),
|
|
|
|
? AppColor.neutral40
|
|
|
|
borderRadius: BorderRadius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
|
|
|
|
: AppColor.background(context),
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
|
|
|
boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 10)],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
widget.mini ? const SizedBox.shrink() : const ASubTitle("Speech To Text"),
|
|
|
|
widget.mini
|
|
|
|
|
|
|
|
? const SizedBox.shrink()
|
|
|
|
|
|
|
|
: Text(
|
|
|
|
|
|
|
|
"Speech To Text",
|
|
|
|
|
|
|
|
style: Theme.of(context).textTheme.bodyLarge,
|
|
|
|
|
|
|
|
),
|
|
|
|
widget.controller.text.isNotEmpty && widget.enabled
|
|
|
|
widget.controller.text.isNotEmpty && widget.enabled
|
|
|
|
? AIconButton2(
|
|
|
|
? AIconButton2(
|
|
|
|
iconData: Icons.delete,
|
|
|
|
iconData: Icons.delete,
|
|
|
|
|
|
|
|
color: context.isDark ? Colors.white : Colors.black87,
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
widget.controller.clear();
|
|
|
|
widget.controller.clear();
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
|