Open cprnn opened 2 weeks ago
Hi! What version of flutter_blockly are you using? In version 1.5.1 no need to import blockly.min.js. All this is done by the library.
If you need to add your own code, you can do it through the script parameter
BlocklyEditorWidget(
workspaceConfiguration: workspaceConfiguration,
initial: initialJson,
onInject: onInject,
onChange: onChange,
onDispose: onDispose,
onError: onError,
script: '''
alert('start blockly ' + !!Blockly);
''',
)
script is of type String. your file can be added to assets and then loaded using loadString for example
Hello!
Yes, it's the 1.5.1. version. I'll try the loadString approach!
Thanks for answering and helping me with this!
Always happy to help you. Let me know if you have any problems.
Hi! Did you get to do it?
Hello! I'm sorry for the delayed answer. Yes! It's working great now.
Thanks again for your help!
By the way, is it better to use the Javascript code generator for the custom blocks or the Dart one? I'm currently studying both to see which one would be better to use for the character movement (that is made using Flame). What's your opinion?
Thank you very much for your help before, and in advance!
Hi, how are you? I'm programming a game in Flutter/Flame that uses the flutter_blockly library and having trouble integrating my custom blocks.
So far, I've created a .js file for these blocks and referenced it in the index.html in /lib, but following this logic hasn't been working properly (it's been showing errors importing and recognizing blockly.min.js).
Is there a process that must be carried out to create and include customized blocks to use with the library? My application is web-based.
Thank you very much in advance!