getCategoryName method Null safety
- int index
Implementation
String getCategoryName(int index) {
switch(index){
case 0:
return "GeneralKnowledge";
case 1:
return "Art";
case 2:
return "Entertainment";
case 3:
return "Science";
case 4:
return "Mythology";
case 5:
return "History";
case 6:
return "Sports";
default:
return "none";
}
}