dart

I cannot run my flutter app. It says Flutter requires Android SDK 28, and I have sdk 28

♀尐吖头ヾ 提交于 2021-02-08 13:11:09
问题 when I run flutter doctor, it shows me the following errors: Running flutter doctor... Doctor summary (to see all details, run flutter doctor -v): [?] Flutter (Channel stable, v1.2.1, on Microsoft Windows [Version 10.0.17134.112], locale en-US) [!] Android toolchain - develop for Android devices (Android SDK version 27.0.3) X Flutter requires Android SDK 28 and the Android BuildTools 28.0.3 To update using sdkmanager, run: D:/Tools/sdk\tools\bin\sdkmanager "platforms;android-28" "build-tools

How to clear app cache programmatically on Flutter

纵饮孤独 提交于 2021-02-08 12:26:42
问题 As I have been developing app using Flutter. I came to find that app is heavy in size plus it is using a lot of space as app data and app cache. Is there any way to clear app cache programmatically? Edit: my app's size in release mode is about 7mb and app data is about 11mb. My app opens one site within app and it also streams online radio so it's app data goes on increasing 回答1: You can get the temp folder, and delete files in it. var appDir = (await getTemporaryDirectory()).path; new

Parsing a URI to extract query parameters, with Dart

China☆狼群 提交于 2021-02-08 12:16:32
问题 I have a request in this form: http://website/index.html?name=MyName&token=12345 Is there a way how to extract name and token from this url? There is always an option to iterate through all characters and save it that way, but I am looking for more elegant solution in Dart. 回答1: var uri = Uri.parse('http://website/index.html?name=MyName&token=12345'); uri.queryParameters.forEach((k, v) { print('key: $k - value: $v'); }); key: name - value: MyName key: token - value: 12345 来源: https:/

Share url+image+text with Twitter/Facebook/Instagram

两盒软妹~` 提交于 2021-02-08 12:05:55
问题 Is there any lib/package that will help in both platform iOS and Android to share image+text+url on FB, Twitter And Insta? I have been searing for 4 hours but didn't find any result. https://pub.dev/packages/flutter_share_me this package is only for android so. If you have any solution for it please guide me. ~ PS : I don't want to use Share package, I have buttons of FB, Insta and Twitter. When user will click on any one of the button then data should be share on any of the social media and

Share url+image+text with Twitter/Facebook/Instagram

隐身守侯 提交于 2021-02-08 12:04:34
问题 Is there any lib/package that will help in both platform iOS and Android to share image+text+url on FB, Twitter And Insta? I have been searing for 4 hours but didn't find any result. https://pub.dev/packages/flutter_share_me this package is only for android so. If you have any solution for it please guide me. ~ PS : I don't want to use Share package, I have buttons of FB, Insta and Twitter. When user will click on any one of the button then data should be share on any of the social media and

Dart - Http Get request with body

人走茶凉 提交于 2021-02-08 11:15:51
问题 I want to send an HTTP GET request with json body using dart. I know this is possible, because I've done it in the past but can't find the files/recode it. Packages like dart:http doesn't allow to send a body along with an GET request. thanks for help 回答1: I am not really sure where the problem should be but I have made this example for Dart VM which I guess does what you want: import 'dart:convert'; import 'dart:io'; Future<void> main(List arguments) async { final response = await

Dart - Http Get request with body

♀尐吖头ヾ 提交于 2021-02-08 11:15:31
问题 I want to send an HTTP GET request with json body using dart. I know this is possible, because I've done it in the past but can't find the files/recode it. Packages like dart:http doesn't allow to send a body along with an GET request. thanks for help 回答1: I am not really sure where the problem should be but I have made this example for Dart VM which I guess does what you want: import 'dart:convert'; import 'dart:io'; Future<void> main(List arguments) async { final response = await

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

随声附和 提交于 2021-02-08 10:59:56
问题 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(

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(

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