• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: flutter UI page navigation

Resolved: flutter UI page navigation

0
By Isaac Tonny on 16/03/2023 Issue
Share
Facebook Twitter LinkedIn

In this post, we will see how to resolve flutter UI page navigation

Question:

PlanDaysExList is a list that has workout exercises and if the list is empty…it should navigate me to the restScreen() / if the list has exercises…it should navigate me to the getPlanExercisesScreen()
my problem is that when the list has exercises or empty…it always navigate me to the getPlanExercisesScreen() i don’t know where the problem is.
here is my code:
in the last line of code, it means that if docs.element.data[day] not matched dayNum so PlanDaysExList must be null but it still navigate me to the getPlanExercisesScreen() however when i navigate there…it doesn’t show me the exercises so that mean the list is empty! what am i missing ?

Best Answer:

The error lies in the line where you check whether the list is empty or not.
Change it to:
Tried this with a simpler example:
where I replaced the if(list1 == [] (in your case) with isEmpty method of the list.
The reason is that you can not compare lists like you’d do in Python, without checking for ListEquality (imported from collection.dart):

If you have better answer, please add a comment about this, thank you!

Source: Stackoverflow.com

flutter
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How to resolve LNK2001 in c++ projects

26/03/2023

Resolved: How to correctly initialize vector of number in Typescript

26/03/2023

Resolved: mysql calculating to get profit or loss from 2 tables ( Purchases and Sales) in FIFO mode

26/03/2023

Comments are closed.

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.