59 lines
1.5 KiB
Dart
59 lines
1.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:rasadyar_core/core.dart';
|
|
|
|
RAppBar chickenAppBar({
|
|
bool hasBack = true,
|
|
bool hasFilter = true,
|
|
bool hasSearch = true,
|
|
bool isBase = false,
|
|
VoidCallback? onBackPressed,
|
|
GestureTapCallback? onFilterTap,
|
|
GestureTapCallback? onSearchTap,
|
|
}) {
|
|
return RAppBar(
|
|
hasBack: isBase == true ? false : hasBack,
|
|
onBackPressed: onBackPressed,
|
|
leadingWidth: 155,
|
|
leading: Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
spacing: 6,
|
|
children: [
|
|
Text('رصدطیور', style: AppFonts.yekan16Bold.copyWith(color: Colors.white)),
|
|
Assets.vec.chickenSvg.svg(
|
|
width: 24,
|
|
height: 24,
|
|
colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
|
),
|
|
],
|
|
),
|
|
additionalActions: [
|
|
if (!isBase && hasFilter) filterWidget(onFilterTap),
|
|
SizedBox(width: 8),
|
|
if (!isBase && hasSearch) searchWidget(onSearchTap),
|
|
SizedBox(width: 8),
|
|
],
|
|
);
|
|
}
|
|
|
|
GestureDetector searchWidget(GestureTapCallback? onSearchTap) {
|
|
return GestureDetector(
|
|
onTap: onSearchTap,
|
|
child: Assets.vec.filterOutlineSvg.svg(
|
|
width: 20,
|
|
height: 20,
|
|
colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
|
),
|
|
);
|
|
}
|
|
|
|
GestureDetector filterWidget(GestureTapCallback? onFilterTap) {
|
|
return GestureDetector(
|
|
onTap: onFilterTap,
|
|
child: Assets.vec.searchSvg.svg(
|
|
width: 24,
|
|
height: 24,
|
|
colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
|
),
|
|
);
|
|
}
|