use new dropdown in Mzansai Ai
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||||
import 'package:mzansi_innovation_hub/main.dart';
|
import 'package:mzansi_innovation_hub/main.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart';
|
import 'package:mzansi_innovation_hub/mih_apis/mih_validation_services.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_dropdwn_field.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_numeric_stepper.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_numeric_stepper.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
||||||
@@ -397,42 +397,67 @@ class _AiChatState extends State<AiChat> {
|
|||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 230,
|
width: 230,
|
||||||
child: MIHDropdownField(
|
child: MihDropdownField(
|
||||||
controller: _ttsVoiceController,
|
controller: _ttsVoiceController,
|
||||||
hintText: "AI Voice",
|
hintText: "Dropdown",
|
||||||
dropdownOptions: _voicesString,
|
dropdownOptions: _voicesString,
|
||||||
required: true,
|
|
||||||
editable: true,
|
editable: true,
|
||||||
enableSearch: false,
|
enableSearch: true,
|
||||||
|
requiredText: true,
|
||||||
|
validator: (value) {
|
||||||
|
return MihValidationServices().isEmpty(value);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Padding(
|
Container(
|
||||||
padding: const EdgeInsets.all(5.0),
|
// color: Colors.white,
|
||||||
child: Container(
|
decoration: BoxDecoration(
|
||||||
//color: MzanziInnovationHub.of(context)!.theme.successColor(),
|
borderRadius: BorderRadius.circular(
|
||||||
decoration: BoxDecoration(
|
25), // Optional: rounds the corners
|
||||||
color: MzanziInnovationHub.of(context)!
|
boxShadow: const [
|
||||||
.theme
|
BoxShadow(
|
||||||
.successColor(),
|
color: Color.fromARGB(60, 0, 0,
|
||||||
borderRadius: const BorderRadius.all(
|
0), // 0.2 opacity = 51 in alpha (255 * 0.2)
|
||||||
Radius.circular(100),
|
spreadRadius: -2,
|
||||||
|
blurRadius: 10,
|
||||||
|
offset: Offset(0, 5),
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
top: 2.0,
|
||||||
|
left: 5.0,
|
||||||
),
|
),
|
||||||
child: IconButton(
|
child: SizedBox(
|
||||||
color: MzanziInnovationHub.of(context)!
|
width: 50,
|
||||||
.theme
|
height: 50,
|
||||||
.primaryColor(),
|
child: IconButton.filled(
|
||||||
onPressed: () {
|
style: ButtonStyle(
|
||||||
print("Start TTS now");
|
backgroundColor:
|
||||||
|
WidgetStateProperty.all<Color>(
|
||||||
_speakText(
|
MzanziInnovationHub.of(context)!
|
||||||
"This is the sample of the Mzansi A.I Voice.");
|
.theme
|
||||||
},
|
.successColor()),
|
||||||
icon: const Icon(Icons.volume_up),
|
),
|
||||||
|
color: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.primaryColor(),
|
||||||
|
iconSize: 25,
|
||||||
|
onPressed: () {
|
||||||
|
print("Start TTS now");
|
||||||
|
_speakText(
|
||||||
|
"This is the sample of the Mzansi A.I Voice.");
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.volume_up,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user