merge static method

Widget merge({
  1. required Widget child,
  2. required List<FeatureFlagValue> flags,
})

Implementation

static Widget merge({
  required Widget child,
  required List<FeatureFlagValue> flags,
}) {
  return Builder(
    builder: (context) {
      var parent = context.dependOnInheritedWidgetOfExactType<FeatureFlags>();
      return FeatureFlags._(
        values: {
          if (parent != null) ...parent.values,
          for (var flag in flags) flag.flag: flag,
        },
        child: child,
      );
    },
  );
}