Skip to content

Instantly share code, notes, and snippets.

@felangel
Last active September 7, 2018 06:40
Show Gist options
  • Save felangel/985fa2d78bbc69f27ae765c84271793e to your computer and use it in GitHub Desktop.
Save felangel/985fa2d78bbc69f27ae765c84271793e to your computer and use it in GitHub Desktop.
[platform_views] TextViewExample
import 'package:flutter/material.dart';
import 'package:text_view/text_view.dart';
void main() => runApp(MaterialApp(home: TextViewExample()));
class TextViewExample extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Flutter TextView example')),
body: Column(children: [
Center(
child: Container(
padding: EdgeInsets.symmetric(vertical: 30.0),
width: 130.0,
height: 100.0,
child: TextView(
onTextViewCreated: _onTextViewCreated,
))),
Expanded(
flex: 3,
child: Container(
color: Colors.blue[100],
child: Center(child: Text("Hello from Flutter!"))))
]));
}
void _onTextViewCreated(TextViewController controller) {
controller.setText('Hello from Android!');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment