Flutter

Persisting data in a flutter application

天涯浪子 提交于 2021-02-16 15:32:13
问题 I am building an app and in it, I have the names of people in a list from which I could add/delete, etc.. The problem is this list is not saved when I close the app, which is inconvenient. I heard you can use shared Preferences to save simple objects like this, without complicating things like using SQLite and json. So I'd like to know what's the suggested way to persist this data and load it etc. Thanks in Advance and have a great day :) Here is the code: import 'package:flutter/material

How to fix this nullOk error when using the flutter_svg package?

佐手、 提交于 2021-02-16 15:15:08
问题 I connected the package, added it to main.dart, I try to compile the application, but I get this error. Help! What should I do about it? error Launching lib\main.dart on XT1562 in debug mode... Running Gradle task 'assembleDebug'... /D:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.18.1/lib/src/picture_provider.dart:50:59: Error: No named parameter with the name 'nullOk'. context != null ? Localizations.localeOf(context, nullOk: true) : null, ^^^^^^ /D:/flutter/packages/flutter/lib

How to fix this nullOk error when using the flutter_svg package?

可紊 提交于 2021-02-16 15:13:07
问题 I connected the package, added it to main.dart, I try to compile the application, but I get this error. Help! What should I do about it? error Launching lib\main.dart on XT1562 in debug mode... Running Gradle task 'assembleDebug'... /D:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.18.1/lib/src/picture_provider.dart:50:59: Error: No named parameter with the name 'nullOk'. context != null ? Localizations.localeOf(context, nullOk: true) : null, ^^^^^^ /D:/flutter/packages/flutter/lib

How to enable Null-Safety in Flutter?

本秂侑毒 提交于 2021-02-16 10:25:57
问题 I tried to use null safety, but it's giving me this error: This requires the 'non-nullable' language feature to be enabled. Try updating your pubspec.yaml to set the minimum SDK constraint to 2.10.0 or higher, and running 'pub get'. I changed my Dart SDK constraint from 2.7.0 to 2.10.0 , but it's still showing this error. Also I upgraded my Dart and Flutter SDK: dart-sdk v2.10.2 is the latest version available based on your source(s). Flutter (Channel stable, 1.22.3, ... 回答1: Null safety is

How to add debug symbols to build.gradle

会有一股神秘感。 提交于 2021-02-16 09:36:28
问题 I have created android build of my Flutter application. Then I created an internal testing release. It is showing a warning This App Bundle contains native code, and you've not uploaded debug symbols. We recommend you upload a symbol file to make your crashes and ANRs easier to analyze and debug. Basically what I had to do is add following to build.gradle file according to the link they show. android.buildTypes.release.ndk.debugSymbolLevel = { SYMBOL_TABLE | FULL } I assume it is android/app

Passing class static factory as method parameter in Dart

独自空忆成欢 提交于 2021-02-16 06:43:07
问题 I'm currently attempting to abstract making different HTTP requests by using generics. I'm using json_serializale for generating fromJson() and toJson() methods. Here is a simple model file: import 'package:json_annotation/json_annotation.dart'; part 'article.g.dart'; @JsonSerializable() class Article { int id = 0; String title = ""; Article({this.id, this.title}); factory Article.fromJson(Map<String, dynamic> json) => _$ArticleFromJson(json); Map<String, dynamic> toJson() => _$ArticleToJson

Google Drive Consent Screen Stuck

被刻印的时光 ゝ 提交于 2021-02-16 05:21:00
问题 I am trying to backup the application data of my android app on Google Drive. Therefore I request access to the https://www.googleapis.com/auth/drive.appdata, https://www.googleapis.com/auth/drive.file scopes using the google_sign_in package. I created a project on the Google Developer Console, enabled the Drive API and added the scopes to the OAuth Consent Screen and added an OAuth Client ID with the package name and the SHA-1 of the debug key. The application works fine if I don't request

Google Drive Consent Screen Stuck

馋奶兔 提交于 2021-02-16 05:20:58
问题 I am trying to backup the application data of my android app on Google Drive. Therefore I request access to the https://www.googleapis.com/auth/drive.appdata, https://www.googleapis.com/auth/drive.file scopes using the google_sign_in package. I created a project on the Google Developer Console, enabled the Drive API and added the scopes to the OAuth Consent Screen and added an OAuth Client ID with the package name and the SHA-1 of the debug key. The application works fine if I don't request

Can any one tell me how to open another app using flutter?

走远了吗. 提交于 2021-02-15 11:04:23
问题 I want to open a bunch of music app links using links data I have in firebase. I want to open, amazonPrimeMusic, Ganna, Spotify, Wynk, JioSavaan to name some. Widget buildResultCard(data) { List items = [Text(data['Ganna']), IconButton(icon:Icon(Icons.all_inclusive), onPressed: ()=> {Text("Ganna")} ), Text(data['Wynk']), IconButton(icon:Icon(Icons.all_inclusive), onPressed: ()=> {Text("Ganna")} ), Text(data['JioSavaan']), IconButton(icon:Icon(Icons.all_inclusive), onPressed: ()=> {Text("Ganna

How to use one field of firebase to login

≡放荡痞女 提交于 2021-02-15 07:39:16
问题 I write the following code and when I click the next Log in button I get the following error when clicking the login button. type 'Future' is not a subtype of type 'String' I want to compare the "Phone" with the user input phone number. How can I verify that which the user enters Phone is the same which in firestore or not? my code is: import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/material.dart'; import 'package:fmiantrader/splash.dart'; import 'componenets.dart';