flutter_ibm_watson 0.0.4 flutter_ibm_watson: ^0.0.4 copied to clipboard
The flutter_ibm_watson makes it easy to integrate IBM Watson
import 'dart:async';
import 'dart:io';
import 'package:example/screenLanguageTranslator.dart';
import 'package:example/screenTextToSpeech.dart';
import 'package:example/screenVisualRecognition.dart';
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import 'package:flutter_ibm_watson/flutter_ibm_watson.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Watson Demo',
theme: new ThemeData(
primarySwatch: Colors.blue,
),
home: new MyHomePage(title: 'Flutter Watson Demo'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => new _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text(widget.title),
),
body: new Center(
child: new Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
new Container(
margin: const EdgeInsets.all(10.0),
child: new RaisedButton(
child: const Text('Screen Language Translator'),
color: Theme.of(context).accentColor,
elevation: 4.0,
splashColor: Colors.blueGrey,
textColor: Colors.white,
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ScreenLanguageTranslator()),
);
},
),
),
new Container(
margin: const EdgeInsets.all(10.0),
child: new RaisedButton(
child: const Text('Screen Visual Recognition'),
color: Theme.of(context).accentColor,
elevation: 4.0,
splashColor: Colors.blueGrey,
textColor: Colors.white,
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ScreenVisualRecognition()),
);
},
),
),
new Container(
margin: const EdgeInsets.all(10.0),
child: new RaisedButton(
child: const Text('Text to Speech'),
color: Theme.of(context).accentColor,
elevation: 4.0,
splashColor: Colors.blueGrey,
textColor: Colors.white,
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ScreenTextToSpeech()),
);
},
),
),
],
),
),
floatingActionButton: new FloatingActionButton(
onPressed: null,
tooltip: 'Increment',
child: new Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
}