ThomasGysemans / code_editor

A code editor (dart, js, html, ...) for Flutter with syntax highlighting and custom theme.
MIT License
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

abmptit commented 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

First Click on edit image

Second Click it is working image

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"], ),

kofj commented 1 month ago

same issue.