CodeController class

Inheritance

Constructors

CodeController({String? text, Mode? language, AbstractAnalyzer analyzer = const DefaultLocalAnalyzer(), AbstractNamedSectionParser? namedSectionParser, Set<String> readOnlySectionNames = const {}, Set<String> visibleSectionNames = const {}, AnalysisResult analysisResult = const AnalysisResult(issues: []), Map<String, TextStyle>? patternMap, bool readOnly = false, EditorParams params = const EditorParams(), List<CodeModifier> modifiers = defaultCodeModifiers})

Properties

actions Map<Type, Action<Intent>>
latefinal
analysisResult AnalysisResult
getter/setter pair
analyzer AbstractAnalyzer
CodeController uses analyzer to generate issues that are displayed in gutter widget.
getter/setter pair
autocompleter → Autocompleter
final
code Code
no setter
fullText String
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
historyController → CodeHistoryController
latefinal
language ↔ Mode?
A highlight language to parse the text with
getter/setter pair
languageId String
no setter
lastTextSpan TextSpan?
The last TextSpan returned from buildTextSpan.
getter/setter pair
modifiers List<CodeModifier>
A list of code modifiers to dynamically update the code upon certain keystrokes.
final
namedSectionParser AbstractNamedSectionParser?
final
params EditorParams
Common editor params such as the size of a tab in spaces
final
patternMap Map<String, TextStyle>?
A map of specific regexes to style
final
popupController ↔ PopupController
getter/setter pair
readOnly bool
Makes the text un-editable, but allows to set the full text. Focusing and moving the selection inside of a CodeField will still be possible.
final
readOnlySectionNames Set<String>
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selection TextSelection
The currently selected range within text.
getter/setter pairinherited
text String
The current string the user is editing.
getter/setter pairinherited
value TextEditingValue
The current value stored in this notifier.
getter/setter pairinherited-getteroverride-setter
visibleSectionNames Set<String>
getter/setter pair

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
analyzeCode() Future<void>
applyHistoryRecord(CodeHistoryRecord record) → void
backspace() → void
Remove the selection or last char if the selection is empty
buildTextSpan({required BuildContext context, TextStyle? style, bool? withComposing}) TextSpan
Builds TextSpan from current editing value.
override
clear() → void
Set the value to empty.
inherited
clearComposing() → void
Set the composing region to an empty range.
inherited
commentOutOrUncommentSelection() → void
Comments out or uncomments the currently selected lines.
dismiss() → void
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
override
foldAt(int line) → void
foldCommentAtLineZero() → void
foldImports() → void
foldOutsideSections(Iterable<String> names) → void
Folds blocks that are outside all of the names sections.
generateSuggestions() Future<void>
getSelectedLineRange() TextRange
indentSelection() → void
insertSelectedWord() → void
Inserts the word selected from the list of completions
insertStr(String str) → void
Replaces the current selection by str
modifySelectedLines(String modifierCallback(String line)) → void
Filters the lines that have at least one character selected.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
onEnterKeyAction() → void
onKey(KeyEvent event) KeyEventResult
onTabKeyAction() → void
outdentSelection() → void
removeChar() → void
Remove the char just before the cursor or the selection
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
removeSelection() → void
Remove the selected text
setCursor(int offset) → void
Sets a specific cursor position in the text
setLanguage(Mode? language, {required AbstractAnalyzer analyzer}) → void
showSearch() → void
toString() String
A string representation of this object.
inherited
unfoldAt(int line) → void

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

defaultCodeModifiers → const List<CodeModifier>