fix : ui change's
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/logic.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/search/logic.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
RAppBar chickenAppBar({
|
||||
@@ -22,7 +24,6 @@ RAppBar chickenAppBar({
|
||||
Assets.vec.chickenSvg.svg(
|
||||
width: 24,
|
||||
height: 24,
|
||||
colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -35,24 +36,62 @@ RAppBar chickenAppBar({
|
||||
);
|
||||
}
|
||||
|
||||
GestureDetector filterWidget(GestureTapCallback? onSearchTap) {
|
||||
return GestureDetector(
|
||||
onTap: onSearchTap,
|
||||
child: Assets.vec.filterOutlineSvg.svg(
|
||||
width: 20,
|
||||
height: 20,
|
||||
colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
GestureDetector searchWidget(GestureTapCallback? onFilterTap) {
|
||||
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),
|
||||
child: Stack(
|
||||
alignment: Alignment.topRight,
|
||||
children: [
|
||||
Assets.vec.filterOutlineSvg.svg(
|
||||
width: 20,
|
||||
height: 20,
|
||||
colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||
),
|
||||
Obx(() {
|
||||
final controller = Get.find<BaseLogic>();
|
||||
return Visibility(
|
||||
visible: controller.isFilterSelected.value,
|
||||
child: Container(
|
||||
width: 8,
|
||||
height: 8,
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.red,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
GestureDetector searchWidget(GestureTapCallback? onSearchTap) {
|
||||
return GestureDetector(
|
||||
onTap: onSearchTap,
|
||||
child: Stack(
|
||||
alignment: Alignment.topRight,
|
||||
children: [
|
||||
Assets.vec.searchSvg.svg(
|
||||
width: 24,
|
||||
height: 24,
|
||||
colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||
),
|
||||
Obx(() {
|
||||
final controller = Get.find<SearchLogic>();
|
||||
return Visibility(
|
||||
visible: controller.searchValue.value!=null,
|
||||
child: Container(
|
||||
width: 8,
|
||||
height: 8,
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.red,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -35,7 +35,7 @@ class BasePage extends StatefulWidget {
|
||||
final FloatingActionButtonLocation? floatingActionButtonLocation;
|
||||
final Widget? floatingActionButton;
|
||||
final Widget? filteringWidget;
|
||||
final void Function(String)? onSearchChanged;
|
||||
final void Function(String?)? onSearchChanged;
|
||||
final bool hasBack;
|
||||
final bool hasFilter;
|
||||
final bool hasSearch;
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
Widget filterBottomSheetWidget({
|
||||
required Rx<Jalali> fromDate,
|
||||
required Function(Jalali jalali) onChangedFromDate,
|
||||
required Rx<Jalali> toDate,
|
||||
required Function(Jalali jalali) onChangedToDate,
|
||||
required VoidCallback onSubmit,
|
||||
}) {
|
||||
return BaseBottomSheet(
|
||||
height: 200,
|
||||
child: Column(
|
||||
spacing: 16,
|
||||
children: [
|
||||
Text('فیلترها', style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal)),
|
||||
Row(
|
||||
spacing: 8,
|
||||
children: [
|
||||
Expanded(
|
||||
child: dateFilterWidget(date: fromDate, onChanged: onChangedFromDate),
|
||||
),
|
||||
Expanded(
|
||||
child: dateFilterWidget(isFrom: false, date: toDate, onChanged: onChangedToDate),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
RElevated(
|
||||
height: 40,
|
||||
isFullWidth: true,
|
||||
backgroundColor: AppColor.greenNormal,
|
||||
text: 'اعمال فیلتر',
|
||||
onPressed: () {
|
||||
onSubmit();
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/root/logic.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
Widget inventoryWidget(RootLogic rootLogic) {
|
||||
return Container(
|
||||
width: Get.width,
|
||||
height: 39,
|
||||
margin: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.greenLight,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.textColor, width: 0.5),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: ObxValue((data) {
|
||||
return Text(
|
||||
' موجودی انبار: ${data.value?.totalRemainWeight?.toInt().separatedByComma ?? '0'} کیلوگرم',
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkHover),
|
||||
);
|
||||
}, rootLogic.inventoryModel),
|
||||
);
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import 'logic.dart';
|
||||
class SearchWidget extends StatefulWidget {
|
||||
const SearchWidget({super.key, this.onSearchChanged});
|
||||
|
||||
final void Function(String)? onSearchChanged;
|
||||
final void Function(String?)? onSearchChanged;
|
||||
|
||||
@override
|
||||
State<SearchWidget> createState() => _SearchWidgetState();
|
||||
@@ -14,6 +14,7 @@ class SearchWidget extends StatefulWidget {
|
||||
|
||||
class _SearchWidgetState extends State<SearchWidget> {
|
||||
late final SearchLogic controller;
|
||||
final TextEditingController textEditingController = TextEditingController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -26,26 +27,50 @@ class _SearchWidgetState extends State<SearchWidget> {
|
||||
Widget build(BuildContext context) {
|
||||
return ObxValue((data) {
|
||||
return AnimatedContainer(
|
||||
margin: EdgeInsets.symmetric(vertical: 4),
|
||||
duration: const Duration(milliseconds: 300),
|
||||
padding: const EdgeInsets.only(top: 5),
|
||||
curve: Curves.easeInOut,
|
||||
height: data.value ? 50 : 0,
|
||||
height: data.value ? 40 : 0,
|
||||
child: Visibility(
|
||||
visible: data.value,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
child: RTextField(
|
||||
suffixIcon: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Assets.vec.searchSvg.svg(
|
||||
width: 10,
|
||||
height: 10,
|
||||
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
||||
height: 40,
|
||||
borderColor: AppColor.blackLight,
|
||||
suffixIcon: ObxValue(
|
||||
(data) => Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||
child: (data.value == null)
|
||||
? Assets.vec.searchSvg.svg(
|
||||
width: 10,
|
||||
height: 10,
|
||||
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
||||
)
|
||||
: IconButton(
|
||||
onPressed: () {
|
||||
textEditingController.clear();
|
||||
controller.searchValue.value = null;
|
||||
controller.isSearchSelected.value = false;
|
||||
widget.onSearchChanged?.call(null);
|
||||
},
|
||||
enableFeedback: true,
|
||||
padding: EdgeInsets.zero,
|
||||
iconSize: 24,
|
||||
splashRadius: 50,
|
||||
icon: Assets.vec.closeCircleSvg.svg(
|
||||
width: 20,
|
||||
height: 20,
|
||||
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
),
|
||||
controller.searchValue,
|
||||
),
|
||||
hintText: 'جستجو',
|
||||
controller: TextEditingController(),
|
||||
hintText: 'جستجو کنید ...',
|
||||
hintStyle: AppFonts.yekan16.copyWith(color: AppColor.blueNormal),
|
||||
filledColor: Colors.white,
|
||||
filled: true,
|
||||
controller: textEditingController,
|
||||
onChanged: (val) => controller.searchValue.value = val,
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user