compileDslBoolValueForExistingWidgetClass function
FFBooleanValue
compileDslBoolValueForExistingWidgetClass(
- FFProject project, {
- required String widgetClassName,
- required String targetNodeKey,
- required DslExpression expression,
Compiles a DSL expression into an FFBooleanValue for an existing node.
Implementation
FFBooleanValue compileDslBoolValueForExistingWidgetClass(
FFProject project, {
required String widgetClassName,
required String targetNodeKey,
required DslExpression expression,
}) {
final context = _buildExistingWidgetClassCompileContext(
project,
widgetClassName: widgetClassName,
);
final target = findByKey(context.widgetClass.node, targetNodeKey);
if (target == null) {
throw ArgumentError(
'Target node "$targetNodeKey" was not found on "$widgetClassName".',
);
}
final env = _configureExistingNodeEnv(context, target);
return context.compiler.compileBoolValue(expression, env);
}