Flutter

Post value to a php file to execute sql query and get back data in json format

断了今生、忘了曾经 提交于 2021-02-08 10:57:15
问题 I am learning Flutter and trying to build a mobile application that can display my today courses. And I want to learn more about data handling so I try to use php and get data from database. My target is that I want to post the date value to the php file, then execute the sql query and get the data in json format. Finally, the data will be displayed in a Flutter app. A part of my php file is as follow: $date = $_POST["date"]; $sql = "SELECT * FROM Table WHERE Date = '$date'"; $response=array(

How can i change the width/padding of a Flutter DropdownMenuItem in a DropdownButton?

会有一股神秘感。 提交于 2021-02-08 10:38:56
问题 How can we change the width/padding of a Flutter DropdownMenuItem in a Dropdown? Row( children: <Widget>[ Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ LightText( text: "Agent", ), Padding( padding: EdgeInsets.only(top: 3), ), Container( height: 27, child: Row( children: <Widget>[ DropdownButtonHideUnderline( child: DropdownButton<Agent>( // isExpanded: true, hint: Text( agentName == null ? "" : agentName, style: TextStyle( fontSize: MediaQuery.of

Is it possible to await a for-loop in Dart?

十年热恋 提交于 2021-02-08 10:38:44
问题 I'm new to Dart and therefore having trouble with asynchronous programming. I'm trying to loop through a list of elements (let's call them ingredients for now) and query the database for recipes which contain the ingredient. To achieve this, I have a list 'ingredientsSelectedList' and pass it over to a future which is supposed to query the Firestore Database and add the result to the 'possibleRecipes' List. The problem is, that I can't figure out how to 'await' the for loop to finish, before

Flutter: send Data from TabBarView (StatefullWidgets) back to main Scaffold

可紊 提交于 2021-02-08 10:28:29
问题 I want to create an App with Tabs to get the users input. The Problem is, that the different Tabs get different inputs, but i have to collect the inputs for the Database. My idea her was, that the main Scaffhold collects the inputs from all Tabs and write it in a database! My Problem is, that i dont know to send data from the tab (statefullWidget in an other file) to the parent class (Scaffold) or run a function from there! Please help me and sorry for my bad english! Jonas 回答1: You can pass

How to render child without parent when using setState?

帅比萌擦擦* 提交于 2021-02-08 10:28:01
问题 How to make the code in this answer How to keep changing a Images every 5 seconds in Flutter? to avoid parent rebuild together with child? I want only child do the setState. I want the setState in Timer does not affect the parent. I read about how to only rerender the child without parent in this link https://androidpedia.net/en/knowledge-base/51725031/flutter-setstate-of-child-widget-without-rebuilding-parent, but I got confused to implement into the code. My Objective is like on the image,

Flutter with firestore missing method

谁都会走 提交于 2021-02-08 10:27:21
问题 MissingPluginException(No implementation found for method DocumentReference#get on channel plugins.flutter.io/cloud_firestore) Hello, i keep having this message for all the methods of firestore with flutter on an android device simulator. I followed the install instruction ("gms...google services" in first gradle and plugin on app gradle file, + the google services.json on app folder. It seems that i should add the firestore api on the android dependencies but this is not on the officiel

How to render child without parent when using setState?

时光毁灭记忆、已成空白 提交于 2021-02-08 10:26:27
问题 How to make the code in this answer How to keep changing a Images every 5 seconds in Flutter? to avoid parent rebuild together with child? I want only child do the setState. I want the setState in Timer does not affect the parent. I read about how to only rerender the child without parent in this link https://androidpedia.net/en/knowledge-base/51725031/flutter-setstate-of-child-widget-without-rebuilding-parent, but I got confused to implement into the code. My Objective is like on the image,

Flutter with firestore missing method

给你一囗甜甜゛ 提交于 2021-02-08 10:26:06
问题 MissingPluginException(No implementation found for method DocumentReference#get on channel plugins.flutter.io/cloud_firestore) Hello, i keep having this message for all the methods of firestore with flutter on an android device simulator. I followed the install instruction ("gms...google services" in first gradle and plugin on app gradle file, + the google services.json on app folder. It seems that i should add the firestore api on the android dependencies but this is not on the officiel

How to notifyListeners with nested child from Provider in Flutter?

回眸只為那壹抹淺笑 提交于 2021-02-08 10:21:29
问题 guys, I'm starting with flutter and I decided to make a mini game like "cookie clicker" to train but I've just run into a problem with the state management... I use a provider to propagate the "GameController" which aims to update the player's resources and do the calculations. I manage to get the "GameController" everywhere but when I interact with a resource (object in the "GameController") and this one is up to date but not in the UI, it doesn't change... main.dart : import 'package

Flutter firebase phone authentication problem. App closes abruptly

ぃ、小莉子 提交于 2021-02-08 10:20:12
问题 Im new to flutter and im trying to implement firebase phone authentication in my app. Once i enter the mobile number ,after 2 to 3 seconds, app closes abruptly. phoneAuth(number) async { await authInstance.verifyPhoneNumber( phoneNumber: "+91$number", verificationCompleted: (PhoneAuthCredential credentials) async { await authInstance .signInWithCredential(credentials) .then((UserCredential userCredentials) { Get.to(HomeScreen()); }); }, verificationFailed: (FirebaseAuthException e) {