Last active
September 7, 2018 06:40
-
-
Save felangel/985fa2d78bbc69f27ae765c84271793e to your computer and use it in GitHub Desktop.
[platform_views] TextViewExample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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