Skip to content

Commit

Permalink
Merge pull request BertrandBev#22 from leoshusar/readonly
Browse files Browse the repository at this point in the history
added readOnly flag
  • Loading branch information
BertrandBev authored Dec 7, 2021
2 parents 9b7171b + 8684507 commit cc80783
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/src/code_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ class CodeField extends StatefulWidget {
/// {@macro flutter.widgets.textField.enabled}
final bool? enabled;

/// {@macro flutter.widgets.editableText.readOnly}
final bool readOnly;

final Color? background;
final EdgeInsets padding;
final Decoration? decoration;
Expand All @@ -105,6 +108,7 @@ class CodeField extends StatefulWidget {
this.padding = const EdgeInsets.symmetric(),
this.lineNumberStyle = const LineNumberStyle(),
this.enabled,
this.readOnly = false,
this.cursorColor,
this.textSelectionTheme,
this.lineNumberBuilder,
Expand Down Expand Up @@ -282,6 +286,7 @@ class CodeFieldState extends State<CodeField> {
autocorrect: false,
enableSuggestions: false,
enabled: widget.enabled,
readOnly: widget.readOnly,
);

final codeCol = Theme(
Expand Down

0 comments on commit cc80783

Please sign in to comment.