|
@@ -35,6 +35,7 @@ class ZefyrEditableText extends StatefulWidget {
|
35
|
35
|
@required this.imageDelegate,
|
36
|
36
|
this.autofocus: true,
|
37
|
37
|
this.enabled: true,
|
|
38
|
+ this.padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
38
|
39
|
}) : super(key: key);
|
39
|
40
|
|
40
|
41
|
final ZefyrController controller;
|
|
@@ -43,6 +44,9 @@ class ZefyrEditableText extends StatefulWidget {
|
43
|
44
|
final bool autofocus;
|
44
|
45
|
final bool enabled;
|
45
|
46
|
|
|
47
|
+ /// Padding around editable area.
|
|
48
|
+ final EdgeInsets padding;
|
|
49
|
+
|
46
|
50
|
static ZefyrEditableTextScope of(BuildContext context) {
|
47
|
51
|
final ZefyrEditableTextScope result =
|
48
|
52
|
context.inheritFromWidgetOfExactType(ZefyrEditableTextScope);
|
|
@@ -123,11 +127,15 @@ class _ZefyrEditableTextState extends State<ZefyrEditableText>
|
123
|
127
|
super.build(context); // See AutomaticKeepAliveState.
|
124
|
128
|
ZefyrEditor.of(context);
|
125
|
129
|
|
|
130
|
+ Widget body = ListBody(children: _buildChildren(context));
|
|
131
|
+ if (widget.padding != null) {
|
|
132
|
+ body = new Padding(padding: widget.padding, child: body);
|
|
133
|
+ }
|
126
|
134
|
final scrollable = SingleChildScrollView(
|
127
|
135
|
padding: EdgeInsets.only(top: 16.0),
|
128
|
136
|
physics: AlwaysScrollableScrollPhysics(),
|
129
|
137
|
controller: _scrollController,
|
130
|
|
- child: ListBody(children: _buildChildren(context)),
|
|
138
|
+ child: body,
|
131
|
139
|
);
|
132
|
140
|
|
133
|
141
|
final overlay = Overlay.of(context, debugRequiredFor: widget);
|