Index: sky/engine/bindings/scripts/code_generator_dart.py |
diff --git a/sky/engine/bindings/scripts/code_generator_dart.py b/sky/engine/bindings/scripts/code_generator_dart.py |
index a8b01c505b4411c0291df073a614c951a84053b3..9ebc3c78e6f3839a2b0c33bed660d272014fadfc 100644 |
--- a/sky/engine/bindings/scripts/code_generator_dart.py |
+++ b/sky/engine/bindings/scripts/code_generator_dart.py |
@@ -149,6 +149,15 @@ class CodeGeneratorDart(object): |
template_contents['cpp_includes'] = sorted(includes) |
+ # If CustomDart is set, read the custom dart file and add it to our |
+ # template parameters. |
+ if 'CustomDart' in interface.extended_attributes: |
+ dart_filename = os.path.join(os.path.dirname(idl_filename), |
+ interface.name + ".dart") |
+ with open(dart_filename) as dart_file: |
+ custom_dartcode = dart_file.read() |
+ template_contents['custom_dartcode'] = custom_dartcode |
+ |
idl_world = {'interface': None, 'callback': None} |
# Load the pickle file for this IDL. |