46 lines
1017 B
Dart
46 lines
1017 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'frosted_panel.dart';
|
|
|
|
|
|
class CircleNavIconButton extends StatelessWidget {
|
|
final IconData icon;
|
|
|
|
|
|
final VoidCallback? onPressed;
|
|
final double iconSize;
|
|
|
|
|
|
final bool enabled;
|
|
|
|
const CircleNavIconButton({
|
|
super.key,
|
|
required this.icon,
|
|
required this.onPressed,
|
|
this.iconSize = 26,
|
|
this.enabled = true,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Opacity(
|
|
opacity: enabled ? 1.0 : 0.35,
|
|
child: FrostedPanel(
|
|
radius: 999,
|
|
enableBlur: false,
|
|
padding: const EdgeInsets.all(8),
|
|
color: Colors.black.withValues(alpha: 0.26),
|
|
border: Border.all(color: Colors.white.withValues(alpha: 0.12)),
|
|
child: Material(
|
|
color: Colors.transparent,
|
|
child: InkWell(
|
|
onTap: onPressed,
|
|
customBorder: const CircleBorder(),
|
|
child: Icon(icon, color: Colors.white, size: iconSize),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|