getFinalAlignment function

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

Implementation

Alignment getFinalAlignment(
    {required String horizontalAlignment,
    required String verticalAlignment,
    required String width,
    required String height}) {
  Map<String, Map<String, dynamic>> sizeMap = {
    'fullWidth': {
      'fullHeight': Alignment.center,
      'hugContent':
          alignmentMap[verticalAlignment]?["center"] ?? Alignment.center,
      'fixed': alignmentMap[verticalAlignment]?["center"] ?? Alignment.center,
    },
    'hugContent': {
      'fullHeight':
          alignmentMap["center"]?[horizontalAlignment] ?? Alignment.center,
      'hugContent': alignmentMap[verticalAlignment]?[horizontalAlignment] ??
          Alignment.center,
      'fixed': alignmentMap[verticalAlignment]?[horizontalAlignment] ??
          Alignment.center,
    },
    'fixed': {
      'fullHeight':
          alignmentMap["center"]?[horizontalAlignment] ?? Alignment.center,
      'hugContent': alignmentMap[verticalAlignment]?[horizontalAlignment] ??
          Alignment.center,
      'fixed': alignmentMap[verticalAlignment]?[horizontalAlignment] ??
          Alignment.center,
    },
  };

  // print(sizeMap[width]?[height]);

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