getFinalAlignment function

Alignment getFinalAlignment({
  1. required String horizontalAlignment,
  2. required String verticalAlignment,
  3. required String width,
  4. required String height,
  5. String? id,
})

Implementation

Alignment getFinalAlignment({
  required String horizontalAlignment,
  required String verticalAlignment,
  required String width,
  required String height,
  String? id,
}) {
  if (id != null && id.contains("container")) {
    return alignmentMap[verticalAlignment]?[horizontalAlignment] ??
        Alignment.center;
  }

  Map<String, Map<String, dynamic>> sizeMap = {
    'fullWidth': {
      'fullHeight': Alignment.center,
      'hugContent':
          alignmentMap[verticalAlignment]?["center"] ?? Alignment.center,
    },
    'hugContent': {
      'fullHeight':
          alignmentMap["center"]?[horizontalAlignment] ?? Alignment.center,
      'hugContent': alignmentMap[verticalAlignment]?[horizontalAlignment] ??
          Alignment.center,
    },
  };

  return sizeMap[width]?[height] ?? Alignment.center;
}