Package selection guidance compiled from public package information, community data, and project usage.
DialogFlowtter is a Flutter package that simplifies integration with DialogFlow, enabling developers to quickly build and deploy chatbot features in their applications. It enhances the original DialogFlow implementation with improved reliability, easier setup, and better Flutter compatibility across multiple platforms. With support for Android, iOS, macOS, Windows, and Linux, it allows seamless real-time conversation handling using natural language processing. Ideal for apps requiring intelligent user interactions, it streamlines the process of connecting to DialogFlow agents and managing responses.
Use cases
Building AI-powered customer support chatbots
Integrating voice and text-based assistants
Creating interactive app guides and tutorials
Enabling multilingual user interactions
Developing conversational UIs for mobile and desktop
Key features
Cross-platform support (Android, iOS, macOS, Windows, Linux)
Easy integration with DialogFlow agents
Real-time message handling
Improved stability over native DialogFlow
Built-in response parsing and error handling
Support for both text and audio input
Suitable for
Flutter developers building chatbots
Teams integrating NLP into existing apps
Projects requiring multilingual chat capabilities
Startups prototyping conversational interfaces
Apps needing fast deployment of AI assistants
Considerations
Requires a DialogFlow agent configured with intents and entities
Needs internet connection for cloud-based NLP processing
May require additional setup for custom authentication
Limited offline functionality
Dependent on DialogFlow's API availability and quotas
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
A Flutter implementation of DialogFlow, improved.
Build your integrations with DialogFlow easier and faster.
About the package
Dialog Flow on Flutter, now with Null Safety support!
DialogFlowtter is a package that helps you to build integrations with DialogFlow easier and faster.
Authenticate with Google Auth Json
Get an authenticated http client so you can talk with your DialogFlow agent
Get access to all DialogFlow responses and models easily
Inspect what values a DialogFlow response could have
Why DialogFlowtter
The problem with the current DialogFlow integration packages that are available in Pub is that they're:
Completely abandoned
Not well documented
Lack functionality
Lack flexibility
This one is intended to solve those problems and add more features that I've seen the users want. Check the TO-DO section for more info on that.
Platform support
This package is fully supported in Android, iOS and Web.
We have plans on testing and adding support for Windows, Linux and MacOS as this platforms mature in the Flutter SDK.
Installation
Add the package to your flutter dependencies in you pubspec.yaml:
dependencies:dialog_flowtter:^0.3.1
Make sure you add your dialog_flow_auth.json to the pubspec.yaml assets:
One of the core features of DialogFlow is to detect what a person is trying to say. You can do that by detecting an intent that you have defined in your DialogFlow console
Create an instance of DialogFlowtter and set the sessionId that will be used to identify the current conversation of the user with DialogFlow.
It's highly recommended that you use a different sessionId for every conversation that the user establishes with the Assistant
You can check the code for more info on what info you can send and receive
Get the info from the intent
You can access the info returned by DialogFlow from the DetectIntentResponse that the detectIntent function returns.
Get the text from the response
DetectIntentResponse response = await dialogFlowtter.detectIntent(
queryInput: QueryInput(text: TextInput(text: "Hi")),
);
String? textResponse = response.text;
print(textResponse); // Hi, how may I help you?
response.text returns null if there's no text returned by DialogFlow or if the first message returned it's not of type MessageType.text
Get the message from the response
See Message for more info on what the model properties can be
Also, check this issue to see how to create and use Rich Responses like cards and carousels
Set the audio configuration in the detectIntent function
DetectIntentResponse response = await dialogFlowtter.detectIntent(
queryInput: QueryInput(text: TextInput(text: "Hi")),
// You can set your own configuration with the OutputAudioConfig class
audioConfig: OutputAudioConfig(),
);
Every time you instanciate DialogFlowtter, the class creates an authenticated http client, with the credentials obtained from the DialogFlow Auth JSON. Be sure to save this instance and reuse it to avoid memory leaks
Memory leaks
Make sure to dispose your DialogFlowtter instance whenever you're done using it. This makes sure to close the authenticated http client and all its StreamSubscriptions to avoid memory leaks.
Too many models
We have coded almost every Dialog Flow model that you may need to use when implementing this package so you don't have to work with annoying Map<String, dynamic> objects. Feel free to ask for any model that is missing to be added to the package.
The models that were not coded are included as annoying Map<String, dynamic> and are tagged with the //? Create model if necessary.
TO-DO
[x] Add support for null safety
[x] Add support for cards, images, etc.
[x] Memory, file and remote auth JSON
[ ] Secure DialogFlow auth JSON
[ ] Support audio queries
[ ] Add a catalog of supported languages
[ ] Add direct access to common used attributes
[ ] Support use of custom HTTP Client
Starware
DialogFlowtter is Starware.
This means you're free to use the project, as long as you star its GitHub repository.
Your appreciation makes us grow and glow up. ⭐