forked from eatvio/eatvio_app
43 lines
1.2 KiB
Dart
43 lines
1.2 KiB
Dart
import 'package:eatvio_app/features/insights/presentation/widgets/insights_colors.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
/// Круглая кнопка «+» (52px) справа-снизу карточки.
|
|
class InsightsFab extends StatelessWidget {
|
|
const InsightsFab({super.key, required this.onPressed, this.tooltip});
|
|
|
|
final VoidCallback onPressed;
|
|
final String? tooltip;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Tooltip(
|
|
message: tooltip ?? '',
|
|
child: Container(
|
|
width: 52,
|
|
height: 52,
|
|
decoration: const BoxDecoration(
|
|
color: InsightsColors.blue,
|
|
shape: BoxShape.circle,
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: InsightsColors.fabShadow,
|
|
blurRadius: 20,
|
|
offset: Offset(0, 8),
|
|
),
|
|
],
|
|
),
|
|
child: Material(
|
|
color: Colors.transparent,
|
|
shape: const CircleBorder(),
|
|
child: InkWell(
|
|
key: const Key('insights_fab'),
|
|
customBorder: const CircleBorder(),
|
|
onTap: onPressed,
|
|
child: const Icon(Icons.add, color: Colors.white, size: 28),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|