frosty/lib/widgets/app_bar.dart
2025-06-25 21:56:33 -04:00

40 lines
967 B
Dart

import 'dart:ui';
import 'package:flutter/material.dart';
class FrostyAppBar extends StatelessWidget implements PreferredSizeWidget {
final Widget? title;
final List<Widget>? actions;
final bool showBackButton;
const FrostyAppBar({
super.key,
this.title,
this.actions,
this.showBackButton = true,
});
@override
Widget build(BuildContext context) {
return ClipRRect(
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 16, sigmaY: 16),
child: AppBar(
leading: showBackButton
? IconButton(
tooltip: 'Back',
icon: Icon(Icons.adaptive.arrow_back_rounded),
onPressed: Navigator.of(context).pop,
)
: null,
title: title,
actions: actions,
centerTitle: false,
),
),
);
}
@override
Size get preferredSize => const Size.fromHeight(kToolbarHeight);
}