fixed slight yank
This commit is contained in:
parent
51c772a2a1
commit
de7758102b
@ -29,6 +29,7 @@ class _ComposeEmailState extends State<ComposeEmail> {
|
||||
TextEditingController _emailRecipientController = TextEditingController();
|
||||
TextEditingController _emailSubjectController = TextEditingController();
|
||||
List<String>? contentOfDraft;
|
||||
bool isInitialized = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@ -53,22 +54,43 @@ class _ComposeEmailState extends State<ComposeEmail> {
|
||||
_composer = MutableDocumentComposer();
|
||||
_editor = createDefaultDocumentEditor(
|
||||
document: _document, composer: _composer);
|
||||
_emailRecipientController.text =
|
||||
widget.emailDraftID!.to[0].address;
|
||||
_emailRecipientController.text = widget.emailDraftID!.to[0].address;
|
||||
_emailSubjectController.text = widget.emailDraftID!.subject;
|
||||
isInitialized = true;
|
||||
|
||||
});
|
||||
}
|
||||
} else {
|
||||
setState(() {
|
||||
_document = MutableDocument(nodes: [
|
||||
ParagraphNode(
|
||||
id: Editor.createNodeId(),
|
||||
text: AttributedText(""),
|
||||
),
|
||||
]);
|
||||
_composer = MutableDocumentComposer();
|
||||
_editor = createDefaultDocumentEditor(
|
||||
document: _document, composer: _composer);
|
||||
isInitialized = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_editor.dispose();
|
||||
_emailRecipientController.dispose();
|
||||
_emailSubjectController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (!isInitialized) {
|
||||
return Center(
|
||||
child: CircularProgressIndicator(),
|
||||
);
|
||||
}
|
||||
return Positioned(
|
||||
bottom: 10.0,
|
||||
right: 10.0,
|
||||
@ -146,7 +168,7 @@ class _ComposeEmailState extends State<ComposeEmail> {
|
||||
//here the widget goes
|
||||
child: SuperEditor(
|
||||
//make this its own
|
||||
editor: _editor!,
|
||||
editor: _editor,
|
||||
plugins: {MarkdownInlineUpstreamSyntaxPlugin()},
|
||||
|
||||
// stylesheet: Stylesheet(
|
||||
|
Loading…
Reference in New Issue
Block a user