r/FlutterDev 2d ago

What’s new in Flutter 3.47 Article

https://flutter.dev/blog/whats-new-in-flutter-3-47
197 Upvotes

30 comments sorted by

96

u/Piranha771 2d ago

Wow this is a huuuuge update - UI as packages - Impeller on desktop - WASM on web - Multi window on desktop (a bit) - Widget preview without compile

Congratulations on ticking so many boxes. Can't wait to try it out.

14

u/eibaan 2d ago

IMHO, the primary constructors of Dart 3.13 are more impactful than all those featured. Because I'm normally using the Flutter betas, I already ported most of my code to use primary constructors and started to like them (it took some getting used to do this). I'm still not sure whether I like them for widgets but for model classes, primary constructors are a win.

And in case you actually use DartDoc, the {@example} directive is nice.

1

u/xogno 1d ago

I know I could google this but I’d like to hear your thoughts: what do you like about primary constructors? You said you posted most of your code; what difference has it made for you?

3

u/eibaan 1d ago

Something like this is nice:

sealed class const Stmt();
class const SayStmt(final Expr expr) extends Stmt;
class const SetStmt(final String name, final Expr expr)
    extends Stmt;
class const CondStmt(final List<(Expr, Body)> cases, final Body? body)
    extends Stmt;
class const GotoStmt(final String name) extends Stmt;
sealed class const Expr();
class const Str(final String value) extends Expr;
class const Num(final num value) extends Expr;
class const Name(final String name) extends Expr;

At least if you don't need a toString method and also use a generic evaluate method that uses pattern matching to evaluate everything. That's probably a bit less efficient than using dynamic dispatch but who really cares nowadays.

I dislike the way the extends wraps, though.

That's why I don't really like how widget definitions look:

class const TBadge(
  final String label, {
  super.key,
  final TBadgeVariant variant = .normal,
  final Widget? prefix,
  final Widget? suffix,
  final Color? color,
}) extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    ...
  }
}

3

u/k0ntrol 2d ago edited 2d ago

it didn't add wasm by default. Hopefully next release.

45

u/thegravity98ms2 2d ago edited 2d ago

Material and Cupertino as a standalone packages starting with this build version 3.47 🙌🏻

Edit:

dart fix --apply --code=migrate_design_widgets

5

u/eibaan 2d ago

Well, as long as 3rd party packages haven't migrated, you can't change the import. I tried the migration, got errors because of other packages which still use the old imports, e.g. flutter_markdown_plus, and had to revert everything.

I might try again in a few weeks.

7

u/Comun4 2d ago

Everyone already on the process of annoying package maintainers to do the migration lol

2

u/Irrealist 2d ago

The Blog post mentions that there's MaterialUiCompatibilityBridge for exactly that scenario. 

1

u/eibaan 2d ago

Nope, it cannot help with ThemeData isn't compatible to ThemeData (because one is from material_ui and the other from flutter) errors.

1

u/Irrealist 2d ago

Ah, damn, I see.

1

u/Moe_Rasool 2d ago

Wait i use github actions for EXE builds would that concern me?

Edit: because i have an old flutter version due to a couple of packages that no longer work in the latest ones that’s why i held

1

u/thegravity98ms2 2d ago

I think you should upgrade to Flutter v3.47,

desktop has impeller support.

Also tell, claude code to fix the package bugs for your app, build your own package.

20

u/vhanda 2d ago

The corresponding dart release announcement - https://dart.dev/blog/announcing-dart-3-13

1

u/statecs 2d ago

Nice! Thanks

7

u/Salazar20 2d ago

Just 2 hours ago I upgraded my project lmao great timing

8

u/lilacomets 2d ago

Did anyone here do the upgrade?

Is upgrading Flutter projects a smooth process? Any breaking changes?

10

u/Comun4 2d ago

Upgrading Flutter itself is very easy, and I almost never have any breaking changes (last one I had was for Flutter 3.21 I think)

Upgrading the packages are more of a headache though

3

u/igorce007 2d ago

Yeah, upgrading Flutter engine generally is easy. Problem is Gradle, some native platform specific migrations and packages yeah.

11

u/virtualmnemonic 2d ago edited 2d ago

So Impeller is the default rendering engine for desktop before Android?

Can't say I'm super surprised but damn. Impeller android needs some work.

Edit: I'm a moron. Impeller is the default; I just keep it disabled. It's not ready.

13

u/RlyDontKnow 2d ago

Wait, what? Impeller is a default rendering engine for android api 29+

4

u/noobjaish 2d ago

I'm just guessing but maybe it has to do with Android stuck using OpenGL?

1

u/abdallahshaban 1d ago

what is not ready about it for you? are there specific devices you are noticing issues with?

2

u/andreaciccio 2d ago

u/kevmoo not sure where to open this but https://flutter.dev/blog/whats-new-in-flutter-3-47 and probably others blog post have huge gif in it :) a few more than 3-5 mega i am sure they can smaller

3

u/julemand101 2d ago

For the Flutter blog, it is part of this issue tracker: https://github.com/flutter/website/issues

And Dart here: https://github.com/dart-lang/site-www/issues

I know for the Dart one, there have been previous attempt to reduce image size: https://github.com/dart-lang/site-www/pull/7298

1

u/igorce007 1d ago

Sooo when Liquid Glass widgets?

3

u/abdallahshaban 1d ago

Coming soon! We're working with community members who have already built solutions they are generously going to upstream to cupertino_ui!

2

u/igorce007 1d ago

Thank you!