JsBuilder class

Helper class used to help building the JS code for the editor.

Constructors

JsBuilder()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

callbackClosure({List<String> args = const [], required String body}) String
Build a closure for a javascript callback.
Build a function which creates and inserts a link.
editorHeight({String height = ""}) String
Build a function which will change editor's height.
editorWidth({String width = ""}) String
Build a function which will change editor's width.
eventListener({String selector = "document", required String event, List<String> args = const [], required String body}) String
Build a javascript event listener.
fileObject({required String fileNode, bool hasBase64 = true}) String
Build a JS object represeting file upload which will be uploaded.
fileUpload({required String handlerBuilder(String payload), required String errorHandlerBuilder(String payload)}) String
Build a function which handles file uploads.
function({required String name, List<String> args = const [], required String body}) String
Build the declaration of a javascript function.
functionCall({required String name, List<String> args = const []}) String
Build a javascript function which will be called.
insertImageUrl() String
Build a function which inserts an image URL.
jqEventListener({required String selector, required String event, List<String> args = const [], required String body}) String
Build a jQuery event listener
jqReady({required String body}) String
Build the jquery ready function.
logDebug() String
Build a function which log debug data to the console.
logDebugCall({required String message, bool wrapInQuotes = false}) String
Build code which calls logDebug function.
onLinkPressedListener({bool allowUrlLoading = true, String handlerBuilder(String payload)?}) String
Build a javascript event listener which listens to link clicks/taps.
onSelectionChange({required String handlerBuilder(String payload)?}) String
Build the onSelectionChange function.
resizeToParent() String
Build the declaration of a function which will resize the editor to the width and height to the parent (window).
setCursorToEnd() String
Build a function which moves the cursor to the end of the editor.
setHtml() String
Build a function which sets the html value of the editor.
summernoteCallback({required EditorCallbacks event, required String body(EditorCallbacks event)}) String
Build an event callback for the summernote editor initialiser.
summernoteInit({String? selector, String? placeholder, bool spellCheck = false, int maximumFileSize = 5 * 1024 * 1024, List<String> customOptions = const [], List<String> summernoteCallbacks = const [], ResizeMode resizeMode = ResizeMode.resizeToParent}) String
Build the initialiser code for the summernote editor.
summernoteMethodCall({String selector = "'#summernote-2'", List<String> args = const []}) String
Build a JS function to call a summernote editor's method.
toggleCodeView({bool resizeToParent = false}) String
Build a function which will toggle to/from code view.
uploadError({required String handlerBuilder(String payload)}) String
Build a function which handles file upload errors.

Constants

editorSelector → const String
Selector for the html input used by summernote.
summernoteSelector → const String
Selector for the summernote editor element.