I am using Bloc pattern and I am getting successful response/data when printed but when I am setting the response on the Text widget its giving me error.
Below is my code
if (state is RegistrationFailureState) {
final String message = state.errorMessage;
print('MESSAGE >>>>>> $message');
showDialog(
context: context,
builder: (context) {
return const AlertDialog(
content: Text(
'Error: $message',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
);
});
}
Below is the error I am getting on the Text widget
Thanks in advance.