debugAssertIsValid method

  1. @override
bool debugAssertIsValid ()
override

In checked mode, throws an exception if the object is not in a valid configuration. Otherwise, returns true.

This is intended to be used as follows:

  assert(myDecoration.debugAssertIsValid());

Implementation

@override
bool debugAssertIsValid() {
  assert(shape != BoxShape.circle ||
        borderRadius == null); // Can't have a border radius if you're a circle.
  return super.debugAssertIsValid();
}