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)
    : assert(entries != null),
      _context = entries.fold(
        <Type, ContextEntry>{},
        (ctx, e) => <Type, ContextEntry>{
          ...ctx,
          e.runtimeType: e,
        },
      );