File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -315,6 +315,7 @@ class _MarkdownAutoPreviewState extends State<MarkdownAutoPreview> {
315
315
emojiConvert: widget.emojiConvert,
316
316
toolbarBackground: widget.toolbarBackground,
317
317
expandableBackground: widget.expandableBackground,
318
+ onClearAction: () => widget.onChanged? .call ("" ),
318
319
)
319
320
],
320
321
);
Original file line number Diff line number Diff line change 1
1
import 'package:flutter/material.dart' ;
2
2
import 'package:font_awesome_flutter/font_awesome_flutter.dart' ;
3
- import 'package:markdown_editor_plus/markdown_editor_plus .dart' ;
3
+ import '../l10n/generated/markdown_editor_plus_localizations .dart' ;
4
4
import '../src/toolbar.dart' ;
5
5
import 'modal_select_emoji.dart' ;
6
6
import 'modal_input_url.dart' ;
@@ -20,6 +20,7 @@ class MarkdownToolbar extends StatelessWidget {
20
20
final bool showEmojiSelection;
21
21
final VoidCallback ? onActionCompleted;
22
22
final String ? markdownSyntax;
23
+ final VoidCallback ? onClearAction;
23
24
24
25
const MarkdownToolbar ({
25
26
super .key,
@@ -35,6 +36,7 @@ class MarkdownToolbar extends StatelessWidget {
35
36
this .onActionCompleted,
36
37
this .showPreviewButton = true ,
37
38
this .showEmojiSelection = true ,
39
+ this .onClearAction,
38
40
});
39
41
40
42
@override
@@ -63,6 +65,7 @@ class MarkdownToolbar extends StatelessWidget {
63
65
onPressedButton: () {
64
66
controller.clear ();
65
67
onActionCompleted? .call ();
68
+ onClearAction? .call ();
66
69
},
67
70
tooltip: MarkdownEditorPlusLocalizations .of (context).toolbar_clear_action,
68
71
),
You can’t perform that action at this time.
0 commit comments