Skip to content

Commit b4e7714

Browse files
committed
Rename 'readonly' to 'readOnly' in CodeController, bump version to v0.2.23
1 parent f97d6c5 commit b4e7714

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
## 0.2.23
2+
3+
* Added `CodeController.readOnly`.
4+
15
## 0.2.22
26

37
* Fixed most of the search bugs (Issue [228](https://github.com/akvelon/flutter-code-editor/issues/228)).
4-
* Added `CodeController.readOnly`.
58

69
## 0.2.21
710

lib/src/code_field/code_controller.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class CodeController extends TextEditingController {
9393
/// Makes the text un-editable, but allows to set the full text.
9494
/// Focusing and moving the selection inside of a [CodeField] will
9595
/// still be possible.
96-
final bool readonly;
96+
final bool readOnly;
9797

9898
String get languageId => _languageId;
9999

@@ -147,7 +147,7 @@ class CodeController extends TextEditingController {
147147
Map<String, TextStyle>? theme,
148148
this.analysisResult = const AnalysisResult(issues: []),
149149
this.patternMap,
150-
this.readonly = false,
150+
this.readOnly = false,
151151
this.stringMap,
152152
this.params = const EditorParams(),
153153
this.modifiers = const [
@@ -654,7 +654,7 @@ class CodeController extends TextEditingController {
654654
void modifySelectedLines(
655655
String Function(String line) modifierCallback,
656656
) {
657-
if (readonly) {
657+
if (readOnly) {
658658
return;
659659
}
660660

@@ -733,7 +733,7 @@ class CodeController extends TextEditingController {
733733
Code get code => _code;
734734

735735
CodeEditResult? _getEditResultNotBreakingReadOnly(TextEditingValue newValue) {
736-
if (readonly) {
736+
if (readOnly) {
737737
return null;
738738
}
739739

lib/src/code_field/code_field.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class CodeField extends StatefulWidget {
151151
/// {@macro flutter.widgets.editableText.readOnly}
152152
///
153153
/// This is just passed as a parameter to a [TextField].
154-
/// See also [CodeController.readonly].
154+
/// See also [CodeController.readOnly].
155155
final bool readOnly;
156156

157157
final Color? background;

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_code_editor
22
description: A customizable code field supporting syntax highlighting and code folding.
3-
version: 0.2.22
3+
version: 0.2.23
44
repository: https://github.com/akvelon/flutter-code-editor
55

66
environment:

test/src/code_field/code_controller_readonly_field_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import 'package:flutter_code_editor/flutter_code_editor.dart';
33
import 'package:flutter_test/flutter_test.dart';
44

55
void main() {
6-
group('CodeController.readonly', () {
6+
group('CodeController.readOnly', () {
77
test('Setting readonly restricts modification of text', () {
88
const initialText = 'Aaa\nAaaa';
99
final controller = CodeController(
1010
text: initialText,
11-
readonly: true,
11+
readOnly: true,
1212
);
1313

1414
controller.value = const TextEditingValue(

0 commit comments

Comments
 (0)