Dashboard class
Class to store all the scene elements. This also acts as the controller to the flow_chart widget It notifies changes to FlowChart
- Inheritance
-
- Object
- ChangeNotifier
- Dashboard
Constructors
- Dashboard({Offset? handlerFeedbackOffset, bool blockDefaultZoomGestures = false, double minimumZoomFactor = 0.25})
- Dashboard.fromJson(String source)
-
factory
-
Dashboard.fromMap(Map<
String, dynamic> map) -
factory
Properties
- blockDefaultZoomGestures ↔ bool
-
getter/setter pair
- dashboardPosition ↔ Offset
-
getter/setter pair
- dashboardSize ↔ Size
-
getter/setter pair
-
elements
↔ List<
FlowElement> -
getter/setter pair
- gridBackgroundParams ↔ GridBackgroundParams
-
getter/setter pair
- handlerFeedbackOffset ↔ Offset
-
handlerFeedbackOffset sets an offset for the handler when user is dragging it
This can be used to prevent the handler being covered by user's finger on touch screens
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- minimumZoomFactor ↔ double
-
minimum zoom factor allowed
default is 0.25
setting it to 1 will prevent zooming out
setting it to 0 will remove the limit
getter/setter pair
- onScaleUpdate ↔ (void Function(double scale)?)
-
callback when the scale is updated
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- zoomFactor → double
-
shorthand to get the current zoom factor
no setter
Methods
-
addElement(
FlowElement element, {bool notify = true}) → dynamic - add a FlowElement to the dashboard
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
addNextById(
FlowElement sourceElement, String destId, ArrowParams arrowParams, {bool notify = true}) → dynamic -
make an arrow connection from
sourceElement
to the elements with iddestId
arrowParams
definition of arrow parameters -
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).
inherited
-
findConnectionByElements(
FlowElement srcElement, FlowElement destElement) → ConnectionParams? -
find the connection from
srcElement
todestElement
return null if not found In case of multiple connections, first connection is returned -
findElementById(
String id) → FlowElement? -
find the element by its
id
for convenience return null if not found -
findElementIndexById(
String id) → int -
find the element by its
id
-
loadDashboard(
String completeFilePath) → dynamic - clear the dashboard and load the new one
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
prettyJson(
) → String -
recenter(
) → void - recenter the dashboard
-
removeAllElements(
{bool notify = true}) → dynamic - remove all elements
-
removeConnectionByElements(
FlowElement srcElement, FlowElement destElement, {bool notify = true}) → dynamic -
remove the connection from
srcElement
todestElement
-
removeElement(
FlowElement element, {bool notify = true}) → bool - remove element return true if it has been removed
-
removeElementById(
String id, {bool notify = true}) → dynamic -
remove all the elements with
id
from the dashboard -
removeElementConnection(
FlowElement element, Handler handler, {bool notify = true}) → dynamic -
remove the
handler
connection ofelement
-
removeElementConnections(
FlowElement element, {bool notify = true}) → dynamic -
remove all the connection from the
element
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
saveDashboard(
String completeFilePath) → dynamic -
save the dashboard into
completeFilePath
-
setDashboardPosition(
Offset position) → dynamic - needed to know the diagram widget position to compute offsets for drag and drop elements
-
setDashboardSize(
Size size) → dynamic - needed to know the diagram widget size
-
setElementResizable(
FlowElement element, bool resizable, {bool notify = true}) → dynamic -
set
isResizable
element property -
setGridBackgroundParams(
GridBackgroundParams params) → dynamic - set grid background parameters
-
setHandlerFeedbackOffset(
Offset offset) → dynamic - set the feedback offset to help on mobile device to see the end of arrow and not hiding behind the finger when moving it
-
setZoomFactor(
double factor, {Offset? focalPoint}) → void -
factor
needs to be a non negative value 1 is the default value giving a value above 1 will zoom the dashboard by the given factor and vice versa Negative values will be ignored zoomFactor will not go below minimumZoomFactorfocalPoint
is the point where the zoom is centered default is the center of the dashboard -
toJson(
) → String -
toMap(
) → Map< String, dynamic> - manage load/save using json
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited