66
77Flutter Code Editor is a multi-platform code editor supporting:
88
9- - Syntax highlighting,
9+ - Syntax highlighting for over 100 languages ,
1010- Code blocks folding,
1111- Autocompletion,
1212- Read-only code blocks,
@@ -63,7 +63,7 @@ See the full runnable example [here](https://github.com/akvelon/flutter-code-edi
6363### Syntax Highlighting
6464
6565Flutter Code Editor supports
66- [ over a hundred languages] ( https://github.com/git-touch/highlight.dart/tree/master/highlight/lib/languages )
66+ [ over a hundred languages] ( https://github.com/git-touch/highlight.dart/tree/master/highlight/lib/languages ) ,
6767relying on the [ highlight] ( https://pub.dev/packages/highlight ) package for parsing code.
6868
6969To select a language, use a
@@ -109,14 +109,14 @@ The editor supports pluggable analyzers to highlight errors and show error messa
109109We ship the following analyzers:
110110
111111- ` DefaultLocalAnalyzer ` highlights unmatched pair characters for supported languages.
112- It works on the client locally.
113- It is selected by default on ` CodeController ` if no other analyzer is specified.
114- - ` DartPadAnalyzer ` for Dart language, calls the [ DartPad] ( https://dartpad.dev ) backend for analysis.
112+ It works on the client locally,
113+ and is selected by default on ` CodeController ` if no other analyzer is specified.
114+ - ` DartPadAnalyzer ` for Dart language, calls upon the [ DartPad] ( https://dartpad.dev ) backend for analysis.
115115
116- For other languages you can write custom analyzers that access your backend.
116+ For other languages, you can write custom analyzers that access your backend.
117117See the code for ` DartPadAnalyzer ` for the implementation example.
118118
119- To set the analyzer call any of the following:
119+ To set the analyzer, call any of the following:
120120
121121``` dart
122122codeController = CodeController(language: dart, analyzer: DartPadAnalyzer());
@@ -125,15 +125,15 @@ codeController.setLanguage(dart, analyzer: DartPadAnalyzer());
125125```
126126
127127** Note:** Code analysis is an experimental feature.
128- We may introduce breaking changes to ` Analyzer ` subclasses without following semver contract.
129- If you only use the analyzers we ship then this will not affect you.
128+ We may introduce breaking changes to ` Analyzer ` subclasses without following the semver contract.
129+ If you only use the analyzers we ship, then this will not affect you.
130130
131131
132132## Themes
133133
134134### Pre-defined Themes
135135
136- Flutter Code Editor supports themes from the [ highlight] ( https://pub.dev/packages/flutter_highlight ) package,
136+ Flutter Code Editor supports themes from the [ highlight] ( https://pub.dev/packages/flutter_highlight ) package —
137137see the full list of the pre-defined themes
138138[ here] ( https://github.com/git-touch/highlight.dart/tree/master/flutter_highlight/lib/themes ) .
139139
@@ -156,15 +156,15 @@ return MaterialApp(
156156
157157### Custom Themes
158158
159- To use a custom theme, create a map of styles under the pre-defined class names.
160- See [ an example] ( https://github.com/git-touch/highlight.dart/blob/master/flutter_highlight/lib/themes/monokai-sublime.dart ) .
159+ To use a custom theme, create a map of styles under the pre-defined class names —
160+ see [ this example] ( https://github.com/git-touch/highlight.dart/blob/master/flutter_highlight/lib/themes/monokai-sublime.dart ) .
161161
162162
163163## Hiding Line Numbers, Errors, and Folding Handles
164164
165- A lot of styling can be tuned with ` GutterStyle ` object passed to ` CodeField ` widget.
165+ A lot of styling can be tuned with a ` GutterStyle ` object passed to a ` CodeField ` widget.
166166See
167- [ the example] ( https://github.com/akvelon/flutter-code-editor/tree/main/example/lib/03.change_language_theme )
167+ [ this example] ( https://github.com/akvelon/flutter-code-editor/tree/main/example/lib/03.change_language_theme )
168168that dynamically changes the properties listed here.
169169
170170``` dart
@@ -195,7 +195,7 @@ usable as one. However, code folding and other features have impact on built-in
195195- ` text ` returns and sets the visible text. If any code is folded, it will not be returned.
196196- ` value ` returns and sets the ` TextEditingValue ` with the visible text and selection.
197197 If any code is folded, it will not be returned.
198- - ` fullText ` returns and sets the entire text including any folded blocks and hidden
198+ - ` fullText ` returns and sets the entire text, including any folded blocks and hidden
199199 service comments (see below).
200200
201201
@@ -244,7 +244,7 @@ To customize section parsing using any other syntax, subclass `AbstractNamedSect
244244
245245## Read-Only Code Blocks
246246
247- Flutter Code Editor allows to define read-only code blocks.
247+ Flutter Code Editor allows you to define read-only code blocks.
248248This may be useful for learning use cases when users are guided to modify certain code blocks
249249while other code is meant to be protected from changes.
250250
@@ -259,8 +259,8 @@ Any non-existent section names in this set are ignored.
259259To make the code editable again, pass an updated set to ` controller.readOnlySectionNames ` .
260260
261261When using this feature, ` text ` and ` value ` properties cannot be used to change the text
262- programmatically because they have the same effect as the user input,
263- and so locking affects them as well.
262+ programmatically because they have the same effect as the user input.
263+ This means that locking affects them as well.
264264
265265To change a partially locked controller, set the ` fullText ` property.
266266
@@ -269,9 +269,9 @@ To change a partially locked controller, set the `fullText` property.
269269
270270## Advanced Code Blocks Folding
271271
272- ### Folding The First Comment/License
272+ ### Folding the First Comment/License
273273
274- Many code snippets contain license as their first comment, and it can distract readers.
274+ Many code snippets contain a license as their first comment, which can distract readers.
275275To fold the first comment, use:
276276
277277``` dart
@@ -292,9 +292,9 @@ controller.foldImports();
292292
293293### Named Sections
294294
295- The editor supports folding all blocks except specific named sections.
295+ The editor supports folding all blocks except for specific named sections.
296296This helps the user focus on those sections while
297- all source code is still there, can be expanded and copied by the user.
297+ all source code is still there and can be expanded and copied by the user.
298298
299299To fold all blocks except those overlapping with the given named sections:
300300
@@ -323,8 +323,8 @@ To get the currently folded blocks, read `controller.code.foldedBlocks`.
323323
324324## Hiding Text
325325
326- The editor allows to completely hide all code except a specific named section.
327- This is useful for even more focus than with folding.
326+ The editor allows you to completely hide all code except for a specific named section.
327+ This is useful to achieve even more focus than with folding.
328328
329329To hide all the code except the given named section:
330330
@@ -337,7 +337,7 @@ controller.visibleSectionNames = {'section1'};
337337When hiding text, the full text is still preserved
338338and available via ` fullText ` property in the Flutter Code Editor.
339339
340- Hiding text preserves line numbering which is not possible by just showing a cropped snippet.
340+ Hiding text preserves line numbering, which is not possible by just showing a cropped snippet.
341341Preserving hidden text is also useful if you later need to send
342342the full code for further processing but still want to hide
343343non-informative parts.
@@ -359,18 +359,18 @@ The editor suggests words as they are typed. Suggested words are:
359359- Words set with ` controller.autocompleter.setCustomWords(['word1', 'word2']) `
360360
361361All those words are merged into an unstructured dictionary.
362- The editor performs no syntax analysis and so cannot tell if a given class really has
363- the method the user is typing. This feature is meant to simplify typing but not to be relied on
362+ The editor does not perform any syntax analysis, so it cannot tell if a given class really has
363+ the method the user is typing. This feature is meant to simplify typing, but should not be relied on
364364when exploring classes and methods.
365365
366+ ![ Suggestions example] ( https://raw.githubusercontent.com/akvelon/flutter-code-editor/main/example/images/suggestions_example.gif )
367+
366368To disable autocompletion:
367369
368370``` dart
369371controller.popupController.enabled = false;
370372```
371373
372- ![ Suggestions example] ( https://raw.githubusercontent.com/akvelon/flutter-code-editor/main/example/images/suggestions_example.gif )
373-
374374
375375## Shortcuts
376376
0 commit comments