r/FlutterDev • • Jul 14 '21

Community - Official Flutter Thread Tell the Flutter team about your experience with web support

182 Upvotes

It has been a few months since we announced the initial stable release of Flutter’s web support at Flutter Engage. Since then we’ve been continuing to work on improvements, with Flutter 2.2 bringing increased performance across our HTML and Canvaskit renderers, support for more desktop features, and improved accessibility support.

We know about 11% of all Flutter builds are targeting the web. We would love to hear from those of you who are using Flutter for web app development. What is working or what is not working for you? How can we improve your developer experience?

Several of us on the team will be reading and contributing to this thread to learn more about your experience with Flutter’s web support.

  • Mariam Hasnany (u/mariamhas) - I’m the product manager on the Flutter team focused on web

  • Tim Sneath (u/timsneath) - director of product management for the Flutter & Dart teams at Google

  • Yegor Jbanov (u/virtualistic) - software engineer on the Flutter team focused on web

  • Mouad Debbar (u/mdebbar-goog) - software engineer on the Flutter team focused on web

  • David Iglesias Teixeira (u/ditman-dev) - software engineer on the Flutter team focused on web


r/FlutterDev • • Oct 13 '25

Plugin Introducing Flumpose: A fluent, declarative UI extension for flutter

181 Upvotes

Hey everyone,

I’ve been working on Flumpose, a lightweight Flutter package that brings a declarative syntax to Flutter, but with a focus on performance and const safety.

It lets you write clean, chainable UI code like:

const Text('Hello, Flumpose!')
        .pad(12)
        .backgroundColor(Colors.blue)
        .rounded(8)
        .onTap(() => print('Tapped'));

Instead of deeply nested widgets.

The goal isn’t to hide Flutter but to make layout composition fluent, readable, and fun again.

Why Flumpose?

  • Fluent, chainable syntax for widgets

  • Performance-minded (avoids unnecessary rebuilds)

  • Const-safe where possible, i.e, it can replace existing nested widgets using const.

  • Lightweight: no magic or build-time tricks

  • Backed by real-world benchmarks to validate its performance claims

  • Comes with detailed documentation and practical examples because clarity matters to the Flutter community

What I’d Love Feedback On

  • How’s the API feel? Natural or too verbose?

  • What other extensions or layout patterns would make it more useful in real projects?

  • Should it stay lean?

🔗 Try it out on https://pub.dev/packages/flumpose


r/FlutterDev • • Apr 19 '25

Discussion I got tired of hearing “is Flutter dead?” So I built a little side project that answers that question with brutal honesty, real data, and… probably too much sarcasm.

181 Upvotes

Spoiler alert, Flutter is far from dead.

https://www.isthistechdead.com/flutter

Also, there is a giant F button to pay respects anyway.


r/FlutterDev • • Jan 07 '25

Discussion Gradle is the most annoying stuff i ever witnessed

181 Upvotes

I have been developing in flutter for around 6 months now and all was going fine, i really like it and wish i could continue on my flutter dev journey.

3 days ago i got some weird issue, everytime i ran my application my pc crashed

After doing some debugging and searching it turns out it was due to gradle issues out of the blue which no longer let me mirror my device on my pixel 8 generated on android studio koala.

After hitting my head against the wall for some hours i figured i would just update android studio to ladybug, but unfortunately the errors multiplied.

Here i am applying multiple solutions found on the web but none of them work, it’s getting close to 02:00 am but still no light at the end of this dark gradle tunnel. Work tomorrow i better call quits for this evening.

On day 2 i tried upgrading my java, turns out this also did not fix anything. I wanted to delve in my application so bad, i started downgrading everything but this gave even more errors, duplicate files, multiple files left behind by the old programs etc.

At this point i was ready to call quits on flutter, this headache surely cannot be worth it. So i decided to reset my entire pc and try downloading every program from scratch.

It did not fix my issues, do i quit flutter and try react native or is there a way out of this hell hole.

Some of the things i tried to fix the issues :

  • Upgrade everything

  • downgrade everything

  • changed build gradle and wrapper so my gradle match the jdk 17 im using, also changed kotlin version to match this.

  • Upgrade to jdk 21

  • Open android file of my project in android studio to update x…(something), it synced my gradle with a newer version

  • flutter run -v

  • more flutter cleans than i am able to count

  • delete android files and create .

For some weird reason the application still rund on chrome web extension, just the mirroring with android device no longer works.

If i am able to fix the issue will i fall in the same hellhole on the next update?

I can provide logs but the length is to long for reddit posts

EDIT : I fixed the gradle issues by reading the comments and coming to new insights, one of these pushed me towards : https://flutter-delux.pages.dev/blog .

This fine gentleman explains all well and even has some video's to back up his solutions, there are hyperlinks above his pages.

I did not fix all issues though, i still CANNOT run my flutter application inside of an android emulator. I upgraded to ladybug with the java 21 sdk (did not manually download java just used the android toolchain one) :

[√] Android Studio (version 2024.2) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)

Am running the latest stable version : Flutter version 3.27.1 on channel stable at C:\flutter

If u have the same issues i do and loading ur Flutter code inside of an android emulator CRASHES your PC, DO NOT FOLLOW THE STEPS I TOOK. This is not a fix.

I just got my program working to a point were i can continue development in Chrome(web-javascript), the one that comes with Flutter.

Another person came forward in this post saying he has the same issues and switched to MAC (Flutter) development because he could not fix the issues.

I guess i will just wait untill more solutions pop-up on the internet as i can not find any having these same issues. If anyone is interested, i can provide logs in a direct message, just not here.


r/FlutterDev • • Nov 18 '24

Article Flutter Openworld Gaming Engine

180 Upvotes

I've created a new openworld gaming engine package using flutter at:

https://pub.dev/packages/openworld

It is working on iOS, macOS, Android, Linux, windows and web and I have included two working games with this engine. The games are not only on github ( https://github.com/forthtemple/openworlddart ) but also them on iTunes, amazon app store and snap if you wanted to see them in action.


r/FlutterDev • • Nov 07 '20

Video 10 hour video on State (Stateful Widgets, Provider, GetX, Redux, BLoC) | The Complete (FREE) Flutter Course

178 Upvotes

Hey all,

For the past couple of months, I've been recording videos on Youtube teaching Flutter. My goal was to give a comprehensive, complete course people could follow.

I originally started because I learned computer science by myself. I had no university degree or any bootcamp certificate. When applying for jobs, a lot of companies told me I was too much of a risk -- they had no idea if I actually knew how to code or just watched a couple udemy courses but learned nothing. This channel was my way of giving potential employers a preview of what I knew. (It worked by the way, I got 4 interviews in the same week I added the channel to my CV, and received 3 of the offers). Since then I've continued just out of momentum. I like doing it, I've already started, so I might as well continue.

My course has been split into modules.

Module 1: Dart Basics (variables, functions, lists etc)

Module 2: OOP Concepts in Dart

Module 3: Basics of Flutter layouts / UI

Module 4: State

I just finished recording the state module yesterday, and compiled the 21 videos about state into a single mammoth of a video. 10 hours long. In this video I introduce the idea of state, talk about stateful vs stateless widgets, talk about why we need state management, inherited widgets, provider, getx, redux + event driven state management, bloc, and finally I answer the question every newbie wants to know, "what's the best state management."

It would be really cool if you guys could check out my channel as I really did put a lot of work into this. If you know someone who wants to learn Flutter completely for free, you could point them to my channel.

My channel:

https://www.youtube.com/channel/UCJW25d8mW8ciz0DQC-5XNsQ

Module 4 Complete Video (State):

https://www.youtube.com/watch?v=lvs14YLGd6I

The next module will be about network connections, RESTful apis, and we'll also talk about local data stores.

I'm not sure what will come after, but probably TDD.

Thanks for reading,

Ovidius


r/FlutterDev • • Jun 29 '20

Plugin I created a library called dough to help people create smooshy UI effects :)

Thumbnail
pub.dev
178 Upvotes

r/FlutterDev • • Dec 26 '24

Article 🚀Flutter Job Guide [ 2025 ]

177 Upvotes

I’ve seen a fair number of posts this year from people having a hard time finding a Flutter-related job. While this is becoming common in software development in general, I wanted to at least try giving some people a framework they can adhere to for landing a role in 2025.

STOP BEING A “FLUTTER DEVELOPER”

Please do not confine yourself to one framework. Even if you smooth talk through an HR employee / recruiter, the technical team will be able to quickly cherry pick a developer who has capabilities beyond just Flutter.

If you only know Flutter, you NEED to at least be somewhat familiar with something else technical – literally anything else. SQL? SwiftUI? JS? Data analytics? Pick something.

No, don’t just watch a freecodecamp video (yes, they are awesome)… actually build things too.

Too many people are “learning Flutter” then saying they can’t find a job. You are not just competing against other “Flutter developers” – you are competing against a universe of developers who come from web/analytics/native backgrounds (probably some with full stack experience) where Flutter is just another tool in their toolbelt.

HOW HAS FLUTTER CHANGED

Being able to communicate how Flutter has evolved will give you an edge in the interview process. A lot of companies who use Flutter don’t know how exactly Flutter was born within Google (not that most companies care) and how it has improved (even prior to the company adopting it).

This is typically something worth glancing over more so with the technical team, but speaking on things like the evolution of Web, Skia -> Impeller, newer features to the framework/language, and news within tech relating to Flutter will help show the team that you are familiar with more than just “how to do ___ in Flutter”.

HOW DO YOU LEARN AND STAY UPDATED

Be able to explain how you keep up to date with new updates within the Flutter community or about technical things in particular. Please at least skim release notes, watch Google I/O if you haven’t yet, watch a few old episodes of The Boring Flutter show etc… This may be more common for mid/senior level positions where a team wants to know how you stay current on updates within the Flutter world.

FLUTTER TECHNICAL STUFF

Goes without saying, but if you cannot briefly explain state management, stateful/stateless, general widgets, you should not be applying for jobs.

Be very comfortable with one state mgmt solution, be familiar with at least one other (i.e. If you typically build with Provider, use Riverpod in a small portfolio app).

Be somewhat competent at debugging, testing, and monitoring + improving performance. Most Flutter coding interviews don’t seem to touch on this stuff, but being able to detect where an app isn’t performant or knowing basics of testing will make sure you don’t lose out on the role to someone who knows these things.

Be able to call APIs. If you are interviewed and the live coding part requires you to fetch data from a weather API and you have no idea how to do it, you’re cooked and wasting their time.

Do you need to know the full SDLC? Well, not always. Most entry level roles want you to be familiar with the stages of it, but it’s a great advantage to understand everything from developing app screens/widgets from Figma mockups to making sure the app adheres to app store compliance and app deployment steps. This is typically a requirement for higher level positions and/or if the dev team is small/ in a startup environment.

How do you work in an “agile” environment? I hate this question from hiring teams and have no advice on this. Just understand what it kind of means, how you iterate within your dev process, and try not to roll your eyes when asked.

FLUTTER “IN CONTEXT”

This has helped me in particular. Ask or discuss why they chose Flutter and how their experience with it has been thus far in the context of their work. If they’ve recently adopted it, ask if they considered RN or native and why they opted for Flutter!

Having also assisted teams pick a dev for a Flutter-related role, it helps to get the hiring team discussing their adoption of Flutter as opposed to just a one-way QA between you and them.

BUT WHY NOT ME?

The sad reality of applying for a job is that most applications aren’t reviewed by a human. Even if your application is viewed by a human, it may be someone from HR and not a developer. Many qualified or capable applicants are disregarded by an ATS or fall between the cracks due to the sheer number of applications. Not being selected to move forward in the interview process does not always mean you aren’t qualified – it can also be an indicator that the HR team / individual hiring for the developer role has to review 300+ applications.

What DOES help your resume survive is tailoring keywords in your resume to match those mentioned in the job description. Is the company looking for a “Frontend Engineer” but your most recent role was “Mobile App Developer” (where you mostly built frontend systems) – change it to “Frontend Engineer”. This helps your resume make it through the ATS and allows HR to understand “Hey, that’s the role we’re looking for.” Also choose a few keywords from their job advertisement and sprinkle those into your application.

Where exactly you choose to apply for jobs is up to you. I find LinkedIn or professionally networking far more valuable than bulk applying on ZipRecruiter or Instahire.

----------

I do hope this stuff helps a few people find a new opportunity.

ABOUT ME: Currently employed working with Flutter / Python. Have worked professionally with Flutter for about 5 years. Built applaunchpad.dev with Flutter (WASM). Frequent flyer on r/flutterhelp


r/FlutterDev • • Aug 14 '22

Discussion How will Flutter apps adapt to Android 13's predictive back gesture?

177 Upvotes

For those not aware, Android 13 will implement a cool new animation that will hint users on where they will land if they complete the swipe back gesture.

According to the page I linked, for most native apps it will be enough to just add android:enableOnBackInvokedCallback="true" to the Android Manifest, whereas apps implementing a custom navigation logic will require some more work.

I tried the Android Manifest trick and I can indeed see the new animation (running Android 13 beta on my Pixel 4), but that obviously breaks navigation in my Flutter app completely. Now every back gesture will just take the user back to their homescreen, rather than navigating one level up within Flutter's screen stack (I'm just using the regular navigator push/pop methods).

I've been googling around but I couldn't find anything specific to Flutter, so I'm just wondering: do we know if this is something the Flutter team will implement in the framework without us doing anything? Or will we have to adapt anything ourselves?

If it's the former, I'd expect to have seen something by now given how close we are to Android 13's final release, right?

Does anybody have any info on this? Or maybe I'm missing something obvious and this is a non-issue?


r/FlutterDev • • Jun 03 '21

Article Introducing NativeShell for Flutter

Thumbnail
matejknopp.com
177 Upvotes

r/FlutterDev • • Mar 14 '21

Discussion Flutter 2.0, shout out to the Flutter Team!!!

177 Upvotes

In my over 3 decades work as a developer I have never upgraded my development environment to a major upgrade in such a short period of time. Outstanding!!!

I put aside the day to upgrade a large app I've spent the better part of a year working on. After 20 minutes of updating on pub, and 2 small code changes I ran flutter upgrade, and got nervous. I've been running tests for an hour, and now I'm going to play the rest of the day.

Again, thank you Flutter Team!!!
PS: I spent 17 years on Delphi 7 because we could never upgrade our entire suite of apps to Delphi 8...10...


r/FlutterDev • • Dec 09 '24

Example A curated list of 750+ awesome open source Flutter apps

175 Upvotes

Hey folks! Wanted to share this awesome list of neatly categorized 750+ open source Flutter apps with the Flutter Community. Hope you find it useful!

https://github.com/fluttergems/awesome-open-source-flutter-apps


r/FlutterDev • • Oct 01 '25

Plugin Motor 1.0 is out, and it might be the best way to orchestrate complex animations in Flutter at the moment!

174 Upvotes

Hey everyone! We just released Motor 1.0, a unified animation system for Flutter that we've been working on for a while.

What it does: Motor lets you build animations using either physics-based springs or traditional duration/curve approaches through one consistent API. The big thing here is that you can swap between the two without rewriting your code.

The sequence API is particularly powerful - it lets you orchestrate multi-phase animations with smooth transitions between states. You can create state machine animations, onboarding flows, or complex UI transitions where different phases use different motions. Think looping loading states, ping-pong effects, or storytelling sequences. You can even have each phase use a different motion type (bouncy spring for one state, smooth curve for another). It's honestly changed how we think about complex animations.

Why physics over curves? If you've ever used iOS or Material 3 Expressive apps, you've probably noticed how animations just feel better – they're responsive, natural, and react to user input in a way that feels alive. That's physics simulations. Traditional curve-based animations are great when you need precise timing, but physics simulations give you that organic feel, especially for user-driven stuff like dragging, swiping, or any interaction where velocity matters.

Other key features:

• Built-in presets matching iOS (CupertinoMotion) and Material Design 3 (MaterialSpringMotion) guidelines • Multi-dimensional animations with independent physics per dimension (super important for natural-feeling 2D motion) • Works with complex types like Offset, Size, Rect, Color – or create your own converters • Interactive draggable widgets with spring-based return animations

We honestly think this is the best tool out there for orchestrating complex animations in Flutter, particularly when users are driving the interaction. The dimensional independence thing is huge – when you fling something diagonally, the horizontal and vertical physics can settle independently, which you just can't get as easily with Flutter's classical animation approaches.

There's a live example app https://whynotmake-it.github.io/rivership/#/motor you can try in your browser, and the package is on pub.dev https://pub.dev/packages/motor.

Would love to hear what you think or answer any questions!


r/FlutterDev • • Oct 12 '24

Plugin 🎉 Introducing Pretty Animated Text - A Flutter Plugin for Stunning Text Animations

174 Upvotes

Hey Flutter Devs! 👋

I’m excited to share my new plugin, Pretty Animated Text, now available on pub.dev! 🚀

If you’re looking to add beautiful, physics-based text animations to your Flutter projects, this plugin has got you covered. It offers a variety of animation types and is super easy to integrate!

With various physics-based animations like:

• Spring, Chime Bell, Scale, Rotate, Blur, and Slide Text Animations

• Supports letter-by-letter and word-by-word animations

• Fully customizable duration and styles

👉 **Preview Website:**https://pretty-animated-text.vercel.app
👉 pub.dev link: https://pub.dev/packages/pretty_animated_text

🔗 Github repo: https://github.com/YeLwinOo-Steve/pretty_animated_text

Looking forward to your feedback and suggestions! Happy coding! 💻


r/FlutterDev • • Oct 05 '21

Plugin ✍️ Just released a dart port of my free-hand drawing algorithm, perfect_freehand!

Post image
174 Upvotes

r/FlutterDev • • Nov 01 '24

Example How I optimized my Flutter game engine load times, server calls and use isolates with possibility to rollback state. A lengthy write up about optimizing heavy Flutter applications.

172 Upvotes

Hello! I've posted a few times here about my Flutter game, WalkScape (more info about it on r/WalkScape if you're interested).

Recently, I've been diving deep into optimizing the game's load time and processing, and I've come up with some solutions. I believe these might be valuable for other Flutter developers, even if you're not creating games.

I also came across this post: https://www.reddit.com/r/FlutterDev/s/WAm0bQrOHI where isolates, optimization, and similar topics seem particularly in-demand for article topics. So, here we go—I'll do my best to write up what I've learned! Given my time constraints, I'll keep the explanations at a conceptual level without code examples (especially since the code for this would be extensive). However, I'll provide links to useful resources for further reading. Let's dive in!

The results

To kick things off, here are my results:

  • Before optimization, the game took 7-12 seconds to load, including server calls. While manageable, the game's increasing complexity and content growth necessitated faster loading times for scalability.

  • After optimization, data loads in about 500ms, with server calls taking less than 1000ms on a regular internet connection. These processes now run concurrently, resulting in a total load time of less than a second. We're seeing up to a 12x improvement—the game now loads before the company logo even fades away!

The stack

To provide more context about the server and game setup, here's some key information:

  • The server is built with Dart, using Dart Frog. It's currently hosted on a low-end Digital Ocean server. We plan to switch to Serverpod, as my testing shows it offers better performance.

  • Our database uses Supabase, hosted on their servers. We're planning to self-host Supabase, preferably on the same machines that run the Dart server, to minimize database call latency.

  • The game engine is custom-built on top of Dart & Flutter. Game data is compiled using development tools I've created, which convert it into JSON. For serialization, I use Freezed.

Analyzing the problem

Before designing an improved system, I analyzed the bottlenecks. The server calls and game data loading were particularly time-consuming.

At launch, the game made multiple sequential server calls:

  • Validate the JWT stored locally on the server.

  • Verify that the game's data matches what is on the server and check for updates.

  • Retrieve the player's most recently used character.

  • Load the character's saved data from the server.

These synchronous calls took several seconds to complete—clearly suboptimal.

As for game data loading, we're dealing with numerous .json files, some exceeding 100,000 lines. These files contain game data objects with cross-references based on object IDs. To ensure all referenced objects were available, the files were iterated through multiple times in a specific order for successful initialization. This approach was also far from ideal.

To optimize, I devised the following plan:

  • Decouple all game logic from the Flutter game into a standalone Dart package. This would allow seamless sharing of game logic with the server. Also, make all of the game logic stateless. Why that is important is explained well here on this Stack Overflow comment.

  • Run the game logic code on separate isolates by default. This prevents competition with the UI thread for resources and enables concurrent execution.

  • Consolidate server calls into a single call. My tests showed that multiple separate calls wasted the most time—the server processed individual calls in milliseconds. Implementing caching would further reduce database calls, saving even more time.

  • Load all game data files concurrently, aiming to iterate through them as little as possible.

Decoupling the game logic

I wish I had done this when I started the project, as it's a huge amount of work to extract all logic from the Flutter game into its own package—one that must be agnostic to what's running it.

I've set up the package using a Feature-first architecture, as the package contains no code for representation. Features include things like Achievements, Items, Locations, Skills, etc. Each feature contains the necessary classes and functions related to it.

The package also includes an Isolate Manager, which I decided to create myself for full control over its functionality.

Any Dart application can simply call the initIsolate() function, await its completion, and then start sending events to it. initIsolate() creates isolates and initializes an IsolateManager singleton, which sets up listeners for the ReceivePort and provides functions to send events back to the main isolate.

Two main challenges when using isolates are that they don't share memory and that they introduce potential race conditions.

Here's how I addressed these challenges!

Solving not-shared memory

To run the logic, an isolate only needs the initialized and loaded game data.

When initializing an isolate, it runs the code to load and initialize the game data files. Only one isolate performs this task, then sends the initialized data to other isolates, ensuring they're all prepared. Once all isolates have the initialized game data, they're ready to receive and process game-related events.

This process is relatively straightforward!

Solving race conditions

To solve race conditions, I'm using a familiar pattern from game development called the Event Queue.

The idea is to send events represented by classes. I create these classes using Freezed, allowing them to be serialized. This is crucial because isolates have limitations on what can be sent between them, and serialization enables these events to be sent to isolates running on the server as well.

For this purpose, I created interfaces called IsolateMessage and IsolateResponse. Each IsolateMessage must have a unique UUID, information on which isolate sent it, data related to the event it wants to run, and a function that returns an IsolateResponse from the IsolateMessage.

IsolateResponse shares the same UUID as the message that created it, includes information on which isolate sent the response, and may contain data to be returned to the isolate that sent the original message.

Every isolate has two Event Queues: ordered and orderless. The orderless event queue handles events that don't need to worry about race conditions, so they can be completed in any order. The ordered queue, on the other hand, contains classes that implement the OrderedEvent interface. OrderedEvents always have:

  • Links to other events they depend on.

  • Data about the event, to run whatever needs to be run.

  • Original state for the event.

  • A function that returns the updated state.

Let's consider an example: a player chooses to equip an iron pickaxe for their character. The game is rendered mostly based on the Player Character object's state, and I'm using Riverpod for state management. Here's how this process would work:

  • Player presses a button to equip an iron pickaxe.

  • An IsolateMessage is sent to the isolate, containing the data for the ordered EquipItem event.

  • The isolate receives the message and adds the EquipItem event to the ordered queue.

  • While there might be other events still processing, it's usually not the case. When it's time for EquipItem, it starts modifying the Player Character state by unequipping any existing item, equipping the iron pickaxe, checking if level requirements are met, and so on.

  • Once processed, the Event Queue returns an IsolateResponse with the updated Player Character, using the EquipItem's return function to retrieve the updated state.

Often, multiple events depend on each other's successful completion. This is why each Event can have links to its dependencies and include the original state.

If an Event encounters an error during processing, it cancels all linked events in the queue. Instead of returning the updated state, it returns an IsolateResponse with the original state and an error that we can display to the user and send to Sentry or another error tracking service.

Now, you might wonder why we use UUIDs for both IsolateMessage and IsolateResponse. Sometimes we want to await the completion of an event on the isolate. Because isolates don't share memory, this could be tricky. However, by giving each IsolateMessage a unique ID and using the same one in the response, we can simplify this process using a Map<String, Completer> :

  • When an IsolateMessage is sent to the isolate, it adds an entry to the Isolate Manager's Map<String, Completer> data structure. The String is the UUID, and a new Completer is created when the message is sent.

  • We can then await the Completer. I use a helper function to send isolate messages, which always returns the Completer, so it’s easy to await for that.

  • When an IsolateResponse is returned to the isolate that sent the message and it has the same ID, we simply mark the Completer with the matching UUID as completed in the Map<String, Completer>.

With this rather straightforward technique, we can await even multiple IsolateMessages until they're processed on the Event Queue on a separate isolate! Additionally, because the events takes the state as input, the game logic process remains effectively stateless, as it doesn't store state anywhere. This stateless nature is crucial for fully decoupling the game logic.

Optimizing the game data loading

Now that you understand how the isolates and game work, and how it's all decoupled to run on any Dart or Flutter application, let's tackle the challenge of loading .json files faster. This is particularly tricky when files contain references to IDs in other files, which might not be initialized during concurrent loading.

In my Freezed data, I use a DataInterface as the interface for all game objects that can be referenced by their ID. I've implemented a custom JSON converter for DataInterfaces, which is straightforward with Freezed.

When loading data, the custom converter first checks if the object has been initialized. Initialized objects are stored in a Map<String, DataInterface>, allowing for constant-time (O(1)) fetching by ID. If the ID isn't in the map, we can't initialize it in the converter. So what's the solution?

Instead of returning null or the actual object, we create a TemporaryData object (also extending DataInterface) that only contains the ID of the object waiting to be initialized.

Each DataInterface has a getter that returns all its children DataInterfaces. By checking if any child is a TemporaryData object during serialization, we can easily determine if it's still waiting for initialization. I use recursion here, as children can also contain uninitialized TemporaryData.

When serializing an object during game data loading, if it has TemporaryData children, we add it to a List<DataInterface> called waitingForInit. After initializing all objects, we re-iterate through the waitingForInit list, reinitializing those objects, checking for TemporaryData children, and if found, adding them back to the list with updated references. This process iterates 4 times in total at the moment, with fewer objects each time. Most objects that had TemporaryData are initialized in the first iteration.

While this solution isn't perfect, it's significantly faster—initializing thousands of objects in 500ms, compared to several seconds previously. Ideally, I'd prefer a solution that doesn't require iterating through a list 4 times, but I haven't found a better approach yet. The presence of circular dependencies adds further complexity. If you have a more efficient solution, I'd be eager to hear it!

Optimizing the server calls

Optimizing server calls is relatively straightforward compared to implementing isolates and concurrent file loading. Instead of making multiple calls, we use a single call to a special authentication endpoint. This endpoint handles all the tasks that would have been done by multiple calls. Here's how it works:

  • The game sends a JWT (JSON Web Token) of the session (or null if there isn't one), along with the game version and game data version.

  • If the JWT is invalid or null, the server responds with an error. It also returns an error if the game version or game data versions are outdated.

  • If the JWT is valid, the server checks the player's most recently used character, loads that data, and sends it back.

But we've gone even further to optimize this process:

  • We save player data both server-side and locally. When calling the server, we include the timestamp of the local save. If it's more recent than the server's version, we simply instruct the game to load the local data in the response.

  • We begin loading the local data before the server call completes, ensuring it's ready even before the response arrives. If the server responds with a save, we load that instead. Usually, the local save is used, saving time.

  • On the server, we use caching extensively. We cache valid JWT tokens for faster lookup, player saves to avoid loading from storage, and previously played characters to skip database lookups.

  • To squeeze out every millisecond, we compress server-side Player Saves with Gzip in the cache. This allows for faster data transmission, even on slower internet connections.

These optimizations made it possible to reach loading time of less than a second.

Other game engine optimisations and further reading

Phew, that was a lot to cover! I hope you found it interesting.

Let me share a few more basic techniques I used to optimize game logic processing on the isolate:

When I started developing the game, I relied heavily on lists as data structures. They're convenient, but they can be performance killers. Removing or updating objects in lists requires iteration, which wasn't an issue initially. However, when you're dealing with thousands of objects that might be iterated through hundreds of times in game loop processes, it starts to hurt performance significantly.

My solution? I replaced lists that didn't require searching with Maps, where the key is the ID and the value is the object—almost always a DataInterface in WalkScape. Getting or setting a key-value pair is constant time, O(1), which is much more efficient.

For data structures that need searching and sorting, binary search trees are excellent. In Dart, I prefer SplayTreeSet as the closest equivalent. These use logarithmic time, O(log n), which is far faster than the linear time, O(n), of standard lists.

These changes alone yielded a significant performance boost. I also implemented caching for parts of the game data that require extensive processing when updated. A prime example in WalkScape is the Player Attributes—the buffs your character gets from items, consumables, skill levels, and so on. Previously, these were processed and updated every time I checked a value for an attribute, which was terrible for performance. Now, they're processed once and cached whenever they change—when the player changes location, gear, or anything else that might affect the attributes. This optimization provided another substantial performance gain.

For more on this topic, check out my development blog post on the WalkScape subreddit: https://www.reddit.com/r/WalkScape/s/IJduXKUpy8

If you're keen to dive deeper, here are some book recommendations that offer more detailed explanations with examples and illustrations:

Packages to help you get started

  • Isolate Manager. I built my own, but this package makes it easier to get started if you're not comfortable creating your own manager.

  • PetitParser. This can be extremely useful when building game engines with Flutter and Dart, as you often end up with complex files (JSON or otherwise). It's especially handy for supporting arithmetic operations or expressions as strings within game data.

  • ObjectBox. I've found this to be the easiest option for shared local storage/database when using Isolates. I've also used Drift, which works well with Isolates too, but requires more setup.

  • Retry. If you want to add retries to your Event Queue to make it more robust, this package is great.

  • Riverpod. Excellent for handling state updates. When IsolateResponses bring updated states back to the main thread, just put them in a provider, and your UI refreshes!

  • Freezed and UUID. These are probably no-brainers for most Flutter developers.

Closing words

This was a lengthy write-up, and I hope you found it interesting!

I rarely have time for such comprehensive write-ups, and I acknowledge this one's imperfections. Would’ve been great to add some pictures or code examples, but I didn’t have time for that.

After two years of game development, I believe the setup and architecture I've settled on are quite robust. I wish I had known about Isolates earlier—from now on, I'll use this processing setup whenever possible with Flutter and Dart. The performance gains and no UI jank, even during heavy, long-running calculations, are awesome.

In hindsight, I should have decoupled the logic entirely from representation into its own package sooner. Having all the game logic as a self-contained Dart package makes testing incredibly convenient. Moreover, the ability to run the game logic anywhere is powerful—I can process the game locally (enabling offline single-player mode) or server-side (minimizing risks of memory/storage manipulation).

I'm eager to answer any questions or provide further elaboration in the comments, so please don't hesitate to ask!

Thank you all—stay hydrated and keep walking! ❤️️


r/FlutterDev • • May 03 '24

Discussion Rabbit R1 just an Android (Flutter) app after all.

172 Upvotes

I have been working on something similar with Flutter this past week, something that would use all available open source LLM models to achieve what R1 is capable of.

No one should be selling crap hardware touting as an Ai device if none of the computation is happen on device and instead making calls to external APIs.

A lot of reviewers said that Rabbit R1 could've just been an app, and it actually is! A Flutter one at that.

Emerge tools did a nice inspection of the said app where they discovered that the app is written with Flutter along with some native Kotlin, probably some platform channel related custom libraries. They're even use Riverpod for state management.

If anyone's interested, have a look:

https://www.emergetools.com/deep-dives/rabbit-r1


r/FlutterDev • • Apr 26 '25

Dart Nullaware elements have been landed in Dart 3.8

171 Upvotes

You can now write this:

String? x;
List<String>? y;
final z = [?x, ...?y];

stead of

final z = [if (x != null) x!, if (y != null) ...y!];

or even

final z = [if (x case final x?) x, if (y case final y?) ...y];

Those null aware elements are a nice extension specified back in 2023 to the spread and control flow extensions to collections from Dart 2.3. Now they're finally available without an experimental flag.

Lukily the trailing_commas: preserve option for the new formatter also has landed and I can set my sdk to ^3.8.0 (or ^3.9.0-0) now. I still get a ton of changes to formatting, but at least, my spreaded lines no longer collapse to one single line.


r/FlutterDev • • Jul 13 '21

Article FYI Flutter docs added a new article about Building Adaptive Apps that's an absolutely fantastic and comprehensive read (even if you're a beginner!)

Thumbnail
flutter.dev
171 Upvotes

r/FlutterDev • • May 19 '21

Tooling FlutterFlow is now live! 💜

Thumbnail
flutterflow.io
171 Upvotes

r/FlutterDev • • Aug 09 '25

Discussion I recently switched from developing on React Native to flutter, this is what I think flutter does better than RN:

170 Upvotes

On flutter.. things.. just work🥹


r/FlutterDev • • Dec 03 '24 Silver is Forever Take My Silver

Discussion From Flutter skeptic to fanboy: Why its UI composition made me never want to go back to React Native/Kotlin XML hell

169 Upvotes

After being forced to use it for a project a few months ago, I've completely changed my tune. Let me explain why:

  1. The declarative UI approach in Flutter just clicks. Instead of fighting with XML layouts or JSX, everything flows naturally. Want to center something? Wrap it in a Center widget. Need a list? ListView is right there. It's like building with LEGO blocks - everything just fits together.

  2. Coming from React Native and Kotlin, I can't tell you how refreshing it is to not deal with separate style sheets or XML files. Remember those times debugging why your styles aren't applying correctly, or fighting with constraint layouts? Yeah, that's all gone.

  3. The widget composition model reminds me so much of game development (I dabbled in Unity before). Everything is a widget, widgets can contain other widgets, and you can create complex UIs by combining simple building blocks. It's intuitive and powerful at the same time.

  4. Hot reload actually works consistently. Not "sometimes works", not "works but breaks after 10 minutes" - it just works. This alone has probably saved me weeks of development time.

  5. Performance is surprisingly good. No more bridge to cross between native and JS, no more layout calculations jumping between different engines. It's all Dart, all the way down.

The thing that really sealed the deal for me was realizing how much mental overhead disappeared. In React Native or Kotlin, I was always context-switching between different paradigms - JSX to StyleSheets, or Kotlin to XML. With Flutter, it's one cohesive mental model.

I know this might sound like fanboy talk, but after months of real-world development, I can confidently say: Flutter's approach to UI composition is superior to anything I've used before. If you're on the fence like I was, give it a real shot. You might be surprised how quickly you fall in love with it too.


r/FlutterDev • • Jan 30 '23

Example I made a companion app for my headphones with Flutter

169 Upvotes

I was very annoyed how big, slow, and bloated official app for my Huawei FreeBuds 4i was 🤬, so I made my own 🌈

I reverse engineered the protocol that the buds use 👨‍💻 and made an app in Flutter 🐦

Here's how Flutter did for me in this case:

THe beggining was hard. Very hard. I managed to make a quick demo using flutter_bluetooth_serial plugin, but it was very alpha-stage, and didn't have any auto-updating callbacks. Meaning, i had to have Stream.periodic that checked connected devices every 10ms.

So I made my own - that took me quite a time, since managing multiple streams from android-blocking-api, to PlatformChannels, then to Dart streams - was hard. Coroutines helped a bit, but Dart way of async stuff is just sooooo damn better 😭

So if anyone needed bluetooth classic: https://github.com/TheLastGimbus/the_last_bluetooth (it lacks documentation yet, but does the job well already 👍)

Once i had that working, rest was just a pleasure. Dart's OOP allowed me to very easily write some abstract interfaces for all headphone features, test them on my desktop with fake class that just spits made-up values, and then implement it with real headphones

Thanks to this, i could publish a web demo app with just few lines: https://freebuddy-web-demo.netlify.app/

OOP sometimes sucks, but Dart/Flutter does it really well 👍👍

Anyway, once i had everything into Streams, UI was a pleasure too. With new updates to Material3, i didn't have to look up any libraries - built in buttons, switches etc are already ✨beautiful✨

I had a problem that i couldn't use raw streams across multiple StreamBuilders/other listeners, but found this super cool package: https://pub.dev/packages/rxdart and used BehaviorSubject instead of StreamController, and it solved all of my problems 🌈

After all of that i have beautiful, stable and ⚡lighthing-fast⚡ app (like it literally opens faster than all other apps on my phone 0_o)

Here it is, on Github 📦 https://github.com/TheLastGimbus/FreeBuddy/

And it's also on Google Play ▶️ https://play.google.com/store/apps/details?id=com.lastgimbus.the.freebuddy

PS. Soon I will try to add support for more headphones, so watch out for new releases 👀


r/FlutterDev • • Nov 02 '20

Article 100 awesome Flutter tips

169 Upvotes

I have compiled 100 Flutter tips in 5 pages of 20 awesome flutter tips. Hope if it will help be beginners and intermediates.

https://github.com/erluxman/awesomefluttertips