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, ArrowStyle defaultArrowStyle = ArrowStyle.curve})
- Dashboard.fromJson(String source)
-
factory
-
Dashboard.fromMap(Map<
String, dynamic> map) -
factory
Properties
- blockDefaultZoomGestures ↔ bool
-
getter/setter pair
- dashboardSize ↔ Size
-
Dashboard size
getter/setter pair
- defaultArrowStyle → ArrowStyle
-
The default style for the new created arrow
final
-
elements
↔ List<
FlowElement> -
The current elements in the dashboard
getter/setter pair
- gridBackgroundParams ↔ GridBackgroundParams
-
Background parameters.
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
- position → Offset
-
Get the position.
no setter
- 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
-
addConnectionListener(
ConnectionListener listener) → void - add listener called when a new connection is created
-
addElement(
FlowElement element, {bool notify = true, int? position}) → void - 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}) → void -
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
-
dissectElementConnection(
FlowElement element, Handler handler, {Offset? point, bool notify = true}) → void -
dissect an element connection
handler
is the handler that is in connectionpoint
is the point where the connection is dissected ifpoint
is null, point is automatically calculated -
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
-
findSrcElementByDestElement(
FlowElement dest) → FlowElement? -
find the source element of the
dest
element. -
loadDashboard(
String completeFilePath) → void -
clear the dashboard and load the new one from file
completeFilePath
-
loadDashboardData(
Map< String, dynamic> source) → void -
clear the dashboard and load the new one from
source
json -
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}) → void - remove all elements
-
removeConnectionByElements(
FlowElement srcElement, FlowElement destElement, {bool notify = true}) → void -
remove the connection from
srcElement
todestElement
-
removeConnectionListener(
ConnectionListener listener) → void - remove connection listener
-
removeDissection(
Pivot pivot, {bool notify = true}) → void - remove the dissection of the connection
-
removeElement(
FlowElement element, {bool notify = true}) → bool - remove element return true if it has been removed
-
removeElementById(
String id, {bool notify = true}) → void -
remove all the elements with
id
from the dashboard -
removeElementConnection(
FlowElement element, Handler handler, {bool notify = true}) → void -
remove the
handler
connection ofelement
-
removeElementConnections(
FlowElement element, {bool notify = true}) → void -
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) → void -
save the dashboard into
completeFilePath
-
setArrowStyle(
FlowElement src, FlowElement dest, ArrowStyle style, {bool notify = true, double tension = 1.0}) → void -
Set a new
style
to the arrow staring fromsrc
pointing todest
. Ifnotify
is true the dasboard is refreshed. Thetension
parameter is used whenstyle
is ArrowStyle.segmented to set the curve strength on pivot points. 0 means no curve. -
setArrowStyleByHandler(
FlowElement src, Handler handler, ArrowStyle style, {bool notify = true, double tension = 1.0}) → void -
Set a new
style
to the arrow staring from thehandler
ofsrc
element. Ifnotify
is true the dasboard is refreshed. Thetension
parameter is used whenstyle
is ArrowStyle.segmented to set the curve strength on pivot points. 0 means no curve. -
setDashboardPosition(
Offset position) → void - needed to know the diagram widget position to compute offsets for drag and drop elements
-
setDashboardSize(
Size size) → void - needed to know the diagram widget size
-
setElementConnectable(
FlowElement element, bool connectable, {bool notify = true}) → void -
set
connectable
element property -
setElementDraggable(
FlowElement element, bool draggable, {bool notify = true}) → void -
set
draggable
element property -
setElementEditingText(
FlowElement element, bool editing, {bool notify = true}) → void - Enable editing mode for an element
-
setElementResizable(
FlowElement element, bool resizable, {bool notify = true}) → void -
set
resizable
element property -
setGridBackgroundParams(
GridBackgroundParams params) → void - set grid background parameters
-
setHandlerFeedbackOffset(
Offset offset) → void - 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