You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
2.2 KiB
Dart
65 lines
2.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:test_sa/extensions/context_extension.dart';
|
|
import 'package:test_sa/extensions/int_extensions.dart';
|
|
|
|
import '../../app_style/app_color.dart';
|
|
|
|
class HomeAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|
final GlobalKey<ScaffoldState> scaffoldKey;
|
|
const HomeAppBar({Key key, this.scaffoldKey}) : super(key: key);
|
|
|
|
@override
|
|
Size get preferredSize => Size.fromHeight(60.toScreenHeight);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Padding(
|
|
padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth),
|
|
child: AppBar(
|
|
backgroundColor: context.isDark ? AppColor.backgroundDark : AppColor.backgroundLight,
|
|
automaticallyImplyLeading: false,
|
|
elevation: 0,
|
|
leadingWidth: 48.toScreenWidth,
|
|
leading: InkWell(
|
|
onTap: () {
|
|
scaffoldKey.currentState.openDrawer();
|
|
},
|
|
child: CircleAvatar(child: Image.network("", fit: BoxFit.fill)),
|
|
),
|
|
actions: [
|
|
Stack(
|
|
children: <Widget>[
|
|
Icon(
|
|
Icons.notifications,
|
|
color: context.isDark ? AppColor.neutral10 : AppColor.neutral20,
|
|
size: 34,
|
|
),
|
|
|
|
///TODO [zaid] : put notifications count rather than number 1
|
|
if (1 != 0)
|
|
PositionedDirectional(
|
|
end: 0,
|
|
top: 0,
|
|
child: Container(
|
|
height: 20.toScreenWidth,
|
|
width: 20.toScreenWidth,
|
|
padding: const EdgeInsets.all(1),
|
|
decoration: BoxDecoration(
|
|
color: AppColor.red50,
|
|
borderRadius: BorderRadius.circular(10),
|
|
),
|
|
child: Text(
|
|
(1).toString(),
|
|
style: Theme.of(context).textTheme.bodySmall?.copyWith(fontWeight: FontWeight.w500, color: AppColor.neutral30),
|
|
textAlign: TextAlign.center,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|