I've never used JSON before so I'm not familiar with its syntax.
At the moment I have multiple arrays containing different pieces of data.
I would like to create one JSON object, that contains the multiple arrays each with several pieces of data. E.g. An object called HotelList, containing multiple arrays each for a different name of Hotels. see the example :
class Jsons {
static var hotelListJson = {
'hotelData': [
{
'index': 0,
'restaurantName': 'Monginis Cake Shop',
'foodCategory': 'The Cake Shop',
'restReview': 5,
'restImage': 'assets/images/Restaurant1.png',
'distanceFromLocation': 40,
'restStatus': 'open',
'menuCategories': [
{
'categoryName': 'Pastry',
'dishes': [
'Dutch Pastry',
'Truffle Pastry',
'Pipeapple Veg Pastry',
'Brownee Sqare Veg Pastry',
'Choco Lava Veg Cup'
],
},
{
'categoryName': 'small cake ( half kg)',
'dishes': [
'Sapphire Veg Small',
'Deviles Delite Veg Small',
'Duth Chocolate Heart Veg (Small)',
'Shimmer Choco Veg Small'
]
},
{
'categoryName': 'Breads',
'dishes': ['Sandwich Bread', 'Multigrain Bread', 'Brown Bread']
},
{
'categoryName': 'Large cake',
'dishes': ['Alpine Choco Veg(Large)']
},
{
'categoryName': 'Cookies',
'dishes': [
'Almond Cocos Cookies',
'Shewsburry Cookies',
'Honey Crunch Cookis',
'Kesar Cookies',
'Jeeraa Cookies'
]
},
{
'categoryName': 'Savouries',
'dishes': [
'Panner pattice',
'Veg Burger',
'Pan Pizza Veg',
'Veg pattice'
]
},
{
'categoryName': 'Chocolate',
'dishes': ['Just Temptations']
},
{
'categoryName': 'Plum & Bar cake',
'dishes': ['Fruit Bar cake']
},
]
},
{
'index': 1,
'restaurantName': 'Swami Hotel',
'foodCategory': 'Family Hotel',
'restReview': 2,
'restImage': 'assets/images/Restaurant2.png',
'distanceFromLocation': 40,
'restStatus': 'open',
'menuCategories': [
{
'categoryName': 'Veg Starter',
'dishes': [ 'Paneer pahadi kabab','Garlic chana','Masala papad', 'Manchurian']
},
{
'categoryName': 'Tandoori',
'dishes': ['Chicken Tandoori','Chicken Tangadi Kabab','Chicken Pahadi Kabab','Mutton Kadhai]
},
{
'categoryName': 'INDIAN BREAD',
'dishes': ['Aalu Paratha','Paneer Paratha','Nan', 'Butter Nan','Tandoori Roti','Chapati']
},
]
},
{
'index': 2,
'restaurantName': 'Diva Sagar',
'foodCategory': 'Family restaurant',
'restReview': 5,
'restImage': 'assets/images/Restaurant3.png',
'distanceFromLocation': 30,
'restStatus': 'open',
},
{
'index': 3,
'restaurantName': 'Smart open pick cake shop',
'foodCategory': 'Cake Shop',
'restReview': 1,
'restImage': 'assets/images/Restaurant4.png',
'distanceFromLocation': 10,
'restStatus': 'closed',
'offer': 'Get 5% discount',
},
]
};
}
I wanted to add list to dishes. how can i do that ?