|
|
@ -6,65 +6,73 @@ import 'package:mohem_flutter_app/extensions/int_extensions.dart';
|
|
|
|
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
|
|
|
|
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
|
|
|
|
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
|
|
|
|
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
|
|
|
|
|
|
|
|
|
|
|
|
AppBar AppBarWidget(BuildContext context,
|
|
|
|
PreferredSize AppBarWidget(BuildContext context,
|
|
|
|
{required String title,
|
|
|
|
{required String title,
|
|
|
|
bool showHomeButton = true,
|
|
|
|
bool showHomeButton = true,
|
|
|
|
bool showNotificationButton = false,
|
|
|
|
bool showNotificationButton = false,
|
|
|
|
bool showMemberButton = false,
|
|
|
|
bool showMemberButton = false,
|
|
|
|
String? image}) {
|
|
|
|
String? image}) {
|
|
|
|
return AppBar(
|
|
|
|
return PreferredSize(
|
|
|
|
leadingWidth: 0,
|
|
|
|
preferredSize: const Size.fromHeight(57.0),
|
|
|
|
// leading: GestureDetector(
|
|
|
|
child: Column(
|
|
|
|
// behavior: HitTestBehavior.opaque,
|
|
|
|
|
|
|
|
// onTap: Feedback.wrapForTap(() => Navigator.maybePop(context), context),
|
|
|
|
|
|
|
|
// child: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
//titleSpacing: -1.44,
|
|
|
|
|
|
|
|
title: Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
GestureDetector(
|
|
|
|
AppBar(
|
|
|
|
behavior: HitTestBehavior.opaque,
|
|
|
|
leadingWidth: 0,
|
|
|
|
onTap:
|
|
|
|
// leading: GestureDetector(
|
|
|
|
Feedback.wrapForTap(() => Navigator.maybePop(context), context),
|
|
|
|
// behavior: HitTestBehavior.opaque,
|
|
|
|
child:
|
|
|
|
// onTap: Feedback.wrapForTap(() => Navigator.maybePop(context), context),
|
|
|
|
const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor),
|
|
|
|
// child: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
//titleSpacing: -1.44,
|
|
|
|
|
|
|
|
title: Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
GestureDetector(
|
|
|
|
|
|
|
|
behavior: HitTestBehavior.opaque,
|
|
|
|
|
|
|
|
onTap:
|
|
|
|
|
|
|
|
Feedback.wrapForTap(() => Navigator.maybePop(context), context),
|
|
|
|
|
|
|
|
child:
|
|
|
|
|
|
|
|
const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
4.width,
|
|
|
|
|
|
|
|
if (image != null) SvgPicture.asset(
|
|
|
|
|
|
|
|
image,
|
|
|
|
|
|
|
|
height: 40,
|
|
|
|
|
|
|
|
width: 40,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
if (image != null) 14.width,
|
|
|
|
|
|
|
|
title.toText24(color: MyColors.darkTextColor, isBold: true).expanded,
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
centerTitle: false,
|
|
|
|
|
|
|
|
elevation: 0,
|
|
|
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
|
|
|
actions: [
|
|
|
|
|
|
|
|
if (showHomeButton)
|
|
|
|
|
|
|
|
IconButton(
|
|
|
|
|
|
|
|
onPressed: () {
|
|
|
|
|
|
|
|
Navigator.popUntil(
|
|
|
|
|
|
|
|
context, ModalRoute.withName(AppRoutes.dashboard));
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
icon: const Icon(Icons.home, color: MyColors.darkIconColor),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
if (showNotificationButton)
|
|
|
|
|
|
|
|
IconButton(
|
|
|
|
|
|
|
|
onPressed: () {
|
|
|
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.worklistSettings);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
icon: const Icon(Icons.notifications, color: MyColors.textMixColor),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
if (showMemberButton)
|
|
|
|
|
|
|
|
IconButton(
|
|
|
|
|
|
|
|
onPressed: () {
|
|
|
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.subordinateLeave);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
icon: const Icon(Icons.people, color: MyColors.textMixColor),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
4.width,
|
|
|
|
Container(width: double.infinity, height: 1, color: MyColors.lightGreyEFColor),
|
|
|
|
if (image != null) SvgPicture.asset(
|
|
|
|
|
|
|
|
image,
|
|
|
|
|
|
|
|
height: 40,
|
|
|
|
|
|
|
|
width: 40,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
if (image != null) 14.width,
|
|
|
|
|
|
|
|
title.toText24(color: MyColors.darkTextColor, isBold: true).expanded,
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
centerTitle: false,
|
|
|
|
|
|
|
|
elevation: 0,
|
|
|
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
|
|
|
actions: [
|
|
|
|
|
|
|
|
if (showHomeButton)
|
|
|
|
|
|
|
|
IconButton(
|
|
|
|
|
|
|
|
onPressed: () {
|
|
|
|
|
|
|
|
Navigator.popUntil(
|
|
|
|
|
|
|
|
context, ModalRoute.withName(AppRoutes.dashboard));
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
icon: const Icon(Icons.home, color: MyColors.darkIconColor),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
if (showNotificationButton)
|
|
|
|
|
|
|
|
IconButton(
|
|
|
|
|
|
|
|
onPressed: () {
|
|
|
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.worklistSettings);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
icon: const Icon(Icons.notifications, color: MyColors.textMixColor),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
if (showMemberButton)
|
|
|
|
|
|
|
|
IconButton(
|
|
|
|
|
|
|
|
onPressed: () {
|
|
|
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.subordinateLeave);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
icon: const Icon(Icons.people, color: MyColors.textMixColor),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|