Documentation

Powered by Algolia

Alan Flutter Framework



Available on Android and iOS platforms.


The Alan Flutter plugin helps you to integrate your voice experience and Alan Studio script into your Flutter app.

Integration

To integrate a Flutter app with Alan:

  1. In the pubspec.yaml file of your Flutter project, add the Alan voice dependency:

    //pubspec.yaml file
    ...
    dependencies:
      flutter:
        sdk: flutter
        ...
    
      alan_voice: 2.0.7
  2. Open the main.dart file and at the top of it, add the alan_voice package dependency:

    //main.dart file
    ...
    import 'package:alan_voice/alan_voice.dart';
  3. In the _MyHomePageState class, add the method for initializing the Alan button:

    //main.dart file
    ...
    class _MyHomePageState extends State<MyHomePage> {
    ...
    	_MyHomePageState() {
    		//init Alan with sample project id
    		AlanVoice.addButton(
    			"",
    			buttonAlign: AlanVoice.BUTTON_ALIGN_LEFT);
    	}
    ...
  4. In the Alan Studio, go to Integrations, copy the value from the Alan SDK Key field and insert this value in the quotes.

    //main.dart file
    ...
    class _MyHomePageState extends State<MyHomePage> {
    ...
    	_MyHomePageState() {
    		//init Alan with sample project id
    		AlanVoice.addButton(
    			"314203787ccd9370974f1bf6b6929c1b2e956eca572e1d8b807a3e2338fdd0dc/prod",
    			buttonAlign: AlanVoice.BUTTON_ALIGN_LEFT);
    	}
    ...

That's it. Now you can run the app, tap the Alan button and start interacting with Alan.

What's next?

You can now proceed to building a voice interface with Alan. Use the following resources: