|
|
|
@ -17,7 +17,7 @@ class DefaultAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|
|
|
final VoidCallback? onWillPopScope;
|
|
|
|
final VoidCallback? onWillPopScope;
|
|
|
|
final TextStyle? titleStyle;
|
|
|
|
final TextStyle? titleStyle;
|
|
|
|
|
|
|
|
|
|
|
|
const DefaultAppBar({this.title, this.onBackPress, this.onWillPopScope, this.actions,this.titleStyle, this.showHomeActionButton = false, this.showBackButton = true, Key? key}) : super(key: key);
|
|
|
|
const DefaultAppBar({this.title, this.onBackPress, this.onWillPopScope, this.actions, this.titleStyle, this.showHomeActionButton = false, this.showBackButton = true, Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
@ -43,30 +43,31 @@ class DefaultAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|
|
|
titleSpacing: 16,
|
|
|
|
titleSpacing: 16,
|
|
|
|
title: Row(
|
|
|
|
title: Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
if(showBackButton)
|
|
|
|
if (showBackButton)
|
|
|
|
const Icon(Icons.arrow_back_ios).onPress(() {
|
|
|
|
const Icon(Icons.arrow_back_ios).onPress(() {
|
|
|
|
if (onWillPopScope != null) {
|
|
|
|
if (onWillPopScope != null) {
|
|
|
|
showDialog(
|
|
|
|
showDialog(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
builder: (BuildContext cxt) => AcknowledgeWorkDialog(
|
|
|
|
builder: (BuildContext cxt) => AcknowledgeWorkDialog(
|
|
|
|
onSave: onWillPopScope!,
|
|
|
|
onSave: onWillPopScope!,
|
|
|
|
onDiscard: () {
|
|
|
|
onDiscard: () {
|
|
|
|
Navigator.of(cxt).pop();
|
|
|
|
Navigator.of(cxt).pop();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (onBackPress != null) {
|
|
|
|
if (onBackPress != null) {
|
|
|
|
onBackPress!();
|
|
|
|
onBackPress!();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
10.width,
|
|
|
|
10.width,
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
title ?? "",
|
|
|
|
title ?? "",
|
|
|
|
style:titleStyle?? AppTextStyles.heading3.copyWith(fontWeight: FontWeight.w500, color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
|
|
|
|
style: titleStyle ??
|
|
|
|
|
|
|
|
(context.isTablet() ? AppTextStyles.heading4 : AppTextStyles.heading3).copyWith(fontWeight: FontWeight.w500, color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
|
|
|
|
).expanded,
|
|
|
|
).expanded,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|