fix : Appbar chicken
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart';
|
||||
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/app_bar.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
@@ -14,15 +15,11 @@ class HomePage extends GetView<HomeLogic> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColor.bgLight,
|
||||
appBar: RAppBar(
|
||||
title: 'رصدطیور',
|
||||
iconTitle: Assets.vec.chickenSvg.path,
|
||||
titleTextStyle: AppFonts.yekan16Bold.copyWith(color: Colors.white),
|
||||
centerTitle: true,
|
||||
appBar: chickenAppBar(
|
||||
hasBack: false,
|
||||
leading: Row(
|
||||
children: [Text('مباشر', style: AppFonts.yekan16Bold.copyWith(color: Colors.white))],
|
||||
),
|
||||
hasFilter: false,
|
||||
hasSearch: false
|
||||
|
||||
),
|
||||
body: Column(
|
||||
spacing: 8,
|
||||
|
||||
57
packages/chicken/lib/presentation/widget/app_bar.dart
Normal file
57
packages/chicken/lib/presentation/widget/app_bar.dart
Normal file
@@ -0,0 +1,57 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
RAppBar chickenAppBar({
|
||||
bool hasBack = true,
|
||||
bool hasFilter = true,
|
||||
bool hasSearch = true,
|
||||
VoidCallback? onBackPressed,
|
||||
GestureTapCallback? onFilterTap,
|
||||
GestureTapCallback? onSearchTap,
|
||||
}) {
|
||||
return RAppBar(
|
||||
hasBack: 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 (hasFilter) filterWidget(onFilterTap),
|
||||
SizedBox(width: 8),
|
||||
if (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),
|
||||
),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user