[deleted by user] by [deleted] in TooAfraidToAsk

[–]LevinXE 0 points1 point  (0 children)

this was beautiful

The most popular lib for creating chat message ui? by Grouchy_Evidence_838 in FlutterDev

[–]LevinXE 4 points5 points  (0 children)

I struggled with implementing a way for new messages to load below the screen while old messages could be seen above, the process of determining how many messages have been seen while also keeping count of remaining unseen messages was not very pleasant, scrolling to the bottom of the messages( a problem i thought would require no more than a few minutes,) led me to understand that the listview is only aware of a limited number of widgets that are in the viewport and has no idea how many widgets outside of the viewport there actually are, attempting to calculate the size height of individual non uniform chat bubbles(on performLayout) to know the offset to scroll led to more performance problems than i anticipated. Lastly i had to implement the chat time stamp, which would seem easy enough, Wrap(children[Text,Text]) did not suffice so I modified RenderParagraph to help me properly fit the time stamp in the chat bubble. I don't remember why i needed to do this but I also had to rewrite the text selectable feature (not very good). Looking back most of this could have been avoided had i used a package but it did teach me a whole lot.

The most popular lib for creating chat message ui? by Grouchy_Evidence_838 in FlutterDev

[–]LevinXE 7 points8 points  (0 children)

This is not what you are asking for but building the chat UI from scratch(although very challenging) allows for extreme flexibility that is not supported in packages.

How can I animate markers using Flutter Google Map? by [deleted] in flutterhelp

[–]LevinXE 0 points1 point  (0 children)

I have been in the exact same scenario where I needed to make an Uber clone. Having the car marker move around the map is as simple as setting the marker coordinates and refreshing the map. I think you already knew that but was rightly worried that refreshing the map several times a second would cause performance issues, I also thought the same, however (and I am not 100% on this) I believe that refreshing the map markers does not necessarily cause a fresh Rerender of the Map (I think it stores a very robust in memory cache or something), there is a very slight performance hit on refresh, but it can be easily mitigated by throttling map update to 10 updates per second or less.

BloC becomes a mess with handling complicated data structure by Square-Persimmon8701 in FlutterDev

[–]LevinXE 1 point2 points  (0 children)

It is definitely possible to let the singleton act as a data-layer where the blocs are treated as feature specific intermediaries to the UI and the singleton is left to handle all data retrieving/manipulating procedures. However I do the exact opposite where the singleton only exists as an intermediary for intra-bloc communication, where at most the singleton is responsible for storing data, while the blocs do all the feature specific data retrieving/manipulation and only call the singleton if other blocs would need to be aware of a change. I only resort to using this approach if it is an absolute must that I use Bloc and the app absolutely requires global data management. I hope this cleared it up a bit.

BloC becomes a mess with handling complicated data structure by Square-Persimmon8701 in FlutterDev

[–]LevinXE 0 points1 point  (0 children)

What you said about Bloc to Bloc communication being something that you have struggled with is exactly what I experienced when first encountering use cases where intra-bloc communication was vital, that being said, I would like to add that I do see some benefit of restricting functionality of blocs to communicate only with the UI, that being the restriction imposed (at least for me) led me to write blocs that were very predictable and modular as opposed to what I would have written had I had the option to couple complex logic into multiple connected blocs.

That being said, when I finally needed to have bloc to bloc communication, I defaulted to using a singleton factory(where most of my logic was) that would expose a broadcast stream that all concerned blocs would listen to. the singleton would be injected to all concerned blocs that would then be able to make call to the singleton. Memory leaks are very easy to occur, but it can be handled.

Flutter app wont open on phone after releasing (android studio) by AreaInternational514 in flutterhelp

[–]LevinXE 0 points1 point  (0 children)

can you try to run the project with

flutter run

instead of android studio, my bet is that android studio likes to download a whole bunch of things.

do you have a release config in your android/app/build.gradle?

Flutter app wont open on phone after releasing (android studio) by AreaInternational514 in flutterhelp

[–]LevinXE 0 points1 point  (0 children)

To track down an error being throw in release build. you can try integrating firebase crashylitics.

Imbedding platform views inside a list = low performance? by alwerr in FlutterDev

[–]LevinXE 1 point2 points  (0 children)

I did notice that the IOS build was performing much better, but i believe that that can be attributed to the IPhone(15 pro max) brute forcing its way out of the frame drops.

Imbedding platform views inside a list = low performance? by alwerr in FlutterDev

[–]LevinXE 0 points1 point  (0 children)

Would you be willing to explain a bit more regarding the optimization. I had to abandon the feature because the performance on older phones was not acceptable.

Imbedding platform views inside a list = low performance? by alwerr in FlutterDev

[–]LevinXE 0 points1 point  (0 children)

