You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1013 B
Dart
36 lines
1013 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../../app_style/app_color.dart';
|
|
|
|
class NotificationIcon extends StatelessWidget {
|
|
int notificationCount;
|
|
NotificationIcon({Key key, this.notificationCount}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Stack(
|
|
children: <Widget>[
|
|
const Icon(Icons.notifications, size: 36,),
|
|
if(notificationCount != null)
|
|
Positioned(
|
|
right: 0,
|
|
child: Container(
|
|
height: 20,
|
|
width: 20,
|
|
padding: EdgeInsets.all(1),
|
|
decoration: BoxDecoration(
|
|
color: Colors.red,
|
|
borderRadius: BorderRadius.circular(10),
|
|
),
|
|
child: Text(
|
|
notificationCount.toString(),
|
|
style: Theme.of(context).textTheme.bodyMedium?.copyWith(fontWeight: FontWeight.w500,color: AppColor.neutral30),
|
|
textAlign: TextAlign.center,
|
|
),
|
|
),
|
|
)
|
|
],
|
|
);
|
|
}
|
|
}
|