mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-28 09:47:35 +08:00
Add a very simple text editor
This commit is contained in:
@ -8,7 +8,7 @@ class JournalList extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var createButton = new FloatingActionButton(
|
var createButton = new FloatingActionButton(
|
||||||
onPressed: _newPost,
|
onPressed: () => _newPost(context),
|
||||||
child: new Icon(Icons.add),
|
child: new Icon(Icons.add),
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -73,8 +73,25 @@ So now what is going to happen?
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _newPost() {
|
void _newPost(BuildContext context) {
|
||||||
print("FOoOO");
|
var bodyWidget = new Container(
|
||||||
|
child: new TextField(
|
||||||
|
autofocus: true,
|
||||||
|
keyboardType: TextInputType.multiline,
|
||||||
|
maxLines: 500,
|
||||||
|
),
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
);
|
||||||
|
|
||||||
|
var newJournalScreen = new Scaffold(
|
||||||
|
appBar: new AppBar(
|
||||||
|
title: new Text("May 15, 17:35"),
|
||||||
|
),
|
||||||
|
body: bodyWidget,
|
||||||
|
);
|
||||||
|
|
||||||
|
var route = new MaterialPageRoute(builder: (context) => newJournalScreen);
|
||||||
|
Navigator.of(context).push(route);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user