@@ -154,6 +154,10 @@ class HomeScreen extends StatefulWidget {
154
154
155
155
class _HomeScreenState extends State <HomeScreen > {
156
156
void _onItemTapped (int index) {
157
+ if (index == 9 && ! widget.useVertexBackend) {
158
+ // Live Stream feature only works with Vertex AI now.
159
+ return ;
160
+ }
157
161
widget.onSelectedIndexChanged (index);
158
162
}
159
163
@@ -188,7 +192,12 @@ class _HomeScreenState extends State<HomeScreen> {
188
192
case 8 :
189
193
return VideoPage (title: 'Video Prompt' , model: currentModel);
190
194
case 9 :
191
- return BidiPage (title: 'Bidi Stream' , model: currentModel);
195
+ if (useVertexBackend) {
196
+ return BidiPage (title: 'Live Stream' , model: currentModel);
197
+ } else {
198
+ // Fallback to the first page in case of an unexpected index
199
+ return ChatPage (title: 'Chat' , model: currentModel);
200
+ }
192
201
default :
193
202
// Fallback to the first page in case of an unexpected index
194
203
return ChatPage (title: 'Chat' , model: currentModel);
@@ -258,58 +267,64 @@ class _HomeScreenState extends State<HomeScreen> {
258
267
selectedFontSize: 10 ,
259
268
unselectedFontSize: 9 ,
260
269
selectedItemColor: Theme .of (context).colorScheme.primary,
261
- unselectedItemColor:
262
- Theme .of (context).colorScheme.onSurface.withValues (alpha: 0.7 ),
263
- items: const < BottomNavigationBarItem > [
264
- BottomNavigationBarItem (
270
+ unselectedItemColor: widget.useVertexBackend
271
+ ? Theme .of (context).colorScheme.onSurface.withValues (alpha: 0.7 )
272
+ : Colors .grey,
273
+ items: < BottomNavigationBarItem > [
274
+ const BottomNavigationBarItem (
265
275
icon: Icon (Icons .chat),
266
276
label: 'Chat' ,
267
277
tooltip: 'Chat' ,
268
278
),
269
- BottomNavigationBarItem (
279
+ const BottomNavigationBarItem (
270
280
icon: Icon (Icons .mic),
271
281
label: 'Audio' ,
272
282
tooltip: 'Audio Prompt' ,
273
283
),
274
- BottomNavigationBarItem (
284
+ const BottomNavigationBarItem (
275
285
icon: Icon (Icons .numbers),
276
286
label: 'Tokens' ,
277
287
tooltip: 'Token Count' ,
278
288
),
279
- BottomNavigationBarItem (
289
+ const BottomNavigationBarItem (
280
290
icon: Icon (Icons .functions),
281
291
label: 'Functions' ,
282
292
tooltip: 'Function Calling' ,
283
293
),
284
- BottomNavigationBarItem (
294
+ const BottomNavigationBarItem (
285
295
icon: Icon (Icons .image),
286
296
label: 'Image' ,
287
297
tooltip: 'Image Prompt' ,
288
298
),
289
- BottomNavigationBarItem (
299
+ const BottomNavigationBarItem (
290
300
icon: Icon (Icons .image_search),
291
301
label: 'Imagen' ,
292
302
tooltip: 'Imagen Model' ,
293
303
),
294
- BottomNavigationBarItem (
304
+ const BottomNavigationBarItem (
295
305
icon: Icon (Icons .schema),
296
306
label: 'Schema' ,
297
307
tooltip: 'Schema Prompt' ,
298
308
),
299
- BottomNavigationBarItem (
309
+ const BottomNavigationBarItem (
300
310
icon: Icon (Icons .edit_document),
301
311
label: 'Document' ,
302
312
tooltip: 'Document Prompt' ,
303
313
),
304
- BottomNavigationBarItem (
314
+ const BottomNavigationBarItem (
305
315
icon: Icon (Icons .video_collection),
306
316
label: 'Video' ,
307
317
tooltip: 'Video Prompt' ,
308
318
),
309
319
BottomNavigationBarItem (
310
- icon: Icon (Icons .stream),
311
- label: 'Bidi' ,
312
- tooltip: 'Bidi Stream' ,
320
+ icon: Icon (
321
+ Icons .stream,
322
+ color: widget.useVertexBackend ? null : Colors .grey,
323
+ ),
324
+ label: 'Live' ,
325
+ tooltip: widget.useVertexBackend
326
+ ? 'Live Stream'
327
+ : 'Live Stream (Currently Disabled)' ,
313
328
),
314
329
],
315
330
currentIndex: widget.selectedIndex,
0 commit comments