only method

T only({
  1. double? x,
  2. double? y,
  3. double? start,
})

Creates an Attribute instance with a custom Alignment or AlignmentDirectional value.

If start is provided, an AlignmentDirectional is created. Otherwise, an Alignment is created.

Throws an AssertionError if both x and start are provided.

Implementation

T only({double? x, double? y, double? start}) {
  assert(x == null || start == null,
      'Cannot provide both an x and a start parameter.');

  return start == null
      ? builder(Alignment(x ?? 0, y ?? 0))
      : builder(AlignmentDirectional(start, y ?? 0));
}