decodeBottomNavigationBarLandscapeLayout static method

BottomNavigationBarLandscapeLayout? decodeBottomNavigationBarLandscapeLayout(
  1. dynamic value, {
  2. bool validate = true,
})

Decodes the value to a BottomNavigationBarLandscapeLayout. Supported values are:

  • centered
  • linear
  • spread

Implementation

static BottomNavigationBarLandscapeLayout?
    decodeBottomNavigationBarLandscapeLayout(
  dynamic value, {
  bool validate = true,
}) {
  BottomNavigationBarLandscapeLayout? result;

  if (value is BottomNavigationBarLandscapeLayout) {
    result = value;
  } else {
    _checkSupported(
      'BottomNavigationBarLandscapeLayout',
      [
        'centered',
        'linear',
        'spread',
      ],
      value,
    );

    if (value != null) {
      assert(SchemaValidator.validate(
        schemaId: '$_baseSchemaUrl/bottom_navigation_bar_landscape_layout',
        value: value,
        validate: validate,
      ));
      switch (value) {
        case 'centered':
          result = BottomNavigationBarLandscapeLayout.centered;
          break;
        case 'linear':
          result = BottomNavigationBarLandscapeLayout.linear;
          break;
        case 'spread':
          result = BottomNavigationBarLandscapeLayout.spread;
          break;
      }
    }
  }

  return result;
}