breadCumbsData property

List<Map<String, dynamic>> get breadCumbsData

Implementation

List<Map<String, dynamic>> get breadCumbsData => [
      ..._navigator.pages.mapIndexed((index, page) {
        Function? action;

        bool isLast = index + 1 == _navigator.pages.length;
        bool isFirst = index == 0;

        if (!isLast && !isFirst) {
          action = () => navigateBack(index);
        }

        if (isFirst && !isLast) {
          action = () => navigateBack(0);
        }

        return {
          "title": page.title,
          "style": isLast ? theme.button.disabledButtonTextStyle : null,
          "action": action,
        };
      }),
    ];