alignment method

  1. @widgetFactory
Widget alignment({
  1. double? start,
  2. double? x,
  3. double? y,
  4. AlignmentGeometry? alignment,
  5. double? widthFactor,
  6. double? heightFactor,
})

Aligns this widget within the available space.

Implementation

@widgetFactory
Widget alignment({
  double? start,
  double? x,
  double? y,
  AlignmentGeometry? alignment,
  double? widthFactor,
  double? heightFactor,
}) {
  assert(() {
    _debugCheckParameterCombinations(modifier: 'alignment', [
      {'start': start},
      {'x': x},
    ]);
    _debugCheckParameterCombinations(modifier: 'alignment', [
      {'start': start, 'x': x, 'y': y},
      {'alignment': alignment},
    ]);
    return true;
  }());

  if (alignment == null) {
    if (start != null) {
      alignment = AlignmentDirectional(start, y ?? 0);
    } else {
      alignment = Alignment(x ?? 0, y ?? 0);
    }
  }

  return FleetAlign(
    alignment: alignment,
    widthFactor: widthFactor,
    heightFactor: heightFactor,
    child: this,
  );
}