Skip to content

Instantly share code, notes, and snippets.

@GaryQian
Created September 5, 2018 17:03
Show Gist options
  • Select an option

  • Save GaryQian/139f7d8614399d4a096a7d0924a0f7b6 to your computer and use it in GitHub Desktop.

Select an option

Save GaryQian/139f7d8614399d4a096a7d0924a0f7b6 to your computer and use it in GitHub Desktop.
Text edit test app.
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