Skip to content

Commit d4ba743

Browse files
committed
disable fix
1 parent 188739b commit d4ba743

File tree

1 file changed

+28
-13
lines changed

1 file changed

+28
-13
lines changed

Diff for: lib/home.dart

+28-13
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class _MyHomePageState extends State<MyHomePage> {
8484
children: [
8585
SlidingUpPanel(
8686
minHeight: height * 0.25,
87-
maxHeight: height * 0.40,
87+
maxHeight: height * 0.25,
8888
color: primaryColor,
8989
boxShadow: [
9090
BoxShadow(
@@ -135,7 +135,9 @@ class _MyHomePageState extends State<MyHomePage> {
135135
} else {
136136
return Center(
137137
child: Text(
138-
"Talk something or type",
138+
isActive
139+
? "Talk something or type"
140+
: "Failed to connect. check 'Base URL'",
139141
style: TextStyle(
140142
color: tertiaryColor,
141143
),
@@ -192,6 +194,8 @@ class _MyHomePageState extends State<MyHomePage> {
192194
style: TextStyle(color: secondaryColor),
193195
),
194196
content: TextField(
197+
minLines: 1,
198+
maxLines: 100,
195199
controller: TextEditingController(text: baseURL),
196200
style: TextStyle(color: secondaryColor),
197201
onChanged: (value) {
@@ -251,18 +255,25 @@ class _MyHomePageState extends State<MyHomePage> {
251255
}
252256

253257
Align getMicButton(Color secondaryColor) {
258+
final nowColor = !isActive
259+
? grey
260+
: isListening
261+
? blue
262+
: lightblue;
254263
return Align(
255264
alignment: Alignment.bottomCenter,
256265
child: Padding(
257266
padding: const EdgeInsets.all(16.0),
258267
child: AvatarGlow(
259-
glowColor: isListening ? blue : lightblue,
260-
animate: isListening,
268+
glowColor: nowColor,
269+
animate: isActive && isListening,
261270
duration: const Duration(milliseconds: 1500),
262271
repeat: true,
263272
glowShape: BoxShape.circle,
264273
child: GestureDetector(
265274
onTap: () {
275+
if (!isActive) return;
276+
266277
isListening = !isListening;
267278
if (isListening) {
268279
if (speechEnabled) {
@@ -281,11 +292,11 @@ class _MyHomePageState extends State<MyHomePage> {
281292
},
282293
child: Container(
283294
decoration: BoxDecoration(
284-
color: isListening ? blue : lightblue,
295+
color: nowColor,
285296
shape: BoxShape.circle,
286297
boxShadow: [
287298
BoxShadow(
288-
color: isListening ? blue : lightblue,
299+
color: nowColor,
289300
blurRadius: 10,
290301
spreadRadius: 3,
291302
),
@@ -312,7 +323,7 @@ class _MyHomePageState extends State<MyHomePage> {
312323
padding: const EdgeInsets.all(20.0),
313324
child: Container(
314325
decoration: BoxDecoration(
315-
color: blue,
326+
color: isActive ? blue : grey,
316327
shape: BoxShape.rectangle,
317328
borderRadius: BorderRadius.circular(20),
318329
),
@@ -342,6 +353,7 @@ class _MyHomePageState extends State<MyHomePage> {
342353
borderRadius: BorderRadius.circular(10.0),
343354
),
344355
child: TextField(
356+
enabled: isActive,
345357
controller: textController,
346358
style: TextStyle(
347359
color: tertiaryColor,
@@ -395,13 +407,16 @@ class _MyHomePageState extends State<MyHomePage> {
395407
fit: BoxFit.fitWidth,
396408
),
397409
SizedBox(height: height * 0.02),
398-
Text(
399-
poseSnapshot.data.words.join(" "),
400-
style: TextStyle(
401-
color: tertiaryColor,
402-
fontSize: 16,
410+
Padding(
411+
padding: const EdgeInsets.symmetric(horizontal: 20),
412+
child: Text(
413+
poseSnapshot.data.words.join(" "),
414+
style: TextStyle(
415+
color: tertiaryColor,
416+
fontSize: 16,
417+
),
418+
textAlign: TextAlign.center,
403419
),
404-
textAlign: TextAlign.center,
405420
),
406421
],
407422
);

0 commit comments

Comments
 (0)