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.
cloudsolutions-atoms/lib/views/pages/user/notifications/widgets/notification_tab_button.dart

56 lines
1.6 KiB
Dart

import 'package:flutter/material.dart';
import 'package:test_sa/extensions/text_extensions.dart';
import 'package:test_sa/new_views/app_style/app_color.dart';
class NotificationTabButton extends StatelessWidget {
final String label;
final int? count;
final bool isSelected;
final VoidCallback onTap;
const NotificationTabButton({
Key? key,
required this.label,
this.count,
required this.isSelected,
required this.onTap,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onTap,
child: Container(
alignment: Alignment.center,
padding: const EdgeInsets.symmetric(horizontal: 12),
decoration: ShapeDecoration(
color: AppColor.background(context),
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1,
color: isSelected ? AppColor.primary10 : AppColor.borderColor(context),
),
borderRadius: BorderRadius.circular(6),
),
shadows: [
BoxShadow(
color: Colors.black.withValues(alpha: 0.05),
blurRadius: 14,
offset: const Offset(0, 0),
spreadRadius: 0,
)
],
),
child: Text(
count != null ? '$label ($count)' : label,
style: AppTextStyles.tinyFont.copyWith(
height: 1,
color: isSelected ? AppColor.primary10 : AppColor.filterButtonTextColor(context),
fontWeight: isSelected ? FontWeight.w600 : FontWeight.w500,
),
),
),
);
}
}