Flutter: Dialogflow SDK returning Tried calling: []("queryText") error

Related searches

I'm trying to use the flutter_dialogflow package with Dialogflow v2. I've taken all the necessary steps in my view. I need help in knowing if I'm missing out on anything.

My Code -

import 'package:flutter/material.dart';
import 'package:flutter_dialogflow/dialogflow_v2.dart';

class Home extends StatefulWidget {
  Home({Key key}) : super(key: key);

  _HomeState createState() => _HomeState();

class _HomeState extends State<Home> {

  String sampleQuery = "travel destinations in india";

  void _sendQuery() async {
    try {
    AuthGoogle _authGoogle = await AuthGoogle(fileJson: "assets/dependencies/dialogflow.json").build();
    Dialogflow dialogflow = Dialogflow(authGoogle: _authGoogle, language: Language.english);
    AIResponse response = await dialogflow.detectIntent("hi");

    } catch(e) {

  Widget build(BuildContext context) {
    return Scaffold(
       appBar: AppBar(
         title: Text('Ask Now'),
       body: RaisedButton(
         onPressed: _sendQuery,
         color: Colors.black87,
         child: Text('Send Query', style: TextStyle(color: Colors.white)),

Please note:

  1. I've enabled Web API option in Dialogflow Integrations
  2. I've downloaded the JSON file and added it to the directory and assets in pubspec.yaml file
  3. I've checked the path to the file many times (no issues there)
  4. My Google Cloud Console is NOT payment verified (i don't think this should be the concern)
  5. I've NOT verified the OAUTH CONSENT SCREEN as I don't know what to put in the URL for a mobile app

Here's the error log -

I/flutter (18856): ------------------------------NoSuchMethodError: The method '[]' was called on null.
I/flutter (18856): Receiver: null
I/flutter (18856): Tried calling: []("queryText")

I believe the issue lies in AIResponse response = await dialogflow.detectIntent("hi"); line of code but can't find out why and how. Maybe I'm missing out on some steps. Thank Youuu!

I've just stumbled across the same issue and in my particular case it was because I'd forgot to enable the API inside https://console.developers.google.com/apis/dashboard for the project after creating a new service account.

You would have most likely set up a service account at: https://console.developers.google.com/iam-admin/serviceaccounts

You'd then need to go to: https://console.developers.google.com/apis/library for that the same project an enable DialogFlow.

This may not be your issue but it's worth checking too.


ERROR: Tried calling: []("queryText") � Issue #21 , ERROR: Tried calling: []("queryText") #21 I/flutter ( 9861): Receiver: null I/flutter ( 9861): Tried calling: Dialogflow detectIntent API Doc getToken}" }, body: body ); return AIResponse(body: json.decode(response.body)); } . This article demonstrates the use of flutter and bots (made up using DialogFlow). WIth the help of DialogFlow, its super easy to make or even modify a bot.

I found out I didn't saved Service account details in the https://console.cloud.google.com/iam-admin/serviceaccounts with the created JSON key.

Double-check if your account has the key saved.

Implementing Flutter FactsBot using DialogFlow, We'll be integrating DialogFlow conversational API in native Flutter App. You can refer to Response text is the output for the phrases tried out by user. If a match is DialogFlow agent is trained and ready to return text responses for default intent ! E/flutter (15032): Tried calling: []("queryText"). Masuba� Your Dialogflow agent can then call on its own fulfillment (deployed as a webhook) to carry out some logic like calling a REST API or other backend service that generates a response to return to the Assistant. This webhook is also known as your Dialogflow fulfillment, and uses the Dialogflow webhook format. Figure 4.

Hey i solved it by using Dialogflow v1 just import v1 lib and use it like this

import 'package:flutter_dialogflow/flutter_dialogflow.dart';
Dialogflow dialogflow = Dialogflow(token: "Your Token");
AIResponse response = await dialogflow.sendQuery("Your Query");
print('thing ${response.getMessageResponse()}');

your token can be found here https://dialogflow.cloud.google.com/#/editAgent/{your project id}/

flutter, Flutter: Dialogflow SDK returning Tried calling: [](“queryText”) error. I'm trying to use the flutter_dialogflow package with Dialogflow v2. I've taken all the� dialogflow detectIntent call need to add audioConfig and input audio #22 opened Feb 20, 2020 by nandakumar111 ERROR: Tried calling: []("queryText")

I also faced same issue and solved it by adding dialogflow API admin role in service account permissions . While creating service account you have got optional section to add role ,if role have not added then please recreate account and select role(dialogflow API admin) then use new JSON generated

Method: projects.agent.sessions.detectIntent, Processes a natural language query and returns structured, actionable POST https://dialogflow.googleapis.com/v2/{session=projects/*/agent/ Try this API. Call this method on live data to see the API request and response. 4 Flutter: Dialogflow SDK returning Tried calling: [] 2 Simply accessing call logs in flutter (?) Jan 15. 1 Flutter how to execute function on back pressed Jan 15.

Dialogflow v1 & v2 for Flutter apps., Dialogflow v1 #. Dialogflow register and create new Agent; Copy Api key (Token); Code. Dialogflow dialogflow = Dialogflow(token: "� flutter_dialogflow: The flutter_dialogflow makes it easy to integrate dialogflow with Flutter project by Victor Alfonso Rodas. tts : A text to speech plugin for flutter by Alex Blount. Here is our

When you call projects.agent.intents.list it will return a JSON file of the following representation: { "intents": [ { object (Intent) } ], "nextPageToken": string } If you want to access intents and send it to the user you should parse the JSON file and access each individual intent and send it and the manner you want (you can populate

Flutter is Google's mobile app SDK for crafting high-quality native experiences on iOS and Android in record time. With the Google Maps Flutter plugin, you can add maps based on Google maps data to your application.

  • Same Problem here. If you find the solution, please put the solution.
  • Nope no solution until now
  • Thanks but all of that was sorted already. No help! It has become very weird now!
  • Hi, will look into it. It's long since I touched that project cause it was postponed. Anyway, it's good to resolve it.