skip to Main Content

I’m using firebase database and i want to show a certain widget if there was docs only.
i tried this line but it’s not the right one.

Visibility(
                  visible: controller.doc.isEmpty(),

2

Answers


  1. Not sure what controller.doc.isEmpty() does but you want the widget to be visible if the doc is not empty. So you have to change it to:

    Visibility(
      visible: !controller.doc.isEmpty(),
    )
    
    Login or Signup to reply.
  2. Try the code:

    Visibility(
      visible: controller.doc.isNotEmpty(),
    ),
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search