fix : app bar no back
This commit is contained in:
@@ -16,6 +16,20 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
final int? leadingWidth;
|
final int? leadingWidth;
|
||||||
final Widget? leading;
|
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({
|
const RAppBar({
|
||||||
super.key,
|
super.key,
|
||||||
required this.title,
|
required this.title,
|
||||||
@@ -27,7 +41,7 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
this.leading,
|
this.leading,
|
||||||
this.hasBack = true,
|
this.hasBack = true,
|
||||||
this.centerTitle = false,
|
this.centerTitle = false,
|
||||||
this.leadingWidth
|
this.leadingWidth,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -39,20 +53,15 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
excludeHeaderSemantics: true,
|
excludeHeaderSemantics: true,
|
||||||
scrolledUnderElevation: 0,
|
scrolledUnderElevation: 0,
|
||||||
centerTitle: centerTitle,
|
centerTitle: centerTitle,
|
||||||
titleTextStyle:
|
titleTextStyle: titleTextStyle ?? AppFonts.yekan16.copyWith(color: Colors.white),
|
||||||
titleTextStyle ??
|
|
||||||
AppFonts.yekan16.copyWith(color:Colors.white),
|
|
||||||
title: Text(title),
|
title: Text(title),
|
||||||
leadingWidth: leadingWidth?.toDouble(),
|
leadingWidth: leadingWidth?.toDouble(),
|
||||||
|
|
||||||
leading:leading!=null ? Padding(
|
leading: leading != null ? Padding(padding: const EdgeInsets.only(right: 16), child: leading) : null,
|
||||||
padding: const EdgeInsets.only(right: 16),
|
|
||||||
child: leading,
|
|
||||||
) : null,
|
|
||||||
titleSpacing: 8,
|
titleSpacing: 8,
|
||||||
actions: [
|
actions: [
|
||||||
if (additionalActions != null) ...additionalActions!,
|
if (additionalActions != null) ...additionalActions!,
|
||||||
if(hasBack)...{
|
if (hasBack) ...{
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
@@ -61,10 +70,7 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
color: iconColor,
|
color: iconColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
}
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ class SupervisionFilterPage extends GetView<InspectorFilterLogic> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
appBar: RAppBar.noBack(title: 'نقشه'),
|
||||||
body: PopScope(
|
body: PopScope(
|
||||||
canPop: !controller.bottomSheetManager.isAnyVisible,
|
canPop: !controller.bottomSheetManager.isAnyVisible,
|
||||||
onPopInvokedWithResult: (didPop, result) {
|
onPopInvokedWithResult: (didPop, result) {
|
||||||
|
|||||||
Reference in New Issue
Block a user