feat : request and request tagging
This commit is contained in:
@@ -2,7 +2,7 @@ import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class MapLogic extends GetxController {
|
||||
|
||||
|
||||
var ss = Get.find<DraggableBottomSheetController>();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/material.dart' as mt;
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_core/presentation/widget/map/view.dart';
|
||||
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class MapPage extends GetView<MapLogic> {
|
||||
@@ -14,9 +11,20 @@ class MapPage extends GetView<MapLogic> {
|
||||
return Scaffold(
|
||||
body: Stack(
|
||||
children: [
|
||||
MapWidget(),
|
||||
MapWidget(
|
||||
markerWidget: Icon(Icons.pin_drop_rounded),
|
||||
initOnTap: () {
|
||||
|
||||
},
|
||||
initMarkerWidget: Assets.vec.mapMarkerSvg.svg(
|
||||
width: 30,
|
||||
height: 30,
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_livestock/presentation/page/root/logic.dart';
|
||||
|
||||
class RequestTaggingLogic extends GetxController {
|
||||
|
||||
|
||||
final TextEditingController phoneController = TextEditingController();
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_livestock/presentation/routes/app_pages.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
@@ -9,37 +11,98 @@ class RequestTaggingPage extends GetView<RequestTaggingLogic> {
|
||||
@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
|
||||
},
|
||||
),
|
||||
],
|
||||
backgroundColor: Colors.white,
|
||||
appBar: RAppBar(
|
||||
title: 'درخواست پلاک کوبی',
|
||||
leadingWidth: 40,
|
||||
leading: Assets.vec.messageAddSvg.svg(width: 12, height: 12),
|
||||
),
|
||||
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
|
||||
},
|
||||
);
|
||||
},
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 15),
|
||||
child: Column(
|
||||
children: [
|
||||
RTextField(
|
||||
controller: controller.phoneController,
|
||||
label: 'تلفن دامدار',
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
SizedBox(
|
||||
width: Get.width,
|
||||
height: 356,
|
||||
child: Card(
|
||||
color: Colors.white,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
width: Get.width,
|
||||
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.lightGreyNormal,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Center(
|
||||
child: Assets.images.placeHolder.image(
|
||||
height: 150,
|
||||
width: 200,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
Container(
|
||||
width: Get.width,
|
||||
height: 40,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: ShapeDecoration(
|
||||
color: AppColor.blueNormal,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
' تصویر گله',
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
Icon(
|
||||
CupertinoIcons.arrow_up_doc,
|
||||
color: Colors.white,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Spacer(),
|
||||
|
||||
|
||||
|
||||
RElevated(
|
||||
text: 'ارسال تصویر گله',
|
||||
onPressed: () {
|
||||
Get.toNamed(LiveStockRoutes.tagging);
|
||||
},
|
||||
height: 40,
|
||||
isFullWidth: true,
|
||||
backgroundColor: AppColor.greenNormal,
|
||||
textStyle: AppFonts.yekan16.copyWith(color: Colors.white),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ class RequestsPage extends GetView<RequestsLogic> {
|
||||
itemBuilder: (context, index) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(LiveStockRoutes.requestTagging,id: 0);
|
||||
Get.toNamed(LiveStockRoutes.requestTagging);
|
||||
},
|
||||
child: Container(
|
||||
width: Get.width,
|
||||
|
||||
@@ -9,6 +9,7 @@ class RootPage extends GetView<RootLogic> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ObxValue((currentIndex) {
|
||||
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
onPopInvokedWithResult: (didPop, result) {
|
||||
@@ -16,7 +17,6 @@ class RootPage extends GetView<RootLogic> {
|
||||
eLog('Pop invoked with result: $result, didPop: $didPop');
|
||||
navigatorKey?.currentState?.pop();
|
||||
|
||||
|
||||
/*eLog('Pop invoked with result: $result, didPop: $didPop');
|
||||
iLog(Get.currentRoute);
|
||||
iLog(Get.previousRoute);
|
||||
@@ -39,11 +39,11 @@ class RootPage extends GetView<RootLogic> {
|
||||
|
||||
child: Scaffold(
|
||||
body: IndexedStack(
|
||||
children: controller.pages,
|
||||
children: [...controller.pages],
|
||||
index: currentIndex.value,
|
||||
sizing: StackFit.expand,
|
||||
),
|
||||
|
||||
extendBody: true,
|
||||
bottomNavigationBar: BottomNavigation1(
|
||||
items: [
|
||||
BottomNavigation1Item(
|
||||
|
||||
15
packages/livestock/lib/presentation/page/tagging/logic.dart
Normal file
15
packages/livestock/lib/presentation/page/tagging/logic.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class TaggingLogic extends GetxController {
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
239
packages/livestock/lib/presentation/page/tagging/view.dart
Normal file
239
packages/livestock/lib/presentation/page/tagging/view.dart
Normal file
@@ -0,0 +1,239 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_core/presentation/widget/buttons/fab.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class TaggingPage extends GetView<TaggingLogic> {
|
||||
const TaggingPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: RAppBar(
|
||||
title: 'پلاک کوبی',
|
||||
leadingWidth: 40,
|
||||
leading: Assets.vec.messageAddSvg.svg(width: 12, height: 12),
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 15),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.greenLightHover,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.darkGreyLight),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text('آمار ثبت شده : سبک 5 و سنگین 8 راس'),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 4),
|
||||
IconButton(
|
||||
onPressed: () {},
|
||||
style: IconButton.styleFrom(
|
||||
backgroundColor: AppColor.blueNormal,
|
||||
fixedSize: Size(40, 40),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
icon: Assets.vec.editSvg.svg(),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Expanded(
|
||||
child: Card(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
color: Colors.white,
|
||||
child: Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
GridView.builder(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 20,
|
||||
vertical: 10,
|
||||
),
|
||||
itemCount: 20,
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
crossAxisSpacing: 12,
|
||||
mainAxisSpacing: 8,
|
||||
),
|
||||
itemBuilder: (context, index) {
|
||||
return Container(
|
||||
decoration: ShapeDecoration(
|
||||
color: AppColor.lightGreyLightHover,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 1,
|
||||
color: AppColor.blackLightHover,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Assets.vec.editSvg.svg(
|
||||
width: 16,
|
||||
height: 16,
|
||||
colorFilter: ColorFilter.mode(
|
||||
AppColor.blueNormal,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
Assets.vec.trashSvg.svg(
|
||||
width: 16,
|
||||
height: 16,
|
||||
colorFilter: ColorFilter.mode(
|
||||
AppColor.error,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
'گوسفند ماده',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
Text(
|
||||
'سن : 18 ماه',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.darkGreyNormal,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'نوع نژاد',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.bgDark,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'1212115112512',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'نوع پلاک',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.bgDark,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
Positioned(
|
||||
bottom: 10,
|
||||
right: 3,
|
||||
child: RFab.add(
|
||||
onPressed: () {
|
||||
Get.bottomSheet(
|
||||
Container(
|
||||
padding: EdgeInsets.all(20),
|
||||
color: Colors.white,
|
||||
height: 300,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
height: 40,
|
||||
width: Get.width,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(
|
||||
width: 1,
|
||||
color: AppColor.darkGreyLight,
|
||||
),
|
||||
),
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'گونه دام',
|
||||
style: AppFonts.yekan14,
|
||||
),
|
||||
Icon(CupertinoIcons.chevron_up),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
/* DropdownMenu(
|
||||
width: Get.width,
|
||||
|
||||
dropdownMenuEntries: [
|
||||
DropdownMenuEntry(
|
||||
value: 'گوسفند',
|
||||
label: 'گوسفند',
|
||||
),
|
||||
DropdownMenuEntry(
|
||||
value: 'بز',
|
||||
label: 'بز',
|
||||
),
|
||||
DropdownMenuEntry(
|
||||
value: 'گوساله',
|
||||
label: 'گوساله',
|
||||
),
|
||||
],
|
||||
),*/
|
||||
],
|
||||
),
|
||||
),
|
||||
isScrollControlled: true,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
SizedBox(height: 10),
|
||||
|
||||
RElevated(
|
||||
text: 'ثبت نهایی و ارسال به اتحادیه',
|
||||
textStyle: AppFonts.yekan18,
|
||||
height: 40,
|
||||
backgroundColor: AppColor.greenNormal,
|
||||
onPressed: () {},
|
||||
isFullWidth: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,8 @@ 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/view.dart';
|
||||
import 'package:rasadyar_livestock/presentation/page/tagging/logic.dart';
|
||||
import 'package:rasadyar_livestock/presentation/page/tagging/view.dart';
|
||||
|
||||
part 'app_routes.dart';
|
||||
|
||||
@@ -26,18 +28,35 @@ sealed class LiveStockPages {
|
||||
Get.lazyPut(() => ProfileLogic());
|
||||
Get.lazyPut(() => ProfileLogic());
|
||||
Get.lazyPut(() => MapWidgetLogic());
|
||||
Get.lazyPut(() => DraggableBottomSheetController());
|
||||
}),
|
||||
children: [
|
||||
GetPage(
|
||||
/*GetPage(
|
||||
name: LiveStockRoutes.requestTagging,
|
||||
page: () => RequestTaggingPage(),
|
||||
middlewares: [AuthMiddleware()],
|
||||
binding: BindingsBuilder(() {
|
||||
Get.lazyPut(() => RequestTaggingLogic());
|
||||
}),
|
||||
),
|
||||
]
|
||||
),*/
|
||||
],
|
||||
),
|
||||
|
||||
GetPage(
|
||||
name: LiveStockRoutes.requestTagging,
|
||||
page: () => RequestTaggingPage(),
|
||||
middlewares: [AuthMiddleware()],
|
||||
binding: BindingsBuilder(() {
|
||||
Get.lazyPut(() => RequestTaggingLogic());
|
||||
}),
|
||||
),
|
||||
GetPage(
|
||||
name: LiveStockRoutes.tagging,
|
||||
page: () => TaggingPage(),
|
||||
middlewares: [AuthMiddleware()],
|
||||
binding: BindingsBuilder(() {
|
||||
Get.lazyPut(() => TaggingLogic());
|
||||
}),
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -6,5 +6,8 @@ sealed class LiveStockRoutes {
|
||||
static const init = '/liveStock';
|
||||
static const requests = '/requests';
|
||||
static const profile = '/profile';
|
||||
static const requestTagging = '$init/tagging';
|
||||
|
||||
//static const requestTagging = '$init/tagging';
|
||||
static const requestTagging = '$requests/tagging';
|
||||
static const tagging = '/tagging';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user