-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom_app_bar.dart
50 lines (46 loc) · 1.34 KB
/
custom_app_bar.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import 'package:flutter/material.dart';
import 'package:futara/controller/constants/app_images.dart';
import 'package:futara/controller/constants/change_lang.dart';
import 'package:futara/controller/resources/theme/colors_manager.dart';
class CustomAppBar extends StatelessWidget implements PreferredSize {
const CustomAppBar({
super.key,
this.leading,
this.title,
this.hideNotification,
this.backgroundColor,
this.elevation,
this.actions,
this.height,
this.isLeading = true,
this.bottom,
});
final Widget? leading, title;
final bool? hideNotification, isLeading;
final Color? backgroundColor;
final double? elevation, height;
final List<Widget>? actions;
final PreferredSizeWidget? bottom;
@override
Widget build(BuildContext context) {
return AppBar(
backgroundColor: backgroundColor ?? AppColors.white,
automaticallyImplyLeading: isLeading ?? false,
elevation: elevation ?? 0,
centerTitle: true,
title: title ??
Image.asset(
langPathKey == 'ar' ? AppImages.logo : AppImages.logoEn,
width: 130,
height: 130,
),
actions: actions,
leading: leading,
bottom: bottom,
);
}
@override
Widget get child => const CustomAppBar();
@override
Size get preferredSize => Size.fromHeight(height ?? 70);
}