Skip to content

Commit

Permalink
Partially implement the _fetch part. We still need to bind the builde…
Browse files Browse the repository at this point in the history
…r argument.
  • Loading branch information
tugorez committed Jan 25, 2024
1 parent 3984acc commit 8d31cad
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion packages/rfw/lib/src/flutter/runtime.dart
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,25 @@ class Runtime extends ChangeNotifier {
final DynamicMap subArguments = _bindArguments(context, node.arguments, arguments, stateDepth, usedWidgets) as DynamicMap;
return _applyConstructorAndBindArguments(FullyQualifiedWidgetName(context.library, node.name), subArguments, stateDepth, usedWidgets, node);
}
if (node is FunctionDeclaration) {
return (DynamicMap builderArg) {
// TODO(tugorez): bind the builder argument.
final DynamicMap subArguments = _bindArguments(
context,
node.constructorCall.arguments,
arguments,
stateDepth,
usedWidgets,
) as DynamicMap;
return _applyConstructorAndBindArguments(
FullyQualifiedWidgetName(context.library, node.constructorCall.name),
subArguments,
stateDepth,
usedWidgets,
node,
);
};
}
if (node is DynamicMap) {
return node.map<String, Object?>(
(String name, Object? value) => MapEntry<String, Object?>(name, _bindArguments(context, value!, arguments, stateDepth, usedWidgets)),
Expand Down Expand Up @@ -990,7 +1009,6 @@ class _WidgetState extends State<_Widget> implements DataSource {
Widget? optionalBuilder(List<Object> argsKey, DynamicMap builderArg) {
final Object value = _fetch(argsKey, expandLists: false);
if (value is _RemoteWidgetBuilder) {
// TODO(tugorez): make sure the [builderArg] is binded.
final _CurriedWidget curriedWidget = value(builderArg) as _CurriedWidget;
return curriedWidget.build(
context,
Expand Down

0 comments on commit 8d31cad

Please sign in to comment.