r/FlutterDev • • Nov 08 '22

Discussion Flutter 4.0?

The Flutter team just released this tweet on their official page. What should we expect?

118 Upvotes

120 comments sorted by

41

u/riveraj33 Nov 08 '22

Cool. I have a feeling impeller will be “stable”.

6

u/azzecca-garbugli Nov 08 '22

I've never tried impeller so far, did you see any real improvements?

6

u/riveraj33 Nov 08 '22

I tried it and got some weird glitches in some icons and videos didn’t show in my app(though audio did play). I didn’t bother to debug it since it’s experimental. But I did notice my app was smoother on iOS and I didn’t have to run the SkSL commands.

0

u/[deleted] Nov 08 '22

[deleted]

2

u/WorldlyEye1 Nov 17 '22

What is impeller?

2

u/[deleted] Nov 10 '22

[removed] — view removed comment

2

u/riveraj33 Nov 10 '22

😂 yea just like that!

45

u/albemala Nov 08 '22

It'll probably have full Material 3 support as well

-4

u/azzecca-garbugli Nov 08 '22

Indeed, they have done huge steps about this topic. Maybe they could consider also to "deprecate" Material 2 at this point...

0

u/[deleted] Nov 08 '22

[deleted]

9

u/Abion47 Nov 09 '22

What would you have them do? Ship Flutter without a default out-of-the-box theme? You can already see how that looks by using the widgets from import "package:flutter/widgets.dart"; and have the base of your app be WidgetsApp instead of MaterialApp or CupertinoApp. It looks awful and you have to customize everything. Most people using Flutter will want to use a default style, so it makes sense to ship the style alongside the standard library. Really, the fact that they support both Material and Cupertino out of the box is already commendable. But if you really want to, you can make an app without using either Material or Cupertino.

0

u/[deleted] Nov 09 '22

[deleted]

0

u/Abion47 Nov 09 '22

There's some truth to that, but it's not like Android/iOS native components are updated so frequently that needing to be able to work on Material/Cupertino widgets separately from the core Flutter releases would result in that much benefit. Combine that with the fact that those packages would need to be updated in parallel with every Flutter release anyway, and it just makes more sense in practice to bundle them with Flutter itself.

Perhaps it would be a nice addition to flutter create that you could specify if you were intending to make a Material or Cupertino targeted app (e.g. flutter create --theme=cupertino), but beyond that, I wouldn't think that any solution separating those themes from the core library wouldn't end up causing more problems than solutions. Tree-shaking already ensures that the theme you don't choose doesn't end up in the final compiled app, so the only real problem is the size of the SDK installation which isn't really that big of a problem.

10

u/pokaboom1 Nov 08 '22

Meta programming would be cool

3

u/azzecca-garbugli Nov 08 '22

This would really improve the overall quality of the framework but I don't know how much time it's still needed to port this feature into Dart

9

u/tomwyr Nov 08 '22

As much as I'd love this to be true, I doubt it, as the metaprogramming feature is still in Being Specd status.

https://github.com/dart-lang/language/projects/1

6

u/sirus2511 Nov 08 '22

Probably material 3.0 full release. But I hope it's not called 4.0🥲

-2

u/azzecca-garbugli Nov 08 '22

Why not? It's pretty straightforward as nomenclature after the 3.0 imho

9

u/sirus2511 Nov 08 '22

TL;DR - it will kill the joy that comes with a new major version release.

In 3.0 there were no breaking change and yet it was called 3.0, it could be called 2.x but for hype and marketing they called it 3

He explains my point really well in the video.

https://youtu.be/MEYQUhJdv9c

3

u/Gears6 Nov 08 '22

In 3.0 there were no breaking change and yet it was called 3.0, it could be called 2.x but for hype and marketing they called it 3

Oh dear lord! I hate it when they do breaking changes. This honestly should not the be the standard for a major version number.

Yes, I know people do it, but that's largely what essentially killed AngularJS momentum and shifted everybody to React.

0

u/azzecca-garbugli Nov 08 '22

Do you have any fancy suggestions? 😅

6

u/sirus2511 Nov 08 '22

If any breaking changes then Flutter 4 else use something 3.x

I don't want any fancy version but flutter to follow semantic versioning

1

u/Gears6 Nov 08 '22

If any breaking changes then Flutter 4 else use something 3.x

I don't really care what the version number is as long as it is consistent and clear demarcation.

1

u/[deleted] Nov 10 '22

[removed] — view removed comment

1

u/sirus2511 Nov 10 '22

The whole video is about it. He talks about 1.0, 2.0 and why it made sense as major versions and why 3.0 doesn't. He also mentioned that flutter doesn't follow semantic versioning so it doesn't matter they can name it anything

30

u/Acrobatic_Egg30 Nov 08 '22

Hopefully faster web loading times

3

u/iamjulianacosta Nov 09 '22

I have only worked on Android with flutter. What are the loading problems on web?

10

u/pdfsalmon Nov 09 '22

Initial loads are incredibly slow - I've experienced 10+ seconds of blankness on some of my apps. Later loads are faster, but still unacceptable to the average user

7

u/Denvildaste Nov 09 '22

Sorry if you already know this, but using Javascript you can add a loading indicator instead of having a blank screen. Doesn't help with the loading times but at least it's not blank.

6

u/Apokaliptor Nov 09 '22

yes but this is not the solution

3

u/slavap_ Nov 09 '22

u/pdfsalmon How can you get 10+ seconds? Even is case app is 3mb - gzipped size will be around 750kb - so time to download that could not be 10+ seconds in any realistic case.

1

u/pdfsalmon Nov 09 '22

Fair point - I don't have any data collected, just my personal experience

1

u/arcanemachined Nov 09 '22

3MB? Go look at some Flutter web examples. 20MB is closer to what I typically see, which is pretty damn gross for a web-based frontend.

1

u/slavap_ Nov 10 '22

u/arcanemachined Show me project which will give you 10+mb javascript when compiled as: flutter build web --release

1

u/arcanemachined Nov 10 '22

No, instead I'll just give some examples as I find them:

https://gallery.flutter.dev/ - 14.83 MB / 4.70 MB transferred

Here's some top reddit submissions from the past year:

https://kamranbekirov.com/ - 30 MB / 22.39 MB transferred

https://pinball.flutter.dev/#/ - 22.96 MB / 14.79 MB transferred

https://quadren.github.io/arc/ - 2.06 MB / 807.34 kB transferred (Surprisingly small but it's just a simple landing page. The only reason I can tell it's Flutter Web is because the scrolling sucks.)

Those are the examples I've found in the 5 minutes I'm willing to devote to this experiment.

1

u/slavap_ Nov 10 '22

u/arcanemachined

Let's start one by one :-)

https://gallery.flutter.dev/

main.dart.js is only 733kb and even if we count all resources loaded (for example bunch of ttf fonts and images) - then it is almost 15mb - but these resources have not to be counted, they can be optimized or even eliminated completely, that's website specific, not tech stack.

https://kamranbekirov.com/

main.dart.js is only 554kb

also canvaskit is used as renderer - it could be eliminated by using html renderer.

rest of payload are fonts and images again - they are website specific and must not be counted.

1

u/arcanemachined Nov 11 '22

You make a good point. For me, unfortunately, the bundle size is just one aspect of makes Flutter Web unappealing for me for now, performance being the other big issue (particularly on older or low-range mobile devices).

Trust me, I really want to see improvements in Flutter Web.

1

u/slavap_ Nov 11 '22

u/arcanemachined Performance is not great, but I don't see anything terrible bad on that side either. On desktop browsers all is quite fast, on mobile phones - it depends, but with html renderer even mid-range phones are ok.

Scrolling is kind of "strange" for web, and resembles native mobile apps, but that is not a stopper in my case. Also, there are some successful attempts to make it more "web friendly", e.g. https://github.com/adrianflutur/flutter_improved_scrolling

→ More replies (0)

0

u/vhax123456 Nov 09 '22

Older browsers won’t be able to unzip properly in my experience and our users happen to use those so I can’t use gzip

7

u/slavap_ Nov 09 '22 edited Nov 09 '22

Even more advanced brotli has 96.55% support. Which older browsers are you talking about? gzip is around 100% supported.

gzip encoding support

brotli support

2

u/arcanemachined Nov 09 '22

Please let this happen. An efficient Flutter Web experience would completely seal the deal.

26

u/waldo_geraldofaldo Nov 08 '22

Android TV support hopefully

One can dream xD

25

u/h3x4d3c1m4l_NL Nov 08 '22

Flutter already works fine on Android TV. Just enable adb (remote debug over LAN/WiFi), connect it. When it's connected your TV wil appear in your device list like it's an emulator or regular phone.

4

u/ImGeorges Nov 09 '22

do you have a source or more info on howto?

1

u/Odd_Conversation_167 Nov 09 '22

Just install apk using flash card :)

1

u/h3x4d3c1m4l_NL Feb 22 '23

That might work using the USB port and a flash drive, but you would probably still need to install a file manager first. Which you can do using the adb steps.

1

u/arcanemachined Nov 09 '22 edited Nov 09 '22

If your TV is Android version 11 or higher (I think that's the right version...), just look into how to set up wireless ADB like any other Android device. Not sure if all TVs allow access to Developer Settings though...

EDIT: Stumbled across this

1

u/h3x4d3c1m4l_NL Feb 22 '23

Whoops, I haven't been on Reddit for a little while...

I only have experience from an old Sony Android TV and a more modern Xiaomi Android TV. With both TV sets the steps where roughly the same as your regular Android phone. Go to the About screen, then click a few times on "Build number" until a toast appears telling you "You are a developer now!" or some similar message.

Then go back one menu level and find "Developer" in your Settings screen. There you should be able to enable adb. Then find the IP of your TV, and make adb connect over the network using your command prompt. This should work over both ethernet and WiFi, as most TV's don't have any USB device port for debug purposes.

After initiating the adb connect command, your TV might ask you to confirm the connection. Just click Yes and the connection should be working! I think at this moment you should be able to sideload and debug Android apps (including Flutter apps, but note that Flutter has a minimum Android version, and several Dart packages might have higher minimum versions to which your TV has to comply).

See also here: https://www.makeuseof.com/how-to-use-adb-on-android-tv/

1

u/arcanemachined Nov 09 '22

FYI I believe wireless ADB is only available on Android 11 or higher.

34

u/eibaan Nov 08 '22

Assuming that development is still happening on Github in the open, only minor features were committed so far. Perhaps the remaining two months will bring something new but I wouldn't hold my breath. So far, I'm not hyped.

As others already guessed, they might declare Impeller beta or something, but that's just an engine replacement under the hood. There has been some work on native pull down menus, which is nice and much needed for better desktop support. Perhaps, macOS even gets multiple windows. I saw some engine changes but from my glance at the design doc, this only enables plugins and has no impact on Flutter itself yet. Dart-FFI based engine embedding as demonstrated for Windows using the win32 package might be another minor feature. And theoretically, this should also be possible with the experimental Objective-C-library support of the Dart VM for macOS.

Last but not least, they might be able to finish the metaprogramming feature for Dart 2.19/2.20, but I doubt that this will have any impact on Flutter in the next two months. Personally, I'd rather have seen record and pattern support, but here work hasn't even started.

Perhaps WASM support will be no longer experimental. If Flutter would directly compile to WASM instead of JS, that would be a major new feature, but I'm not even sure that this would result in a faster or smaller runtime. Perhaps this could provide a better integration with SkiaKit. Or Impeller. I don't know. I didn't follow that work. Still, it would be nice to for example bundle a WASM-compiled SQLite database instead of special-casing the web platform.

7

u/AlexandrFarkas Nov 08 '22 edited Nov 08 '22

Why do you think records/patterns haven't started? You could see dart-lang/language/projects, where this feature in "Being Implemented". Also there are plenty of commits to dart-lang/sdk related to patterns (seen it in Insights section).

As far as I know, you could even test records and patterns with experimental flag enabled.

5

u/eibaan Nov 09 '22

I stand corrected. Work in ongoing for patterns. Records are still pending, though.

5

u/AlexandrFarkas Nov 09 '22

2

u/eibaan Nov 09 '22

Now I feel stupid. I knew about the experimental flags, but I forgot the @dart=2.19 make them possible. This works now:

// @dart=2.19

typedef Parser<T> = (T, String)? Function(String input);

Parser<String> any() {
  return (input) => input.isEmpty ? null: (input[0], input.substring(1));
}

Parser<List<T>> many<T>(Parser<T> parser) {
  return (input) {
    final results = <T>[];
    for(;;) {
      final result = parser(input);
      if (result == null) return (results, input);
      results.add(result.$0);
      input = result.$1;
    }
  };
}

void main() {
  print(many(any())('hello'));
}

The formatter seems to stop working, though. This is an error: dart format --enable-experiment=records records.dart and this dart --enable-experiment=records format records.dart accepts the cli option but still complains. Is there any other way to pass the flags to the formatter?

2

u/bernaferrari Nov 09 '22

Records is like 75% done. Pattern has barely started.

1

u/rasmusir Nov 08 '22

Could you elaborate what records/patterns would entail? Like an example or similar, it would help me a lot I think.

5

u/eibaan Nov 09 '22

Both features will eventually add lightweight tuple and record types as well as destructuring assignment as well as pattern matching via switch/case. Similar features are available in Swift or Kotlin and would make Dart a little bit more expressive and more on par with more modern languages.

16

u/[deleted] Nov 08 '22

Linux and other desktop integration would be nice for a focus but that's of course not where the money is...

1

u/[deleted] Nov 09 '22

isn't ubuntu using flutter for their installation screens?

2

u/[deleted] Nov 10 '22

Yep, their (new/WIP) installer is flutter and dart frontend with rust for the backend. Not sure if it's released yet.

It's a bit of a weird case since installer apps don't have a lot of the front end caveats that regular apps do. They dont usually respect the theming of the OS, or need native window decorations and widgets since they're meant to be easily distinguished from the OS experience.

Linux support is okay but annoyingly hard to style like a native app. There's a single GNOME-like widget project and that's it.

1

u/[deleted] Nov 10 '22

I think its hard in general to style an app on linux ;-), on the other hand I think linux users are very tolerant for the style ;-). Anyway, its interesting they use a rust backend, do they communicate via rest? Because I also have in mind to run the backend on a different language, and I am not sure if rest can be secure. I sometimes think there might be something like shared memory and interprocess communication

14

u/Caveat_emptor_4 Nov 08 '22

Native JSON and Freezed support.

35

u/Apokaliptor Nov 08 '22

Improvements for web would be awesome

14

u/caynebyron Nov 08 '22

I've been loving using Flutter Web lately. Obviously still has a long way to go but I'm personally enjoying it.

17

u/Apokaliptor Nov 08 '22

If this initial load could come closer to native web would be a big jump already

3

u/sdkysfzai Nov 08 '22

is that even possible?

4

u/Apokaliptor Nov 08 '22

Why not? I want to hope it is :D

4

u/low_key_lee Nov 08 '22

Official release of flutter web compile to wasm ?

1

u/AfterLaw7488 Nov 19 '22

I have tried a few things but.... fail

6

u/milogaosiudai Nov 09 '22

im really looking forward to hear more good news for impeller.

12

u/ankmahato Nov 08 '22

Though it is a long shot .. but maybe some support for 3D Games / Graphics.

4

u/anlumo Nov 08 '22

I expect a lot of work coming up for me for my custom embedder.

3

u/machakhelidze Nov 09 '22

Flutter will be announced as the second major framework for Android, officially supported by Google.

2

u/Necessary1OK Nov 12 '22

Wishful thinking I see 👍🏼

2

u/Bartingrad Nov 08 '22

I want a more useful use of vanilla state management. it needs to get a little closer to Native in this regard.

2

u/Neuralpaths Nov 09 '22

I’m hoping they’ve sorted out how to use less CPU power with texteditingcontrollers using iOS/mac. Major jank

2

u/jhuckabee Nov 09 '22

Flavor support for macOS?

2

u/Artronn Nov 09 '22

TV,watch,auto support! Theme changes to their base colors?! Stable and smooth interfaces on iOS maybe?!

These all guesses i found on Twitter! :P

2

u/mad-Rog Nov 09 '22

Apple Watch support?

2

u/aryehof Nov 14 '22 edited Nov 14 '22

I expect another marketing oriented release, rather than one with polished major engineering product change or enhancements.

Something sort of ready-ish will be labeled beta, stable or ready for use, to indicate momentum and progress.

Flutter is one product that manages to release major new versions to great fanfare, without delivering significant new framework/runtime “completed” features.

2

u/sauloandrioli Nov 08 '22

This kind of post just makes my anxiety go to the roof. Why make a announcement for a thing that will happen only in 2 months? And it is not even an Iron Maiden show :D

3

u/or9ob Nov 09 '22

The solution may be more in the realm of dealing with and overcoming the anxiety, than stopping people from announcing features ahead of time :)

1

u/marflage Nov 15 '22

Do not forget the marketing as well. Usually when companies announce events months before their actual date, they are trying to build hype around them to ensure a tonne of attendees.

1

u/[deleted] Nov 09 '22

Been no mention of flutter 4 on fhat tweet at all

1

u/opsb Nov 09 '22

What's the latest news on static metaprogramming?

1

u/ThaFresh Nov 09 '22

it means theyre leaving Twitter, you need to announce it these days

1

u/marflage Nov 15 '22

I have a very long wish list for features I want Flutter to support natively. But, this time I am rooting for widgets support (on Android, at least), since to me it seems their usage has increased, or so the news would like to portray.

0

u/escobarcampos Nov 08 '22

Is it too late to get started with 3?

0

u/[deleted] Nov 08 '22

[deleted]

2

u/escobarcampos Nov 08 '22

Can you pls elaborate? I was literally browsing Udemy for Flutter courses today. Should I wait then? I do have developer experience, though not in dart.

7

u/kindaforgotit Nov 09 '22

he's joking, you can start anytime

1

u/escobarcampos Nov 09 '22

Tx. As I am a complete beginner I thought some massive changes were coming, you know, like iOS switching from objective to swift

1

u/marflage Nov 15 '22

Nah. There will not be this major of a change. I do not know anything about iOS development, but I suppose the change from Objective-C to Swift was not only a change of language but also the framework and development kit. If that was the case, then you can think of it as a new release of a framework for iOS development.

0

u/MableThrope Nov 09 '22

Fuchsia support is overdue.

1

u/paperpatience Nov 10 '22

Fuchsia news is overdue too.

-31

u/[deleted] Nov 08 '22

nice they are finally going to let us use other languages with flutter

26

u/Apokaliptor Nov 08 '22

Why? Totally unnecessary, Dart is a joy to use, I am really happy with this language, I never understood the hate

8

u/frombih Nov 08 '22

I second this

2

u/GundamLlama Nov 08 '22 edited Aug 19 '25

husky door trees wide waiting steer dam dinosaurs dime unwritten

This post was mass deleted and anonymized with Redact

1

u/Gears6 Nov 08 '22

Java is very much verbose, but that verbosity does lend to clarity. Dart lives in that Python space where some things are conventions.

I love Dart, but wish it was just a tad more verbose. Especially around OOP.

2

u/aymswick Nov 08 '22 edited Nov 08 '22

I am an intermediate dev who's dabbled enough to learn the quirks and comfortability of Java, JavaScript/typescript, Rust, and Python. Also of course played with C enough to know it's a low-level language meant for high capability with few guardrails - never exactly fit the projects I've been able to work on.

I was totally counting dart as a negative for switching to a Flutter dev environment, wow was I wrong. Dart is my favorite language by far, and that's ignoring the integrated developer experience you get with first-party plugins for vscode/minting/package management etc that it's language design enables. Dart is incredibly elegant to both write and read, and is surprisingly powerful for remaining succinct. My only gripe is that not supporting reflection means you need to manually write JSON mappings or use a codegen build step. I understand the performance reasons for excluding, but man it is a bummer, every time you have to re-declare structured data throughout your stack, you're adding another point for potential failure unlikely to be caught before runtime. I know there are other solutions to this problem like protobuf/gRPC, but those options don't seem to be completely viable yet in terms of supported user environments.

2

u/Apokaliptor Nov 08 '22

That's the thing, everyone I know that gave Dart opportunity now loves it, yet there is so much hate around it, I can only conclude it's people that don't even use it or just knows Javascript/python. I am coding for more than 10 years, and I've used so many languages, and Dart is easily one of my favorites, if not the favorite

1

u/aymswick Nov 08 '22

I was just about to accept the "JavaScript is terrible but its ubiquity and utility makes up for its objectively shortsighted design" thought brewing in my head when I tried Dart. Going back to JavaScript now feels like coding with drunk goggles on.

1

u/anlumo Nov 08 '22

I've dug pretty deep down into the framework, and I don't think that there's a way without rewriting everything. Flutter is very much connected to Dart on multiple levels (everything except drawing basic shapes).

1

u/[deleted] Nov 10 '22

have any examples, i hear this but i don't understand why? bad architecture they are so coupled or what?

1

u/anlumo Nov 10 '22

No, most of Flutter is simply implemented in Dart. It's easier to write and read than C++ and less error-prone, so I guess that's reason enough for doing that.

-7

u/vhax123456 Nov 08 '22

If they ever use Kotlin for Flutter, Dart is gonna be so dead 💀

3

u/Apokaliptor Nov 08 '22

Why? Everybody making those claims are probably ignorant, so giving you chance to explain, let me guess, Kotlin is the language you use more?

2

u/vhax123456 Nov 08 '22

It’s the opposite. I’ve been only using Kotlin recently and was blown away by it over Dart.

1

u/aymswick Nov 08 '22

Kotlin is a nice facelift for Java, probably feels like a godsend if you're suddenly able to replace your mega classes and 10 line stringbuffer methods with kotlin's inline stuff, also yeah coroutines are sick. I think toe-to-toe Dart beats Kotlin in most areas where accessibility and suggesting good development paradigms are concerned. I know native Android has shifted to Kotlin, but to be fair I haven't spent equal time with Kotlin because the Dart/Flutter approach seems so much easier to grasp. Android now has a bunch of disparate "official" ways to develop and it seems really confusing. Jetpack compose? Appcompat? Maybe the confusion has been cleared up but as someone who did Android in the eclipse/java days and basked in the delight of Android Studio 1.0, stuff got really confusing really fast when they kept announcing new alpha products while deprecating the currently accepted model, kinda felt like... "hey...you're doing it wrong now that's the old way, also there's no stable new way yet but here's some fragmented documentation good luck"

3

u/vhax123456 Nov 08 '22

You really don’t think Kotlin’s Data class, metaprogramming, immutability are other selling points of Kotlin over Dart? Also fragmented documentation is Android development’s problem, it doesn’t really matter to Kotlin vs Dart

2

u/NekroVision Nov 08 '22

I second that. Kotlin feels designed properly from the ground up. Dart for me seems like a JavaScript offspring that wants to morph into something else

1

u/aymswick Nov 08 '22

Metaprogramming is huge, and yeah you're right it is unfair to judge them based on their most common application rather than their inherent properties. Not here to bash kotlin but Dart is more approachable in my opinion. As always, right tool for the right job etc.

0

u/[deleted] Nov 08 '22

There are a few languages that support flutter-like UI syntax if you'd prefer.

Rust has one that's actually quite similar: https://github.com/fruiframework/frui

Cant remember the one for python.

0

u/[deleted] Nov 08 '22

[deleted]

17

u/albemala Nov 08 '22

They are going to do it with Dart 3, so possibly...

1

u/AfterLaw7488 Nov 19 '22

null-safe

I don't like null-safe

1

u/lfelipecastrosales Dec 19 '22

Dropping support for non-null-safe code

this has been confirmed.

• https://medium.com/dartlang/the-road-to-dart-3-afdd580fbefa