...
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CategoryPage(
snapshot.data[index]),
));
},
...
Using the above code i try to pass the service id and the service type to the category page ... class CategoryPage extends StatefulWidget { // final String serviceId; // final String service_type; final String categorydata;
CategoryPage(data, {key, this.categorydata}) : super(key: key);
// @override
// CategoryPage(categorydata) {
// this.serviceId = categorydata.serviceId;
// this.service_type = categorydata.serviceId;
// }
_CategoryPageState createState() =>
_CategoryPageState(categorydata.toString());
}
class _CategoryPageState extends State<CategoryPage> {
String id = "";
_CategoryPageState(String categorydata) {
this.id = categorydata.serviceId;
}
...
From the above code, I need to get the service id and service type and display the tile of the Category page with the service type parameter. Please help me on achieving this result