AlignmentAddonConfig constructor

const AlignmentAddonConfig(
  1. String alignmentName
)

Can only be one of the predefined values:

  • 'Top Left'
  • 'Top Center'
  • 'Top Right'
  • 'Center Left'
  • 'Center'
  • 'Center Right'
  • 'Bottom Left'
  • 'Bottom Center'
  • 'Bottom Right'

Implementation

const AlignmentAddonConfig(
  String alignmentName,
) : assert(
      // Since we can only use constant values, that means we cannot use
      // an enum or the [Alignment] class from Flutter. We have to use
      // strings instead, and we have to make sure that the string is
      // one of the predefined values.
      alignmentName == 'Top Left' ||
          alignmentName == 'Top Center' ||
          alignmentName == 'Top Right' ||
          alignmentName == 'Center Left' ||
          alignmentName == 'Center' ||
          alignmentName == 'Center Right' ||
          alignmentName == 'Bottom Left' ||
          alignmentName == 'Bottom Center' ||
          alignmentName == 'Bottom Right',
    ),
    super(
      'alignment',
      'alignment:${alignmentName}',
    );