Skip to content

Instantly share code, notes, and snippets.

@jtmuller5
Created April 15, 2021 02:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtmuller5/c74df24501d8d7e22570d3d4cc05b7ae to your computer and use it in GitHub Desktop.
Save jtmuller5/c74df24501d8d7e22570d3d4cc05b7ae to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
import 'package:stacked/stacked.dart';
import 'single_command_view_model.dart';
class SingleCommandView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ViewModelBuilder<SingleCommandViewModel>.reactive(
viewModelBuilder: () => SingleCommandViewModel(),
onModelReady: (model) {
// model.initialize();
},
builder: (context, model, child) {
return Scaffold(
appBar: AppBar(
title: Text('Single Command'),
),
body: Center(
child: Column(
children: [
ElevatedButton(onPressed: (){
model.startListening();
}, child: Text('Start listening'),),
Text(model.recognizedWords)
],
),
)
);
},
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment