alan_voice 0.8.0 alan_voice: ^0.8.0 copied to clipboard
Alan voice plugin
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: 0.5.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
Remove everything from it and paste following code:
class MyButtonState extends State<MyButton> {
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
new Text(displayedString, style: new TextStyle(fontSize: 40.0)),
and change it to
new Text("Alan voice example", style: new 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: https://docs-stage.alan.app/docs/intro.html for more info.