alan_voice 1.3.0 alan_voice: ^1.3.0 copied to clipboard
Alan voice plugin. One can easily add voice interaction to exisiting app with this plugin See more on the homepage and in the docs section - https://alan.app/docs/intro.html
alan_voice #
Alan voice plugin
About #
This plugin helps you to integrate Alan voice experience into your Flutter app
Quickstart #
Add Alan Voice dependency to your app
your pubspec.yaml file:
dependencies:
flutter:
sdk: flutter
...
alan_voice: 1.3.0
We will use Flutter sample app from here: https://github.com/nisrulz/flutter-examples/tree/master/stateful_widget
Clone this repo and open main.dart
file.
First add alan_voice package dependency
import 'package:alan_voice/alan_voice.dart';
Than locate MyButtonState
class paste following code into it:
class MyButtonState extends State<MyButton> {
//PASTE THESE LINES -\/-
bool _enabled = true; //start button state
void _initAlanButton() async {
//init Alan with sample project id
AlanVoice.initButton("8e0b083e795c924d64635bba9c3571f42e956eca572e1d8b807a3e2338fdd0dc/stage");
setState(() {
_enabled = false;
});
// -------/\-------
}
And now modify main widget:
- locate this string
Text(displayedString, style: TextStyle(fontSize: 40.0)),
and change it to
Text("Alan voice example", style: TextStyle(fontSize: 40.0)),
- locate following line in the
RaisedButton
widget params:
onPressed: onPressOfButton
and change it to
onPressed: _initAlanButton
- That's it. Now run your app and press the button!
See this page for more info.