/r/FlutterDev

Photograph via //r/FlutterDev

A community for the publishing of news and discussion about Flutter.

/r/FlutterDev

142,770 Subscribers

0

Flutter vs native kotlin composer

I searched online and found mixed opinions. Some say Flutter isn't suitable for larger projects due to performance and lagging issues. However, it seems that Flutter developers are in high demand in the market. My question is: Can Flutter compete with natively developed apps in terms of performance and scalability? I want to understand this better.

3 Comments
2024/12/02
05:51 UTC

0

API Integration in Flutter

As developers, we often face challenges in creating clean and efficient network layers for API communication. Recently, I explored Dio, Extensions, and Records to build a robust and reusable NetworkApiService.

🔑 Key Highlights:

✅ Seamless handling of GET, POST, PUT, DELETE requests

✅ Clean error handling with Dio interceptors

✅ Simplified response management using Records

✅ Flexible API design with clear abstractions

📖 Dive into the full article here: https://medium.com/@rishad2002/api-calls-in-flutter-using-dio-with-extensions-and-records-for-clean-code-cd4935328c98

💻 Explore the complete codebase on GitHub: https://github.com/rishad13/dio_with_extension.git

Let's build clean, maintainable, and scalable apps together! Feel free to share your thoughts or ask questions in the comments. 💬

1 Comment
2024/12/02
05:07 UTC

5

Send Notifications Directly in Flutter & Show Popup Alerts with FCM

1 Comment
2024/12/02
04:12 UTC

5

Advice please - where to find beta testers for Flutter app?

Hello Flutter community,

I started with Flutter couple of months ago and really enjoy the learning process so far. I'm in the process of releasing my first Flutter app on Google Play atm =)

However, Google requires a minimum number of beta testers & I don't really have a social media present :( . Just wonder if anyone here can advise on finding beta testers?

The app itself is an educational app that generate worksheet for year 2 kids to practice their math skills. I originally built this to make it easier for me to support my son with his maths learning - as it was super time consuming with paper based worksheets. After a few months, he has made huge progress which encouraged me to open this up for everyone.

Many thanks,
p/s: or if anyone interested to help out with beta testing please DM me and I will send you with more info.

2 Comments
2024/12/02
02:26 UTC

3

Why use flutter_curl vs http or webview

I was looking at the package flutter_curl but cannot seem to figure out a use case for it vs something like http package for POST and webview for browsing. Can someone give an example where flutter_curl is a good fit?

6 Comments
2024/12/01
23:32 UTC

1

How to make auto rotation in media_kit

Hi, I am working on creating a video player using Media Kit i I want when I enter full screen and hold the phone in the right or left direction, the video rotates with the new directionI want when I enter full screen and hold the phone in the right or left direction, the video rotates with the new direction

0 Comments
2024/12/01
21:06 UTC

64

Lessons learned releasing my first flutter app on iOS

After working for over 3 years on a weekend/weeknights project "EILA money manager" I finally released version 1 on iOS, coming from corporate software world, without having native development experience Flutter was an ideal choice for me to target both Android and iOS.

I gained a lot of Flutter and package ecosystem experience along the way; to show my appreciation and say thank you to flutter open source community I am willing to answer your questions.

