feat : buy page and widgets

This commit is contained in:
2025-06-30 10:36:30 +03:30
parent 7cec6bd084
commit 79adab71e3
11 changed files with 138 additions and 25 deletions

View File

@@ -5,12 +5,13 @@ RAppBar chickenAppBar({
bool hasBack = true,
bool hasFilter = true,
bool hasSearch = true,
bool isBase = false,
VoidCallback? onBackPressed,
GestureTapCallback? onFilterTap,
GestureTapCallback? onSearchTap,
}) {
return RAppBar(
hasBack: hasBack,
hasBack: isBase == true ? false : hasBack,
onBackPressed: onBackPressed,
leadingWidth: 155,
leading: Row(
@@ -26,9 +27,9 @@ RAppBar chickenAppBar({
],
),
additionalActions: [
if (hasFilter) filterWidget(onFilterTap),
if (!isBase && hasFilter) filterWidget(onFilterTap),
SizedBox(width: 8),
if (hasSearch) searchWidget(onSearchTap),
if (!isBase && hasSearch) searchWidget(onSearchTap),
SizedBox(width: 8),
],
);

View File

@@ -0,0 +1,20 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/presentation/widget/page_route.dart';
import 'package:rasadyar_core/core.dart';
class BasePage extends StatelessWidget {
const BasePage({super.key, required this.routes, required this.appBar, required this.widgets});
final List<String> routes;
final RAppBar appBar;
final List<Widget> widgets;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColor.bgLight,
appBar: appBar,
body: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [buildPageRoute(routes), ...widgets]),
);
}
}

View File

@@ -1,6 +1,9 @@
import 'package:flutter/cupertino.dart';
import 'package:rasadyar_core/core.dart';
Text buildPageRoute(List<String> route) {
return Text(route.isEmpty ? 'خانه' : route.join("/"), style: AppFonts.yekan14.copyWith(color: AppColor.bgDark));
Widget buildPageRoute(List<String> route) {
return Padding(
padding: const EdgeInsets.fromLTRB(0, 4, 7, 8),
child: Text(route.isEmpty ? 'خانه' : route.join("/"), style: AppFonts.yekan14.copyWith(color: AppColor.bgDark)),
);
}

View File

@@ -0,0 +1,34 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
Widget saleOrBuyItemCard({String? title, String? iconPath, required VoidCallback onTap}) {
return InkWell(
onTap: onTap,
child: Card(
color: Colors.white,
shape: RoundedRectangleBorder(
side: BorderSide(color: AppColor.blueNormal, width: 1.0.w),
borderRadius: BorderRadius.circular(8.r),
),
child: Container(
width: 160.w,
height: 160.h,
padding: const EdgeInsets.all(8.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (iconPath != null)
SvgGenImage.vec(iconPath).svg(
width: 64.w,
height: 64.h,
colorFilter: const ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
),
SizedBox(height: 12.h),
if (title != null) Text(title, style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal)),
],
),
),
),
);
}