encodeNavigationDestinationLabelBehavior static method

String? encodeNavigationDestinationLabelBehavior(
  1. NavigationDestinationLabelBehavior? value, {
  2. bool validate = true,
})

Encodes the given value to the String representation. Supported values are:

  • alwaysHide
  • alwaysShow
  • onlyShowSelected

All other values, including null, will result in null.

Implementation

static String? encodeNavigationDestinationLabelBehavior(
  NavigationDestinationLabelBehavior? value, {
  bool validate = true,
}) {
  String? result;

  if (value != null) {
    switch (value) {
      case NavigationDestinationLabelBehavior.alwaysHide:
        result = 'alwaysHide';
        break;

      case NavigationDestinationLabelBehavior.alwaysShow:
        result = 'alwaysShow';
        break;

      case NavigationDestinationLabelBehavior.onlyShowSelected:
        result = 'onlyShowSelected';
        break;
    }
  }

  return result;
}