You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
894 B
35 lines
894 B
import 'package:flutter/material.dart';
|
|
import '../navigation/main_navigation_scaffold.dart';
|
|
|
|
/// Primary AppBar widget with user icon for all main screens.
|
|
class PrimaryAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|
final String title;
|
|
|
|
const PrimaryAppBar({
|
|
super.key,
|
|
required this.title,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AppBar(
|
|
title: Text(title),
|
|
actions: [
|
|
IconButton(
|
|
icon: const Icon(Icons.person),
|
|
tooltip: 'User',
|
|
onPressed: () {
|
|
// Navigate to User screen by finding the MainNavigationScaffold
|
|
final scaffold = context.findAncestorStateOfType<MainNavigationScaffoldState>();
|
|
scaffold?.navigateToUser();
|
|
},
|
|
),
|
|
],
|
|
);
|
|
}
|
|
|
|
@override
|
|
Size get preferredSize => const Size.fromHeight(kToolbarHeight);
|
|
}
|
|
|