Context.fromList constructor

Context.fromList(
  1. List<ContextEntry> entries
)

Creates a context from a list of entries.

If more then one entry per type is provided, the last one is used.

Implementation

Context.fromList(List<ContextEntry> entries)
    : _context = entries.fold<Map<Type, ContextEntry>>(
        <Type, ContextEntry>{},
        (ctx, e) => <Type, ContextEntry>{
          ...ctx,
          e.runtimeType: e,
        },
      );