dart

array of items as state in a StatefulWidget & ensuring “setState” only triggers updates for items in the array that has changed?

寵の児 提交于 2021-02-11 17:35:46
问题 Background - want to utilise a dynamic list of items for a StatefulWidget. In my usecase the widget will be calling a CustomePainter (canvas) so sometimes there will be a varying number of images to be drawn on the canvas, hence within parent StatefulWidget would like to have an "array of images". Question - if using an array as the state variable what do I need to do programmtically (if anything) to ensure only the items that have changed within the array do infact get "redrawn", in

OAuth2: No login dialog after log out, direct log in of last user

喜夏-厌秋 提交于 2021-02-11 16:57:01
问题 I am building a flutter app that needs the user to authenticate against an identity provider in order to user the app. I am using the package simple_auth_flutter to do the authentication stuff. So far this works as expected: When clicking on the log in button, the users is queried for its credentials and after passing the correct credentials I get a valid token. I only got an issue, when the user logs out from the identity provider. When the user clicks on the log in button he gets

Flutter Pie Chart labelAccessorFn is not working

旧街凉风 提交于 2021-02-11 16:56:57
问题 Note: I used this answer How to add label to pieChart flutter as a reference to implement labelAccessorFn. I am using charts_flutter package to display charts in my flutter app, as far as I know, we use labelAccessorFn to show labels in Pie Chart but it's not working in my case. App Overview: It's a mood checker app where user chose its mood every day using one of 5 emojis and in charts, we display data of emoji vs num of days it's been chosen. chart file (labelAccessorFn is defined in

Flutter Pie Chart labelAccessorFn is not working

自作多情 提交于 2021-02-11 16:56:10
问题 Note: I used this answer How to add label to pieChart flutter as a reference to implement labelAccessorFn. I am using charts_flutter package to display charts in my flutter app, as far as I know, we use labelAccessorFn to show labels in Pie Chart but it's not working in my case. App Overview: It's a mood checker app where user chose its mood every day using one of 5 emojis and in charts, we display data of emoji vs num of days it's been chosen. chart file (labelAccessorFn is defined in

Another exception was thrown: NoSuchMethodError: The getter 'latitude' was called on null

邮差的信 提交于 2021-02-11 16:40:19
问题 I am trying to utilize the Location package in Flutter, but when I try to display the Latitude and Longitude in my app I am getting an error stating "The getter 'latitude' was called on null." Is it possible that there's something wrong with the location services on my device? I am also prompted with a popup when I click on the screen stating "For a better experience, turn on device location, which uses Google's location service" but I already enabled permissions for location services in the

How to refresh the states of ParentStatefulWidget from ModalBottomSheet in flutter

試著忘記壹切 提交于 2021-02-11 16:19:55
问题 I'm new to flutter and I don't have proper idea about the states of a widget. I'm creating an application where I'm adding some items to the cart from home screen and by clicking on Cartbutton I'm opening ModalBottomSheet where user can also modify their cart items, and what I want when user close the ModalBottomSheet without proceeding for checkout. it refreshes the selected items at home screen as well. I'm calculating addition and subtraction of each item into a list. Everything is working

ListView scroll offset issue in flutter

自古美人都是妖i 提交于 2021-02-11 15:51:14
问题 With the new ListView add two or more children. Scroll down the list to the point where the first child is entirely off the screen. Scroll all the way back up to the initial position. The ListView shows nothing on screen (just white empty space). Currently I'm facing this problem after upgrading the flutter to the latest version. Please help me fixing this issue. https://github.com/flutter/flutter/issues/8155 My error and issue is exactly same as provided in this case. 来源: https:/

ListView scroll offset issue in flutter

时光总嘲笑我的痴心妄想 提交于 2021-02-11 15:49:58
问题 With the new ListView add two or more children. Scroll down the list to the point where the first child is entirely off the screen. Scroll all the way back up to the initial position. The ListView shows nothing on screen (just white empty space). Currently I'm facing this problem after upgrading the flutter to the latest version. Please help me fixing this issue. https://github.com/flutter/flutter/issues/8155 My error and issue is exactly same as provided in this case. 来源: https:/

ListView scroll offset issue in flutter

喜欢而已 提交于 2021-02-11 15:48:59
问题 With the new ListView add two or more children. Scroll down the list to the point where the first child is entirely off the screen. Scroll all the way back up to the initial position. The ListView shows nothing on screen (just white empty space). Currently I'm facing this problem after upgrading the flutter to the latest version. Please help me fixing this issue. https://github.com/flutter/flutter/issues/8155 My error and issue is exactly same as provided in this case. 来源: https:/

How to use python code with Flutter application?

北城以北 提交于 2021-02-11 15:33:18
问题 I wanna to make a chatbot app with fluter, so i will use flutter only to create the user interface, and i wanna to interact my flutter app with python, so i will receive the question from flutter app and i will send it to python function, and this function should return the answer , and in flutter i will display it to the screen. Hint: 1- I made the UI with flutter. 2- I created python function "It uses Neural Network". 3- I wanna to use python as a function only, i will pass the questions to