-1

I have a page that displays all products from a rest Api. On the same page I have a DropDownButton which is populated with the various categories. My question is how can I filter the data after selecting an item from the dropdown button and also reload the page with the filtered data?

Christopher Moore
  • 15,626
  • 10
  • 42
  • 52
mark gichohi
  • 125
  • 4
  • 11

1 Answers1

0

Was able to work it out like this for anyone who it may help.

InkWell(
                                      onTap: () {
                                        clearimage();
                                      },
                                      child: Row(
                                        children: <Widget>[
                                          Icon(
                                            Icons.cancel,
                                            color: red,
                                            size: 13.0,
                                          ),
                                          Padding(
                                            padding: const EdgeInsets.only(
                                                left: 15.0),
                                            child: Text(
                                              "Remove",
                                              style: TextStyle(fontSize: 10),
                                            ),
                                          ),
                                        ],
                                      ),
                                    ),

i called a method clearimage(); i had to File _mage back to null

  clearimage() {
    setState(() {
      _image = null;
    });
  }
mark gichohi
  • 125
  • 4
  • 11