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

Provider vs Get_It - Memory consumption test
I'm considering switching to Get_It from Provider as my default singleton provider.In order to measure if are there some impact in memory consumption, I've created some simple code to profile how each solution manages the lazy allocation of objects in memory.The test consists on monitoring the memory consumption while the number of registered singletons grows.By running Flutter in "profile" mode, from Dart DevTools, I got the following results :get_it: 3.1.0Implementation:GetIt sl = GetIt.instance;sl.registerLazySingleton<AppGlobalState>(() => AppGlobalState());sl.registerLazySingleton<JustALazyLoadingTest1>(() => JustALazyLoadingTest1());...sl.registerLazySingleton<JustALazyLoadingTest10>(() => JustALazyLoadingTest10());Results - (size, count, accumulator)1 Singleton, 1 used (24, 1, 1)2 Singletons, 1 used (24, 1, 1)11 Singletons, 1 used (24, 1, 1),11 Singletons, 6 used (24, 1, 1),Provider: 4.0.1Implementation:MultiProvider(
providers: [
Provider<AppGlobalState>(create: (_) => AppGlobalState(),),
Provider<JustALazyLoadingTest1>(create: (_) => JustALazyLoadingTest1(),),
...
Provider<JustALazyLoadingTest10>(create: (_) => JustALazyLoadingTest10(),),
])In order to allow multiple singletons, Provider uses two objects, so, for each test, consider the results of "Provider" + "Multiprovider".Results - (size, count, accumulator)1 Singleton, 1 used (40, 2, 2)Provider (24, 1, 1)MultiProvider (16, 1, 1)2 Singletons, 1 used (64, 3, 3)Provider (48, 2, 2)MultiProvider (16, 1, 1)11 Singletons, 1 used (280, 12, 12)Provider (264, 11, 11)MultiProvider (16, 1, 1)11 Singletons, 6 used (280, 12, 12)Provider (264, 11, 11)MultiProvider (16, 1, 1)ResultsGet_It had a better performance in all tests. No matter how many lazy singletons it holds, the memory consumption will be the same.In Provider, memory consumption grows as more lazy singletons are added to. Besides to "Provider" object, it also loads "MultiProvider", which makes using MultiProvider more expensive even if there's only one singleton.In both packages, the quantity of lazily instantiated objects had no impact on memory usage beyond the normal size of each single object.GitHub repos:Provider Test: https://github.com/carnevalli/flutter-provider-memory-consumption-testGet_It Test: https://github.com/carnevalli/flutter-getit-memory-consumption-test

January 13, 2020 at 07:22AM by carnevalli
https://ift.tt/30gRTUy
New post on Flutter Dev Google group:

Issue with installation of flutter
Hello team, I have issue with installation please give me solution for this error . following is attachment.please give me solution as soon as possible. [image: Untitled 1.png] thanks and regards indrajeet patil

January 13, 2020 at 08:41AM by Indrajeet Patil
https://ift.tt/30hs6ve
New post on Flutter Dev Google group:

FCM Integration with Flutter Web
Hi Team Can we integrate FCM with Flutter Web? I could not find the any link for FCM Integration with Flutter Web. I got for Android and IOS. Thanks Gaurav Dixit

January 13, 2020 at 10:24AM by gaurav dixit
https://ift.tt/35MdWDQ
New post on /r/flutterdev subreddit:

Flutter Europe conference 2020
Hi all, do you know if the coming Flutter Europe conference of January 2020 will be available on live streaming?Tickets are sold out.https://fluttereurope.dev/

January 13, 2020 at 11:13AM by marcodeka
https://ift.tt/3a6PMqY
New post on /r/flutterdev subreddit:

What is the best way to package preload api data which is subsequently saved in sqflite so that when users download the application they can do some sql query of the database data immediately?
The data coming from the api has a lot of information and I wish to only store certain values into the database (e.g. only id, name etc). Ideally it will be great if the data is stored into the database once the user install the application, else I'm also open to other methods like running a miniscript to do a api call and convert the data and store it on the first instance. I'm intending to provider for state management (in the midst of trying to convert from bloc). Thank you in advance as I am still a Flutter beginner.

January 13, 2020 at 11:33AM by lightcomet
https://ift.tt/2QLIfWN
New post on Flutter Dev Google group:

MAKING A FLUTTER WEB PAGE READY FOR PRINTING
Hello guyz, I've been working on a project and i need to generate a certificate which we can print, but im not able to setup its page for a print view, i always get unwanted space at the bottom. Is there a way to make flutter webpage ready for printing process?plz help

January 13, 2020 at 12:03PM by vinay sharma
https://ift.tt/2FMQk7r
New post on /r/flutterdev subreddit:

