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

<b>future? futurebuilder? I'm struggling just a bit</b>
I've been playing around with flutter. I'm completely new to app development, but I've been building backends in PHP for over a decade now.I'm lost on some of the syntax. The app I'm playing with communicates with some API entry points for an existing site of mine. I've so far been mashing together various examples and failing gracefully a lot. I wanted to see if someone could give me some human friendly explainers on some of the code.My questions are largely from this example: <a href="https://flutter.dev/docs/cookbook/networking/fetch-data">https://flutter.dev/docs/cookbook/networking/fetch-data</a>In step 4, they create the initial call for http data<pre>FutureBuilder<Post>( future: fetchPost(), builder: (context, snapshot) { if (snapshot.hasData) { return Text(snapshot.data.title); } else if (snapshot.hasError) { return Text("${snapshot.error}"); } // By default, show a loading spinner. return CircularProgressIndicator(); }, ); </pre>They call FutureBuilder<Post> - why Post? Is that because they built a future of that previously? Or is Post a reserved word? Since This is getting a JSON object from the web, I am possibly confusing a GET and POST request. I think this is just the naming here. But they called it in the next line, fetchPost(), if they're calling the function, why specify <Post>? I don't fully understand the necessity of those two pieces.Then the builder - What is the context and what is the snapshot? From being able to read the function, it looks like the snapshot gets the data from the JSON request. Context I'm guessing passes on something, but I don't fully get what. Are the names changeable? Instead of snapshop, can I call is 'jsondata'?In the step before that, they create the Future. I don't really get what a Future is or does.<pre>Future<Post> fetchPost() async { final response = await http.get('https://jsonplaceholder.typicode.com/posts/1'); if (response.statusCode == 200) { // If server returns an OK response, parse the JSON. return Post.fromJson(json.decode(response.body)); } else { // If that response was not OK, throw an error. throw Exception('Failed to load post'); } } </pre>I am guessing this is a Future of the Post object they created in the first step. If that's the case, why isn't it part of that object? If it is part of that object, then why does the function name matter? Are there instances where you'd want Future<Post> thisFunction() as well as Future<Post> thatFunction()?The Post class in the previous step has something called a factory. This seems to process some data then feed it back into the object. I'm used to objects having constructors, but a factory is new. Am I correct on my interpretation here?Finally, the way they kick this off is weird to me.<pre>MyApp(post: fetchPost()) </pre>Why are the calling the class by passing it the function? And why are they passing post: fetchPost() and not just fetchPost()? This is why I'm inclined to believe the function name does not make it unique on it's own.Oh and in the MyApp class, what the heck is this?<pre>MyApp({Key key, this.post}) : super(key: key); </pre>I don't understand this. I know we defined a post variable in the class that references the Future<Post>, but I don't really get this. Why not just call the function directly? Can't that be done?I'm sure there are gaps in my knowledge since this isn't what I usually work in. I've been googling a lot and not getting too far. I'm hoping someone can just give me a nice human break down. Any bits of it you care to explain, I'd be happy to read.I can report that I've been working at what feels like a nice pace. I'm working on my login mechanism, already have a data feed that I can display and am deciding what to do next. None of it looks stellar, but I love it. It feels like the first time I ever played with HTML. None of it looks amazing, but I made it, and that makes it amazing. I hope you guys can…
New post on Flutter Dev Google group:

Problem with notifications not showing icon
Hi, Someone know why I'm not showing icon on notifications? I only see a white square Thanks.

October 14, 2019 at 05:43PM by Daniel Reuven
https://ift.tt/2OSXWuZ
New post on Flutter Dev Google group:

Google signin problem
Iam doing my college project i did many efforts to solve google signin problem but iam unable to solve i have to add feature into it so kindly provide me the code of google signin i already setup the firebase and the its plugin all the stuff so plz guys help me Plz share the google signin code

October 14, 2019 at 06:43PM by Mohd Arshad
https://ift.tt/31iGF0t
New post on /r/flutterdev subreddit:

Is there a way to match users based on their location?
Essentially I am hoping to have the app register the location of user A who is actively using the app. Then register the location of user B who is also active and then match them if they are within a 20 mile radius.

October 14, 2019 at 08:06PM by DumbNeurosurgeon
https://ift.tt/33zQXLd
New post on /r/flutterdev subreddit:

Question about ExpansionPanelList Widget in flutter
Hi all,I am building an application where I need to use something like an expansion panel list/radio widget. My functionality is as followsLogin and arrive on a pageThe page contains list of credit card information downloaded from server and each card is labelled by the card's name(Ex: BANK ONE Credit card, Bank Two Credit Card etc)when we click on card the list expands and shows user the card data and and an edit button appears on the header of panel, with which can edit the card information such as address.we can save the information by pressing cancel/save buttons present in the editable widget.My question is ListView in flutter contains a builder constructor with which we can build dynamic lists and reduce memory consumption. However after going through ExpansionPanelList documentation, I do not see anything about building dynamic content. So should I create a custom widget and pass it in a listview.builder method or expansion panel List is optimized to handle large lists?​I appreciate any kind of feedback, thanks!

October 14, 2019 at 08:05PM by _flutter_apprentice_
https://ift.tt/35zBw7O
New post on /r/flutterdev subreddit:

Using Admob in Flutter?
Hi. I just started learning Flutter yesterday and I find it pretty interesting. This is coming from a Swift iOS developer. I had a question on how to implement ads in an app and I saw AdMob online. My AdMob account was terminated for some reason so I was wondering if there are any other ads services for Flutter?

October 14, 2019 at 08:01PM by Michael12390
https://ift.tt/2IRPAj8
New post on Flutter Dev Google group:

Creating Two Columns in ListView.builder()
I am using ListView.builder to display results in my app, which is optimized for phones. Currently I'm trying to optimize for tablet views. My designer wants to create a "grid view" for the results. Basically there would be two columns. The results would alternate between the columns. I'm not

October 14, 2019 at 08:36PM by Matthew Jones
https://ift.tt/32g1R8L
New post on Flutter Dev Google group:

call recorder in flutter
Hello Team, I just started using Flutter and I urgently have a project that requires recording calls when picked by the user. Is this possible with flutter?

October 14, 2019 at 09:56PM by Seyi Falaiye
https://ift.tt/2MJG17d
New post on /r/flutterdev subreddit:

Finding people/projects to collaborate with/in
Hello everyone, I have been using flutter for a good eight to ten months now and I must say I really enjoy it. Over this time I have worked on some actual projects that are now living the life of 'live apps'. But I am now looking to get more experience in the software developement world and I believe the best option for this is to work in collaboration with other people.Unfortunately I am quite young and do not have anyone intrested in this kind of stuff in my circle of friends.So I wondered if any of you knows of a platform where I could find people looking for other developpers to help them on small to medium sized projects as this would allow me to contact and connect with some people.

October 14, 2019 at 09:14PM by tGautot
https://ift.tt/2qfWuIL
New post on /r/flutterdev subreddit:

D/skia ( 5106): Shader compilation error
I've created a simple Flutter 1.9.1+hotfix.4 application using Android Studio 3.5.1. After adding successfully a new virtual device (Nexus 6) and tried to run my app, I got this error: D/skia ( 5106): Shader compilation errorAny idea on how to resolve this issue? Tank you

October 14, 2019 at 08:46PM by archavin
https://ift.tt/33v3kbt
New post on Flutter Dev Google group:

sign in with google and application goes closed automatically
dear all iam a developing a college mini project i made a project where i add google signin feature and calling it on pressed of a button but my applicaton goes off plz solve my problem thank you so much [image: C1apture.PNG]

October 15, 2019 at 02:31AM by Mohd Arshad
https://ift.tt/2B8AFgt
New post on Flutter Dev Google group:

Problem with pagination (SilverList + ListView.builder)
Hi guys, I am facing some issue with the silver list + ListView.builder. The idea is to build the list view as SilverList as it is needed for the SilverStickyHeader. When the user scrolls to the end (position), the next page of the list will be loaded. somehow this kind of code works without

October 15, 2019 at 07:30AM by Zhe Xiao
https://ift.tt/2BanLyf
New post on /r/flutterdev subreddit:

About Flutter meetup suggestion at Bangalore, India
Hey everyone Flutter is taking over in development, So are love to build an app on Flutter or would like to give a try with Flutter and have an idea then let us know in comment section so we can arrange one meetup and our dev team will publish a public open-source code on GitHub and as well as on our website at https://www.ionicfirebaseapp.com/products/category/FreeSo you can go ahead with easy development with Flutter.#flutter #flutterdev #fluttermeetup #meetup

October 15, 2019 at 11:23AM by ionicfirebaseapp
https://ift.tt/33pumkG
New post on Flutter Dev Google group:

plugin dependency only for specific platform?
Hey, is it possible to include a dependency only for a sepcific platform? I am developing a cross-plattform app fro macOS and iOS and are using the shared_preferences plugin. in pubspec.yaml I added this: shared_preferences: ^0.5.3+4 shared_preferences_fde: path: ../../flutter-desk

October 15, 2019 at 12:22PM by Thomas Verbeek
https://ift.tt/2VGJh7t
New post on /r/flutterdev subreddit:

Hybrid App
Hi, I am going to be creating an app for my final year project and I plan on using flutter with a firestore database behind it. It will be a recipe app. I have not decieded whether I will develop it for both Android and/or iOS. I just wanted to know whether hybrid development is time consuming or too difficult? I don't want to have it in my project plan and then struggle to implement it and get marked down.​Thanks for any advice or guidance looking forward to creating my first flutter app!

October 15, 2019 at 01:18PM by fmcd97
https://ift.tt/35CExV1
New post on /r/flutterdev subreddit:

Any gRPC with Flutter tutorials?
I read some articles but couldn't get grpc to work. Any tutorials that you recommend ?

October 15, 2019 at 03:47PM by bimsina
https://ift.tt/2MggDXI
New post on /r/flutterdev subreddit:

Increase and decrease the font size of user input (TextField)
Hello guys, I am trying to code an app, in which a TextField has a set size, given by a SizedBox around it. As the user types, the text should shrink form the initial font size to whatever size is necessary to fit in the box, so that everything typed is visible, without having to scroll.I have been trying for a while, with no success. I am fairly new to Flutter/Dart so any help would be appreciated. I would also settle for two buttons that increase/decrease the text font size typed in the TextField, so the user does that manually.I have looked into the auto_text_size package, but if you think this could work, please provide a full example because I tried it but every example of this package I could find cannot be use with user input text.Can anyone help me?

October 15, 2019 at 03:16PM by JustyDonutd
https://ift.tt/2MeIUh8