@@ -84,7 +84,7 @@ class _MyHomePageState extends State<MyHomePage> {
84
84
children: [
85
85
SlidingUpPanel (
86
86
minHeight: height * 0.25 ,
87
- maxHeight: height * 0.40 ,
87
+ maxHeight: height * 0.25 ,
88
88
color: primaryColor,
89
89
boxShadow: [
90
90
BoxShadow (
@@ -135,7 +135,9 @@ class _MyHomePageState extends State<MyHomePage> {
135
135
} else {
136
136
return Center (
137
137
child: Text (
138
- "Talk something or type" ,
138
+ isActive
139
+ ? "Talk something or type"
140
+ : "Failed to connect. check 'Base URL'" ,
139
141
style: TextStyle (
140
142
color: tertiaryColor,
141
143
),
@@ -192,6 +194,8 @@ class _MyHomePageState extends State<MyHomePage> {
192
194
style: TextStyle (color: secondaryColor),
193
195
),
194
196
content: TextField (
197
+ minLines: 1 ,
198
+ maxLines: 100 ,
195
199
controller: TextEditingController (text: baseURL),
196
200
style: TextStyle (color: secondaryColor),
197
201
onChanged: (value) {
@@ -251,18 +255,25 @@ class _MyHomePageState extends State<MyHomePage> {
251
255
}
252
256
253
257
Align getMicButton (Color secondaryColor) {
258
+ final nowColor = ! isActive
259
+ ? grey
260
+ : isListening
261
+ ? blue
262
+ : lightblue;
254
263
return Align (
255
264
alignment: Alignment .bottomCenter,
256
265
child: Padding (
257
266
padding: const EdgeInsets .all (16.0 ),
258
267
child: AvatarGlow (
259
- glowColor: isListening ? blue : lightblue ,
260
- animate: isListening,
268
+ glowColor: nowColor ,
269
+ animate: isActive && isListening,
261
270
duration: const Duration (milliseconds: 1500 ),
262
271
repeat: true ,
263
272
glowShape: BoxShape .circle,
264
273
child: GestureDetector (
265
274
onTap: () {
275
+ if (! isActive) return ;
276
+
266
277
isListening = ! isListening;
267
278
if (isListening) {
268
279
if (speechEnabled) {
@@ -281,11 +292,11 @@ class _MyHomePageState extends State<MyHomePage> {
281
292
},
282
293
child: Container (
283
294
decoration: BoxDecoration (
284
- color: isListening ? blue : lightblue ,
295
+ color: nowColor ,
285
296
shape: BoxShape .circle,
286
297
boxShadow: [
287
298
BoxShadow (
288
- color: isListening ? blue : lightblue ,
299
+ color: nowColor ,
289
300
blurRadius: 10 ,
290
301
spreadRadius: 3 ,
291
302
),
@@ -312,7 +323,7 @@ class _MyHomePageState extends State<MyHomePage> {
312
323
padding: const EdgeInsets .all (20.0 ),
313
324
child: Container (
314
325
decoration: BoxDecoration (
315
- color: blue,
326
+ color: isActive ? blue : grey ,
316
327
shape: BoxShape .rectangle,
317
328
borderRadius: BorderRadius .circular (20 ),
318
329
),
@@ -342,6 +353,7 @@ class _MyHomePageState extends State<MyHomePage> {
342
353
borderRadius: BorderRadius .circular (10.0 ),
343
354
),
344
355
child: TextField (
356
+ enabled: isActive,
345
357
controller: textController,
346
358
style: TextStyle (
347
359
color: tertiaryColor,
@@ -395,13 +407,16 @@ class _MyHomePageState extends State<MyHomePage> {
395
407
fit: BoxFit .fitWidth,
396
408
),
397
409
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,
403
419
),
404
- textAlign: TextAlign .center,
405
420
),
406
421
],
407
422
);
0 commit comments