A code editor (dart, js, html, ...) for Flutter with syntax highlighting and custom theme.
72
stars
17
forks
source link
When I click on edit the text is not displayed, I need to click ok and click again edit to visualize it #19
Open
abmptit opened 7 months ago
Hello, Thanks for this package ;)
I tried small game using flutter with code_editor and eval package. it will be available in few hours there: https://play.google.com/store/apps/details?id=com.kapalak.connect4
The game is the famous Connect Four, In this Connect4Dev version player can create their own bot.
Before the edit click![image](https://github.com/ThomasGysemans/code_editor/assets/13944974/940be893-7067-4626-9bf5-2f3a5cb1104a)
First Click on edit![image](https://github.com/ThomasGysemans/code_editor/assets/13944974/06962437-9484-4c24-b4b5-aa7db4c0a0df)
Second Click it is working![image](https://github.com/ThomasGysemans/code_editor/assets/13944974/38ea70c2-e293-429d-a68b-1ba10db7477c)
Here my code
CodeEditor( model: EditorModel( files: [ FileEditor( name: "player.dart", language: "dart", code: player.code, ) ], styleOptions: EditorModelStyleOptions( showUndoRedoButtons: true, reverseEditAndUndoRedoButtons: true, fontSize: 13, ), ), disableNavigationbar: true, // textModifier: (language, content) { // content = player.code ?? ""; // return content; // }, onSubmit: (String language, String value) { if (value != player.code) { try { setState(() { errorCodeEditor = ""; }); var grid = List.generate(42, (index) => $int(0)); var clicks = []; eval(value, function: 'getColumnToPlay', args: [grid, clicks]); player.code = value; playerUpdated = true; } catch (ex) { setState(() { errorCodeEditor = ex.toString(); }); } } }, formatters: const ["dart"], ),