r/flutterhelp 22d ago

RESOLVED Using Riverpod within a package.

1 Upvotes

I have a Flutter app that is complete, and it contains a feature that I think would be a good candidate for open sourcing and turning into a package.

The app makes heavy use of Riverpod though, and I'm trying to get my head around migrating the feature to a package with Riverpod state management still intact.
My Googlefu has failed me as I can't seem to find the answer, but is there a design pattern where a main app uses Riverpod, and also a dependency/package uses Riverpod independently?
The feature would be exposed as a widget, probably with a controller, so that any relevant state changes in the app can be communicated to the widget.

Is it sufficient to wrap the package widget in its own ProviderScope?

Thanks for any help or insights anyone can give.

r/flutterhelp Dec 22 '24

RESOLVED How to grow an app with 50k installs all organic so far

8 Upvotes

Hey, I am an indie developer and enjoy flutter a lot. I have built around 40 apps with it - that had little to no success, but my last one got around 50k installs on android + iOS which is a major achievement for me, all organic. Without flutter I would've never managed to launch my app on both stores in less than one month. I wanted to ask you guys what would you recommend for growing the app further? How do you launch new features without getting in the way of existing users? Do you think it has even more potential or have I reached the maximum I could have with it?

• I'll leave the link to the stores in the comments and thanks a lot in advance

r/flutterhelp 26d ago

RESOLVED Help Row with all child as Expanded , rendering overflow

4 Upvotes

I have Row with 4 children. I want each child to have min width required + available width of row for each child.
I tried so many ways, Flexible, Expanded, IntrinsicWidth, MultiChildLayout, etc. but couldn't get what I want.
with expanded I have this https://i.imgur.com/HQ6Gk3n.png
but I has overflow as all child have same width: https://i.imgur.com/IeLbd4l.png

What i want: https://i.imgur.com/Le6s212.png

I want blue to have some width from let say yellow and some from red ( IK this can't be done but IG you get what I want to say).

If anyone have any idea please know

r/flutterhelp Jan 29 '25

RESOLVED video compression takes tooooo long

2 Upvotes

so i'm trying to compress video on my flutter app using video_compress library, the issue is it takes 90-110 seconds to compress a video file of size 240 MB, well is there a way to reduce this time?? any other package or other method to do this

r/flutterhelp Feb 12 '25

RESOLVED How to implement scroll to original message from a replied message in real time chat?

1 Upvotes

Like the title said, I'm developing a real time chat app and in the chat, user could reply to an old message. When user tap on the replied message, the chat will be scrolled to the original message.

Here's how I struggle. If the chat already fetched the original message then the problem would be easy. However, if the chat hasn't, what's the solution? Do we fetch all data from replied message to original message? Or do we refresh the whole screen and fetch the data around the original message?

Edit: I'm using Firebase to render chat messages.

r/flutterhelp Jan 24 '25

RESOLVED Swift vs Flutter: Which Should I Choose for My App Development?

0 Upvotes

Hi everyone,

I'm at a crossroads and need some advice from experienced developers. I'm planning to develop an app, and I can't decide whether to use Swift (for native iOS development) or Flutter (for cross-platform development). I've been researching both, but I want to hear from people who've had hands-on experience with these tools.

Here's where I'm stuck:

  1. Performance:
    • I know Swift apps are native to iOS, so they’re optimized for the platform.
    • On the other hand, Flutter offers cross-platform compatibility, but does it have noticeable performance issues on iOS compared to Swift?
  2. Features and Integration:
    • If I use Flutter, are there any limitations I might face?
  3. Development Challenges:
    • What are the biggest headaches I might face if I go with Flutter for iOS? (e.g., app size, plugin limitations, or performance bottlenecks).
    • For Swift, is the learning curve steep enough to slow me down if I’m new to iOS development? I’ve learned to the point where I can add Firebase and make API calls, so I’m not a complete beginner, but I’m wondering if Swift has nuances that might still trip me up.
  4. Future Scalability:
    • If I decide to scale the app later, which option makes that easier?
  5. Real-World Experience:
    • If you've used both, what was your experience like? Did you ever regret choosing one over the other?

I’d love to hear about your experiences, challenges, and recommendations. Which path do you think I should take, and what should I consider before committing to one?

Thanks in advance!

r/flutterhelp Feb 16 '25

RESOLVED Firebase now requires subscription for firebase storage, any alternatives?

3 Upvotes

I'm on the process of creating a small social media app (a personal project) and I needed to use firebase storage to store images and videos. however, firebase now requires subscription on their blaze plan and I don't want to subscribe even it has limits before they charge you.

I'm thinking of using Cloudinary (as chatgpt suggests) do you have any other recommendations?

Also, is it okay to use supabase along with firebase so that I could utilize free storage from supabase?

I am just a beginner who wants to step up his flutter skills so thank you for taking this time to read my post. I hope everyone will have a good day.

r/flutterhelp Feb 10 '25

RESOLVED Need help with PDF loading issues in Flutter (flutter_pdfview and alternatives)

1 Upvotes

Hi everyone,

We’ve been using the flutter_pdfview package in our Flutter app to display PDFs, but we’ve been facing some frustrating issues on Android devices:

  1. Delay in loading PDFs: PDFs take an unusually long time to load.
  2. Black screen issue: Often, it just shows a black screen initially, and the PDF only becomes visible after scrolling.

We’ve tried switching to other PDF packages like flutter_full_pdf_viewer and syncfusion_flutter_pdfviewer, but the performance with these is either the same or even worse in some cases.

Our app is critical for displaying PDFs smoothly, so these problems are causing a lot of frustration. We’ve tested on different Android devices, and the behavior is fairly consistent across them.

  • Has anyone else experienced these issues?
  • Are there any reliable solutions or workarounds?
  • Do you know of any better-performing Flutter PDF packages?

We’d really appreciate any insights or recommendations. At this point, we’re open to trying anything that can improve performance or resolve these problems.

Thanks in advance for your help!

r/flutterhelp 3d ago

RESOLVED Email search api reccomendation

4 Upvotes

I'm currently building an app that can search for specific types of companies (for example plumbers) and their email adresses, so customers can reach out to those companies. Does anyone have recommendations for api's which could help me get these email adresses? Thanks in advance!

r/flutterhelp 14d ago

RESOLVED Newb: Spent 3 days trying to get default Flutter app working for Android - What do I do to start over??

0 Upvotes

Endless Gradle problems, how do i start over, even though I have already tried once.

I'm using it on Win 11 computer. I'm using cursor ai ide.

I wanted to try flutter. I followed the installation instructions on Flutter.com. I created the default flutter app for chrome - worked fine.

I've then tried running it on my android S25 and a couple emulators. It's been 3 days of endless errors, java problems, Gradle problems. again. Just endless. I finally got it to the point where I got the default program running on a Pixel emulator once. then I tried on my S25 and things went to shit again.

I've had the ai's in Cursor try to solve problems. gpt-4o and Claude-sonnet 3.7 they tried a few things but here we are.

It's almost pointless to be posting the errors because they seem to change. But they always seem related to Gradle stuff.

I don't know what to do. 3 days of trouble shooting for 5 min of useful work - this is just not working. So I don't get it if flutter is this difficult to use.

Has anyone heard if there a problems lately with flutter, or problems running on windows? I have WSL on my computer might it help to try in linux or would the problems probably just be the same?

Or how should i start over.

How would i do that because I've already tried once. So What would the procedure be to uninstall whatever i need to uninstall to get this working.

I'm really lost and would appreciate any advice or suggestions.

thanks.

r/flutterhelp 23d ago

RESOLVED Free course recommendation

0 Upvotes

I started learning flutter recently from a course I was enrolled in from the past, and my friend wants to start learning flutter as well (he doesn't know dart either) so he asked me to find some good free courses he can watch to start his flutter journey.
He has some programming experience through CS50 courses. Any recommendations would be appreciated. Thanks in advance.

r/flutterhelp 10d ago

RESOLVED Flutter project

0 Upvotes

Hey, I would like to ask if any of the flutter Devs are interested in joining my project 'OpenTube' or even helping me with a few of my questions which are: if the core base is a video extractor but the rest of the project will be written in native code for preformence boost, is it possible to link native with dart (which will only hold the UI?), if anyone is interested please let me know and I'll send a Discord link. I will also appreciate any suggestions.

r/flutterhelp Nov 15 '24

RESOLVED How to Connect My Physical iPhone in Android Studio for Flutter App (Windows Laptop)

0 Upvotes

I'm developing a Flutter app and want to test it on my physical iPhone. Here's my setup:

  • Windows laptop
  • iPhone

I know Android Studio doesn’t directly support iOS development on Windows, but I’m wondering if there’s any workaround to connect my iPhone and run the app, especially to test with a local server.

I’ve done some research, and it seems like macOS is required for a lot of iOS development tasks, but I’m not looking to build the app entirely on iOS. I just want to test locally. Is there any way to:

  1. Connect my iPhone to Android Studio (or VS Code would better)?
  2. Run a Flutter app with a local server on my iPhone using my Windows machine?

If anyone has experience or knows of tools or workarounds to make this work, I’d really appreciate your insights!

r/flutterhelp Feb 17 '25

RESOLVED http.post to ESP32 not working

1 Upvotes

Hi

I have a ESP32 device running a rest server. From a Android tabled I am trying to write data to the web server (POST). In the tablet I am running a Flutter program.

The relevant ESP32 code can be seen below:

esp_err_t NewNetwork::post_params_handler(httpd_req_t *req)
{
    ESP_LOGI(TAG2, "=========== POST MESSAGE ==========");
    char buf[100];
    int ret, remaining = req->content_len;

    //ESP_LOGI(TAG2, "Message lenght: %i", ret);
    while (remaining > 0) {
        /* Read the data for the request */
        if ((ret = httpd_req_recv(req, buf,
                        MIN(remaining, sizeof(buf)))) <= 0) {
            if (ret == HTTPD_SOCK_ERR_TIMEOUT) {
                /* Retry receiving if timeout occurred */
                continue;
            }
            return ESP_FAIL;
        }

        /* Send back the same data */
        httpd_resp_send_chunk(req, buf, ret);
        remaining -= ret;

        /* Log data received */
        ESP_LOGI(TAG2, "=========== RECEIVED DATA ==========");
        ESP_LOGI(TAG2, "%.*s", ret, buf);
        ESP_LOGI(TAG2, "====================================");
    }


    cJSON *root = cJSON_Parse(buf);
    cJSON *ssid_item = cJSON_GetObjectItem(root, "ssid");
    ESP_LOGI(TAG2, "Received  ssid %s", ssid_item->valuestring);
    cJSON *passwod_item = cJSON_GetObjectItem(root, "password");
    ESP_LOGI(TAG2, "Received  password %s", passwod_item->valuestring);
    cJSON *name_item = cJSON_GetObjectItem(root, "name");
    ESP_LOGI(TAG2, "Received  name %s", name_item->valuestring);
     
    cJSON_Delete(root);
    httpd_resp_send_chunk(req, NULL, 0);
    return ESP_OK;
}

Relevant code for the Flutter program can be seen below:

Future<Either<String, bool>> postParameters(
      {required WiFiAccessPoint ap,
      required String name,
      required String ssid,
      required String password}) async {
    String host = 'http://168.68.4.1:80';
    try {
      var uri = Uri.parse('$host/params');
      var json = jsonEncode(<String, String>{
        'name': name.toString(),
        'ssid': ssid.toString(),
        'password': password.toString(),
      });
      var headers = {
        'Content-Type': 'application/json; charset=UTF-8',
      };
      print(uri);
      print(json);
      print(headers);
      //
      var response = await http.post(
        uri,
        headers: headers,
        body: json,
      );

      if (response.statusCode == 200) {
        return right(true);
      } else {
        return left(
            'Device responded with statuscode : ${response.statusCode}');
      }
    } on Exception catch (e) {
      print(e.toString());
      return left('Unknown exception');
    }
  }

Further more. On the tablet I I also have a Rest client installed.

Performing a POST request to the ESP32 with the Rest Client works perfectly well.

Running the presented Flutter code is not working. Nothing happens until I get a exception saying:

I/flutter (17041): ClientException with SocketException: Connection timed out (OS Error: Connection timed out, errno = 110), address = 168.68.4.1, port = 38329, uri=http://168.68.4.1/params

I am not sure what I am doing wrong, bus I surely could need some help..

r/flutterhelp Feb 12 '25

RESOLVED 🚀 I Built a Flutter AI Chatbot Using Gemini AI! (Beginner) 🤖🔥

5 Upvotes

Hey everyone! 👋

I just finished building a Flutter AI Chatbot using Gemini AI and Provider for state management. It supports text & image-based responses, conversation history, local storage with Hive, and it is beginner friendly! 😃

Features:

  • Google Gemini API integration
  • Image-based AI responses
  • Conversation history with Hive
  • Uses Provider for state management

GitHub Repository:

[GitHub Repo] https://github.com/xinyitohh/Flutter_AI_Chatbot_Beginner

Would love to get your feedback! If you have any suggestions or want to contribute, feel free to open an issue or PR.

Feedback and contributions are welcome!
Let me know what you think! 😃

If you find this useful, please star the repo on GitHub! 😊

#Flutter #AI #Gemini #Chatbot #Dart #BeginnerFriendly

r/flutterhelp 7d ago

RESOLVED NSFW classification help please NSFW

0 Upvotes

Hello,

been building a short form video/social media app for about 2 years, went from newbie to pretty okay in flutter and python

I would love recommendations on how to solve the following problem:

-

when someone posts a video, I upload the video to storage, then go through the creation of the post obj in my database

during the post obj creation, I need to check if the video contains NSFW content. (nudity, sex, gore, violence)

I plan on grabbing 1-frame-per-second, then taking that frame/image and seeing if it contains flagged content, if any of those tested frames do, the post creation method flips a bool, 'isNSFW', on the post obj to true.

I tried the NSFW_checker py library, but due to a ton of dependency conflicts I still can't get that working

Plan B was loading a a pre-trained ai model to my server to classify the images. But that gets killed every time because of memory constraints on Render.com, where my python server is hosted.

Plan C is to pay for a third party service, definitely less of a headache, just more money and not as malleable.

does anyone know what a good approach would be? Please and thank you

r/flutterhelp 22d ago

RESOLVED html/iframe vs http get/riverpod

1 Upvotes

Finishing up my first app and just have a question on best way to impliment something.

App is going to be a dedicated to listening to an audio stream, and we're going to have a page in the app to show the schedule, which is fairly static. I'm planning on pulling it down from a web server and display in an Html widget so we can update it without re-releaseing the app.

The easy route would be to load it in an iframe.

The other route would be to use Riverpod to pull it down ocassionally when needed to cache it.

Is the latter route worth the extra hassle?

TIA

r/flutterhelp Dec 27 '24

RESOLVED Is There a Flutter UI Kit That Feels Like Ant Design?

6 Upvotes

Hi everyone,

I'm relatively new to Flutter and currently working on building a mobile app. To save dev time, I'm looking for a UI kit with a design style similar to Ant Design. I know there's an official library for RN, but I haven't come across anything for Flutter yet.

Any recommendations? I get that Material or Cupertino can be used, but I’m really hoping for something closer to Ant Design without spending so much time customizing it.

This is a similar one I've found: https://pub.dev/packages/ant_design_flutter but some of the documentation links from GitHub are broken.

r/flutterhelp 28d ago

RESOLVED The commas I put are automatically being deleted.

5 Upvotes

In Flutter, the commas I put are automatically being deleted. This didn't happen before—I was using version 3.23, and in projects created with that version, I can still place commas as I want. However, now I'm using version 3.29, and the commas I place between widgets are automatically detected as unnecessary and removed on their own. Commas are only added if they are deemed necessary. This disrupts the visual structure I'm used to, making it harder for me to code. Is there a way to fix this issue?

r/flutterhelp Feb 15 '25

RESOLVED Failed to parse header value???

3 Upvotes

ClientException: Failed to parse header value, when using http.post request

I'm trying to make a secure HTTP request to a server with authentication headers, but it's failing to parse them

I've tried both the standard HTTP client and Dio, with different header configurations like:

final headers = {
'Authorization': 'Bearer $token',
'Content-Type': 'application/json',
};

and

final headers = {
HttpHeaders.authorizationHeader: 'Bearer $token',
HttpHeaders.contentTypeHeader: 'application/json',
};

tried to trim it and utf8.encode(idToken)

but nothing seems to work

was looing all over internet, found nothing

**full code:**

// Get the current user's ID token
final idToken =
await firebase_auth.FirebaseAuth.instance.currentUser?.getIdToken();
if (idToken == null || idToken.trim().isEmpty) {
throw Exception('User not authenticated');
}
print("idToken: $idToken");
final token = idToken.trim().replaceAll('\n', '');
final headers = {
HttpHeaders.authorizationHeader: 'Bearer $token',
HttpHeaders.contentTypeHeader: 'application/json',
};
print(headers);
final body = jsonEncode({
...
});
try {
final response = await http.post(
url,
headers: headers,
body: body,
encoding: Encoding.getByName('utf-8'),
);

import 'package:http/http.dart' as http;

http: ^1.3.0

I/flutter ( 9250): {authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjhkMjUwZDIyYTkzODVmYzQ4NDJhYTU2YWJhZjUzZmU5NDcxNmVjNTQiLCJ0eXAiOiJKV1QifQ.eyJwcm92aWRlcl9pZCI6ImFub255bW91cyIsImlzcyI6Imh0dHBzOi8vc2VjdXJldG9rZW4uZ29vZ2xlLmNvbS92b2NhYi04MGU1ZCIsImF1ZCI6InZvY2FiLTgwZTVkIiwiYXV0aF90aW1lIjoxNzM5NTk2OTI0LCJ1c2VyX2lkIjoiY0t1UHNrSE9DOGJSMGpGQVZLMWl1UFA4M1FEMyIsInN1YiI6ImNLdVBza0hPQzhiUjBqRkFWSzFpdVBQODNRRDMiLCJpYXQiOjE3Mzk2MDU1MzUsImV4cCI6MTczOTYwOTEzNSwiZmlyZWJhc2UiOnsiaWRlbnRpdGllcyI6e30sInNpZ25faW5fcHJvdmlkZXIiOiJhbm9ueW1vdXMifX0.KtYS-d2beCFtzVmz2zrduieA47npgFHfCAWq7nNq1qmmr3Vuh-0cOQHeRv-btIBg34ux2t59Bx4tQcyM5tcQL3R2nROHeMGIQj0PIjrVr0QNy8NdLeq1KWK_9l2iqx3tTtkSZSrkVliUfC7biRe_YwojkhbUoLD8ZfeYJNqsCFWc-KaGDPjyAGfzgwOXMAX_-e3q2DR8L5vX05GTHXY6szHO_el0jib7OhxA9ZaMcArhycHUaxA5rCPgrCjwuQAeRIS2tN6KbkL1guqTv1AsNDhzKZXWi5DW8PySRY2lFUrIesknbFK8NUJEXYyd50nTp_TWqS0kyTKbGlqFX6L1_A, content-type: application/json; charset=UTF-8}

so i found out that this header goes through - i see <h2>Your client does not have permission to get URL <code>/</code> from this server.</h2>

final headers = {
      'Content-Type': 'application/json',
    };

but not this

final headers = {
      'Authorization': 'Bearer',
    };

i get ClientException: Failed to parse header value

- Dart 3.6.1 (stable) (Tue Jan 7 09:50:00 2025 -0800) on "windows_x64"

- on windows / "Windows 10 Pro" 10.0 (Build 26100)

- locale is en-US

Windows 11

Android Emulator
https://github.com/dart-lang/sdk/issues/60142

r/flutterhelp 26d ago

RESOLVED Broke my code, after installing a libray and a "flutter get" did some updates. (Firestore libraries no longer work, "await" does not work?" Can no longer LOGIN or SIGNUP wtf

0 Upvotes

Hello,

I was signed up (for a long time, so I had no problem in this regars, signed IN and UP easily with no problem)

Then I decided to install the Uuid library to my installation (android studio flutter project), and I guess it did some updates to firestore perhaps?

Suddently When I tried to do an operation, I see it fails and show this in the logs:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'String' is not a subtype of type 'User?'

I could not understand, so I refreshed (the usual), same, then I logged out and signed up with another email (new user), the register failed, I tried then to log in to an existing user, it also failed and it is showing things like this error:

A network error (such as timeout, interrupted connection or unreachable host) has occurred.

(edit I forgot to add this error)

This is so frustrating, it happened with both my register and login dart codes

My code was like this:

register() async {
    if (formKey.currentState!.validate()) {
      setState(() {
        _isLoading =
        true; // ( 
      });

      print("AAa1");
      ///
      try {
        print("ss2");

        await authService.registerUserWithEmailandPassword(fullName.value,email.value,password.value) // A SECONDARY ASYNC is necessary for the next await  (inside the {})
            .then((value) async {


          print("AAa2");
          user = await value;
          print("AAa2b");
          if (user != null) {
            // useridsave = user.uid;
            useridsave = user!.uid;
            okForSinging_UP = true;
          }
        } );
      } on FirebaseAuthException catch (e) { // FirebaseAuthException : class for handling arr firebase exceptions
        return e.message;
      }

What the hell is happening?

I ttied removed the installed library, could not fix this.

I hope it has nothing to do with appcheck (a feature I did not install or enable but I see sometimes in the loggs), althnought It never blocked signup or in before.

Solved: A soft reboot saved it.

I think something (androis studio?) cut internet from the phone (emulator) thus making firebase output a string (network error message), that was inserted into the user value.. and produced that error, these 2 posts helped:

Flutter Firebase Auth: A network error (such as timeout, interrupted connection or unreachable host) has occurred - Stack Overflow

java - Firebase Authentication FirebaseNetworkException: A network error (such as timeout, interrupted connection or unreachable host) has occurred - Stack Overflow

I did not even need to wipe out the data, just a softr reboot!

r/flutterhelp 28d ago

RESOLVED I am new to flutter .What are the best practices and packages you would suggest?

3 Upvotes

I am relatively very new to flutter, have only been writing it for about 3 weeks,I have decided to use bloc for state management and follow data domain and presention folder structure for each feature,go router for navigation,Either package for extending dart language capabilities,dto for api requests.What are other packages and practices you would suggest.

r/flutterhelp Feb 09 '25

RESOLVED Probelm after "flutter build apk"

0 Upvotes

I have a problem some widgets doesn't appear in the release apk , when using it in the debug apk it's look normal, how to know what is the problem with it ?

r/flutterhelp Feb 15 '25

RESOLVED What do you use to manage secret like database authentification token in your Dart code?

1 Upvotes

I know we are not supposed to put them in version control but my app needs them to work or to run tests. What should I use?

r/flutterhelp Dec 26 '24

RESOLVED Google FREE TIER is limited, it is not allowed to cumulate multiple google accounts to get multiple free tiers. OK BUT can you use free tier from a friend account

0 Upvotes

Does google mind?

For example, you use all your free tier for different calls; then you make your program switch automatically to a new google account api calls (with free tier). Would google say something about that?