diff --git a/lib/widgets/conditional_parent.dart b/lib/widgets/conditional_parent.dart index 757c8f992..e8c60884a 100644 --- a/lib/widgets/conditional_parent.dart +++ b/lib/widgets/conditional_parent.dart @@ -21,3 +21,27 @@ class ConditionalParent extends StatelessWidget { } } } + +class BranchedParent extends StatelessWidget { + const BranchedParent({ + Key? key, + required this.condition, + required this.conditionBranchBuilder, + required this.otherBranchBuilder, + required this.children, + }) : super(key: key); + + final bool condition; + final Widget Function(List) conditionBranchBuilder; + final Widget Function(List) otherBranchBuilder; + final List children; + + @override + Widget build(BuildContext context) { + if (condition) { + return conditionBranchBuilder(children); + } else { + return otherBranchBuilder(children); + } + } +}