marginNeeded method

  1. @override
EdgeInsets marginNeeded()
override

Get extra margin (not definable by the user). This makes sure that any decoration that leaves original drawing window is not drawing outside of that window (This is not enforced right now but it's unwanted behaviour)

Any decoration that needs space on side of the chart (any side) has to override this method and return how much space it needs and where as EdgeInsets.

Implementation

@override
EdgeInsets marginNeeded() {
  return EdgeInsets.symmetric(horizontal: lineWidth / 2);
}