Here are my experiences and what I used:

  1. Used Provider for state management, get_it for DI (dependency injection), when I started riverpod was not mature, probably in the future I will try riverpod instead of provider
  2. Intl for localizations and number formatting, however number formatting was a bit tricky as either fixing decimals to 2 decimals or skipping the decimals was not enough:
  • If you skip decimals then it’s not useful for strong currencies like Kuwaiti dinar, Bitcoin etc where even 0.01 is a meaningful or big amount, which means you will show 0 for BTC 0.01 which is equivalent to 900USD
  • By fixing it to 2 you still have issue 1 e.g. for 0.001 BTC, on top of that all amounts will have unncessary 00s making the UI crowded
  • Hence, I used a progressive approach based on the value, to show minimum decimals in view only fields, at the same time should be able to show amounts as small as 0.00001 BTC, however show all decimals where it's an entry field
  • One thing I regret is using double for amounts due to its floating point limitations, 69656.3 is formatted as 69,656.300000000003
  1. Used a combination of sqflite and shared_preferences for persistence, instead of ORM tools to not have performance overheads, and to precisely control DML and DDL the way I want specially for DB upgrades overtime
  2. Initially used http for networking then switched to cronet and cupertino_http for performance reasons
  3. Used workmanager for backend processing, however it’s becoming a pain point due to its almost abandoned state even though the plugin is under flutter community
  4. For in-app-purchases I used official plugin, did a lot of trial and error due to intricacies and differences between Android and iOS workflows and behavior, with lots of manual testing. I recommend testing edge cases using delayed payments to minimize issues during production rollout
  5. Use developer options on both Android and iOS to put network limitations e.g. speed and packet loss to experience performance issues in countries with lagging internet infrastructure, this is highly recommended when you include in-app-purchases and Ads
  6. Used crashlytics from the get-go to fix errors before they become widespread, its highly recommended(or sentry) together with analytics
  7. Tried following TDD with clean architecture as much as I could, however instead of doing every unit test I leaned towards behavior testing. Business logic has almost 100% tests coverage
  8. Initially hand wrote most of the code apart from json_serializable, and equatable, later created a complex mason brick which outputs complete feature boilerplate including entities, view models, data sources, repositories, and use cases
  9. Used Android as a playground for years with minimal functionality before releasing on iOS
  10. Releasing the App on app stores:
  • After reading bad experiences from others, tried to not leave anything to chance by overthinking and overly preparing 😊 reading all Apple and Google docs and best practices and comments from others
  • Android release was a long time ago for limited open testing so don't remember exact details but it was smooth, took 1 to 2 days
  • iOS was better than expected even though I submitted on a weekend, timeline from logs: Prepare for Submission Sep 15, 2024 at 6:33 PM, Pending Developer Release Sep 17, 2024 at 4:30 AM. The only issue I faced was creating developer account before release, which if I remember correctly took more than a month for reasons only known to "Apple engineers" though the support staff was very kind. So it’s recommended to start developer account process quite in advance

 

Recommendations for dependencies:

  1. Keep your dependencies to a minimum and try to remove unmaintained ones
  2. Try to update dependencies once every couple of weeks, but do not use the latest one instead use the one before that. Whenever you update a dependency read the changelog and if the dependency does not follow semantic versioning, then overview the code to know what really changed
  3. Do the upgrades one dependency at a time and test the app to isolate errors related to one dependency
  4. Do not upgrade to Flutter latest stable until it has received 3 minor hotfixes e.g. instead of going for 3.24.0 wait till at least 3.24.3

If you want you can check the app here:

Android App

iOS App

15 Comments
2024/12/01
20:21 UTC

4

Online quiz without internet

Hello everyone!

I am currently working on an application designed to conduct exams for students in a hall without internet access. The concept works as follows:

  1. A Wi-Fi device (without internet) is set up in the hall.

  2. The teacher’s phone (admin) connects to the network and is assigned a static IP address.

  3. Students connect to the Wi-Fi to download the exam, then disconnect after receiving it.

  4. After finishing the exam, students reconnect to the Wi-Fi to submit their answers.

So far, the system works well.

The Problem:

If there are more than 500 students in the hall, and the available router supports only 100 connected devices simultaneously, two issues arise:

  1. Number of connected devices: The router cannot handle this large number of connections.

  2. DHCP issues: Due to high demand, many devices may receive incorrect IP addresses, leading to failed connections, even though I ensure that IP addresses become available after two minutes once a device disconnects from the router to provide IPs for new devices.

Constraints:

• The current router is the only available and optimal device, and no additional devices can be added because the device needs to be set up and dismantled during the exam period, as the hall location changes.

Proposed Idea:

Instead of having all students connect to the router directly:

  1. Divide students into small groups (e.g., 5 students per group). One student in each group connects to the router directly, while the other students in the group connect to this device to get the exam and submit their answers.

  2. Alternatively, make the admin’s phone act as the processor instead of the router to distribute IPs and ensure stable speed and performance. However, I don’t know where to start if I want to implement this.

Challenges:

  1. Transferring data between students without requiring the user’s approval every time. Approval can be given once during download and once during submission, but not more or less, specifically for the selected phone connecting with the group.

  2. Ensuring the data transfer process does not result in the loss of any answers.

  3. Determining which devices will connect to the router or to other devices for sending and receiving exams and answers.

Questions:

  1. I mainly need guidance on where to search for the best solution or similar experiments for this idea.

  2. In your opinion, which solution would be the best?

6 Comments
2024/12/01
19:49 UTC

4

Should i change framework for this?

Hey everyone!

I’m building a project where feeds are a core part of the functionality. I was initially considering using GetStream Feeds for this, as it’s an MVP. However, I’ve realized that their Flutter SDK is unmaintained and will remain so. The REST API is also a bit over my head, especially with handling tokens and permissions separately.

