Porting Java+JavaFX project to Dart+Flutter

Some time ago I wrote musical score production software in Java+JavaFX, and now wish to port it to Dart+Flutter. The user can create multi-page music scores using a desktop (not mobile) graphical editor that automatically formats the music according to standard conventions. This software has been used to create (for example) 200-page full opera scores. Internally, the data structures are ideally created using compositional design instead of inheritance, which is why I wish to move away from the Java inheritance design. I have roughed out a design using Dart mixins, and it looks great. I can port the pure Java parts to Dart. However, I need to port all the graphics from JavaFX to Flutter. I have looked at interoperability with JavaFX, but it is too cumbersome and inefficient. So, my question is: Are there any text/graphics editors written in Flutter that create multi-page documents (think Apple Pages) that I can use to learn how to port the JavaFX code to Flutter? I have looked through the repositories, and there is even some rudimentary music notation software, but I can’t find any multi-page document editors that could help me understand how to do this in Flutter. Any clues most appreciated. Thank you.

You might consider Quills – I think this is the right link.

I too am porting a JavaFX project to Flutter. The Dart vs Java part is pretty straightforward as Java code with some syntax changes pretty much maps to Dart code (except initializers to some extent).

But the UI side .. quite different.

CW

Thanks. Yes, I looked into Quill. Not what I’m looking for. After I finish the Flutter tutorials etc, it looks like I’ll need to write the code from scratch starting with a zoom-pan view that knows about standard paper sizes etc. I have about a dozen Inspectors (one for each kind of musical object) that will be the bulk of the work. Some kind of semi-automated conversion from JavaFX to Flutter would help, but I doubt whether so-called AI has sufficient base of training data for this task to generate sound estimates of code.

My experience is that there is no easy translation from JavaFX to Flutter. It took me some time to get my Flutter app structure “correct-ish” after porting it from JavaFX.

What is it about Quills that doesn’t fit your needs. I ask out of curiosity as it’s not totally clear to me what your needs are – perhaps you could give more specifics?

Also I have a more philosophical question. Given that the target is desktop I would have thought that JavaFX is an excellent choice of UI framework.

You say that “Internally, the data structures are ideally created using compositional design instead of inheritance, which is why I wish to move away from the Java inheritance design”.

You don’t have to use inheritance in Java/JavaFX (you will for a few things). I do a lot of Java and JavaFX programming and make very little use of inheritance, but perhaps that is a reflection of the domains I program in?

I am not critiquing your choices, just curious.
CW

It might be best to take this discussion offline because the key points are not strictly related to Dart+Flutter. We can then discuss the numerous design choices on this project since 1991, starting with Ojective-C, then a Java port, then a Scala port. Java doesn’t do data compositionality (only delegation via interfaces). Scala has syntactic sugar for data compositionality, but was too inefficient (5x slower than the Java version). Dart offers true data compositionality, ideal for representing musical notation objects, which have over a dozen traits that do not fall neatly into an inheritance tree. Yes, JavaFX is great, but it is inefficient to wrap it with translated data structures from another language. As for document widgets in Flutter, Quill doesn’t have them (it is a rich text editing window), but there is a pdf viewer that gives some clues for how to do part of this idiomatically in Flutter.