what should i repair? it's error.
characterList[index]['real_name'].toUpperCase()
How can fix the error?
CodePudding user response:
Add null check like this
characterList[index]['real_name']!.toUpperCase()
or change String? to String
CodePudding user response:
if you're sure that it can't be null
but just have a nullable ?
, just cast it like this:
(characterList[index]['real_name'] as String).toUpperCase()