Created
September 5, 2018 17:03
-
-
Save GaryQian/139f7d8614399d4a096a7d0924a0f7b6 to your computer and use it in GitHub Desktop.
Text edit test app.
This file contains hidden or 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'; | |
| void main() => runApp(new MyApp()); | |
| class MyApp extends StatelessWidget { | |
| // This widget is the root of your application. | |
| @override | |
| Widget build(BuildContext context) { | |
| return new MaterialApp( | |
| title: 'Flutter Demo', | |
| theme: new ThemeData( | |
| primarySwatch: Colors.blue, | |
| ), | |
| home: new MyHomePage(title: 'Flutter Demo Home Page'), | |
| ); | |
| } | |
| } | |
| 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 Column( | |
| children: <Widget>[ | |
| new Text( | |
| 'This is a Flutter app', | |
| ), | |
| TextField(), | |
| RaisedButton(child: Text("Launch dialog"), onPressed: () { | |
| showDialog(context: context, builder: (context) { | |
| return AlertDialog(title: Text("Dialog with edit text"), | |
| content: TextField() | |
| ); | |
| }); | |
| },) | |
| ], | |
| ), | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment