4

Flutter is no longer a cross-platform framework — it is something more.

 3 years ago
source link: https://itnext.io/flutter-is-no-longer-a-cross-platform-framework-b53c87b14c39
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Flutter is no longer a cross-platform framework — it is something more.

1*sZFbbyMVel4Xa1tG1lycWA.png?q=20
flutter-is-no-longer-a-cross-platform-framework-b53c87b14c39

Hi I am Luke and I am software developer.

Since I’ve chosen a very bold title I need to elaborate a bit more on it. FYI I do think technically Flutter is a cross-platform framework.

But bear with me...

Since the release of Flutter 2.0, I began to see the hype going a little bit too far. Don’t get me wrong I am a big fan of Flutter and I will forever be an advocate for it.

I use Flutter in my daily work building iOS and Android app. Every day I see the advantages and disadvantages of Flutter since the app that I am working on was previously written natively in Kotlin and Swift with all the perks you can imagine: scan/page recognition, pin/biometric app authentication, notifications, firebase statistics, along with very advanced user flow. That’s why I feel I can say few words about our (Flutterers) current situation.

The six

1*LVrwzO4wpo9XbztzXsG6Ew.png?q=20
flutter-is-no-longer-a-cross-platform-framework-b53c87b14c39

One of the main things pointed out during this year's Flutter Engage was the ability to build your app to one of six platforms: iOS, Android, Mac, Windows, Linux and web. That’s awesome news! But…

Yes, you can deploy your app on 6 platforms, but honestly, I am not planning to do so. Basically, because YOU SHOULD use different design patterns depending on the platform. I can’t imagine deploying my apps on a different platform. It would feel heavily out of place — bottom modals, app bars, simple, yet clear lists? That’s not what users expect on larger devices. Usually what works on mobile won’t work on desktop and the other way around.

Our dear friend

talked about the mythical designer-developer in his Flutter Engage talk. I totally agree with him on the matter. More devs should be aware of what they are doing instead of blindly following their sprint boards.

Scrum Sprint is a repeatable fixed time-box during which a “Done” product of the highest possible value is created. — Wikipedia

You should definitely watch Filip here. Going back to Flutter:

Stop thinking that you will create one app and deploy it everywhere.

Rather start thinking about how modular can I write your apps to reuse them in future projects. Here’s an example for you. In my company, we are building apps that focus on user data. This presents a need of creating custom and advances surveys and we don’t want to write new widgets every time we have to add new questions. Our approach — a writing module that contains every possible survey logic — allows us to use it in many projects without the need to rewrite it every single time from scratch.

What I mean by giving you this example is, when you’re building an app, think about what your app or entire business is focused on. What is the business logic behind it?

In computer software, business logic or domain logic is the part of the program that encodes the real-world business rules that determine how data can be created, stored, and changed. — Wikipedia

When having clarified domain logic you can encapsulate it into modules, that you can use in your Flutter apps.

But Luke, why do I need all the fuss?

Excellent question! Glad you asked it!

You can build multiple Flutter apps with different user flow but focusing on the same business logic.

Grouping your Flutter apps into (mobile, desktop, and possibly web — if needed) allows you to focus on optimal user experience for every particular platform.

Why do I think you should write multiple apps?

Flutter is a great tool that everyone can use and build his apps but it’s a relatively new technology, and it’s mostly used in small companies or by individual devs. I see that this may change in the near future considering how Flutter team is asking questions to the community. [If you want to help them please fill out a survey]

I worked professionally on several enterprise-level apps. From my experience there need to be a clear workflow on each part of the system. Backend, front-end, dev-ops, etc. But for sake of this argument imagine that your one app, build for every platform, is becoming popular. Due to its high demand, you need to hire a team of developers. Combining all platforms into one app simply wouldn’t be possible. Can you imagine how 10+ programmers (in smaller company) are working on the same code base but at the same time on different platforms? It’s a management nightmare. One dev team is working on a desktop feature that is conflicting with what the mobile team is working on.

Second of all the app size goes bigger and bigger with packages sometimes not needed for every platform. Now in the time of Flutter 2.0 release for the first time I have a problem with chained dependencies because not all packages are updated to support null-safety or have mutually exclusive dependencies.

So finally, why Flutter is not a cross-platform framework?

After reading this article, you can assume why I consider Flutter not a traditional cross-platform framework. Simply because it’s a tool providing us with everything we possibly need to build apps for each platform. But my humble opinion is that shouldn’t be a single app, more like a group of apps driven by the same business logic.

The other thing is that, when we write a Flutter app, we are not crossing any platforms 😉 We were if we would write it in Xamarin or any other tool that translates its code to native elements… but we’re not doing that. We have a blank canvas where we paint everything ourselves.

If I had to compare Flutter to something else it would be a game engine, like Unity. We are not writing Windows or Mac games specifically. We are writing in Unity and then exporting it to a specific platform. Writing in Unity became a thing of its own. We don't call every painting cross-home canvas 😉

I promise this is the end you are waiting for.

If you’re reading this: Thank you! You’re amazing!

At the end of this article I want to say that this are my thought on the topic of multi-platforming and yours can be different. If you liked what you read give this articles some claps, please follow me here on Medium or there on: Twitter.

0*hqoVBdkAVHkN2HLm.jpg?q=20
flutter-is-no-longer-a-cross-platform-framework-b53c87b14c39
Flutter Engage artwork

If you missed this year’s biggest Flutter conference and you don’t have a clue what I am talking about here, you can find the whole event here.

LET the code be with you!

My other articles on Flutter:


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK