Mi Corazon (Flutter for Corona)

Today I am a happy man :slight_smile: :).

This is what I coded on Corona :

local MiCorazon = require "mi.corazon" function MyButtonPressed() print ("My button is pressed") end MiCorazon.showFlutterRoute ( { class = 'Scaffold', body = { class = 'Center', child = { class = 'RaisedButton', onPressed = 'MyButtonPressed', child = { class = 'Text', caption = 'The button' } } } } )

And I got this on my device :

https://github.com/Canardoux/mi_corazon/blob/master/Screenshot%202019-06-06%20at%2013.41.31.png

And, of course, the Lua function ‘MyButtonPressed()’ was correctly triggered when I clicked the button.

‘Mi Corazon’ is a project that I have, for giving access to Flutter from Corona/Lua.

Actually this is just a proove of concept. Not even an Alpha release. But my first tries are very encouraging : Now, I am ready to start a real project from scratch.

The goals are :

  • Access from Lua to the Flutter librairy. Not only the UI, but also other packages (like Sqflite for example for accessing a Database Management System).
  • Build Flutter screens in Lua, without any Dart code.
  • Invoke a Flutter screen from Lua, and return to Corona when the user finished with his Flutter screen

When those goals will be reached (in many, many months :wink: from now) it will be time to create something who is crually missing : a graphic UI editor like the one we have in Delphi and Lazarus.

OK, I agree. I am just talking about vaporware. But I cannot resist to send this post because I am excited by what I see as reachable with some work.

This project will certainly need other contributions. But not now. Actually the project foundation is not hard enough.

hi Larpoux!

Sound cool! One question though: why don’t you just make the graphic editor in Lua? I’ve made a couple of good level editors for my own games using just that - work perfectly.

Hi thomas6

It is not clear now if the graphic editor will be coded in Lua, in Dart or maybe in another language. I love coding, but now I prefer to integrate other software, when available, than coded another new soft. Probably I will find several great graphic editors already existing. Maybe your :wink: :wink:

This editor will generate Mi Corazon forms (i.e. Lua ‘Tables’ or Dart ‘Maps’), or both.

I do not understand why Flutter does not use static data for their Routes (Screens) but dynamicaly create them in Dart.

For Mi Corazon, I prefer using Static Maps/Tables for specifying the widgets, their properties and their events.

This is not a problem : this is trivial to interpret those Maps/Table in Flutter and create the final Routes/Screens

[Edit:] Maybe I did not understand correctly your question. Probably you wonder why MiCorazon, instead of using the existing Corona Widgets. This is a good question. I do not know Corona enough to be sure that integrating a Flutter Engine in Corona will really improve what Corona already does. I just have the impression that Corona is too much <Games Oriented> and not <Desktop Oriented> enough. But more, I am convinced that Flutter will be very very important in the future (Google is not CoronaLabs) and that it will be stupid not to be Flutter complient.

hi Larpoux!

Sound cool! One question though: why don’t you just make the graphic editor in Lua? I’ve made a couple of good level editors for my own games using just that - work perfectly.

Hi thomas6

It is not clear now if the graphic editor will be coded in Lua, in Dart or maybe in another language. I love coding, but now I prefer to integrate other software, when available, than coded another new soft. Probably I will find several great graphic editors already existing. Maybe your :wink: :wink:

This editor will generate Mi Corazon forms (i.e. Lua ‘Tables’ or Dart ‘Maps’), or both.

I do not understand why Flutter does not use static data for their Routes (Screens) but dynamicaly create them in Dart.

For Mi Corazon, I prefer using Static Maps/Tables for specifying the widgets, their properties and their events.

This is not a problem : this is trivial to interpret those Maps/Table in Flutter and create the final Routes/Screens

[Edit:] Maybe I did not understand correctly your question. Probably you wonder why MiCorazon, instead of using the existing Corona Widgets. This is a good question. I do not know Corona enough to be sure that integrating a Flutter Engine in Corona will really improve what Corona already does. I just have the impression that Corona is too much <Games Oriented> and not <Desktop Oriented> enough. But more, I am convinced that Flutter will be very very important in the future (Google is not CoronaLabs) and that it will be stupid not to be Flutter complient.