CUNavBar constructor

CUNavBar({
  1. required List<CUNavBarGroup> groups,
  2. required List<CUNavBarGroup> constGroups,
  3. required ValueNotifier<int> index,
  4. Key? key,
  5. void onChange(
    1. int
    )?,
  6. void onBack(
    1. int
    )?,
  7. double? maxHeight,
  8. Duration? duration,
})

Implementation

CUNavBar({
  required this.groups,
  required this.constGroups,
  required this.index,
  final Key? key,
  this.onChange,
  this.onBack,
  this.maxHeight,
  this.duration,
}) : super(key: key) {
  for (final groups in [groups, constGroups]) {
    groups.forEach((final CUNavBarGroup group) {
      group.sub.forEach((final sub) => sub.can == null ? sub.can = ValueNotifier(true) : true);
      _allSubs.addAll(group.sub);
    });
  }
  _miniKeys.addAll(List<GlobalKey>.generate(_allSubs.length, (final _) => GlobalKey()));
  _fullKeys.addAll(List<GlobalKey>.generate(_allSubs.length, (final _) => GlobalKey()));
}