wrapScope method

void wrapScope(
  1. Scope prev, {
  2. required dynamic block(),
})

Utility to wrap contents in block with pushScope and popScope respectively. Preserves the parent scope prev.

Implementation

void wrapScope(Scope prev, {required Function() block}) {
  pushScope(prev);
  block();
  popScope();
}