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(myTextSpan.debugAssertIsValid());
Source
bool debugAssertIsValid() { assert(() { if (!visitTextSpan((TextSpan span) { if (span.children != null) { for (TextSpan child in span.children) { if (child == null) return false; } } return true; })) { throw new FlutterError( 'TextSpan contains a null child.\n' 'A TextSpan object with a non-null child list should not have any nulls in its child list.\n' 'The full text in question was:\n' '${toString(" ")}' ); } return true; }); return true; }