resolve method

  1. @override
Alignment resolve(
  1. TextDirection? direction

Convert this instance into an Alignment, which uses literal coordinates (the x coordinate being explicitly a distance from the left).

See also:

  • Alignment, for which this is a no-op (returns itself).
  • AlignmentDirectional, which flips the horizontal direction based on the direction argument.


Alignment resolve(TextDirection? direction) {
  assert(direction != null, 'Cannot resolve $runtimeType without a TextDirection.');
  return switch (direction!) {
    TextDirection.rtl => Alignment(-start, y),
    TextDirection.ltr => Alignment(start, y),