Flutter

Attempt to execute code removed by Dart AOT compiler (TFA), how to troubleshoot this issue

馋奶兔 提交于 2021-01-29 13:01:04
问题 I see this error once I install the release apk - "Attempt to execute code removed by Dart AOT compiler (TFA)" on the Material Widget. How do I resolve this? I used charts_flutter: ^0.6.0 to implement some charts in my flutter project then tested the project using the "flutter run" command. It was running fine. After completing my project I generated a Release APK with the command "flutter build apk --release". Now I see this error once I install the release apk - "Attempt to execute code

Using model class in flutter (dart)

笑着哭i 提交于 2021-01-29 12:57:08
问题 I'm trying to create a model class with a few methods to simplify retrieving information from Firebase. I have a "Unregistered" page where user clicks on the "Login with google" button. If my user is already registered it checks the DB to see if he completed his profile, otherwise it writes basic data to the database with a field profileCompleted: false and redirects the user to the profile page so he can complete his profile. I'm trying to use a model here, but i'm getting all sorts of

Flutter GestureDetector not working inside Stack with TextField

故事扮演 提交于 2021-01-29 12:53:52
问题 I wrote a non-modal popup dialog that works fine UNTIL I put it inside a Stack with a TextField. Works fine without the TextField and even when I put two dialogs in the Stack (they both work). I saw a similar post here, but I don't think it applies because it involves two GestureDetectors in a Stack, not the problem I'm seeing of a TextField breaking my GestureDetector. As requested, I created a dartpad version of my modeless dialog using a Stack: Dartpad version EDIT I see what's happening

On running my first time auto generated code in android studio is gives me an error

微笑、不失礼 提交于 2021-01-29 12:52:05
问题 This shows when I try to run the code without changing any word it gives me an error in android studio, and when I run flutter doctor it shows flutter and dart plugins are not installed but it is, when I asked that on stack overflow others told me it can be safely ignored I don't know what to do the question where I asked that Flutter doctor: Flutter and dart plugins not installed Launching lib\main.dart on Device in debug mode... Running Gradle task 'assembleDebug'... Checking the license

Flutter expansion tile remove trailing

旧街凉风 提交于 2021-01-29 12:30:47
问题 i have a exoansiontile and i want it to be like a box, everything centered, the problem is that if i add a text that is too long, i get the overflow error and i think this is caused by the trailing of the expansion tile. Here is a picture: https://gyazo.com/c29329106dc5dcb162b71b5f41951b67 Here is the code: ExpansionTile( trailing: Text(''), leading: Container( margin: new EdgeInsets.only(left: 0, top: 10.0, right: 0.0, bottom: 0.0), child: Image.asset( 'images/food.png' )), title: Row(

Undefined symbols for architecture x86_64: “_OBJC_CLASS_$_GNSMessageManager” - NearBy native development for iOS in flutter app

橙三吉。 提交于 2021-01-29 12:23:42
问题 Just trying to build nearby natively in flutter app throws error Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_GNSMessageManager", referenced from: objc-class-ref in AppDelegate.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) I tried to change build setting architecture and build phase linked binary with library as well but nothing worked for me. Info.plist file <?xml version="1.0" encoding="UTF-8"?>

type 'Future<dynamic>' is not a subtype of type 'List<dynamic>' in type cast

六月ゝ 毕业季﹏ 提交于 2021-01-29 12:22:54
问题 I'm trying to get all the documents inside a determined collection from my firestore and after that, I want to set them in a list of documents which each position of the list represents a document. However, when I made the code, I received this error: type 'Future' is not a subtype of type 'List' in type cast import 'package:cloud_firestore/cloud_firestore.dart'; class Restaurant{ String keyword; String state; String address; String city; int evaluation; String image; String phone; double

Flutter custom font multi weight doesn't work properly

…衆ロ難τιáo~ 提交于 2021-01-29 12:14:43
问题 I'm trying to use a family font with multi weight in a flutter. But when I use font style with weight bold (w700) and heavy(w800) , it doesn't work. Only work until semibold/medium (w600) Here is my font assets folder structure : myapp\assets\fonts\unisans\unisans_Bold.ttf myapp\assets\fonts\unisans\unisans_Heavy.ttf myapp\assets\fonts\unisans\unisans_Reguler.ttf myapp\assets\fonts\unisans\unisans_Semibold.ttf Defined fonts in pubspec.yaml : fonts: - family: Unisans fonts: - asset: assets

Flutter: Unable to read data from firebase. The method '[]' was called on null error

折月煮酒 提交于 2021-01-29 12:11:01
问题 I am trying to read the data from firebase after scanning a barcode. This is how it should appear, but instead of barcode, it should display name and price from the database (https://m.imgur.com/gallery/lEFJZ0Q) Code: class ListTileModel { String barcode; ListTileModel(this.barcode); } the below code is inside the stateful widget List<ListTileModel> _items = []; String barcode = ""; void _add() { _items.add(ListTileModel(barcode)); setState(() {}); } @override void initState(){ super

How show tooltip In Flutter using charts_flutter package

╄→尐↘猪︶ㄣ 提交于 2021-01-29 12:01:12
问题 hi i am useing https://pub.dev/packages/charts_flutter For charts in My app I want tooltip when i press point in PointsLineChart... Any way to show tooltip... 回答1: I struggled with this for an hour and finally found a solution in a github issue I modified the code a bit to show the tapped value as a tooltip. import 'dart:math'; import 'package:flutter/material.dart'; import 'package:charts_flutter/flutter.dart'; import 'package:charts_flutter/src/text_element.dart'; import 'package:charts