register method

  1. @override
Widget register(
  1. BuildContext context,
  2. dynamic resolverOrList, {
  3. Widget? child,
  4. Key? key,
})
override

Implementation

@override
Widget register(BuildContext context, resolverOrList,
    {Widget? child, Key? key}) {
  Iterable<Inst> extract(final input) {
    if (input is Iterable) {
      return input.expand((e) => extract(e));
    } else if (input is Inst) {
      return [input];
    } else {
      return [Inst.instance(input)];
    }
  }

  final items = extract(resolverOrList).toList();
  return registerAll(context, items, child: child, key: key)!;
}