top | item 40412537

(no title)

wismwasm | 1 year ago

I personally haven’t used react native but what I like about Flutter:

- Comes with a decent component library out of the box that’s easy to customise

- Dart is a nice language overall, null save and typed

- As it paints on the screen there’s no need to write any UI layer more than once for different platforms

- Good development experience with VS Code

- JS interop in case you need to use JS libraries

I just really like to avoid CSS though and flutter offers that. Having pre styled widgets with documented styling parameters as arguments is great.

https://dartpad.dev/?sample=counter

discuss

order

santy-gegen|1 year ago

wow, this is incredibly useful information! thank you so much. i didn't know flutter offered so much

wismwasm|1 year ago

It may also look a bit boilerplate heavy but with the VS Code add in and code snippets it’s actually quite ergonomic to write. Just don’t attempt to type it all out by hand.

If you decide to give it a try there are some packages I’d recommend:

- Follow the official getting started: https://docs.flutter.dev/get-started/install

- State management: https://riverpod.dev/ is easy enough and quite powerful. The official docs still recommend Provider, but that’s basically deprecated. Riverpod is an improved Provider by the same maintainer

- Go router https://pub.dev/packages/go_router is the standard for routing

- I used sqflite for persisting local state: https://pub.dev/packages/sqflite

The setup may of your dev environment may take a bit (the mobile SDKs are quite big to download) but after that it’s quite smooth.

Flutter is “inspired” by react so you should feel familiar with the widget lifecycle. Unlike modern react though it uses class based components and when using stateful widgets (components) it’s split into two separate widgets.