Live data from Hacker News

Flutter desktop isn’t there yet

plei.one

231–240 of 242 posts

Re: Flutter desktop isn’t there yet

#231

Earlier quoted context omitted.

the syntax is similar to C/java/C++ so the out-of-box experience was great, please keep it. I do hope there is a `dart build`(similar to `dart run`) to run pub-get-then-compile-exe as that's what Go and rust have, it's nothing major, just handy. I use dart for scripting as well, which works really well. For deployment I wonder if Dart can be made a little like Go (or C/C++): to build into a single static executable i…

> I do hope there is a `dart build`(similar to `dart run`) to run pub-get-then-compile-exe as that's what Go and rust have, it's nothing major, just handy. It's "dart compile": $ dart compile --help Compile Dart to various formats. Usage: dart compile [arguments] -h, --help Print this usage information. Available subcommands: aot-snapshot Compile Dart to an AOT snapshot. exe Compile Dart to a self-contained executabl…

not really, dart-compile does not do pub-get automatically, while dart-run does. dart-build is basically a (pub-get + dart-compile) to be "consistent" with other modern languages such as 'cargo build' or 'go build'

    dart_build () 
    { 
        [[ -f pubspec.yaml ]] || return;
        DART=$(grep ^name pubspec.yaml | awk '{print $2}');
        dart pub get;
        dart compile exe bin/"$DART".dart
    }

Re: Flutter desktop isn’t there yet

#232
post #128

Earlier quoted context omitted.

Okay I guess I should provide more details. Constructor syntax fine? Jesus how come you can't use the constructor parameters as the default values but have to either resort to using `late` or that weird `: {}` after constructor like in C++, can't remember how it was. I just added `late` and thought whatever. Probably there are nuances I've missed but how come you had to reinvent that - thought it should be intuitive…

> Jesus how come you can't use the constructor parameters as the default values but have to either resort to using `late` or that weird `: {}` after constructor like in C++, can't remember how it was. This is a really good question. The reason is that it ensures that you can never see a field before it's initialized. In Java, you might think that you'll never observe a final field before it's been initialized but not…

Thanks for the detailed write up!

Re: Flutter desktop isn’t there yet

#233

Earlier quoted context omitted.

It's open source the way Chrome is open source: the source is there, but the development is ~100% by Google