I noticed that their React Native package is still maintained, so I’m considering either switching to React Native for this project or continuing with the Flutter SDK (even though it’s no longer supported). The downside of the latter is that it could restrict future package upgrades. The thing is if we see traction and hit a point where getstream is expensive we will remove it from our app and go full on postgresql and dive deep into the complexities of that.

For now, GetStream will serve as a secondary database for the feeds, but everything will remain in our primary PostgreSQL database.

9 Comments
2024/12/01
13:31 UTC

5

Should I Switch from JavaFX to Another Framework for a Kiosk Application?

Hi everyone,

I’m currently developing a kiosk application using JavaFX. The app is used by customer, making payments (integrating with an EDC), and issuing keys from a key dispenser. While JavaFX has served us well, we’re facing challenges with creating responsive layouts that adapt to different screen sizes and orientations (landscape/portrait).

I’ve been considering switching to a more modern framework that offers:

  • Better flexibility and responsiveness (like web technologies).
  • Faster development cycles compared to JavaFX.
  • Ability to handle hardware interactions with devices like EDCs and key dispensers.

After researching, I found that frameworks like Flutter could be an option, as it supports desktop apps and cross-platform development. However, I’m concerned about:

  1. How effective Flutter or similar frameworks are for desktop kiosk apps.
  2. Handling hardware interactions through these frameworks.
  3. Any significant trade-offs or challenges I might face if I move away from JavaFX.

Would Flutter or another framework like Electron or web-based solutions be better suited for such use cases? Or should I stick to JavaFX and find ways to optimize its responsiveness?

Any advice, experiences, or suggestions would be greatly appreciated!

7 Comments
2024/12/01
10:54 UTC

6

Dart Analysis Server - Optimization?

Even when I type out something primitive:

final String s = 'Hello';

The dart analyzer server (dart process) immediately jumps to 100-200% CPU usage (it appears bottlenecked by single-thread performance). If there is an error/warning, each character of the line of code is slowly underlined.

Running "Capture Dart Analysis Server logs", I can see that the server is referencing what appears to be every single .dart file in my project - hundreds of separate files. I do have custom analyzer rules to exclude generated files and unnecessary folders. The server logs from recording a single line of code (declaring a variable; <10 seconds) comes out at 3151 lines, with "package:my_package_name" occurring 4012 times (referencing individual files/packages within my project).

I'm running on a fresh installation of macOS Sequoia, using the latest VS Code. The only VS Code plugins I have enabled are Dart, Flutter, and a theme. All up-to-date official release. The only lint dependency I have is "flutter_lints" 5.0.0.

My specs are:

  • i9-13900k

  • 64GB DDR5 6000

  • RX 6950 XT

  • Gen4 nVME SSD

  • macOS Sequoia 15.1.1

I closed all open files in my project, created an empty dart file and began declaring a variable. The output analysis server log hit 22MB in just 9 seconds of recording.

Does anybody else have this issue? It's driving me insane.

8 Comments
2024/12/01
00:05 UTC

0

How Would You Suggest Developing a Netflix-Like App?

Hey there,
I’m exploring how to develop a Netflix-like app and would love to hear your insights!🙏

What’s on My Mind

  • Tech Stack Dilemma:
    • On the frontend, I’m debating between Flutter, Native (Kotlin for Android, Swift for iOS), and React Native.
    • Currently, I’m leaning toward Flutter, but I’d like to understand its potential limitations for a complex app like Netflix. Are there any major disadvantages I should consider?
  • Streaming Apps in Flutter:
    • Have you seen any great streaming apps built with Flutter? What kind of challenges did they run into?

If you were tasked with building Netflix in 2024, how would you do it?
I’m open to any ideas, tips, or pitfalls to watch out for!

Thanks in advance for sharing your thoughts and experiences!

17 Comments
2024/11/30
18:31 UTC

14

How do you promote your flutter apps?

So the Flutter app is finished and released. So, what's next?

How do you guys promote your app? Are there some pages? Do you make some social media?

I published my next app project two weeks ago, and I guess for most of us, the hardest part is sharing the apps and doing some marketing.

So on all successful indie developers here. What are your advises for us newbie indie devs?

13 Comments
2024/11/30
18:11 UTC

0

What do you think about my video on Cursor? I created a Flutter app with DDD architecture and all work was done by the AI!

3 Comments
2024/11/30
17:16 UTC

0

How and where to learn Dart & Flutter professionally?

Hi Devs.

I want to learn Dart and Flutter from ground up and I have limited programming skill. I've coded in python and java for some very basic things and now I want to learn flutter. I don't mind paying for any services if I have to or hire tutors but I don't know where I can do that or find such platform to begin with. I found most free youtube videos kind of lame and if you can recommend some would be great.

