recursive_tree_flutter library

Classes

AbsNodeType
An abstract class about node data type. There're 2 kinds of node: inner node (including root) & leaf node.
DefaultEmptyWidget
ExpandableTreeWidget<T extends AbsNodeType>
This widget displays the whole tree using SingleChildScrollView
LazyStackWidget<T extends AbsNodeType>
StackWidget<T extends AbsNodeType>
This tree widget is a stack view (not expandable view). So there is a special requirement: you can start with a list of children tree rather than the root. If you want to start with root, you can pass the argument: listTrees = [root]
TreeType<T extends AbsNodeType>
TreeViewProperties<T extends AbsNodeType>
VTSDepartmentTreeWidget<T extends AbsNodeType>
This widget displays the whole tree using SingleChildScrollView

Enums

EChosenAllValues
This enum support functions isChosenAll

Mixins

ExpandableTreeMixin<T extends AbsNodeType>

Functions

checkAll<T extends AbsNodeType>(TreeType<T> tree) bool
checkAll for this tree (from current node to bottom)
findRightmostOfABranch<T extends AbsNodeType>(TreeType<T> tree) TreeType<T>
If we use canvas to draw lines in expandable tree view (look at example), we will wonder, what is the rightmost node in current branch of tree? Because the line in rightmost node has little difference from other.
findRoot<T extends AbsNodeType>(TreeType<T> tree) TreeType<T>
findTreeWithId<T extends AbsNodeType>(TreeType<T> tree, dynamic id) TreeType<T>?
isChosenAll<T extends AbsNodeType>(TreeType<T> tree, {bool isThisLazyTree = false}) EChosenAllValues
Check if the the tree is chosen all
returnChosenLeaves<T extends AbsNodeType>(TreeType<T> tree, List<TreeType<T>> result) → void
returnChosenNodes<T extends AbsNodeType>(TreeType<T> tree, List<TreeType<T>> result) → void
returnFavoriteNodes<T extends AbsNodeType>(TreeType<T> tree, List<TreeType<T>> result) → void
searchAllTreesWithTitleDFS<T extends AbsNodeType>(TreeType<T> tree, String text, List<TreeType<T>> result) → void
Using DFS to return all the trees if each of root's data contains searching text
searchLeavesWithTitleDFS<T extends AbsNodeType>(TreeType<T> tree, String text, List<TreeType<T>> result) → void
Using DFS to return leaves if each of leaf's data contains searching text
showVTSDepartmentTreeBottomSheet<T extends AbsNodeType>({required BuildContext context, double? height, double sheetBorderRadius = 24, double spaceTopPositionedMainView = 24, Widget? titleLeadingWidget, Widget? titleTrailingWidget, required String sheetTitle, TextStyle? sheetTitleStyle, required Widget loadingWidget, required Widget emptyPage, required Widget errorPage, Widget handleBar = const SizedBox.shrink(), required Future<TreeType<T>?> funcParseDataToTree, dynamic funcWhenComplete(TreeType<T> tree)?, required FunctionBuildLeadingWidget<T> buildLeadingWidgetNode}) → void
uncheckALl<T extends AbsNodeType>(TreeType<T> tree) bool
uncheckAll for this tree (from current node to bottom)
updateAllUnavailableNodes<T extends AbsNodeType>(TreeType<T> tree) bool
This function is used to update all unavailable nodes of current tree.
updateTreeMultipleChoice<T extends AbsNodeType>(TreeType<T> tree, bool? chosenValue, {bool isUpdatingParentRecursion = false, bool isThisLazyTree = false}) → void
updateTreeMultipleChoice when choose/un-choose a node:
updateTreeSingleChoice<T extends AbsNodeType>(TreeType<T> tree, bool chosenValue) → void
The tree is single choice, not multiple choice. Only leaf can be chosen.
updateTreeSingleChoiceDms4<T extends AbsNodeType>(TreeType<T> tree, bool chosenValue) → void
The tree is single choice, not multiple choice. Viettel DMS.4 customized version: Every node can be chosen, so T.isChosen is never null.
updateTreeWithSearchingTitle<T extends AbsNodeType>(TreeType<T> tree, String searchingText, {bool willBlurParent = false, bool willAllExpanded = false}) → void
Update field isShowedInSearching of every node based on searching text.

Typedefs

FunctionBuildLeadingWidget<T extends AbsNodeType> = Widget Function(TreeType<T> tree, VoidCallback setStateCallback)
FunctionGetTreeChildren<T extends AbsNodeType> = List<TreeType<T>> Function(TreeType<T> parent)