Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit abcb06e

Browse files
committed
Merge branch 'main' of github.com:reqable/re-editor
2 parents a610e27 + 215f5ae commit abcb06e

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

lib/src/_code_editable.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ class _CodeEditable extends StatefulWidget {
2626
final EdgeInsetsGeometry margin;
2727
final Widget? sperator;
2828
final Border? border;
29+
final BorderRadius? borderRadius;
30+
final Clip clipBehavior;
2931
final ValueChanged<CodeLineEditingValue>? onChanged;
3032
final FocusNode focusNode;
3133
final CodeLineEditingController controller;
@@ -61,6 +63,8 @@ class _CodeEditable extends StatefulWidget {
6163
required this.margin,
6264
required this.sperator,
6365
this.border,
66+
this.borderRadius,
67+
this.clipBehavior = Clip.none,
6468
this.onChanged,
6569
required this.focusNode,
6670
required this.controller,
@@ -218,7 +222,9 @@ class _CodeEditableState extends State<_CodeEditable> with AutomaticKeepAliveCli
218222
decoration: BoxDecoration(
219223
border: widget.border,
220224
color: widget.backgroundColor,
225+
borderRadius: widget.borderRadius,
221226
),
227+
clipBehavior: widget.clipBehavior,
222228
margin: widget.margin,
223229
child: Row(
224230
crossAxisAlignment: CrossAxisAlignment.start,

lib/src/code_editor.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ class CodeEditor extends StatefulWidget {
174174
this.shortcutOverrideActions,
175175
this.sperator,
176176
this.border,
177+
this.borderRadius,
178+
this.clipBehavior = Clip.none,
177179
this.readOnly,
178180
this.showCursorWhenReadOnly,
179181
this.wordWrap,
@@ -237,6 +239,17 @@ class CodeEditor extends StatefulWidget {
237239
/// The border of the editor.
238240
final Border? border;
239241

242+
/// The radius of the editor's border corners.
243+
///
244+
/// This defines how rounded the corners of the editor's border will appear.
245+
///
246+
/// If null, the corners will not be rounded.
247+
final BorderRadius? borderRadius;
248+
249+
250+
/// How the content should be clipped if it overflows the editor's bounds.
251+
final Clip clipBehavior;
252+
240253
/// Whether the text can be changed.
241254
///
242255
/// When this is set to true, the text cannot be modified
@@ -460,6 +473,8 @@ class _CodeEditorState extends State<CodeEditor> {
460473
showCursorWhenReadOnly: widget.showCursorWhenReadOnly ?? true,
461474
sperator: widget.sperator,
462475
border: widget.border,
476+
borderRadius: widget.borderRadius,
477+
clipBehavior: widget.clipBehavior,
463478
onChanged: widget.onChanged,
464479
focusNode: _focusNode,
465480
padding: (widget.padding ?? _kDefaultPadding).add(EdgeInsets.only(

0 commit comments

Comments
 (0)