feat: actions and map page

This commit is contained in:
2025-05-21 14:43:26 +03:30
parent b5406a00a0
commit 1ed8e69262
19 changed files with 586 additions and 33 deletions

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
import 'logic.dart';
class ActionPage extends GetView<ActionLogic> {
@@ -7,6 +8,211 @@ class ActionPage extends GetView<ActionLogic> {
@override
Widget build(BuildContext context) {
return Container();
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(),
),
);
}
}

View File

@@ -2,4 +2,7 @@ import 'package:rasadyar_core/core.dart';
class MapLogic extends GetxController {
}

View File

@@ -1,14 +1,22 @@
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> {
MapPage({super.key});
@override
Widget build(BuildContext context) {
return Container();
return Scaffold(
body: Stack(
children: [
MapWidget(),
],
),
);
}
}
}

View File

@@ -6,7 +6,7 @@ import 'package:rasadyar_livestock/presentation/page/profile/view.dart';
class RootLogic extends GetxController {
List<Widget> pages = [ActionPage(), MapPage(), ProfilePage()];
RxInt indexedPage = 1.obs;
RxInt currentIndex = 1.obs;
@override
void onReady() {
@@ -19,4 +19,7 @@ class RootLogic extends GetxController {
// TODO: implement onClose
super.onClose();
}
void changePage(int i) => currentIndex.value = i;
}

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
import 'logic.dart';
class RootPage extends GetView<RootLogic> {
@@ -7,14 +8,39 @@ class RootPage extends GetView<RootLogic> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: ObxValue((data) {
return IndexedStack(
return ObxValue((currentIndex) {
return Scaffold(
body: IndexedStack(
children: controller.pages,
index: data.value,
index: currentIndex.value,
sizing: StackFit.expand,
);
}, controller.indexedPage),
);
),
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);
}
}