Norbert515 / flutter_ide

A visual editor for Flutter widgets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Additional flutter tools

modulovalue opened this issue · comments

Because we can't compile flutter on mobile devices yet and a flutter IDE would most likely still be tied to a computer I'd like to add some ideas.

In a nutshell: There should be a package that can analyze the source code meaningfully and provide information to the source code itself.

Preview

What I've been trying to do recently, is to collect all stateless widgets (or those with minimal state) inside a static preview variable.

    static PreviewModel get preview =>
        PreviewModel(
            description: "A Sparkline",
            preview: (context, counterStream, animationStream, ticker) =>
                Sparkline(
                    data: [0.0, 5.0, 1.5, 13],
                ),
        );

counterStream provides a counter stream for e.g. animating boolean values.
animationStream provides an animation stream for generic animation.
ticker access to a TickerProvider

That way I can collect previews of widgets manually and display them inside a list on a flutter desktop embedder from which I hope to get a better overview of all widgets as they grow in numbers.

I do believe that this could be greatly automated e.g. by adding annotations that the potential package could use to collect those previews automatically.

Navigation

The way I handle navigation right now is by giving all widgets that are supposed to be navigated to a mixin that tells them how they can be opened. This 'open' method is called from 'navigation command' objects that can be called anywhere.

Combining the first approach with the second should be enough to gather enough data to create an ios-storyboard-ish view. I believe that bigger applications could benefit from such a view by providing a general view of the application.

.

My point is, that these two use cases could easily be implemented by providing a common set of tools. The productivity we currently enjoy through our IDEs is hard to replace but relatively easy to improve by providing additional, easily expandable tools.

IntelliJ's plugins are hard to write and thats why barely anyone takes the time to do that. VSCode has many more plugins for flutter and dart but I'd say IntelliJ is still the preferred platform for developing flutter apps. With a solid foundation one could then easily replace their current IDE with a mobile one once the technology catches up.

While you're right about Mobile devices, keep in mind, the pixelbook has the ability to run Android and Linux at the same time. That's currently how I develop my apps. I connect the Linux part to the Android part through adb and Android studio recognizes the pixelbook as an Android device to build the apps on.

@modulovalue those are some excellent ideas. I'll explore those possibilities in the (hopefully) near future.
@thewithz that's pretty cool - the widget-builder I made actually communicates through a client/server interface so live-value adjustments should work on any combination of systems.