JsonEditor class
Edit your JSON object with this Widget. Create, edit and format objects using this user friendly widget.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- JsonEditor
Constructors
-
JsonEditor.new({Key? key, required String json, required ValueChanged onChanged, Duration duration = const Duration(milliseconds: 500), bool enableMoreOptions = true, bool enableKeyEdit = true, bool enableValueEdit = true, List<
Editors> editors = const [Editors.tree, Editors.text], Color? themeColor, List<Widget> actions = const [], bool enableHorizontalScroll = false, Duration searchDuration = const Duration(milliseconds: 500), bool hideEditorsMenuButton = false, List expandedObjects = const []}) -
JSON can be edited in two ways, Tree editor or text editor. You can disable
either of them.
const
Properties
-
actions
→ List<
Widget> -
A list of Widgets to display in a row at the end of header.
final
- duration → Duration
-
Debounce duration for onChanged function.
final
-
editors
→ List<
Editors> -
List of supported editors. First element will be used as default editor.
final
- enableHorizontalScroll → bool
-
Enables horizontal scroll for the tree view. Defaults to
false
.final - enableKeyEdit → bool
-
Enables editing of keys. Defaults to
true
.final - enableMoreOptions → bool
-
Enables more options like adding or deleting data. Defaults to
true
.final - enableValueEdit → bool
-
Enables editing of values. Defaults to
true
.final - expandedObjects → List
-
expandedObjects refers to the objects that will be expanded by
default. Index can be provided when the data is a List.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hideEditorsMenuButton → bool
-
Hides the option of changing editor. Defaults to
false
.final - json → String
-
JSON string to be edited.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onChanged → ValueChanged
-
Callback function that will be called with the new
dynamic
data.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- searchDuration → Duration
-
Debounce duration for search function.
final
- themeColor → Color?
-
Theme color for the editor. Changes the border color and header color.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< JsonEditor> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited