fix : app bar no back

This commit is contained in:
2025-06-02 10:37:56 +03:30
parent faa8f310db
commit ce4966a78d
2 changed files with 20 additions and 13 deletions

View File

@@ -16,6 +16,20 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget {
final int? leadingWidth;
final Widget? leading;
const RAppBar.noBack({
super.key,
required this.title,
this.backgroundColor = AppColor.blueNormal,
this.iconColor = Colors.white,
this.titleTextStyle,
this.onBackPressed,
this.additionalActions,
this.leading,
this.hasBack = false,
this.centerTitle = false,
this.leadingWidth,
});
const RAppBar({
super.key,
required this.title,
@@ -27,7 +41,7 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget {
this.leading,
this.hasBack = true,
this.centerTitle = false,
this.leadingWidth
this.leadingWidth,
});
@override
@@ -39,20 +53,15 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget {
excludeHeaderSemantics: true,
scrolledUnderElevation: 0,
centerTitle: centerTitle,
titleTextStyle:
titleTextStyle ??
AppFonts.yekan16.copyWith(color:Colors.white),
titleTextStyle: titleTextStyle ?? AppFonts.yekan16.copyWith(color: Colors.white),
title: Text(title),
leadingWidth: leadingWidth?.toDouble(),
leading:leading!=null ? Padding(
padding: const EdgeInsets.only(right: 16),
child: leading,
) : null,
leading: leading != null ? Padding(padding: const EdgeInsets.only(right: 16), child: leading) : null,
titleSpacing: 8,
actions: [
if (additionalActions != null) ...additionalActions!,
if(hasBack)...{
if (hasBack) ...{
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: IconButton(
@@ -61,10 +70,7 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget {
color: iconColor,
),
),
}
},
],
);
}

View File

@@ -11,6 +11,7 @@ class SupervisionFilterPage extends GetView<InspectorFilterLogic> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: RAppBar.noBack(title: 'نقشه'),
body: PopScope(
canPop: !controller.bottomSheetManager.isAnyVisible,
onPopInvokedWithResult: (didPop, result) {