[enter image description here][1] I'm creating a maintenance app in flutter with dummy model.
what I'm try to achieve is when the user select a main category the screen should navigate to the subcategory then when the user select the subcategories the screen should navigate to the super-subcategory. I already took the main category datas to the GridView.builder
Now I want to get the subcategory iconPath and name to make a new GridView.builder
final List<Category> mianCategory = [
Category(
iconPath: 'assets/svg/electrical.svg',
name: 'Electrical',
subCategory: [
Category(
iconPath: 'assets/svg/plug.svg',
name: 'Plug',
superSubCategory: [
'Plug Not Working',
'Fuse Neeeds Replacement',
'Other'
],
),
Category(
iconPath: 'assets/svg/communication.svg',
name: 'Communication',
superSubCategory: [
'Plug Not Working',
'Fuse Neeeds Replacement',
'Other'
],
),
],
),
Here is my Model
class Category {
final String? iconPath;
final String name;
final List<Category>? subCategory;
final List<String>? superSubCategory;
const Category({
this.iconPath,
required this.name,
this.subCategory,
this.superSubCategory,
});
}
[1]: https://i.stack.imgur.com/UL79U.png