File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1
1
import 'package:flutter/material.dart' ;
2
2
import 'package:flutter/services.dart' ;
3
3
import 'package:flutter_markdown/flutter_markdown.dart' ;
4
+
4
5
import '../src/constants.dart' ;
5
6
import '../src/emoji_input_formatter.dart' ;
6
7
import '../src/toolbar.dart' ;
@@ -28,6 +29,7 @@ class MarkdownAutoPreview extends StatefulWidget {
28
29
this .readOnly = false ,
29
30
this .expands = false ,
30
31
this .decoration = const InputDecoration (isDense: true ),
32
+ this .hintText,
31
33
});
32
34
33
35
/// Markdown syntax to reset the field to
@@ -37,6 +39,9 @@ class MarkdownAutoPreview extends StatefulWidget {
37
39
///
38
40
final String ? markdownSyntax;
39
41
42
+ /// Hint text to show when the field is empty
43
+ final String ? hintText;
44
+
40
45
/// For enable toolbar options
41
46
///
42
47
/// if false, toolbar widget will not display
@@ -269,7 +274,7 @@ class _MarkdownAutoPreviewState extends State<MarkdownAutoPreview> {
269
274
child: MarkdownBody (
270
275
key: const ValueKey <String >("zmarkdown-parse-body" ),
271
276
data: _internalController.text == ""
272
- ? "_Markdown text_"
277
+ ? widget.hintText ?? "_Markdown text_"
273
278
: _internalController.text,
274
279
),
275
280
),
You can’t perform that action at this time.
0 commit comments