cb_prestige_qr/lib/core/widgets/CenterNavButton.dart

65 lines
1.9 KiB
Dart
Raw Permalink Normal View History

2026-04-09 06:47:03 +00:00
import 'package:flutter/material.dart';
class CenterNavButton extends StatelessWidget {
final bool isActive;
final VoidCallback onTap;
const CenterNavButton({
super.key,
required this.isActive,
required this.onTap,
});
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return InkWell(
onTap: onTap,
borderRadius: BorderRadius.circular(20),
splashColor: theme.colorScheme.primary.withAlpha(26),
child: AnimatedContainer(
duration: const Duration(milliseconds: 250),
margin: const EdgeInsets.symmetric(horizontal: 6, vertical: 10),
decoration: BoxDecoration(
color: isActive
? theme.colorScheme.primary.withAlpha(31)
: Colors.transparent,
borderRadius: BorderRadius.circular(20),
),
child: Center(
child: AnimatedScale(
duration: const Duration(milliseconds: 200),
scale: isActive ? 1.15 : 1.0,
child: Container(
height: 48,
width: 48,
decoration: BoxDecoration(
shape: BoxShape.circle,
gradient: LinearGradient(
colors: [
theme.colorScheme.primary,
theme.colorScheme.primary.withAlpha(179),
],
),
boxShadow: [
BoxShadow(
color: theme.colorScheme.primary.withAlpha(102),
blurRadius: 16,
offset: const Offset(0, 6),
),
],
),
child: const Icon(
Icons.qr_code_scanner,
color: Colors.white,
size: 24,
),
),
),
),
),
);
}
}