Flutter Heroes
26.4K subscribers
272 photos
2 videos
31.1K links
Download Telegram
New post on /r/flutterdev subreddit:

Firebase Cloud Messaging - How to effectively use `onBackgroundMessage` callback?
I'm fairly new to Flutter and mobile development so maybe some basic knowledge is missing and my question might seem illogical.I am trying to come up with a reasonable way to use `onBackgroundMessage` callback. The documentation states that the callback can be top level function or static method. This means it has no access to members of a class (when using static method) and can basically access other code via global scope.I might have application architecture where I'm passing instances (singletons) to Flutter widgets of services that might do network requests and update application state. Let's say I want to process data push notification while app is in background. Maybe the notification contains some payload, like event name. I do HTTP request with some payload, some data is returned to me and I want to update my application state with the results. To me it's basically not possible as I might already have services for fetching remote data instantiated as classes, for state management I might be using `flutter_bloc` so I need access to `context` to update my "BLoC".I think I get the point that there are limitations in place to abuse bad behaviour. Apps should not be doing stuff in background or maybe very conservatively. I assume that the background process runs in isolate and it's easier to release resources in dart code when it's just a function?How do people process data in background then? You would at least want to store data coming from data push notification somewhere. I can only think of one way. Creating a class that is instantiated via `factory` constructor where I could store such data so it would have its own internal state. With that I could get a reference to my singleton instance inside the callback and call some method. However I am using dependency injection in my code already and creation of singletons is handled in different way.

June 02, 2021 at 07:27AM by ondrejsy
https://ift.tt/3ifksN5
New post on Flutter Dev Google group:

is flutter.dev working?
Last several days I can't browse https://flutter.dev site: The connection has timed out The server at flutter.dev is taking too long to respond. Is the problem on my side (Kazakhstan) or something else?

June 02, 2021 at 02:44PM by Steepe Hare
https://ift.tt/3fFs7mi
New post on /r/flutterdev subreddit:

New app build with Flutter!
Hi guys, just wanted to show you the new app we made with Flutter!Let me know what you think.iOS -> https://play.google.com/store/apps/details?id=social.yutu.appAndroid -> https://play.google.com/store/apps/details?id=social.yutu.appOf course with null safety enabled!

June 02, 2021 at 01:55PM by adrian_antoci
https://ift.tt/3wLtOnG
New post on /r/flutterdev subreddit:

<b>Top 10 Features Of Flutter 2.2</b>
At the recent I/O conference, the flutter team confirmed that more than 200,000 apps are created with Flutter only in the Play Store. More than one in every eight new apps in Play store are built with Flutter. Popular companies like BMW, Shein, Tencent and new emerging companies use Flutter to create innovative apps. With Flutter 2.2, you get the way out for optimizing, polishing and improving iOS, Android, Web and <a href="https://solaceinfotech.com/blog/10-necessary-questions-to-ask-before-start-desktop-applications-development/">Desktop app</a> performance. Also there are more material icons, automatic scrolling behavior on mobile and desktop, improved text handling and lots of exciting features. Here we’ve curated some more new features of Flutter 2.2.Top 10 Features of Flutter 2.2-1. Dart 2.13-Dart also gets updated with new features accompanied by Flutter 2.2. It brings some new features to its FFI for calling C code, official Docker support and Google Cloud support for Dart backends. It also offers support type aliases that makes code easy to read and maintain.2. Performance Improvements-By using Dart’s split AOT compilation feature, Flutter team has built support for android apps to download modules ahead-of-time resource and code at runtime. They call these installable splits deferred components. It can reduce the initial app size and allow to download features and resources when a user needs them. Whereas, for ios, new update offers new tools to precompile shaders to remove or reduce the first-run jank. Jank occurs when the time to compile shaders goes beyond the time limit. These improved features of Android and iOS are now in preview mode.3. Type Alias-You can create a new name for any existing type and then that name can be used rather than an existing type. Prior to Dart 2.13 users can create a type alias for function now it’s extended to the variable type.For Example:<pre>typedef Length = double; final Length x = 4; Good thing about type alias is- it passes the type equality test also. You can legal to call the constructor on a type alias that names a class. Example: Void main() { debugPrint(double == Length); // True } Benefit of using type alias is that one can make it easy to read code to others. </pre>4. Dart Foreign Function Interface-<pre>FFI is a mechanism for calling C code. FFI has new feature through which users can wrap the inline array directly in dart. Example- class StructInlineArray extends Struct { @Array(8) external Array<Unit8> arr; } Rather than struct MyStruct { Unit8_t arr[8]; } One more improvement in FFI is that it now supports packed structs. And this help to avoid padding to lower overall memory consumption. For instance- @Packed(4) class TASKDIALOGCONFIG extends Struct { @Uint32() external int cbSize; @IntPtr() external int hwndParent; @IntPtr() external int hInstance; @Uint32() external int dwFlags; } </pre>5. Null Safety Update-<pre>Whenever you create a project with Flutter 2.2, it will by default generate a project with null safety. Most of the plugins are relieved to the null safety it is safe to migrate Flutter app to sound null safety. </pre>6. Custom Text Actions-<pre>With Flutter 2.2 users can completely customize the keystrokes associated with text actions. This feature serves lots of possibilities for Flutter developers. For instance, users can send message with ENTER Key while still allowing a new line to be inserted by Ctrl + ENTER. </pre>7. Mouse Cursor Over Text Spans-<pre>You might know that, TextSpan is not a widget. We can change the mouse cursor while hovering over a clickable widget except TextSpan. Now it’s a past with Flutter 2.2 when you are using TestSpan with GestureDetector user will get the corresponding mouse cursor. It supports onEnter and onExit events. </pre>8. Flutter Windows UWP Alpha-<pre>One more update with Flutter 2.2 is for desktop lovers, support for Windows UWP has moved to…
New post on /r/flutterdev subreddit:

Is there a straightforward way to create modal that gets dismissed when the user swipes down?
I know this is more of an iOS paradigm, but is there a way to create a modal in flutter that is dismisable by just dragging down that works on iOS and Android?Example: https://images.squarespace-cdn.com/content/v1/5963d59386e6c005a77134ba/1591209736852-OB5E0Z66EPT13070YU9A/ke17ZwdGBToddI8pDm48kGN-LNnhqarKX6pkakskNDZZw-zPPgdn4jUwVcJE1ZvWEtT5uBSRWt4vQZAgTJucoTqqXjS3CfNDSuuf31e0tVEWBN-lGAmflG_vA8pWdp2bIrZva-qkljkuSBI4mtasNx926scO3xePJoa6uVJa9B4/readit+multiple+modal+views.gif

June 02, 2021 at 04:52PM by purecoaster
https://ift.tt/34D8N2E
New post on Flutter Dev Google group:

IOS error when uploading flutter app to testflight
Anyone ever see this error? It comes up when trying to upload for testFlight? ERROR ITMS-90171: "Invalid Bundle Structure - The binary file 'Runner.app/Frameworks/Pods_Runner.framework/Pods_Runner' is not permitted. Your app can’t contain standalone executables or libraries, other than a valid

June 02, 2021 at 05:23PM by Wes Thierry
https://ift.tt/3fHitzm
New post on /r/flutterdev subreddit:

ELI5: Provider and state management VS shared preferences
I've made a few apps before, mostly recycled code from package examples and what not, since I'm mostly a backend guy and not pro. In most of my apps, I've found it easier to just store (boolean/string) configuration values in shared preferences and local storage/sqflite instead of using provider or some state management setup. Can someone advise between the point of using state management VS storing the variables?

June 02, 2021 at 05:59PM by Akandoji
https://ift.tt/3wUMSjp
New post on /r/flutterdev subreddit:

Bubble chat idea
Hi! I am a software developer and i just had this idea in mind and I would want to ask if it is an interesting idea. Thanks in advance for reading!The app would be a chat app where you could create a chat room with a word that would describe the theme or the subject that would be discussed.The active rooms would be seen as bubbles in your home screen like the agar.io game. By pressing on them you could enter that room and engage on the topic proposed.Does this sound appealing?View Poll

June 02, 2021 at 08:12PM by RedJohn27
https://ift.tt/2S8xdhI
New post on /r/flutterdev subreddit:

Embed UIViewController into UIKitView widget
Hi everybody! I developed a flutter plugin which is essentially a UIViewController that I am currently presenting into “Flutter side”, with a button, as a full screen modal but I am wondering if it is possible to “embed” this plugin into an UIKitView widget. I know I can show native UIViews into this widget but I was trying for a while showing the UIViewController into it with no success and now I’m skeptical al about it. What do you think?

June 02, 2021 at 08:39PM by quetool
https://ift.tt/3uFaNlH
New post on /r/flutterdev subreddit:

Anyone else seeing dartfmt hanging VSCode lately?
Seems to have started happening a couple of weeks ago for me. I see a dialog/alert saying "Saving 'file.dart': Runing 'Dart' formatter (configure)." and it just hangs. I can Cancel, but of course it doesn't format.It seems to be less forgiving of syntax errors in the code than it used to be, which is a problem when you're making lots of changes/refactoring, and just want to save your work, regardless of whether it's currently correct or not.

June 02, 2021 at 08:36PM by DaveWoodX
https://ift.tt/3pfqgaR
New post on /r/flutterdev subreddit:

Flutter Auto Colorized Text Avatar Plugin
Hi,This is Deniz and I've published the Colorized Text Avatar package to help developers to create colorful text avatars based on the users initials.​It is simple but very useful package for both MVP and production applications. Enjoy it! 🔥![Colorize Text Avatar](https://github.com/deniscolak/colorize-text-avatar/raw/master/example/screenshots/img_1.png)All feedback and contributions are welcome!​https://pub.dev/packages/colorize_text_avatar

June 02, 2021 at 09:59PM by Nevurix
https://ift.tt/2S4ETBM