0

I'm new to flutter, I wanna show container if a specific value exists in Kinds model, the model contains stores, groceries and markets I don't know how to do it exactly please help me with my code the controller returns the json is kindController.kindDataList

so if market exist in the json then show

     child: HomeFlatBtn(image: 'market', height: 150, currentTab: 1,),



         Container(
          child: Padding(
            padding: EdgeInsets.symmetric(
                horizontal: Dimensions.PADDING_SIZE_SMALL),
            child: IntrinsicHeight(
              child: Row(
                crossAxisAlignment: CrossAxisAlignment.stretch,
                children: [
                  Expanded(
                    child: Column(children: [
                      
                      Padding(
                        padding: EdgeInsets.symmetric(vertical: Dimensions
                            .PADDING_SIZE_SMALL,
                            horizontal: Dimensions.PADDING_SIZE_SMALL),
                        child: HomeFlatBtn(
                          image: 'market', height: 150, currentTab: 1,),
                      ),

                      Padding(
                        padding: EdgeInsets.symmetric(horizontal: Dimensions
                            .PADDING_SIZE_SMALL),

                        child: HomeFlatBtn(
                          image: 'grocery', height: 150, currentTab: 1,),
                      ),
                    ]
                    ),
                  ),
                  Expanded(child: HomeFlatBtn(image: 'food',
                      height: 0,
                      currentTab: 1),
                  ),
                ],
              ),
            ),
          ),
        ),
1

1 Answer 1

1

You can use Visibility widget for this.

Just wrap Container with Visibility. Like this:

Visibility(
  visible: true,  //set this to either true or false
  child: Container(
    //the contents of Container
  ),
),
//visible decides whether your Container will be visible or not.
Sign up to request clarification or add additional context in comments.

2 Comments

I think you didn't understand what I need, I wana check in the model if a value exist!!!!
Your question is not complete I guess. Where is your model?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.