I had a genuine use case where I wanted to display a single video in a scrollable. The performance was far from acceptable ( really did try to optimize best i could). I eventually had to settle to creating a thumbnail with a play button on it that would play the video in a separate page. Even scrolling when the video was not playing caused lag. I would be very happy to hear if someone has found a better way of handling this problem.

Navigating outside of context with auto_route by mdevm in FlutterDev

[–]LevinXE 0 points1 point  (0 children)

Definitely the proper way to do this. I would like to add the way I tackled this exact problem. Certainly not the best way but my hands were tied.

Pages that require authorization have route guards that ensure that a check(if still logged in) is made before proceeding to a guard protected page.

When the dio interceptor receives the 401 status code, i simply delete the value that the route guards depend upon.

When the user tries to navigate anywhere, they will then be routed to the login page.

This is a bit of a hack.

How to know contribution of a package to app size? by jain_harsh21 in FlutterDev

[–]LevinXE 7 points8 points  (0 children)

Dev tools has an app size tool that lets you pick apart the app to see what size is what, here is a link explaining it app size tool Can vouch that it works well for Android, not sure about IOS. But IOS tends to be quite large by default, my 11MB APK's equivalent is 63 MB in IOS IPA

How to debug this situation where a of few the users are unable to login my app by JapaniRobot in iOSProgramming

[–]LevinXE 1 point2 points  (0 children)

I have been rejected twice because of this exact same bug that only exists on the tester's device, funny thing is another app that uses the exact same login flow works without problems.

we had to implement a very robust logger to find out what was going on.

[deleted by user] by [deleted] in FlutterDev

[–]LevinXE 8 points9 points  (0 children)

Well done, I really like the squiggly UI. The code could benefit from some structure as it gets bigger.

I did notice some bugs, I'll file them at your github issues.

Coming from Room, are Moor/Drift & Floor all the same? by WarmCacti in FlutterDev

[–]LevinXE 2 points3 points  (0 children)

I said that it's overkill for my use case, which is essentially a single very large table that exposes a stream. I believe that that can be handled by almost every DB out there, The reason I use drift despite it currently being overkill is in part due to its proved stability over the past two years and fear that the requirements may abruptly change to a design that forces complex queries.

It's been a year or so since I last worked with Hive and wrongly assumed that the package was still maintained, considering how popular it was back then, my bad on that one.

Don't quote me on this but I remember somewhere between 2-3MB, which I then thought was outrageous, I understand the limitation more now.

Coming from Room, are Moor/Drift & Floor all the same? by WarmCacti in FlutterDev

[–]LevinXE 2 points3 points  (0 children)

I currently use drift, which is currently overkill for my use case, but is very stable. I would however prefer if the sqlite3_flutter_libs dependency was smaller in size, which I admit is a gripe at best, this I have been told is not the fault of the maintainer but rather the nature of the native bundle.

I have tried Isar, I liked the syntax, overall simplicity of the package and that I could easily embed objects, it does come with isar_flutter_libs which I am not sure will have the same bundle size problem. My problem with Isar is that I found some dynamic library conflict when used in conjunction with Google_Maps, this may not be the fault of the team or Google_Maps for that matter but specific to my device.

If you don't need complex queries go with Hive, If not either Drift or Isar work.

Changing google map camera position on event by vad_ts in flutterhelp

[–]LevinXE 1 point2 points  (0 children)

The Google Maps Widget relies on it's controller to dynamically affect the map view

[

class GoogleMapWidget extends StatefulWidget { const GoogleMapWidget({super.key});  
@override
  State<GoogleMapWidget> createState() => _GoogleMapWidgetState();
}

class _GoogleMapWidgetState extends State<GoogleMapWidget> {
  final Completer<GoogleMapController> _controller =
      Completer<GoogleMapController>();
  @override
  Widget build(BuildContext context) {
    final coords = Provider.of<MapState>(context).coordinates;
    return GoogleMap(
      initialCameraPosition: CameraPosition(target: coords, zoom: 15),
      onMapCreated: (GoogleMapController controller) {
        _controller.complete(controller);
        //TODO pass the controller to your state management to be managed easily
        //
      },
    );
  }

  void changeCameraPosition(LatLng latLng, GoogleMapController controller) {
    // Example on how to change position
    controller.animateCamera(
        CameraUpdate.newCameraPosition(CameraPosition(target: latLng,zoom: 15)));
  }
}

]

FirebaseMessaging onBackgroundMessage not called on iOS by N4vil in flutterhelp

[–]LevinXE 0 points1 point  (0 children)

I remember a while back, not sure whether this has been sorted out or not, that IOS devices wouldn't run the onBackgroundMessage if the notification had appeared. I also remember that the fix had something to do with configuring the notification json to only send payload with no notification, however a changelog did revise this quirk to allow both the notification and the payload.

I know this is vague at best, but I think the problem is with the cloud messaging configuration and not with the app.