mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-20 21:25:48 +08:00
Give the NoteEditor a state
This way its creationDate will be accurate
This commit is contained in:
@ -5,12 +5,20 @@ import 'package:intl/intl.dart';
|
||||
import 'package:journal/note.dart';
|
||||
import 'package:journal/state_container.dart';
|
||||
|
||||
class NoteEditor extends StatelessWidget {
|
||||
class NoteEditor extends StatefulWidget {
|
||||
@override
|
||||
NoteEditorState createState() {
|
||||
return new NoteEditorState();
|
||||
}
|
||||
}
|
||||
|
||||
class NoteEditorState extends State<NoteEditor> {
|
||||
static final GlobalKey<FormFieldState<String>> noteTextKey =
|
||||
GlobalKey<FormFieldState<String>>();
|
||||
|
||||
final DateTime _createdAt;
|
||||
|
||||
NoteEditor() : _createdAt = new DateTime.now();
|
||||
NoteEditorState() : _createdAt = new DateTime.now();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
Reference in New Issue
Block a user