build method Null safety
- BuildContext context
override
It returns a Container widget with a red circle and a text inside it.
Args: context (BuildContext): The context of the widget.
Returns: A Container with a red background and a white text with the number of notifications.
Implementation
@override
/// It returns a Container widget with a red circle and a text inside it.
///
/// Args:
/// context (BuildContext): The context of the widget.
///
/// Returns:
/// A Container with a red background and a white text with the number of notifications.
Widget build(BuildContext context) {
return Container(
width: 35.0,
height: 35.0,
decoration: new BoxDecoration(
color: Colors.red,
shape: BoxShape.circle,
),
child: Center(child: Text(notification.toString(), style: const TextStyle(fontSize: 24, color: Colors.white, fontWeight: FontWeight.bold),),),
);
}