Google Chrome is not open source, Chromium is. [Reference]( https://en.wikipedia.org/wiki/Chromium_(web_browser)#:~:text... .)

People keep pointing this out as if this made a grain of difference.

Re: Flutter desktop isn’t there yet

#234

The basic functionality of the typical UI hasnt changed for ages. Yet technologies keep churning. There is probably a better way but apparently people are not incentivised to find it.

This is a strange take for me- people are CONSTANTLY trying to find new, better ways to do UI. Elm, React, DearIMGUI, Flutter, and Xilem are some of the more well-known fairly recent libraries.

See https://raphlinus.github.io/rust/gui/2022/07/15/next-dozen-g... for an overview of UI libs in Rust.

See https://www.cmyr.net/blog/gui-framework-ingredients.html for a great overview of some of the challenges making a GUI library

Re: Flutter desktop isn’t there yet

#235
post #229

Earlier quoted context omitted.

You're definitely not alone in this. One of the core reasons my team chose Flutter was the fact we would not have to spend much time setting up development environments and making sure we were always using the latest and greatest framework.

Odd thing to say, since you definitely have to set up a Flutter/Dart development environment—you don't just get it for free. The only real way to escape this at all is to settle on the browser as your runtime, so there's a certain irony to what you're saying.

I never said we didn't have to set up an environment, but that the environment is

1. Installing Flutter 2. flutter create 3. flutter run

Instead of installing/configuring/setting-up npm, typescript, eslint + rules, react + rules + types, prettier, react-native-web + rules + types, a rendering framework + rules + types, webpack, jest, and whatever else.

You do, basically, get it for free.

Re: Flutter desktop isn’t there yet

#236
post #229

Earlier quoted context omitted.

Odd thing to say, since you definitely have to set up a Flutter/Dart development environment—you don't just get it for free. The only real way to escape this at all is to settle on the browser as your runtime, so there's a certain irony to what you're saying.

I never said we didn't have to set up an environment, but that the environment is 1. Installing Flutter 2. flutter create 3. flutter run Instead of installing/configuring/setting-up npm, typescript, eslint + rules, react + rules + types, prettier, react-native-web + rules + types, a rendering framework + rules + types, webpack, jest, and whatever else. You do, basically, get it for free.

You have now transitioned from saying that you don't have to spend as much time to set up a development environment to saying that it is pretty much free, which is even odder still.

Again, it's definitely not free (or "basically" free, either). Step 1 negates that statement. You have to set up a development environment. It takes some non-zero amount of effort.

In contrast, the browser is already there. It already runs JS. You don't have to do anything to make that happen[1]. And in saying it takes nothing, that's not merely "basically" nothing; it's literally nothing.

> Instead of installing/configuring/setting-up npm [and a bunch of other crap]

What if I told you that while you're free to opt for doing any/all of those things, none of it is actually necessary, let alone a good idea? (Or point out that TypeScript is not even JS, for that matter?) That you're totally allowed to ignore the GitHub busyworkers and write actual (i.e. straightforward, standards-compliant) JS—in contrast to much of what's available for NPM/NodeJS, where you are most often encouraged to write "JS" that's incompatible with what's in the standard (and what the browser makers actually implement)?

1. https://www.colbyrussell.com/2019/03/06/how-to-displace-java...>

Re: Flutter desktop isn’t there yet

#237
post #236

Earlier quoted context omitted.

I never said we didn't have to set up an environment, but that the environment is 1. Installing Flutter 2. flutter create 3. flutter run Instead of installing/configuring/setting-up npm, typescript, eslint + rules, react + rules + types, prettier, react-native-web + rules + types, a rendering framework + rules + types, webpack, jest, and whatever else. You do, basically, get it for free.

You have now transitioned from saying that you don't have to spend as much time to set up a development environment to saying that it is pretty much free, which is even odder still. Again, it's definitely not free (or "basically" free, either). Step 1 negates that statement. You have to set up a development environment. It takes some non-zero amount of effort. In contrast, the browser is already there. It already run…

You seem to be suggesting that instead of installing a piece of software and running two commands is somehow inferior to writing untyped, unscalable javascript, hard refreshing the page each time to see your changes, loaded in yourself with script tags. This is the oddest argument of all (I can use that word too)

There is a reason people made these countless frameworks and solutions, but the benefit Flutter provides is it's an out-of-the-box fix, and yeah, installing some software and running two commands is an out-of-the-box fix.

In addition, the entirety of your argument just flat-out ignores the cross-platform aspect of it, targeting only the browser instead of mobile and desktop platforms as well.

> You have now transitioned from saying that you don't have to spend as much time to set up a development environment to saying that it is pretty much free, which is even odder still.

I truly don't understand this odd exercise in linguistic gymnastics, as these are both simultaneously and entirely true. You can resolve this yourself.

And yes, it's still (basically) free.

Re: Flutter desktop isn’t there yet

#238
post #236

Earlier quoted context omitted.

You have now transitioned from saying that you don't have to spend as much time to set up a development environment to saying that it is pretty much free, which is even odder still. Again, it's definitely not free (or "basically" free, either). Step 1 negates that statement. You have to set up a development environment. It takes some non-zero amount of effort. In contrast, the browser is already there. It already run…

You seem to be suggesting that instead of installing a piece of software and running two commands is somehow inferior to writing untyped, unscalable javascript, hard refreshing the page each time to see your changes, loaded in yourself with script tags. This is the oddest argument of all (I can use that word too) There is a reason people made these countless frameworks and solutions, but the benefit Flutter provides…

> You seem to be suggesting that instead of installing a piece of software and running two commands is somehow inferior to writing untyped, unscalable javascript, hard refreshing the page each time to see your changes, loaded in yourself with script tags.

Nope.

> This is the oddest argument of all (I can use that word too)

Oh, boy. That sounds bad. I guess it's a good thing that's an argument I'm not making it, then! (Also: I didn't use that word, FYI.)

Re: Flutter desktop isn’t there yet

#239

Earlier quoted context omitted.

Last I checked you can’t even have enums with payloads/ associated values. Garbage language

You can since 2.17. Not sure if you’re being sarcastic about this making it a garbage language.

Is that not just string/int/basic types? Last time I looked it was and it was a complete joke.

I want to define

enum UserState {

case loggedOut

case loggedIn(user: User)

}

where User is itself a struct with props like email/id/Etc

Then, I want to be able to switch on said enum, so that my code can take a UserSession state stream and switch over each case to react accordingly. This gives me compiler - enforced case handling completeness everywhere my enum is consumed which is amazing for code reliability.

This is trivial in Swift or any real language, but with Dart and the stupid flutter bloc model you seemingly can’t do this and end up with these huge if cast chains to send messages.

If I’m wrong and things have changed for the better please let me know, it was my biggest issue with dart/flutter

Re: Flutter desktop isn’t there yet

#240

Earlier quoted context omitted.

Last I checked you can’t even have enums with payloads/ associated values. Garbage language

https://codewithandrea.com/tips/enums-with-members-dart-2.17

See my sibling comment. That appears to only work with basic types like strings/ints?

I need to add complex objects, sometimes multiple. Swift lets you do this easily.

Post reply on HN