feat : request tagging and fix chips and fix overflow module in auht
This commit is contained in:
@@ -23,7 +23,7 @@ class CardIcon extends StatelessWidget {
|
|||||||
side: const BorderSide(color: AppColor.blueNormal, width: 1),
|
side: const BorderSide(color: AppColor.blueNormal, width: 1),
|
||||||
),
|
),
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(8),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
@@ -55,7 +56,7 @@ class RFilterChips extends StatelessWidget {
|
|||||||
required this.index,
|
required this.index,
|
||||||
required this.onTap,
|
required this.onTap,
|
||||||
this.selectedColor = AppColor.blueNormal,
|
this.selectedColor = AppColor.blueNormal,
|
||||||
this.unSelectedColor = AppColor.whiteGreyNormal,
|
this.unSelectedColor = AppColor.whiteGreyDark,
|
||||||
});
|
});
|
||||||
|
|
||||||
final bool isSelected;
|
final bool isSelected;
|
||||||
@@ -66,7 +67,7 @@ class RFilterChips extends StatelessWidget {
|
|||||||
final Color unSelectedColor;
|
final Color unSelectedColor;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
/* Widget build(BuildContext context) {
|
||||||
return FilterChip(
|
return FilterChip(
|
||||||
labelStyle: isSelected
|
labelStyle: isSelected
|
||||||
? AppFonts.yekan10.copyWith(color: AppColor.mediumGreyDarkActive)
|
? AppFonts.yekan10.copyWith(color: AppColor.mediumGreyDarkActive)
|
||||||
@@ -74,12 +75,38 @@ class RFilterChips extends StatelessWidget {
|
|||||||
label: Text(
|
label: Text(
|
||||||
title,
|
title,
|
||||||
textAlign: TextAlign.center),
|
textAlign: TextAlign.center),
|
||||||
deleteIconColor: Colors.red,
|
|
||||||
selected: isSelected,
|
selected: isSelected,
|
||||||
|
showCheckmark: false, // مخفیکردن چکمارک پیشفرض
|
||||||
|
avatar: isSelected
|
||||||
|
? Icon(
|
||||||
|
Icons.star, // آیکون دلخواه بهجای چکمارک
|
||||||
|
size: 18,
|
||||||
|
color: Colors.orange,
|
||||||
|
)
|
||||||
|
: null,
|
||||||
selectedColor: selectedColor,
|
selectedColor: selectedColor,
|
||||||
onSelected: (bool selected) {
|
onSelected: (bool selected) {
|
||||||
onTap.call(index);
|
onTap.call(index);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
}*/
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return RawChip(
|
||||||
|
label: Text(title),
|
||||||
|
labelStyle: isSelected
|
||||||
|
? AppFonts.yekan10.copyWith(color: AppColor.mediumGreyDarkActive)
|
||||||
|
: AppFonts.yekan10,
|
||||||
|
selected: isSelected,
|
||||||
|
onSelected: (bool selected) => onTap(index),
|
||||||
|
backgroundColor: Colors.grey[200],
|
||||||
|
selectedColor: selectedColor,
|
||||||
|
showCheckmark: false,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: const BorderRadius.all(Radius.circular(8.0)),
|
||||||
|
side: BorderSide(width: 1, color: isSelected? selectedColor :unSelectedColor),
|
||||||
|
),
|
||||||
|
deleteIcon: Icon(CupertinoIcons.clear_circled),
|
||||||
|
onDeleted: isSelected ? () => onTap(index) : null,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
import 'package:rasadyar_core/core.dart';
|
|
||||||
|
|
||||||
class ActionLogic extends GetxController {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,218 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:rasadyar_core/core.dart';
|
|
||||||
|
|
||||||
import 'logic.dart';
|
|
||||||
|
|
||||||
class ActionPage extends GetView<ActionLogic> {
|
|
||||||
ActionPage({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Scaffold(
|
|
||||||
appBar: RAppBar(
|
|
||||||
title: 'لیست درخواستها',
|
|
||||||
hasBack: false,
|
|
||||||
centerTitle: true,
|
|
||||||
),
|
|
||||||
body: Column(
|
|
||||||
children: [
|
|
||||||
SizedBox(height: 16),
|
|
||||||
_searchWidget(),
|
|
||||||
SizedBox(height: 16),
|
|
||||||
SizedBox(
|
|
||||||
height: 50,
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
scrollDirection: Axis.horizontal,
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 12),
|
|
||||||
child: Row(
|
|
||||||
spacing: 12,
|
|
||||||
children: [
|
|
||||||
CustomChip(
|
|
||||||
title: 'انتخاب فیلتر',
|
|
||||||
index: 0,
|
|
||||||
isSelected: true,
|
|
||||||
selectedColor: AppColor.blueNormal,
|
|
||||||
onTap: (index) {},
|
|
||||||
),
|
|
||||||
|
|
||||||
RFilterChips(
|
|
||||||
title: 'درخواستهای من',
|
|
||||||
index: 1,
|
|
||||||
isSelected: true,
|
|
||||||
selectedColor: AppColor.yellowNormal,
|
|
||||||
onTap: (index) {},
|
|
||||||
),
|
|
||||||
|
|
||||||
RFilterChips(
|
|
||||||
title: 'در انتظار ثبت ',
|
|
||||||
index: 2,
|
|
||||||
selectedColor: AppColor.greenLightActive,
|
|
||||||
isSelected: true,
|
|
||||||
onTap: (index) {},
|
|
||||||
),
|
|
||||||
|
|
||||||
RFilterChips(
|
|
||||||
title: 'ارجاع به تعاونی',
|
|
||||||
index: 3,
|
|
||||||
selectedColor: AppColor.blueLightHover,
|
|
||||||
isSelected: true,
|
|
||||||
onTap: (index) {},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 10),
|
|
||||||
Expanded(
|
|
||||||
child: ListView.separated(
|
|
||||||
itemCount: 10,
|
|
||||||
physics: BouncingScrollPhysics(),
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
|
||||||
separatorBuilder: (context, index) => SizedBox(height: 16),
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
return Container(
|
|
||||||
width: Get.width,
|
|
||||||
height: 75,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color:
|
|
||||||
index < 3
|
|
||||||
? AppColor.yellowNormal
|
|
||||||
: index < 7
|
|
||||||
? AppColor.greenLightActive
|
|
||||||
: AppColor.blueLight,
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
SizedBox(width: 5),
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.white,
|
|
||||||
borderRadius: BorderRadius.only(
|
|
||||||
topRight: Radius.circular(8),
|
|
||||||
bottomRight: Radius.circular(8),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
SizedBox(width: 10),
|
|
||||||
Text(
|
|
||||||
'محمد احمدی',
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: AppFonts.yekan12.copyWith(
|
|
||||||
color: AppColor.blueNormal,
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 20),
|
|
||||||
Expanded(
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'پنج شنبه 14 اردیبهشت',
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: AppFonts.yekan10.copyWith(
|
|
||||||
color: AppColor.darkGreyNormal,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
' همدان - نهاوند - روستای - همدان - نهاوند - روستای ',
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: AppFonts.yekan10.copyWith(
|
|
||||||
color: AppColor.darkGreyNormal,
|
|
||||||
),
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
maxLines: 1,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 20),
|
|
||||||
GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
// controller.onTapMap();
|
|
||||||
},
|
|
||||||
child: SizedBox(
|
|
||||||
width: 50,
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Assets.vec.mapSvg.svg(
|
|
||||||
width: 20,
|
|
||||||
height: 20,
|
|
||||||
colorFilter: ColorFilter.mode(
|
|
||||||
AppColor.blueNormal,
|
|
||||||
BlendMode.srcIn,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 8),
|
|
||||||
Text(
|
|
||||||
'مسیریابی',
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: AppFonts.yekan10.copyWith(
|
|
||||||
color: AppColor.blueNormal,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
SizedBox(width: 20),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
Container(
|
|
||||||
width: 20,
|
|
||||||
child: Center(
|
|
||||||
child: RotatedBox(
|
|
||||||
quarterTurns: 3,
|
|
||||||
child: Text(
|
|
||||||
index < 3
|
|
||||||
? ' بازرسی'
|
|
||||||
: index < 7
|
|
||||||
? 'اطلاعات'
|
|
||||||
: 'ارجاع به تعاونی',
|
|
||||||
style: AppFonts.yekan8,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _searchWidget() {
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
|
||||||
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),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
hintText: 'جستجو',
|
|
||||||
onChanged: (value) {
|
|
||||||
//controller.search(value);
|
|
||||||
},
|
|
||||||
controller: TextEditingController(),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
import 'package:rasadyar_livestock/presentation/page/root/logic.dart';
|
||||||
|
|
||||||
|
class RequestTaggingLogic extends GetxController {
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onReady() {
|
||||||
|
super.onReady();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onClose() {
|
||||||
|
super.onClose();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import 'logic.dart';
|
||||||
|
|
||||||
|
class RequestTaggingPage extends GetView<RequestTaggingLogic> {
|
||||||
|
const RequestTaggingPage({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text('Request Tagging'),
|
||||||
|
centerTitle: true,
|
||||||
|
actions: [
|
||||||
|
IconButton(
|
||||||
|
icon: const Icon(Icons.search),
|
||||||
|
onPressed: () {
|
||||||
|
// Implement search functionality
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
Expanded(
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: 10, // Replace with your data length
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return ListTile(
|
||||||
|
title: Text('Request Item $index'),
|
||||||
|
onTap: () {
|
||||||
|
// Handle item tap
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
import 'package:rasadyar_livestock/presentation/page/root/logic.dart';
|
||||||
|
|
||||||
|
class RequestsLogic extends GetxController {
|
||||||
|
RxList<int> filterSelected = <int>[].obs;
|
||||||
|
|
||||||
|
}
|
||||||
255
packages/livestock/lib/presentation/page/requests/view.dart
Normal file
255
packages/livestock/lib/presentation/page/requests/view.dart
Normal file
@@ -0,0 +1,255 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
import 'package:rasadyar_livestock/presentation/routes/app_pages.dart';
|
||||||
|
|
||||||
|
import 'logic.dart';
|
||||||
|
|
||||||
|
class RequestsPage extends GetView<RequestsLogic> {
|
||||||
|
RequestsPage({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: RAppBar(
|
||||||
|
title: 'لیست درخواستها',
|
||||||
|
hasBack: false,
|
||||||
|
centerTitle: true,
|
||||||
|
),
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
SizedBox(height: 16),
|
||||||
|
_searchWidget(),
|
||||||
|
SizedBox(height: 16),
|
||||||
|
SizedBox(
|
||||||
|
height: 50,
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 12),
|
||||||
|
child: ObxValue((data) {
|
||||||
|
return Row(
|
||||||
|
spacing: 12,
|
||||||
|
children: [
|
||||||
|
CustomChip(
|
||||||
|
title: 'انتخاب فیلتر',
|
||||||
|
index: 0,
|
||||||
|
isSelected: true,
|
||||||
|
selectedColor: AppColor.blueNormal,
|
||||||
|
onTap: (index) {},
|
||||||
|
),
|
||||||
|
|
||||||
|
RFilterChips(
|
||||||
|
title: 'درخواستهای من',
|
||||||
|
index: 1,
|
||||||
|
isSelected: data.contains(1),
|
||||||
|
selectedColor: AppColor.yellowNormal,
|
||||||
|
onTap: (index) {
|
||||||
|
if (data.contains(1)) {
|
||||||
|
data.remove(1);
|
||||||
|
} else {
|
||||||
|
data.add(1);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
|
||||||
|
RFilterChips(
|
||||||
|
title: 'در انتظار ثبت ',
|
||||||
|
index: 2,
|
||||||
|
selectedColor: AppColor.greenLightActive,
|
||||||
|
isSelected: data.contains(2),
|
||||||
|
onTap: (index) {
|
||||||
|
if (data.contains(2)) {
|
||||||
|
data.remove(2);
|
||||||
|
} else {
|
||||||
|
data.add(2);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
|
||||||
|
RFilterChips(
|
||||||
|
title: 'ارجاع به تعاونی',
|
||||||
|
index: 3,
|
||||||
|
selectedColor: AppColor.blueLightHover,
|
||||||
|
isSelected: data.contains(3),
|
||||||
|
onTap: (index) {
|
||||||
|
if (data.contains(3)) {
|
||||||
|
data.remove(3);
|
||||||
|
} else {
|
||||||
|
data.add(3);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}, controller.filterSelected),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 10),
|
||||||
|
Expanded(
|
||||||
|
child: ListView.separated(
|
||||||
|
itemCount: 10,
|
||||||
|
physics: BouncingScrollPhysics(),
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||||
|
separatorBuilder: (context, index) => SizedBox(height: 16),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Get.toNamed(LiveStockRoutes.requestTagging,id: 0);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
width: Get.width,
|
||||||
|
height: 75,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color:
|
||||||
|
index < 3
|
||||||
|
? AppColor.yellowNormal
|
||||||
|
: index < 7
|
||||||
|
? AppColor.greenLightActive
|
||||||
|
: AppColor.blueLight,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
SizedBox(width: 5),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topRight: Radius.circular(8),
|
||||||
|
bottomRight: Radius.circular(8),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
SizedBox(width: 10),
|
||||||
|
Text(
|
||||||
|
'محمد احمدی',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: AppFonts.yekan12.copyWith(
|
||||||
|
color: AppColor.blueNormal,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 20),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'پنج شنبه 14 اردیبهشت',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: AppFonts.yekan10.copyWith(
|
||||||
|
color: AppColor.darkGreyNormal,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
' همدان - نهاوند - روستای - همدان - نهاوند - روستای ',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: AppFonts.yekan10.copyWith(
|
||||||
|
color: AppColor.darkGreyNormal,
|
||||||
|
),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
maxLines: 1,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 20),
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
// controller.onTapMap();
|
||||||
|
},
|
||||||
|
child: SizedBox(
|
||||||
|
width: 50,
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Assets.vec.mapSvg.svg(
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
colorFilter: ColorFilter.mode(
|
||||||
|
AppColor.blueNormal,
|
||||||
|
BlendMode.srcIn,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 8),
|
||||||
|
Text(
|
||||||
|
'مسیریابی',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: AppFonts.yekan10.copyWith(
|
||||||
|
color: AppColor.blueNormal,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(width: 20),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
Container(
|
||||||
|
width: 20,
|
||||||
|
child: Center(
|
||||||
|
child: RotatedBox(
|
||||||
|
quarterTurns: 3,
|
||||||
|
child: Text(
|
||||||
|
index < 3
|
||||||
|
? ' بازرسی'
|
||||||
|
: index < 7
|
||||||
|
? 'اطلاعات'
|
||||||
|
: 'ارجاع به تعاونی',
|
||||||
|
style: AppFonts.yekan8,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
RElevated(
|
||||||
|
text: '+ ایجاد درخواست',
|
||||||
|
width: Get.width - 36,
|
||||||
|
height: 40,
|
||||||
|
textStyle: AppFonts.yekan18.copyWith(color: Colors.white),
|
||||||
|
onPressed: () {
|
||||||
|
//TODO
|
||||||
|
},
|
||||||
|
),
|
||||||
|
SizedBox(height: 10),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _searchWidget() {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||||
|
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),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
hintText: 'جستجو',
|
||||||
|
onChanged: (value) {
|
||||||
|
//controller.search(value);
|
||||||
|
},
|
||||||
|
controller: TextEditingController(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +1,30 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
import 'package:rasadyar_livestock/presentation/page/action/view.dart';
|
|
||||||
import 'package:rasadyar_livestock/presentation/page/map/view.dart';
|
import 'package:rasadyar_livestock/presentation/page/map/view.dart';
|
||||||
import 'package:rasadyar_livestock/presentation/page/profile/view.dart';
|
import 'package:rasadyar_livestock/presentation/page/profile/view.dart';
|
||||||
|
import 'package:rasadyar_livestock/presentation/page/request_tagging/view.dart';
|
||||||
|
import 'package:rasadyar_livestock/presentation/page/requests/view.dart';
|
||||||
|
import 'package:rasadyar_livestock/presentation/routes/app_pages.dart';
|
||||||
|
|
||||||
class RootLogic extends GetxController {
|
class RootLogic extends GetxController {
|
||||||
List<Widget> pages = [ActionPage(), MapPage(), ProfilePage()];
|
List<Widget> pages = [
|
||||||
|
Navigator(
|
||||||
|
key: Get.nestedKey(0),
|
||||||
|
initialRoute: LiveStockRoutes.requests,
|
||||||
|
onGenerateRoute: (settings) {
|
||||||
|
switch (settings.name) {
|
||||||
|
case LiveStockRoutes.requests:
|
||||||
|
return GetPageRoute(page: () => RequestsPage());
|
||||||
|
case LiveStockRoutes.requestTagging:
|
||||||
|
return GetPageRoute(page: () => RequestTaggingPage());
|
||||||
|
default:
|
||||||
|
return GetPageRoute(page: () => RequestsPage());
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
MapPage(),
|
||||||
|
ProfilePage(),
|
||||||
|
];
|
||||||
RxInt currentIndex = 1.obs;
|
RxInt currentIndex = 1.obs;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -21,5 +40,4 @@ class RootLogic extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void changePage(int i) => currentIndex.value = i;
|
void changePage(int i) => currentIndex.value = i;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,36 +9,65 @@ class RootPage extends GetView<RootLogic> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ObxValue((currentIndex) {
|
return ObxValue((currentIndex) {
|
||||||
return Scaffold(
|
return PopScope(
|
||||||
body: IndexedStack(
|
canPop: false,
|
||||||
children: controller.pages,
|
onPopInvokedWithResult: (didPop, result) {
|
||||||
index: currentIndex.value,
|
final navigatorKey = Get.nestedKey(currentIndex);
|
||||||
sizing: StackFit.expand,
|
eLog('Pop invoked with result: $result, didPop: $didPop');
|
||||||
),
|
navigatorKey?.currentState?.pop();
|
||||||
|
|
||||||
bottomNavigationBar: BottomNavigation1(
|
|
||||||
items: [
|
|
||||||
BottomNavigation1Item(
|
|
||||||
icon: Assets.vec.filterSvg.path,
|
|
||||||
label: 'درخواستها',
|
|
||||||
isSelected: currentIndex.value == 0,
|
|
||||||
onTap: () => controller.changePage(0),
|
|
||||||
),
|
|
||||||
|
|
||||||
BottomNavigation1Item(
|
/*eLog('Pop invoked with result: $result, didPop: $didPop');
|
||||||
icon: Assets.vec.mapSvg.path,
|
iLog(Get.currentRoute);
|
||||||
label: 'نقشه',
|
iLog(Get.previousRoute);
|
||||||
isSelected: currentIndex.value == 1,
|
|
||||||
onTap: () => controller.changePage(1),
|
|
||||||
),
|
|
||||||
|
|
||||||
BottomNavigation1Item(
|
final navigatorKey = Get.nestedKey(currentIndex);
|
||||||
icon: Assets.vec.profileUserSvg.path,
|
|
||||||
label: 'پروفایل',
|
if (currentIndex.value == 0 &&
|
||||||
isSelected: currentIndex.value == 2,
|
navigatorKey != null &&
|
||||||
onTap: () => controller.changePage(2),
|
navigatorKey.currentState != null) {
|
||||||
),
|
if (navigatorKey.currentState!.canPop()) {
|
||||||
],
|
navigatorKey.currentState!.pop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!didPop) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
},
|
||||||
|
|
||||||
|
child: Scaffold(
|
||||||
|
body: IndexedStack(
|
||||||
|
children: controller.pages,
|
||||||
|
index: currentIndex.value,
|
||||||
|
sizing: StackFit.expand,
|
||||||
|
),
|
||||||
|
|
||||||
|
bottomNavigationBar: BottomNavigation1(
|
||||||
|
items: [
|
||||||
|
BottomNavigation1Item(
|
||||||
|
icon: Assets.vec.filterSvg.path,
|
||||||
|
label: 'درخواستها',
|
||||||
|
isSelected: currentIndex.value == 0,
|
||||||
|
onTap: () => controller.changePage(0),
|
||||||
|
),
|
||||||
|
|
||||||
|
BottomNavigation1Item(
|
||||||
|
icon: Assets.vec.mapSvg.path,
|
||||||
|
label: 'نقشه',
|
||||||
|
isSelected: currentIndex.value == 1,
|
||||||
|
onTap: () => controller.changePage(1),
|
||||||
|
),
|
||||||
|
|
||||||
|
BottomNavigation1Item(
|
||||||
|
icon: Assets.vec.profileUserSvg.path,
|
||||||
|
label: 'پروفایل',
|
||||||
|
isSelected: currentIndex.value == 2,
|
||||||
|
onTap: () => controller.changePage(2),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}, controller.currentIndex);
|
}, controller.currentIndex);
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import 'package:rasadyar_auth/auth.dart';
|
import 'package:rasadyar_auth/auth.dart';
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
import 'package:rasadyar_core/presentation/widget/map/logic.dart';
|
import 'package:rasadyar_core/presentation/widget/map/logic.dart';
|
||||||
import 'package:rasadyar_livestock/presentation/page/action/logic.dart';
|
|
||||||
import 'package:rasadyar_livestock/presentation/page/map/logic.dart';
|
import 'package:rasadyar_livestock/presentation/page/map/logic.dart';
|
||||||
import 'package:rasadyar_livestock/presentation/page/profile/logic.dart';
|
import 'package:rasadyar_livestock/presentation/page/profile/logic.dart';
|
||||||
|
import 'package:rasadyar_livestock/presentation/page/request_tagging/logic.dart';
|
||||||
|
import 'package:rasadyar_livestock/presentation/page/request_tagging/view.dart';
|
||||||
|
import 'package:rasadyar_livestock/presentation/page/requests/logic.dart';
|
||||||
import 'package:rasadyar_livestock/presentation/page/root/logic.dart';
|
import 'package:rasadyar_livestock/presentation/page/root/logic.dart';
|
||||||
import 'package:rasadyar_livestock/presentation/page/root/view.dart';
|
import 'package:rasadyar_livestock/presentation/page/root/view.dart';
|
||||||
|
|
||||||
@@ -19,13 +21,23 @@ sealed class LiveStockPages {
|
|||||||
middlewares: [AuthMiddleware()],
|
middlewares: [AuthMiddleware()],
|
||||||
binding: BindingsBuilder(() {
|
binding: BindingsBuilder(() {
|
||||||
Get.put(RootLogic());
|
Get.put(RootLogic());
|
||||||
BindingsBuilder.put(() => RootLogic());
|
Get.lazyPut(() => RequestsLogic());
|
||||||
Get.lazyPut(() => ActionLogic());
|
|
||||||
Get.lazyPut(() => MapLogic());
|
Get.lazyPut(() => MapLogic());
|
||||||
Get.lazyPut(() => ProfileLogic());
|
Get.lazyPut(() => ProfileLogic());
|
||||||
Get.lazyPut(() => ProfileLogic());
|
Get.lazyPut(() => ProfileLogic());
|
||||||
Get.lazyPut(() => MapWidgetLogic());
|
Get.lazyPut(() => MapWidgetLogic());
|
||||||
}),
|
}),
|
||||||
|
children: [
|
||||||
|
GetPage(
|
||||||
|
name: LiveStockRoutes.requestTagging,
|
||||||
|
page: () => RequestTaggingPage(),
|
||||||
|
middlewares: [AuthMiddleware()],
|
||||||
|
binding: BindingsBuilder(() {
|
||||||
|
Get.lazyPut(() => RequestTaggingLogic());
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
]
|
||||||
),
|
),
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,7 @@ sealed class LiveStockRoutes {
|
|||||||
LiveStockRoutes._();
|
LiveStockRoutes._();
|
||||||
|
|
||||||
static const init = '/liveStock';
|
static const init = '/liveStock';
|
||||||
static const action = '$init/liveStock';
|
static const requests = '/requests';
|
||||||
static const map = '$init/liveStock';
|
static const profile = '/profile';
|
||||||
static const profile = '$init/profile';
|
static const requestTagging = '$init/tagging';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user