feat : app bar
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:rasadyar_inspection/presentation/routes/app_routes.dart';
|
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
import 'package:rasadyar_core/presentation/widget/buttons/fab.dart';
|
import 'package:rasadyar_core/presentation/widget/buttons/fab.dart';
|
||||||
|
import 'package:rasadyar_inspection/presentation/routes/app_routes.dart';
|
||||||
|
|
||||||
import 'logic.dart';
|
import 'logic.dart';
|
||||||
|
|
||||||
@@ -11,24 +11,41 @@ class SupervisionFilterPage extends GetView<InspectorFilterLogic> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: RAppBar.noBack(title: 'نقشه'),
|
appBar: RAppBar.noBack(title: 'نقشه', additionalActions: [_searchButton(), _filterButton()]),
|
||||||
body: PopScope(
|
body: PopScope(
|
||||||
canPop: !controller.bottomSheetManager.isAnyVisible,
|
canPop: !controller.bottomSheetManager.isAnyVisible,
|
||||||
onPopInvokedWithResult: (didPop, result) {
|
onPopInvokedWithResult: (didPop, result) {
|
||||||
controller.bottomSheetManager.closeFirstVisible();
|
controller.bottomSheetManager.closeFirstVisible();
|
||||||
},
|
},
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [_buildMap(), _buildGpsButton(), Obx(() => controller.bottomSheetManager.buildVisibleSheet())],
|
||||||
_buildMap(),
|
|
||||||
_buildGpsButton(),
|
|
||||||
_buildFilterButton(),
|
|
||||||
Obx(() => controller.bottomSheetManager.buildVisibleSheet()),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GestureDetector _searchButton() {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () async{
|
||||||
|
|
||||||
|
},
|
||||||
|
child: Assets.vec.searchSvg
|
||||||
|
.svg(width: 24, height: 24, colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn))
|
||||||
|
.paddingOnly(left: 16),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
GestureDetector _filterButton() {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
controller.filterBottomSheetController.toggle();
|
||||||
|
},
|
||||||
|
child: Assets.vec.filterSvg
|
||||||
|
.svg(width: 24, height: 24, colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn))
|
||||||
|
.paddingOnly(left: 16),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Widget _buildMap() {
|
Widget _buildMap() {
|
||||||
return ObxValue((currentLocation) {
|
return ObxValue((currentLocation) {
|
||||||
return FlutterMap(
|
return FlutterMap(
|
||||||
@@ -41,25 +58,19 @@ class SupervisionFilterPage extends GetView<InspectorFilterLogic> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
children: [
|
children: [
|
||||||
TileLayer(
|
TileLayer(urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png'),
|
||||||
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
|
|
||||||
),
|
|
||||||
ObxValue((markers) {
|
ObxValue((markers) {
|
||||||
return MarkerLayer(
|
return MarkerLayer(
|
||||||
markers:
|
markers: markers
|
||||||
markers
|
.map(
|
||||||
.map(
|
(e) => markerWidget(
|
||||||
(e) => markerWidget(
|
marker: e,
|
||||||
marker: e,
|
onTap: () {
|
||||||
onTap: () {
|
controller.selectedLocationBottomSheetController.isVisible.value = true;
|
||||||
controller
|
},
|
||||||
.selectedLocationBottomSheetController
|
),
|
||||||
.isVisible
|
)
|
||||||
.value = true;
|
.toList(),
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.toList(),
|
|
||||||
);
|
);
|
||||||
}, controller.markers),
|
}, controller.markers),
|
||||||
],
|
],
|
||||||
@@ -70,12 +81,12 @@ class SupervisionFilterPage extends GetView<InspectorFilterLogic> {
|
|||||||
Widget _buildGpsButton() {
|
Widget _buildGpsButton() {
|
||||||
return Positioned(
|
return Positioned(
|
||||||
right: 10,
|
right: 10,
|
||||||
bottom: 83,
|
bottom: 15,
|
||||||
child: ObxValue((data) {
|
child: ObxValue((data) {
|
||||||
return RFab.small(
|
return RFab(
|
||||||
backgroundColor: AppColor.greenNormal,
|
backgroundColor: AppColor.greenNormal,
|
||||||
isLoading: data.value,
|
isLoading: data.value,
|
||||||
icon: Assets.vec.gpsSvg.svg(),
|
icon: Assets.vec.gpsSvg.svg(width: 28, height: 28),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
controller.isLoading.value = true;
|
controller.isLoading.value = true;
|
||||||
await controller.determineCurrentPosition();
|
await controller.determineCurrentPosition();
|
||||||
@@ -85,18 +96,6 @@ class SupervisionFilterPage extends GetView<InspectorFilterLogic> {
|
|||||||
}, controller.isLoading),
|
}, controller.isLoading),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildFilterButton() {
|
|
||||||
return Positioned(
|
|
||||||
right: 10,
|
|
||||||
bottom: 30,
|
|
||||||
child: RFab.small(
|
|
||||||
backgroundColor: AppColor.blueNormal,
|
|
||||||
icon: Assets.vec.filterSvg.svg(width: 24,height: 24),
|
|
||||||
onPressed: () => controller.filterBottomSheetController.toggle(),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Marker markerWidget({required LatLng marker, required VoidCallback onTap}) {
|
Marker markerWidget({required LatLng marker, required VoidCallback onTap}) {
|
||||||
@@ -105,14 +104,7 @@ Marker markerWidget({required LatLng marker, required VoidCallback onTap}) {
|
|||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
behavior: HitTestBehavior.opaque,
|
behavior: HitTestBehavior.opaque,
|
||||||
child: SizedBox(
|
child: SizedBox(width: 36, height: 36, child: Assets.vec.mapMarkerSvg.svg(width: 30, height: 30)),
|
||||||
width: 36,
|
|
||||||
height: 36,
|
|
||||||
child:Assets.vec.mapMarkerSvg.svg(
|
|
||||||
width: 30,
|
|
||||||
height: 30,
|
|
||||||
)
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -316,9 +308,7 @@ Widget markerDetailsWidget() {
|
|||||||
Text(
|
Text(
|
||||||
'داود خرم پور',
|
'داود خرم پور',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: AppFonts.yekan16.copyWith(
|
style: AppFonts.yekan16.copyWith(color: AppColor.darkGreyDarkHover),
|
||||||
color: AppColor.darkGreyDarkHover,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Spacer(),
|
Spacer(),
|
||||||
vecWidgetWithOnTap(
|
vecWidgetWithOnTap(
|
||||||
@@ -355,9 +345,7 @@ Widget markerDetailsWidget() {
|
|||||||
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||||
decoration: ShapeDecoration(
|
decoration: ShapeDecoration(
|
||||||
color: AppColor.blueLight,
|
color: AppColor.blueLight,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(side: BorderSide(width: 1, color: AppColor.blueLightHover)),
|
||||||
side: BorderSide(width: 1, color: AppColor.blueLightHover),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
@@ -365,16 +353,12 @@ Widget markerDetailsWidget() {
|
|||||||
Text(
|
Text(
|
||||||
'باقی مانده',
|
'باقی مانده',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: AppFonts.yekan14.copyWith(
|
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||||
color: AppColor.darkGreyDarkHover,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'0 کیلوگرم',
|
'0 کیلوگرم',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: AppFonts.yekan14.copyWith(
|
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||||
color: AppColor.darkGreyDarkHover,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -387,16 +371,12 @@ Widget markerDetailsWidget() {
|
|||||||
Text(
|
Text(
|
||||||
'شماره همراه',
|
'شماره همراه',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: AppFonts.yekan14.copyWith(
|
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||||
color: AppColor.darkGreyDarkHover,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'0326598653',
|
'0326598653',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: AppFonts.yekan14.copyWith(
|
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||||
color: AppColor.darkGreyDarkHover,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -408,17 +388,13 @@ Widget markerDetailsWidget() {
|
|||||||
Text(
|
Text(
|
||||||
'آخرین فعالیت',
|
'آخرین فعالیت',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: AppFonts.yekan14.copyWith(
|
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||||
color: AppColor.darkGreyDarkHover,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
'1409/12/12',
|
'1409/12/12',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: AppFonts.yekan14.copyWith(
|
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||||
color: AppColor.darkGreyDarkHover,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -430,16 +406,12 @@ Widget markerDetailsWidget() {
|
|||||||
Text(
|
Text(
|
||||||
'موجودی',
|
'موجودی',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: AppFonts.yekan14.copyWith(
|
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||||
color: AppColor.darkGreyDarkHover,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'5کیلوگرم',
|
'5کیلوگرم',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: AppFonts.yekan14.copyWith(
|
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||||
color: AppColor.darkGreyDarkHover,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -454,16 +426,12 @@ Widget markerDetailsWidget() {
|
|||||||
Text(
|
Text(
|
||||||
'فروش رفته',
|
'فروش رفته',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: AppFonts.yekan14.copyWith(
|
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||||
color: AppColor.darkGreyDarkHover,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'0 کیلوگرم',
|
'0 کیلوگرم',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: AppFonts.yekan14.copyWith(
|
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||||
color: AppColor.darkGreyDarkHover,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -473,12 +441,7 @@ Widget markerDetailsWidget() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget customChip({
|
Widget customChip({bool isSelected = false, required String title, required int index, required Function(int) onTap}) {
|
||||||
bool isSelected = false,
|
|
||||||
required String title,
|
|
||||||
required int index,
|
|
||||||
required Function(int) onTap,
|
|
||||||
}) {
|
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
onTap.call(index);
|
onTap.call(index);
|
||||||
@@ -489,18 +452,14 @@ Widget customChip({
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: isSelected ? AppColor.blueNormal : AppColor.whiteGreyNormal,
|
color: isSelected ? AppColor.blueNormal : AppColor.whiteGreyNormal,
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
border:
|
border: isSelected
|
||||||
isSelected
|
? Border.fromBorderSide(BorderSide.none)
|
||||||
? Border.fromBorderSide(BorderSide.none)
|
: Border.all(width: 0.25, color: const Color(0xFFB0B0B0)),
|
||||||
: Border.all(width: 0.25, color: const Color(0xFFB0B0B0)),
|
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
title,
|
title,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style:
|
style: isSelected ? AppFonts.yekan10.copyWith(color: AppColor.whiteLight) : AppFonts.yekan10,
|
||||||
isSelected
|
|
||||||
? AppFonts.yekan10.copyWith(color: AppColor.whiteLight)
|
|
||||||
: AppFonts.yekan10,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -531,11 +490,8 @@ Widget selectedLocationWidget({
|
|||||||
backgroundColor: AppColor.blueNormal,
|
backgroundColor: AppColor.blueNormal,
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: Colors.white,
|
||||||
padding: EdgeInsets.all(16),
|
padding: EdgeInsets.all(16),
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(bottomRight: Radius.circular(8), topRight: Radius.circular(8)),
|
||||||
bottomRight: Radius.circular(8),
|
child: Assets.vec.mapSvg.svg(width: 24, height: 24),
|
||||||
topRight: Radius.circular(8),
|
|
||||||
),
|
|
||||||
child: Assets.vec.mapSvg.svg( width: 24, height: 24),
|
|
||||||
),
|
),
|
||||||
CustomSlidableAction(
|
CustomSlidableAction(
|
||||||
onPressed: (context) {
|
onPressed: (context) {
|
||||||
@@ -549,12 +505,9 @@ Widget selectedLocationWidget({
|
|||||||
onPressed: (context) {},
|
onPressed: (context) {},
|
||||||
backgroundColor: AppColor.warning,
|
backgroundColor: AppColor.warning,
|
||||||
padding: EdgeInsets.all(16),
|
padding: EdgeInsets.all(16),
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(8), topLeft: Radius.circular(8)),
|
||||||
bottomLeft: Radius.circular(8),
|
child: Assets.vec.securityTimeSvg.svg(),
|
||||||
topLeft: Radius.circular(8),
|
),
|
||||||
),
|
|
||||||
child: Assets.vec.securityTimeSvg.svg()),
|
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
@@ -572,34 +525,14 @@ Widget selectedLocationWidget({
|
|||||||
children: [
|
children: [
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text('داود خرم مهری پور', style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal)),
|
||||||
'داود خرم مهری پور',
|
Text('گوشت و مرغ', style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover)),
|
||||||
style: AppFonts.yekan10.copyWith(
|
|
||||||
color: AppColor.blueNormal,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
'گوشت و مرغ',
|
|
||||||
style: AppFonts.yekan12.copyWith(
|
|
||||||
color: AppColor.darkGreyDarkHover,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text('باقی مانده', style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal)),
|
||||||
'باقی مانده',
|
Text('0 کیلوگرم', style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover)),
|
||||||
style: AppFonts.yekan10.copyWith(
|
|
||||||
color: AppColor.blueNormal,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
'0 کیلوگرم',
|
|
||||||
style: AppFonts.yekan12.copyWith(
|
|
||||||
color: AppColor.darkGreyDarkHover,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Assets.vec.scanBarcodeSvg.svg(),
|
Assets.vec.scanBarcodeSvg.svg(),
|
||||||
|
|||||||
Reference in New Issue
Block a user