File tree Expand file tree Collapse file tree 1 file changed +0
-38
lines changed
firebase_ai_logic_showcase/lib/demos/chat Expand file tree Collapse file tree 1 file changed +0
-38
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,6 @@ class _ChatDemoState extends ConsumerState<ChatDemo> {
4444 Uint8List ? _attachment;
4545 final ScrollController _scrollController = ScrollController ();
4646 bool _loading = false ;
47- static bool _functionCallDialogShown = false ;
4847
4948 @override
5049 void initState () {
@@ -54,43 +53,6 @@ class _ChatDemoState extends ConsumerState<ChatDemo> {
5453 _chatService.init ();
5554 _userTextInputController.text =
5655 'Hey Gemini! Can you set the app color to purple?' ;
57- WidgetsBinding .instance.addPostFrameCallback ((_) async {
58- if (! _functionCallDialogShown) {
59- _functionCallDialogShown = true ;
60- final trigger = await _showFunctionCallDialog ();
61- if (mounted && trigger == true ) {
62- sendMessage (_userTextInputController.text);
63- }
64- }
65- });
66- }
67-
68- Future <bool ?> _showFunctionCallDialog () {
69- return showDialog <bool >(
70- context: context,
71- builder: (BuildContext context) {
72- return AlertDialog (
73- title: const Text ('Function Call' ),
74- content: const Text (
75- 'Do you want to trigger a function call to change app background color?' ,
76- ),
77- actions: < Widget > [
78- TextButton (
79- child: const Text ('No' ),
80- onPressed: () {
81- Navigator .of (context).pop (false );
82- },
83- ),
84- TextButton (
85- child: const Text ('Yes' ),
86- onPressed: () {
87- Navigator .of (context).pop (true );
88- },
89- ),
90- ],
91- );
92- },
93- );
9456 }
9557
9658 @override
You can’t perform that action at this time.
0 commit comments