Any help would be much appreciated.

10 Comments
2024/11/30
15:26 UTC

20

Which Backend Would You Recommend for a Flutter Developer with 2 Years of Experience?

Hi everyone,
I’ve been working as a Flutter developer for the past 2 years and am now looking to expand my skills by diving into backend development. There are so many options out there, and I’d love to hear your recommendations.

Some context about me:

  • I have experience with Firebase since it integrates seamlessly with Flutter.
  • I’d like to learn a backend that complements mobile app development well.
  • Ideally, I’m looking for something that’s in demand in the industry and allows me to work on scalable projects.

Should I go with Node.js, Django, Laravel, or perhaps something like Supabase or Appwrite for simplicity? Or would you suggest going deeper into raw Dart for backend development?

Looking forward to your suggestions!

51 Comments
2024/11/30
13:52 UTC

45

Flutter breaks every time I update the sdk to a newer version

Every time I want to install a new package that requires newer sdk version, I experience hell. When I click on the lovely little green triangular button to run my app with a newer version of sdk, my other dependencies start screaming on the terminal especially firebase (almost always), gradle this and gradle that. compatibility issue, version issues, cannot establish connection to some url (gl.google.com/something/something), and all sorts of configuration issues.

The way I solve this is to blindly follow the instructions which I find on the internet which usually includes, pasting a few lines on the gradle files or increasing or decreasing versions of the sdk.

What I hope to seek here is, How do I go about updating my sdk without having to disturb my current state of the app.

34 Comments
2024/11/29
22:54 UTC

4

Riverpod 1 -> riverpod 2

Since there was fine interest in riverpod articles while still it was riverpod 1, migration article came (late I know)

https://medium.com/itnext/flutter-riverpod-2-0-modern-state-management-and-code-generation-ac82bd6dfb6a

0 Comments
2024/11/29
18:39 UTC

4

Best practices for error-handling

What is a good generic way to handle errors without writing error handling code in every UI widget. For example, let's say we have a logged in user performing actions in the app and the login expires (JWT). Then the user tries to perform an action and the server returns error '401 - unauthorized' because it can no longer authenticate the user, whose JWT expired. The reaction of the app should be either a) show an error message and return the user to the login screen or b) refresh the JWT token and continue.

How can a flutter app have a generic error handler that can do these actions, given they are tied to the UI? Showing a dialog or using Navigator to return the user to login screen is tied to `BuildContext` which is a UI dependency. So I don't think that storing a reference to the repository/api-client would be prudent. How do you handle such cases in your apps?

My current approach is having a utility method that takes in the context and an exception to write the error-handling code once. But still I have to call it on every UI that performs an API call with a try/catch. Seems repetitive.

7 Comments
2024/11/29
14:12 UTC

5

Yet another Material/Flutter theme editor

Started working on a Material-UI / Flutter Theme Editor.

Before sinking any more time into this, wanted to know if anyone would actually find this remotely useful?

https://bobbyholmes.net/design_editor/

Given these things already exist, my thoughts to improve on this type of editor would be either a set of predefined themes and/or the ability to save themes to share with others?

Any feed back appreciated (constructive is better) but hey I know its not very fleshed out or functional at this stage.

6 Comments
2024/11/29
04:55 UTC

48

A Free, Flutter Open-Source Mobile Client for Ollama LLMs (iOS/Android)

Hey everyone! 👋

I wanted to share MyOllama, an open-source mobile client I've been working on that lets you interact with Ollama-based LLMs on your mobile devices. If you're into LLM development or research, this might be right up your alley.

**What makes it cool:**

* Completely free and open-source

* No cloud BS - runs entirely on your local machine

* Built with Flutter (iOS & Android support)

* Works with various LLM models (Llama, Gemma, Qwen, Mistral)

* Image recognition support

* Markdown support

* Available in English, Korean, and Japanese

**Technical stuff you might care about:**

* Remote LLM access via IP config

* Custom prompt engineering

* Persistent conversation management

* Privacy-focused architecture

* No subscription fees (ever!)

* Easy API integration with Ollama backend

**Where to get it:**

* GitHub: https://github.com/bipark/my_ollama_app

* App Store: https://apps.apple.com/us/app/my-ollama/id6738298481

The whole thing is released under GNU license, so feel free to fork it and make it your own!

Let me know if you have any questions or feedback. Would love to hear your thoughts! 🚀

Edit: Thanks for all the feedback, everyone! Really appreciate the support!

8 Comments
2024/11/29
01:30 UTC

Back To Top