I have a chats class:
List<Message> chats = [
Message(
sender: roberta,
time: '5:30 PM',
text: 'Hey, how\'s it going? What did you do today?',
isLiked: false,
unread: true,
),
Message(
sender: roberta,
time: '5:30 PM',
text: 'Hey, how\'s it going? What did you do today?',
isLiked: false,
unread: true,
),
Message(
sender: stefano,
time: '4:30 PM',
text: 'Hey, how\'s it going? What did you do today?',
isLiked: false,
unread: true,
),
With messages property and one of them is "unread" property. How I can assign true to an Int like a number 1 and if is false is 0 I need to take this bool "unread" and transform into a number to show how many unreads message into a notification widget in flutter
Any input?