1

enter image description hereenter image description here

When the item in the listview is clicked, I want to move the information to the bottom sheet, but I couldn't find the way. Navigator.push( context, MaterialPageRoute( builder: (context) => customBottomSheet(context), ),i tried but it didn't work how can i solve this problem

return Expanded(
                      child: ListView.builder(
                          shrinkWrap: true,
                          scrollDirection: Axis.vertical,
                          itemCount: coinListForDisplay.length,
                          itemBuilder: (context, index) {
                            return InkWell(
                              onTap: (() {
                                customBottomSheet(context);
                              }),
                              child: ListViewCard(
                                name: coinListForDisplay[index].name,
                                symbol: coinListForDisplay[index].symbol,
                                imageUrl: coinListForDisplay[index].imageUrl,
                                price:
                                    coinListForDisplay[index].price.toDouble(),
                                change:
                                    coinListForDisplay[index].change.toDouble(),
                                changePercentage: coinListForDisplay[index]
                                    .changePercentage
                                    .toDouble(),
                              ),
                            );
                          }),
                    );```
Deniz
  • 33
  • 6

1 Answers1

0

You can pass data in parameters like this. In you custom bottom sheet, use

CustomBottomSheet(BuildContext context,yourData){
    //Your code
}

And in your onTap function use

CustomBottomSheet(context,yourData);
Sheikh Haziq
  • 229
  • 1
  • 10