How does `build` occur from root to leaves?
Hi Hackers,I've tried tracing through the source to answer this but I get a little lost in the Flutter machinery. We pass runApp a Widget, which becomes the root widget of our app. That widget must implement build, which returns a Widget.Does Flutter just use simple recursion to call build on that returned Widget, and so on, for the Widget returned by each subsequent child's build method?While recursing, and it encounters a StatelessWidget, does Flutter do a type check to call createState instead of build, and then perform an extra step, calling build on the State that createState returns?How does the recursive / chain of calls to build methods stop? For example, the Text widget has a build method that returns a RichText widget, which is a MultiChildRenderObjectWidget. Does Flutter again do type checking here and stop calling build and instead invoke createElement, which in the end generates the elements for the Element tree?

January 13, 2020 at 02:11PM by yjblow
https://ift.tt/2sgNjce
New post on /r/flutterdev subreddit:

Flutter Python: Firebase like backend in Flutter using Python! (MongoDB and WebSocket)
https://ift.tt/35Pb1ds

January 13, 2020 at 03:28PM by abhay994
https://ift.tt/2NntZ4p
New post on /r/flutterdev subreddit:

Flutter Tap Newsletter Week 21 - Articles, tutorials, videos and much more
https://ift.tt/383yaKQ

January 13, 2020 at 04:17PM by vensign
https://ift.tt/35LTcvF
New post on Flutter Dev Google group:

Flutter Geofencing permission only one
Hello , I am looking to activate one part of my app only after confirming the user location , but this has to be confirmed only first time when the user starts the app . Is there a way to achieve this . Regards

January 13, 2020 at 06:43PM by Nikesh Bhansali
https://ift.tt/30idBHD
New post on /r/flutterdev subreddit:

Which package to use to consume a REST API: Dio or Chopper?
I'm implementing a quite complex mobile application in Flutter thus I need to make a good decision here before going on and implementing the consumers of the API. I also saw Retrofit, no changes were made since 2 months thus I will not consider it for the moment. My time is limited thus I do not want to spend time forking and adding implementation myself.I wrote code using both Dio and Chopper. In the architecture I implemented in my project, a simple authentication(refresh token) request is implemented the following manner with Dio:
Future<Response> grantPasswordAuth(PasswordAuthRequest passwordAuthObject) { ApiUri apiUri = new ApiUri(PATH); // create path apiUri.addQueryParam('grant_type', 'password'); // add query params return post(apiUri, data: passwordAuthObject.toJson()); // call superclass method to POST } 
In Chopper on the other hand a simple request is implemented the following manner:
 @Post(headers: const { 'content-type': 'appliation/x-www-form-urlencoded', }, path: 'token') Future<Response> grantPasswordAuth(@Body() LoginUser loginUser); 
As you can see, regarding code length they are approximately the same.On the other hand, the differences I have come up with are:Chopper creates an extra file which increases the size of the project and its package structure complexity.Dio is more mature(the above code in Chopper using 'content-type': 'appliation/x-www-form-urlencoded' created many problems to me. Dio seems to not have any complexities that come unexpected.Dio is better maintained and has more functionalities.​Should I go for Dio since the problem that Chopper solves(which is generating biolerplate code) I have solved myself in Dio(the code for a POST request is very short and biolerplate code is avoided as you can see)? Looking forward to opinions of developers who have used both or have used one of them extensively and could tell me what kind of disadvantages are there that I can find out before starting to implement.

January 13, 2020 at 07:10PM by albaniantech
https://ift.tt/2QP4Sd3
New post on /r/flutterdev subreddit:

Embeddable JSON Database engine Flutter plugin. Both iOS and Android supported.
https://ift.tt/2Njgz9C

January 13, 2020 at 01:29PM by adamansky
https://ift.tt/2QQhzEv
New tweet from FlutterDev:

Need your app to display images?

Images bring your app to life! Image widget offers several constructors to display different types of images, wherever they may come from: assets, network, file system, RAM, and more.

More #WidgetoftheWeek here &rarr; https://t.co/1t10ChoWrq pic.twitter.com/lvst9P4lTE— Flutter (@FlutterDev) January 13, 2020

January 13, 2020 at 07:55PM
http://twitter.com/FlutterDev/status/1216795974279917570
New post on /r/flutterdev subreddit:

Here's a little package I've created : Flutter Week View. It allows you to display a highly customizable day / week widget.
Hey guys,I've created a little package that allows to display a highly customizable week view (or day view) which is able to display events, to be scrolled, to be zoomed-in & out and a lot more !It's compatible with iOS, Android and Web. Here is a screenshot of the DayView and here is a screenshot of the WeekView.Links :pub.dev : https://pub.dev/packages/flutter_week_viewSource code : https://github.com/Skyost/FlutterWeekView

January 13, 2020 at 10:27PM by Skyost
https://ift.tt/3a4H1gZ