chore : change package supervision to inspection
This commit is contained in:
91
features/inspection/lib/data/utils/marker_generator.dart
Normal file
91
features/inspection/lib/data/utils/marker_generator.dart
Normal file
@@ -0,0 +1,91 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
|
||||
|
||||
/*
|
||||
class GridGenParams {
|
||||
final LatLng center;
|
||||
final int count;
|
||||
final double spacingMeters;
|
||||
|
||||
const GridGenParams({
|
||||
required this.center,
|
||||
required this.count,
|
||||
required this.spacingMeters,
|
||||
});
|
||||
}Future<List<LatLng>> generateGridMarkersIsolate(GridGenParams params) async {
|
||||
return compute(_generateGridMarkersOptimized, params);
|
||||
}
|
||||
|
||||
List<LatLng> _generateGridMarkersOptimized(GridGenParams params) {
|
||||
final List<LatLng> result = [];
|
||||
final Distance distance = const Distance();
|
||||
|
||||
// Pre-calculate the grid dimensions
|
||||
final int gridSize = sqrt(params.count).ceil();
|
||||
final double halfWidth = (gridSize * params.spacingMeters) / 2;
|
||||
final double halfHeight = (gridSize * params.spacingMeters) / 2;
|
||||
|
||||
// Calculate top-left corner of the grid
|
||||
final LatLng topLeft = distance.offset(
|
||||
distance.offset(params.center, -halfHeight, 0), // south
|
||||
-halfWidth, 270 // west
|
||||
);
|
||||
|
||||
// Generate grid in batches for better memory management
|
||||
const int batchSize = 10000;
|
||||
for (int batch = 0; batch < (params.count / batchSize).ceil(); batch++) {
|
||||
final int startIdx = batch * batchSize;
|
||||
final int endIdx = min((batch + 1) * batchSize, params.count);
|
||||
|
||||
for (int i = startIdx; i < endIdx; i++) {
|
||||
final int row = i ~/ gridSize;
|
||||
final int col = i % gridSize;
|
||||
|
||||
final double dx = col * params.spacingMeters;
|
||||
final double dy = row * params.spacingMeters;
|
||||
|
||||
final LatLng point = distance.offset(
|
||||
distance.offset(topLeft, dy, 180), // south
|
||||
dx, 90 // east
|
||||
);
|
||||
|
||||
result.add(point);
|
||||
}
|
||||
}
|
||||
|
||||
return result.sublist(0, min(result.length, params.count));
|
||||
}
|
||||
*/
|
||||
class LatLngSimple {
|
||||
final double lat;
|
||||
final double lng;
|
||||
|
||||
LatLngSimple(this.lat, this.lng);
|
||||
|
||||
Map<String, double> toJson() => {'lat': lat, 'lng': lng};
|
||||
}
|
||||
|
||||
|
||||
List<LatLngSimple> generateLatLngInIsolate(int count) {
|
||||
final Random random = Random();
|
||||
const double minLat = 35.610;
|
||||
const double maxLat = 36.120;
|
||||
const double minLng = 50.190;
|
||||
const double maxLng = 51.100;
|
||||
|
||||
return List.generate(count, (_) {
|
||||
double lat = minLat + random.nextDouble() * (maxLat - minLat);
|
||||
double lng = minLng + random.nextDouble() * (maxLng - minLng);
|
||||
return LatLngSimple(lat, lng);
|
||||
});
|
||||
}
|
||||
|
||||
Future<List<LatLng>> generateLocationsUsingCompute(int count) async {
|
||||
final result = await compute(generateLatLngInIsolate, count);
|
||||
return result.map((e) => LatLng(e.lat, e.lng)).toList();
|
||||
}
|
||||
7
features/inspection/lib/inspection.dart
Normal file
7
features/inspection/lib/inspection.dart
Normal file
@@ -0,0 +1,7 @@
|
||||
library;
|
||||
|
||||
export 'presentation/filter/logic.dart';
|
||||
export 'presentation/filter/view.dart';
|
||||
export 'presentation/routes/app_pages.dart';
|
||||
export 'presentation/routes/app_routes.dart';
|
||||
|
||||
80
features/inspection/lib/presentation/action/logic.dart
Normal file
80
features/inspection/lib/presentation/action/logic.dart
Normal file
@@ -0,0 +1,80 @@
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_core/data/utils.dart';
|
||||
|
||||
class ActionLogic extends GetxController with GetTickerProviderStateMixin {
|
||||
late Rx<SlidableController> slidController;
|
||||
bool showSlideHint = true;
|
||||
|
||||
RxInt selectedIndex = 0.obs;
|
||||
RxInt previousIndex = 0.obs;
|
||||
|
||||
List<String> headersTitle = [
|
||||
'کاربران',
|
||||
'سوابق بازرسی من',
|
||||
'آمار',
|
||||
'خروج از سامانه',
|
||||
];
|
||||
|
||||
List<String> headersIcons = [
|
||||
Assets.vecProfileUserSvg,
|
||||
Assets.vecCalendarSearchSvg,
|
||||
Assets.vecDiagramSvg,
|
||||
Assets.vecLogoutSvg,
|
||||
];
|
||||
|
||||
RxList<bool> supervisionHistoryList = [false, false, false, false].obs;
|
||||
|
||||
List<String> tmpLs = ['دولتی', 'غیر دولتی', 'استیجاری', 'شخصی', 'سایر'];
|
||||
|
||||
List<String> hamadanCities = [
|
||||
'همدان',
|
||||
'ملایر',
|
||||
'نهاوند',
|
||||
'تویسرکان',
|
||||
'اسدآباد',
|
||||
'بهار',
|
||||
'رزن',
|
||||
'کبودرآهنگ',
|
||||
'فامنین',
|
||||
'لالجین',
|
||||
];
|
||||
|
||||
RxInt filter1Index = 0.obs;
|
||||
RxInt filter2Index = 0.obs;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
slidController = SlidableController(this).obs;
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
Future<void> triggerSlidableAnimation() async {
|
||||
await Future.delayed(Duration(milliseconds: 200));
|
||||
await slidController.value.openEndActionPane();
|
||||
await Future.delayed(Duration(milliseconds: 200));
|
||||
await slidController.value.close();
|
||||
showSlideHint = !showSlideHint;
|
||||
}
|
||||
|
||||
|
||||
void updateSelectedIndex(int index) {
|
||||
if(index == selectedIndex.value) {
|
||||
return;
|
||||
}
|
||||
previousIndex.value = selectedIndex.value;
|
||||
selectedIndex.value = index;
|
||||
}
|
||||
}
|
||||
723
features/inspection/lib/presentation/action/view.dart
Normal file
723
features/inspection/lib/presentation/action/view.dart
Normal file
@@ -0,0 +1,723 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_core/presentation/widget/buttons/elevated.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class ActionPage extends GetView<ActionLogic> {
|
||||
const ActionPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColor.bgLight,
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 20),
|
||||
ObxValue((data) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: List.generate(4, (index) {
|
||||
return headerWidget(
|
||||
icon: controller.headersIcons[index],
|
||||
title: controller.headersTitle[index],
|
||||
onTap: () {
|
||||
controller.updateSelectedIndex(index);
|
||||
},
|
||||
isSelected: controller.selectedIndex.value == index,
|
||||
);
|
||||
}),
|
||||
);
|
||||
}, controller.selectedIndex),
|
||||
Expanded(
|
||||
child: ObxValue((index) {
|
||||
if (index.value == 3) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
barrierDismissible: true,
|
||||
builder: (context) {
|
||||
return CupertinoAlertDialog(
|
||||
title: Text(
|
||||
'از سامانه خارج می شوید؟',
|
||||
style: AppFonts.yekan18.copyWith(
|
||||
color: AppColor.lightGreyDarkActive,
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
spacing: 16,
|
||||
children: [
|
||||
Expanded(
|
||||
child: RElevated(
|
||||
text: 'بله',
|
||||
onPressed: () {
|
||||
exit(0);
|
||||
},
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: ROutlinedElevated(
|
||||
text: 'خیر',
|
||||
onPressed: () {
|
||||
controller.updateSelectedIndex(
|
||||
controller.previousIndex.value,
|
||||
);
|
||||
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
return switch (index.value) {
|
||||
0 => profileWidget(),
|
||||
1 => supervisionHistoryWidget(),
|
||||
2 => statisticsWidget(),
|
||||
|
||||
int() => Container(),
|
||||
};
|
||||
}, controller.selectedIndex),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Container statisticsWidget() => Container(
|
||||
margin: EdgeInsets.only(top: 50),
|
||||
padding: EdgeInsets.symmetric(vertical: 50),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(30),
|
||||
topRight: Radius.circular(30),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 32,
|
||||
margin: EdgeInsets.symmetric(horizontal: 22,vertical: 10),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
spacing: 10,
|
||||
children: [
|
||||
Expanded(
|
||||
child: ROutlinedElevatedIcon(
|
||||
icon: FaIcon(FontAwesomeIcons.calendar),
|
||||
onPressed: () {},
|
||||
text: 'از تاریخ',
|
||||
textStyle: AppFonts.yekan16.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: ROutlinedElevatedIcon(
|
||||
icon: FaIcon(FontAwesomeIcons.calendar),
|
||||
onPressed: () {},
|
||||
text: 'تا تاریخ',
|
||||
textStyle: AppFonts.yekan16.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
optionWidget(
|
||||
selected: controller.filter1Index,
|
||||
title: 'فیلترتراکنش ها',
|
||||
options: controller.tmpLs,
|
||||
),
|
||||
optionWidget(
|
||||
selected: controller.filter2Index,
|
||||
title: 'فیلتر شهرستان',
|
||||
options: controller.hamadanCities,
|
||||
),
|
||||
|
||||
SizedBox(height: 10),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
vecWidgetWithOnTap(
|
||||
assets: Assets.vecPdfDownloadSvg,
|
||||
onTap: () {},
|
||||
width: 64,
|
||||
height: 64,
|
||||
),
|
||||
vecWidgetWithOnTap(
|
||||
assets: Assets.vecExcelDownloadSvg,
|
||||
onTap: () {},
|
||||
width: 64,
|
||||
height: 64,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 20,
|
||||
children: [
|
||||
headerInfo(title: 'تعداد تراکنش ها', description: '183 '),
|
||||
headerInfo(
|
||||
title: 'جمع تراکنش ها',
|
||||
description: '183 ریال',
|
||||
background: AppColor.green1Light,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
Widget supervisionHistoryWidget() {
|
||||
return ObxValue((data) {
|
||||
return ListView.builder(
|
||||
itemBuilder: (context, index) {
|
||||
return historyItem(data[index], () {
|
||||
data[index] = !data[index];
|
||||
});
|
||||
},
|
||||
shrinkWrap: true,
|
||||
physics: BouncingScrollPhysics(),
|
||||
itemCount: data.length,
|
||||
);
|
||||
}, controller.supervisionHistoryList);
|
||||
}
|
||||
|
||||
Column profileWidget() {
|
||||
return Column(
|
||||
children: [
|
||||
slidableWidgetOne(),
|
||||
slidableWidgetOne(),
|
||||
slidableWidgetOne(),
|
||||
slidableWidgetOne(),
|
||||
slidableWidgetOne(),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget headerWidget({
|
||||
required String icon,
|
||||
required String title,
|
||||
required VoidCallback onTap,
|
||||
bool isSelected = false,
|
||||
}) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
Container(
|
||||
width: 48,
|
||||
height: 48,
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: ShapeDecoration(
|
||||
color: isSelected ? AppColor.blueLightActive : AppColor.blueLight,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: vecWidget(
|
||||
icon,
|
||||
width: 40,
|
||||
height: 40,
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
title,
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color:
|
||||
isSelected ? AppColor.blueNormalActive : AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget slidableWidgetOne() {
|
||||
if (controller.showSlideHint) {
|
||||
controller.triggerSlidableAnimation();
|
||||
}
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 20),
|
||||
child: Slidable(
|
||||
key: Key('selectedLocationWidget'),
|
||||
controller: controller.slidController.value,
|
||||
endActionPane: ActionPane(
|
||||
motion: StretchMotion(),
|
||||
children: [
|
||||
CustomSlidableAction(
|
||||
onPressed: (context) {},
|
||||
backgroundColor: AppColor.redNormal,
|
||||
foregroundColor: Colors.white,
|
||||
padding: EdgeInsets.all(16),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
autoClose: true,
|
||||
child: vecWidget(Assets.vecTrashSvg, width: 24, height: 24),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: GestureDetector(
|
||||
onTap: () {},
|
||||
child: Container(
|
||||
height: 62,
|
||||
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: AppColor.blackLightHover),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
spacing: 4,
|
||||
children: [
|
||||
Text(
|
||||
'داود خرم مهری پور',
|
||||
style: AppFonts.yekan10.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'03295224154',
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
spacing: 4,
|
||||
children: [
|
||||
Text(
|
||||
'افزودن کاربر',
|
||||
style: AppFonts.yekan10.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'ثبت بازرسی',
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
spacing: 4,
|
||||
children: [
|
||||
Text(
|
||||
'همدان',
|
||||
style: AppFonts.yekan10.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'همدان',
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget slidableWidgetTwo({required VoidCallback onTap}) {
|
||||
return Slidable(
|
||||
key: Key('selectedLocationWidget'),
|
||||
controller: controller.slidController.value,
|
||||
endActionPane: ActionPane(
|
||||
motion: StretchMotion(),
|
||||
children: [
|
||||
CustomSlidableAction(
|
||||
onPressed: (context) {},
|
||||
backgroundColor: AppColor.blueNormal,
|
||||
foregroundColor: Colors.white,
|
||||
padding: EdgeInsets.all(16),
|
||||
borderRadius: BorderRadius.only(
|
||||
topRight: Radius.circular(8),
|
||||
bottomRight: Radius.circular(8),
|
||||
),
|
||||
autoClose: true,
|
||||
child: vecWidget(Assets.vecEditSvg, width: 24, height: 24),
|
||||
),
|
||||
CustomSlidableAction(
|
||||
onPressed: (context) {},
|
||||
backgroundColor: AppColor.redNormal,
|
||||
foregroundColor: Colors.white,
|
||||
padding: EdgeInsets.all(16),
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(8),
|
||||
bottomLeft: Radius.circular(8),
|
||||
),
|
||||
autoClose: true,
|
||||
child: vecWidget(Assets.vecTrashSvg, width: 24, height: 24),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
height: 62,
|
||||
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: AppColor.blackLightHover),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
spacing: 4,
|
||||
children: [
|
||||
Text(
|
||||
'داود خرم مهری پور',
|
||||
style: AppFonts.yekan10.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'03295224154',
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
spacing: 4,
|
||||
children: [
|
||||
Text(
|
||||
'افزودن کاربر',
|
||||
style: AppFonts.yekan10.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'ثبت بازرسی',
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
spacing: 4,
|
||||
children: [
|
||||
Text(
|
||||
'همدان',
|
||||
style: AppFonts.yekan10.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'همدان',
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget historyItem(bool isExpanded, VoidCallback onTap) {
|
||||
return AnimatedContainer(
|
||||
margin: EdgeInsets.symmetric(horizontal: 30, vertical: 10),
|
||||
curve: Curves.easeInOut,
|
||||
duration: Duration(seconds: 1),
|
||||
height: isExpanded ? 364 : 62,
|
||||
child:
|
||||
isExpanded
|
||||
? markerDetailsWidget(ontap: onTap)
|
||||
: slidableWidgetTwo(onTap: onTap),
|
||||
);
|
||||
}
|
||||
|
||||
Widget markerDetailsWidget({required VoidCallback ontap}) {
|
||||
return GestureDetector(
|
||||
onTap: ontap,
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: Container(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
|
||||
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||
decoration: ShapeDecoration(
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
child: Column(
|
||||
spacing: 15,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
spacing: 12,
|
||||
children: [
|
||||
vecWidgetWithOnTap(
|
||||
assets: Assets.vecEditSvg,
|
||||
onTap: () {},
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
Text(
|
||||
'سوابق بازرسی من',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
vecWidgetWithOnTap(
|
||||
assets: Assets.vecTrashSvg,
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: AppColor.redNormal,
|
||||
onTap: () {},
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
height: 32,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||
decoration: ShapeDecoration(
|
||||
color: AppColor.blueLight,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 1, color: AppColor.blueLightHover),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'تاریخ بازرسی',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'1403/12/12',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'شماره همراه',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'0326598653',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Text(
|
||||
'آخرین فعالیت',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
|
||||
Text(
|
||||
'1409/12/12',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Text(
|
||||
'موجودی',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'5کیلوگرم',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
...List.generate(
|
||||
5,
|
||||
(index) => Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Text(
|
||||
'فروش رفته',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'0 کیلوگرم',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Column optionWidget({
|
||||
required RxInt selected,
|
||||
required String title,
|
||||
required List<String> options,
|
||||
}) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 22,vertical: 10),
|
||||
child: Text(
|
||||
title,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 30),
|
||||
child: Wrap(
|
||||
runSpacing: 8,
|
||||
spacing: 8,
|
||||
children:
|
||||
options
|
||||
.map(
|
||||
(e) => ObxValue((data) {
|
||||
return ChoiceChip(
|
||||
onSelected: (value) {
|
||||
selected.value = options.indexOf(e);
|
||||
},
|
||||
selectedColor: AppColor.blueNormal,
|
||||
labelStyle:
|
||||
data.value == options.indexOf(e)
|
||||
? AppFonts.yekan13.copyWith(
|
||||
color: AppColor.whiteLight,
|
||||
)
|
||||
: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.darkGreyNormalActive,
|
||||
),
|
||||
checkmarkColor: Colors.white,
|
||||
label: Text(e),
|
||||
selected: options.indexOf(e) == data.value,
|
||||
);
|
||||
}, selected),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Container headerInfo({
|
||||
required String title,
|
||||
required String description,
|
||||
Color? background,
|
||||
}) {
|
||||
return Container(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
decoration: ShapeDecoration(
|
||||
color: background ?? AppColor.blueLight,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 1, color: AppColor.blackLightHover),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
alignment: AlignmentDirectional.center,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
spacing: 10,
|
||||
children: [
|
||||
Text(title, style: AppFonts.yekan10),
|
||||
|
||||
Text(description, style: AppFonts.yekan12),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class AddMobileInspectorLogic extends GetxController {
|
||||
RxInt countInspector = 1.obs;
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_core/presentation/widget/buttons/elevated.dart';
|
||||
import 'package:rasadyar_core/presentation/widget/buttons/fab.dart';
|
||||
import 'package:rasadyar_core/presentation/widget/inputs/r_input.dart';
|
||||
import 'package:inspection/presentation/routes/app_routes.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class AddMobileInspectorPage extends GetView<AddMobileInspectorLogic> {
|
||||
const AddMobileInspectorPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColor.bgLight,
|
||||
appBar: RAppBar(
|
||||
title: 'افزودن بازرس همراه',
|
||||
leading: vecWidget(
|
||||
Assets.vecMessageAddSvg,
|
||||
color: AppColor.blueNormal,
|
||||
width: 16,
|
||||
height: 16,
|
||||
),
|
||||
additionalActions: [
|
||||
RFab.smallAdd(onPressed: () => controller.countInspector.value++),
|
||||
],
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: ObxValue((data) {
|
||||
return ListView.separated(
|
||||
itemBuilder:
|
||||
(context, index) => Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 16,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: AppColor.bgDark),
|
||||
),
|
||||
child: Column(
|
||||
spacing: 16,
|
||||
children: [
|
||||
RTextField(
|
||||
label: 'نام و نام خانوادگی',
|
||||
filled: true,
|
||||
filledColor: AppColor.whiteLight,
|
||||
padding: EdgeInsets.zero,
|
||||
),
|
||||
RTextField(
|
||||
label: 'شماره مجوز',
|
||||
filled: true,
|
||||
filledColor: AppColor.whiteLight,
|
||||
padding: EdgeInsets.zero,
|
||||
),
|
||||
RTextField(
|
||||
label: 'شماره ثبت',
|
||||
filled: true,
|
||||
filledColor: AppColor.whiteLight,
|
||||
padding: EdgeInsets.zero,
|
||||
),
|
||||
RTextField(
|
||||
label: 'کد اقتصادی',
|
||||
filled: true,
|
||||
filledColor: AppColor.whiteLight,
|
||||
padding: EdgeInsets.zero,
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
child: SizedBox(
|
||||
height: 40,
|
||||
child: Row(
|
||||
spacing: 16,
|
||||
children: [
|
||||
Expanded(
|
||||
child: RElevated(
|
||||
text: 'ثبت',
|
||||
onPressed: () {},
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: ROutlinedElevated(
|
||||
text: 'انصراف',
|
||||
onPressed: () {},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
separatorBuilder: (context, index) => SizedBox(height: 15),
|
||||
itemCount: data.value,
|
||||
);
|
||||
}, controller.countInspector),
|
||||
),
|
||||
|
||||
RElevated(
|
||||
text: 'مرحله بعد',
|
||||
onPressed: () {
|
||||
Get.toNamed(InspectionRoutes.inspectionRegistrationOfViolation);
|
||||
},
|
||||
isFullWidth: true,
|
||||
height: 40,
|
||||
backgroundColor: AppColor.greenNormal,
|
||||
textStyle: AppFonts.yekan16.copyWith(color: Colors.white),
|
||||
),
|
||||
SizedBox(height: 25),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class AddSupervisionLogic extends GetxController {
|
||||
RxInt selectedSegment = 0.obs;
|
||||
RxInt selectedTypeOfOwnership = 0.obs;
|
||||
RxInt selectedUnitType = 0.obs;
|
||||
RxInt selectedAccompanyingInspectors = 0.obs;
|
||||
|
||||
List<String> tmpLs = ['دولتی', 'غیر دولتی', 'استیجاری', 'شخصی', 'سایر'];
|
||||
|
||||
// The data for the segments
|
||||
final Map<int, Widget> segments = {
|
||||
0: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(50)),
|
||||
child: Text('دائم', style: AppFonts.yekan13),
|
||||
),
|
||||
1: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(50)),
|
||||
child: Text('موقت', style: AppFonts.yekan13),
|
||||
),
|
||||
};
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
136
features/inspection/lib/presentation/add_supervision/view.dart
Normal file
136
features/inspection/lib/presentation/add_supervision/view.dart
Normal file
@@ -0,0 +1,136 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_core/presentation/widget/buttons/elevated.dart';
|
||||
import 'package:rasadyar_core/presentation/widget/inputs/r_input.dart';
|
||||
import 'package:rasadyar_core/presentation/widget/tabs/new_tab.dart';
|
||||
import 'package:inspection/inspection.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class AddSupervisionPage extends GetView<AddSupervisionLogic> {
|
||||
const AddSupervisionPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColor.lightGreyLight,
|
||||
appBar: RAppBar(
|
||||
title: 'ایجاد بازرسی',
|
||||
leading: vecWidget(
|
||||
Assets.vecMessageAddSvg,
|
||||
color: AppColor.blueNormal,
|
||||
width: 16,
|
||||
height: 16,
|
||||
),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: 16,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: 12,
|
||||
children: [
|
||||
Text(
|
||||
'نوع پروانه کسب',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
|
||||
ObxValue((data) {
|
||||
return NewCupertinoSegmentedControl<int>(
|
||||
padding: EdgeInsets.zero,
|
||||
children: controller.segments,
|
||||
groupValue: data.value,
|
||||
selectedColor: AppColor.blueNormal,
|
||||
unselectedColor: Colors.white,
|
||||
borderColor: Colors.grey.shade300,
|
||||
onValueChanged: (int value) {
|
||||
data.value = value;
|
||||
},
|
||||
);
|
||||
}, controller.selectedSegment),
|
||||
|
||||
RTextField(label: 'صادر کننده پروانه'),
|
||||
RTextField(label: 'شماره مجوز'),
|
||||
RTextField(label: 'شماره ثبت'),
|
||||
RTextField(label: 'کد اقتصادی'),
|
||||
],
|
||||
),
|
||||
),
|
||||
optionWidget(controller.selectedTypeOfOwnership),
|
||||
optionWidget(controller.selectedAccompanyingInspectors),
|
||||
optionWidget(controller.selectedUnitType),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: RElevated(
|
||||
text: 'مرحله بعد',
|
||||
onPressed: () {
|
||||
Get.toNamed(InspectionRoutes.inspectionAddMobileInspector);
|
||||
},
|
||||
height: 40,
|
||||
isFullWidth: true,
|
||||
backgroundColor: AppColor.greenNormal,
|
||||
textStyle: AppFonts.yekan16.copyWith(color: Colors.white),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Column optionWidget(RxInt selected) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Text(
|
||||
'نوع پروانه کسب',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
),
|
||||
|
||||
SizedBox(
|
||||
height: 75,
|
||||
child: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
padding: EdgeInsets.all(20),
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemBuilder:
|
||||
(context, index) => ObxValue((data) {
|
||||
return ChoiceChip(
|
||||
onSelected: (value) {
|
||||
selected.value = index;
|
||||
},
|
||||
selectedColor: AppColor.blueNormal,
|
||||
labelStyle:
|
||||
data.value == index
|
||||
? AppFonts.yekan13.copyWith(
|
||||
color: AppColor.whiteLight,
|
||||
)
|
||||
: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.darkGreyNormalActive,
|
||||
),
|
||||
checkmarkColor: Colors.white,
|
||||
label: Text(controller.tmpLs[index]),
|
||||
selected: index == data.value,
|
||||
);
|
||||
}, selected),
|
||||
|
||||
separatorBuilder: (context, index) => SizedBox(width: 8),
|
||||
itemCount: controller.tmpLs.length,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class DisplayInformationLogic extends GetxController {}
|
||||
@@ -0,0 +1,421 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_core/presentation/widget/buttons/elevated.dart';
|
||||
import 'package:rasadyar_core/presentation/widget/inputs/r_input.dart';
|
||||
import 'package:inspection/inspection.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class DisplayInformationPage extends GetView<DisplayInformationLogic> {
|
||||
const DisplayInformationPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: RAppBar(
|
||||
title: 'نمایش اطلاعات',
|
||||
leading: vecWidget(
|
||||
Assets.vecMessageAddSvg,
|
||||
color: AppColor.blueNormal,
|
||||
width: 16,
|
||||
height: 16,
|
||||
),
|
||||
),
|
||||
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
spacing: 20,
|
||||
children: [
|
||||
markerDetailsWidget(),
|
||||
accompanyingInspectorsWidget(),
|
||||
accompanyingInspectorsWidget(),
|
||||
violationWidget(),
|
||||
violationWidget(),
|
||||
ratingbarWidget()
|
||||
|
||||
],
|
||||
),
|
||||
),);
|
||||
}
|
||||
|
||||
Widget ratingbarWidget() {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(35, 5, 35, 35),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
children: [ Text('به این صنف امتیاز دهید',style: AppFonts.yekan12,),],
|
||||
),
|
||||
|
||||
SizedBox(height: 12,),
|
||||
RatingBar.builder(
|
||||
initialRating: 3,
|
||||
minRating: 1,
|
||||
direction: Axis.horizontal,
|
||||
allowHalfRating: true,
|
||||
itemCount: 5,
|
||||
wrapAlignment: WrapAlignment.center,
|
||||
itemPadding: EdgeInsets.symmetric(horizontal: 4.0),
|
||||
itemBuilder: (context, _) =>
|
||||
Icon(
|
||||
Icons.star,
|
||||
color: Colors.amber,
|
||||
),
|
||||
onRatingUpdate: (rating) {
|
||||
|
||||
},
|
||||
),
|
||||
|
||||
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: RElevated(
|
||||
height: 40,
|
||||
text: 'ثبت', onPressed: (){})),
|
||||
SizedBox(width: 8,),
|
||||
Expanded(child: ROutlinedElevated(
|
||||
height: 40,
|
||||
text: 'انصراف', onPressed: (){
|
||||
Get.until((route) => route.isFirst);
|
||||
}))
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget violationWidget() {
|
||||
return Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 35),
|
||||
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: AppColor.bgDark),
|
||||
|
||||
),
|
||||
child: Column(
|
||||
spacing: 16,
|
||||
children: [
|
||||
|
||||
RTextField(
|
||||
label: 'عنوان تخلف',
|
||||
filled: true,
|
||||
filledColor: AppColor.whiteLight,
|
||||
|
||||
),
|
||||
RTextField(
|
||||
label: 'توضیحات تخلف',
|
||||
filled: true,
|
||||
filledColor: AppColor.whiteLight,
|
||||
maxLines: 5,
|
||||
minLines: 5,
|
||||
|
||||
),
|
||||
RTextField(
|
||||
label: 'عنوان تخلف',
|
||||
filled: true,
|
||||
filledColor: AppColor.whiteLight,
|
||||
|
||||
),
|
||||
RTextField(
|
||||
label: 'عنوان تخلف',
|
||||
filled: true,
|
||||
filledColor: AppColor.whiteLight,
|
||||
|
||||
),
|
||||
RTextField(
|
||||
label: 'توضیحات تخلف',
|
||||
filled: true,
|
||||
filledColor: AppColor.whiteLight,
|
||||
maxLines: 5,
|
||||
minLines: 5,
|
||||
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget markerDetailsWidget() {
|
||||
return Container(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
margin: EdgeInsets.symmetric(horizontal: 35, vertical: 10),
|
||||
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||
decoration: ShapeDecoration(
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
child: Column(
|
||||
spacing: 15,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 12,
|
||||
children: [
|
||||
Text(
|
||||
'ایجاد بازرسی',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
height: 32,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||
decoration: ShapeDecoration(
|
||||
color: AppColor.blueLight,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 1, color: AppColor.blueLightHover),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'تاریخ بازرسی',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'1403/12/12',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'شماره همراه',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'0326598653',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Text(
|
||||
'آخرین فعالیت',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
|
||||
Text(
|
||||
'1409/12/12',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Text(
|
||||
'موجودی',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'5کیلوگرم',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
...List.generate(
|
||||
5,
|
||||
(index) =>
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Text(
|
||||
'فروش رفته',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'0 کیلوگرم',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget accompanyingInspectorsWidget() {
|
||||
return Container(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
margin: EdgeInsets.symmetric(horizontal: 35),
|
||||
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||
decoration: ShapeDecoration(
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
child: Column(
|
||||
spacing: 15,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 12,
|
||||
children: [
|
||||
Text(
|
||||
'بازرس همراه',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'نام و نام خانوادگی',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'آیدا گل محمدی',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'تاریخ بازرسی',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'1403/12/12',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'شماره همراه',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'0326598653',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Text(
|
||||
'آخرین فعالیت',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
|
||||
Text(
|
||||
'1409/12/12',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Text(
|
||||
'موجودی',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'5کیلوگرم',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
177
features/inspection/lib/presentation/filter/logic.dart
Normal file
177
features/inspection/lib/presentation/filter/logic.dart
Normal file
@@ -0,0 +1,177 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/animation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map/flutter_map.dart';
|
||||
import 'package:flutter_map_animations/flutter_map_animations.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:inspection/data/utils/marker_generator.dart';
|
||||
|
||||
enum BottomSheetStep { filter, markerSelected, markerDetails }
|
||||
|
||||
class SupervisionFilterLogic extends GetxController
|
||||
with GetTickerProviderStateMixin {
|
||||
Rx<LatLng> currentLocation = LatLng(35.824891, 50.948025).obs;
|
||||
RxList<LatLng> allMarkers = <LatLng>[].obs;
|
||||
RxList<LatLng> markers = <LatLng>[].obs;
|
||||
Timer? _debounceTimer;
|
||||
RxBool isLoading = false.obs;
|
||||
|
||||
RxInt filterIndex = 0.obs;
|
||||
RxInt showIndex = 0.obs;
|
||||
bool showSlideHint = true;
|
||||
|
||||
|
||||
Rx<BottomSheetStep> bottomSheetStep = BottomSheetStep.filter.obs;
|
||||
late Rx<SlidableController> slidController;
|
||||
|
||||
Rx<MapController> mapController = MapController().obs;
|
||||
late final AnimatedMapController animatedMapController;
|
||||
|
||||
late Rx<DraggableBottomSheetController> sheetController;
|
||||
|
||||
Future<void> determineCurrentPosition() async {
|
||||
bool serviceEnabled;
|
||||
LocationPermission permission;
|
||||
|
||||
serviceEnabled = await Geolocator.isLocationServiceEnabled();
|
||||
if (!serviceEnabled) {
|
||||
return Future.error('Location services are disabled.');
|
||||
}
|
||||
|
||||
permission = await Geolocator.checkPermission();
|
||||
if (permission == LocationPermission.denied) {
|
||||
permission = await Geolocator.requestPermission();
|
||||
if (permission == LocationPermission.denied) {
|
||||
return Future.error('Location permissions are denied.');
|
||||
}
|
||||
}
|
||||
|
||||
if (permission == LocationPermission.deniedForever) {
|
||||
return Future.error('Location permissions are permanently denied.');
|
||||
}
|
||||
|
||||
final position = await Geolocator.getCurrentPosition(
|
||||
locationSettings: AndroidSettings(accuracy: LocationAccuracy.best),
|
||||
);
|
||||
final latLng = LatLng(position.latitude, position.longitude);
|
||||
currentLocation.value = latLng;
|
||||
markers.add(latLng);
|
||||
animatedMapController.animateTo(
|
||||
dest: latLng,
|
||||
zoom: 18,
|
||||
curve: Curves.easeInOut,
|
||||
duration: const Duration(seconds: 1),
|
||||
);
|
||||
}
|
||||
|
||||
void debouncedUpdateVisibleMarkers({required LatLng center}) {
|
||||
_debounceTimer?.cancel();
|
||||
_debounceTimer = Timer(const Duration(milliseconds: 300), () {
|
||||
final filtered = filterNearbyMarkers({
|
||||
'markers': allMarkers,
|
||||
'centerLat': center.latitude,
|
||||
'centerLng': center.longitude,
|
||||
'radius': 2000.0,
|
||||
});
|
||||
|
||||
markers.addAll(filtered);
|
||||
});
|
||||
}
|
||||
|
||||
List<LatLng> filterNearbyMarkers(Map<String, dynamic> args) {
|
||||
final List<LatLng> rawMarkers = args['markers'];
|
||||
final double centerLat = args['centerLat'];
|
||||
final double centerLng = args['centerLng'];
|
||||
final double radiusInMeters = args['radius'];
|
||||
final center = LatLng(centerLat, centerLng);
|
||||
final distance = Distance();
|
||||
|
||||
return rawMarkers
|
||||
.where((marker) => distance(center, marker) <= radiusInMeters)
|
||||
.toList();
|
||||
}
|
||||
|
||||
Future<void> generatedMarkers() async {
|
||||
final generatedMarkers = await generateLocationsUsingCompute(100000);
|
||||
allMarkers.value = generatedMarkers;
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
animatedMapController = AnimatedMapController(
|
||||
vsync: this,
|
||||
duration: const Duration(milliseconds: 500),
|
||||
curve: Curves.easeInOut,
|
||||
cancelPreviousAnimations: true,
|
||||
);
|
||||
sheetController =
|
||||
DraggableBottomSheetController(
|
||||
initialVisibility: false,
|
||||
initialHeight: 300,
|
||||
minHeight: 70,
|
||||
maxHeight: 600,
|
||||
).obs;
|
||||
|
||||
slidController = SlidableController(this).obs;
|
||||
|
||||
/*bottomSheetStep.listen((data) {
|
||||
tLog('1 bottomSheetStep -> ${data.nme}');
|
||||
if (data == BottomSheetStep.filter) {
|
||||
sheetController.value = DraggableBottomSheetController(
|
||||
initialVisibility: true,
|
||||
initialHeight: 300,
|
||||
minHeight: 70,
|
||||
maxHeight: 600,
|
||||
);
|
||||
} else if (data == BottomSheetStep.markerSelected) {
|
||||
sheetController.value =
|
||||
DraggableBottomSheetController(
|
||||
initialVisibility: true,
|
||||
initialHeight: 250,
|
||||
minHeight: 50,
|
||||
maxHeight: 300,
|
||||
);
|
||||
|
||||
}else if(data == BottomSheetStep.markerDetails){
|
||||
sheetController.value =
|
||||
DraggableBottomSheetController(
|
||||
initialVisibility: true,
|
||||
initialHeight: 500,
|
||||
minHeight: 50,
|
||||
maxHeight: 700,
|
||||
);
|
||||
}
|
||||
sheetController.refresh();
|
||||
sheetController.value.toggle();
|
||||
|
||||
});*/
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
determineCurrentPosition();
|
||||
generatedMarkers();
|
||||
|
||||
}
|
||||
|
||||
Future<void> triggerSlidableAnimation() async {
|
||||
await Future.delayed(Duration(milliseconds: 200));
|
||||
await slidController.value.openEndActionPane();
|
||||
await Future.delayed(Duration(milliseconds: 200));
|
||||
await slidController.value.close();
|
||||
showSlideHint = !showSlideHint;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
632
features/inspection/lib/presentation/filter/view.dart
Normal file
632
features/inspection/lib/presentation/filter/view.dart
Normal file
@@ -0,0 +1,632 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map/flutter_map.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_core/presentation/widget/buttons/fab.dart';
|
||||
import 'package:inspection/presentation/routes/app_routes.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class SupervisionFilterPage extends GetView<SupervisionFilterLogic> {
|
||||
SupervisionFilterPage({super.key});
|
||||
|
||||
final Map styleTypes = <String, String>{
|
||||
'satellite': 's',
|
||||
'satelliteWithLabel': 'y',
|
||||
'street': 'p',
|
||||
'streetWithTraffic': 'p,traffic',
|
||||
};
|
||||
|
||||
final String token =
|
||||
"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjJlMGQyZTUyYzU1ZDJmMDkxNzBmNTdmM2JmOGVkODgxOTg5YTQxN2E5M2JiNDRiZTk1YzEyMjI1NzRlYWM3ZGYwOTlkNzhkNDUyMDRlMDJiIn0.eyJhdWQiOiIyODYyMiIsImp0aSI6IjJlMGQyZTUyYzU1ZDJmMDkxNzBmNTdmM2JmOGVkODgxOTg5YTQxN2E5M2JiNDRiZTk1YzEyMjI1NzRlYWM3ZGYwOTlkNzhkNDUyMDRlMDJiIiwiaWF0IjoxNzI1MTc2MDI5LCJuYmYiOjE3MjUxNzYwMjksImV4cCI6MTcyNzc2ODAyOSwic3ViIjoiIiwic2NvcGVzIjpbImJhc2ljIl19.bYQSwq48FZ9IM-Y7aTQAblEmIAz1b4m3nOWuKg-VTalx-eZqcIlzIOJI7XarBeS35CGvPbu6W9tAFoliz_HPARSMJM_Ni0YwESjscVqvPNJqV2vZlmgMj_wRDa0W5FmBipZ-AzKGcsuoMEpD8WzUgnlrhUdqVob1UHXQmZt1BFJlFHLm_grzKFf1_Lw_cHA_mRhhe36d_hU5Qg0jY3NP2NXG_TmecQcqch4YEwCh5_R_dUyMIlt70FL2OJ37ESyPYl-XMg3qOOjgI5YD8h6rciSfFsQpnOgl84HhV3aQ4MvWrIPl9ekEnwLM71He8o5KY1hhSQdOHSvO4yL6MBg9Yw";
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return PopScope(
|
||||
canPop: controller.sheetController.value.handleBack,
|
||||
onPopInvokedWithResult: (didPop, result) {
|
||||
if (!didPop &&
|
||||
controller.sheetController.value.bottomSheets.isNotEmpty) {
|
||||
controller.sheetController.value.removeLastBottomSheet();
|
||||
}
|
||||
},
|
||||
child: Stack(
|
||||
children: [
|
||||
ObxValue((currentLocation) {
|
||||
return FlutterMap(
|
||||
mapController: controller.animatedMapController.mapController,
|
||||
options: MapOptions(
|
||||
initialCenter: currentLocation.value,
|
||||
initialZoom: 18,
|
||||
onPositionChanged: (camera, hasGesture) {
|
||||
controller.debouncedUpdateVisibleMarkers(
|
||||
center: camera.center,
|
||||
);
|
||||
},
|
||||
),
|
||||
children: [
|
||||
TileLayer(
|
||||
urlTemplate:
|
||||
"https://map.ir/shiveh/xyz/1.0.0/Shiveh:Shiveh@EPSG:3857@png/{z}/{x}/{y}.png"
|
||||
"?x-api-key=$token",
|
||||
),
|
||||
|
||||
ObxValue((markers) {
|
||||
return MarkerLayer(
|
||||
markers:
|
||||
markers.map((marker) => markerWidget(marker)).toList(),
|
||||
);
|
||||
}, controller.markers),
|
||||
],
|
||||
);
|
||||
}, controller.currentLocation),
|
||||
|
||||
Positioned(
|
||||
right: 10,
|
||||
bottom: 150,
|
||||
child: ObxValue((data) {
|
||||
return RFab.small(
|
||||
backgroundColor: AppColor.greenNormal,
|
||||
isLoading: data.value,
|
||||
icon: vecWidget(Assets.vecGpsSvg),
|
||||
onPressed: () {
|
||||
controller.isLoading.value = true;
|
||||
controller.determineCurrentPosition().then(
|
||||
(value) =>
|
||||
controller.isLoading.value =
|
||||
!controller.isLoading.value,
|
||||
);
|
||||
},
|
||||
);
|
||||
}, controller.isLoading),
|
||||
),
|
||||
Positioned(
|
||||
right: 10,
|
||||
bottom: 100,
|
||||
child: RFab.small(
|
||||
backgroundColor: AppColor.blueNormal,
|
||||
icon: vecWidget(Assets.vecFilterSvg, width: 24, height: 24),
|
||||
onPressed: () {
|
||||
controller.sheetController.value.addBottomSheet(child: filterWidget(),
|
||||
initHeight: 400,
|
||||
maxHeight: 470,
|
||||
minHeight: 350);
|
||||
},
|
||||
),
|
||||
),
|
||||
Obx(
|
||||
() =>
|
||||
Stack(
|
||||
children:
|
||||
controller.sheetController.value.bottomSheets
|
||||
.map((sheet) => sheet)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Marker markerWidget(LatLng marker) {
|
||||
return Marker(
|
||||
point: marker,
|
||||
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
controller.sheetController.value.addBottomSheet(
|
||||
child: selectedLocationWidget(),
|
||||
minHeight: 0,
|
||||
maxHeight: 250,
|
||||
initHeight: 250,
|
||||
);
|
||||
},
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: SizedBox(
|
||||
width: 36,
|
||||
height: 36,
|
||||
child: Icon(Icons.location_on, color: Colors.red, size: 30),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget selectedLocationWidget() {
|
||||
if (controller.showSlideHint) {
|
||||
controller.triggerSlidableAnimation();
|
||||
}
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 20),
|
||||
child: Slidable(
|
||||
key: Key('selectedLocationWidget'),
|
||||
controller: controller.slidController.value,
|
||||
endActionPane: ActionPane(
|
||||
motion: StretchMotion(),
|
||||
children: [
|
||||
CustomSlidableAction(
|
||||
onPressed: (context) {
|
||||
Get.toNamed(InspectionRoutes.inspectionLocationDetails);
|
||||
},
|
||||
backgroundColor: AppColor.blueNormal,
|
||||
foregroundColor: Colors.white,
|
||||
padding: EdgeInsets.all(16),
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomRight: Radius.circular(8),
|
||||
topRight: Radius.circular(8),
|
||||
),
|
||||
child: vecWidget(Assets.vecMapSvg, width: 24, height: 24),
|
||||
),
|
||||
CustomSlidableAction(
|
||||
onPressed: (context) {
|
||||
Get.toNamed(InspectionRoutes.inspectionAddSupervision);
|
||||
},
|
||||
backgroundColor: AppColor.greenNormal,
|
||||
padding: EdgeInsets.all(16),
|
||||
child: vecWidget(Assets.vecMessageAddSvg),
|
||||
),
|
||||
CustomSlidableAction(
|
||||
onPressed: (context) {},
|
||||
backgroundColor: AppColor.warning,
|
||||
padding: EdgeInsets.all(16),
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.circular(8),
|
||||
topLeft: Radius.circular(8),
|
||||
),
|
||||
child: vecWidget(Assets.vecSecurityTimeSvg),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
controller.sheetController.value.addBottomSheet(
|
||||
child: markerDetailsWidget(),
|
||||
minHeight: 0,
|
||||
maxHeight: Get.height * 0.65,
|
||||
initHeight: Get.height * 0.6,
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
height: 58,
|
||||
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: AppColor.blackLightHover),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
'داود خرم مهری پور',
|
||||
style: AppFonts.yekan10.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'گوشت و مرغ',
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
'باقی مانده',
|
||||
style: AppFonts.yekan10.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'0 کیلوگرم',
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
vecWidget(Assets.vecScanBarcodeSvg),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Padding filterWidget() {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: Column(
|
||||
spacing: 16,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
spacing: 16,
|
||||
children: [
|
||||
Container(
|
||||
width: 100,
|
||||
height: 64,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.blueLight,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: AppColor.blackLightHover),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 4,
|
||||
children: [
|
||||
Text('دامداران', style: AppFonts.yekan10),
|
||||
Text('183 عدد', style: AppFonts.yekan13Bold),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 100,
|
||||
height: 64,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.greenLight,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: AppColor.blackLightHover),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 4,
|
||||
children: [
|
||||
Text('مرغداران', style: AppFonts.yekan10),
|
||||
Text('183 عدد', style: AppFonts.yekan13Bold),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 100,
|
||||
height: 64,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.blueLight,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: AppColor.blackLightHover),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 4,
|
||||
children: [
|
||||
Text('اصناف', style: AppFonts.yekan10),
|
||||
Text('183 عدد', style: AppFonts.yekan13Bold),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: 12,
|
||||
children: [
|
||||
Text(
|
||||
'فیلتر نمایش',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan13.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
ObxValue((data) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
spacing: 8,
|
||||
children: [
|
||||
customChip(
|
||||
isSelected: data.value == 0,
|
||||
onTap: (data) {
|
||||
controller.filterIndex.value = data;
|
||||
},
|
||||
index: 0,
|
||||
title: 'دامداران',
|
||||
),
|
||||
customChip(
|
||||
isSelected: data.value == 1,
|
||||
title: 'مرغداران',
|
||||
onTap: (data) {
|
||||
controller.filterIndex.value = data;
|
||||
},
|
||||
index: 1,
|
||||
),
|
||||
customChip(
|
||||
isSelected: data.value == 2,
|
||||
title: 'اصناف',
|
||||
onTap: (data) {
|
||||
controller.filterIndex.value = data;
|
||||
},
|
||||
index: 2,
|
||||
),
|
||||
],
|
||||
);
|
||||
}, controller.filterIndex),
|
||||
],
|
||||
),
|
||||
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: 12,
|
||||
children: [
|
||||
Text(
|
||||
'نمایش',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan13.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
ObxValue((data) {
|
||||
return SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
spacing: 8,
|
||||
children: [
|
||||
customChip(
|
||||
isSelected: data.value == 0,
|
||||
title: 'نمایش همه',
|
||||
onTap: (data) {
|
||||
controller.showIndex.value = data;
|
||||
},
|
||||
index: 0,
|
||||
),
|
||||
customChip(
|
||||
isSelected: data.value == 1,
|
||||
title: 'دارای تراکنش',
|
||||
onTap: (data) {
|
||||
controller.showIndex.value = data;
|
||||
},
|
||||
index: 1,
|
||||
),
|
||||
customChip(
|
||||
isSelected: data.value == 2,
|
||||
title: 'بازرسی شده ها',
|
||||
onTap: (data) {
|
||||
controller.showIndex.value = data;
|
||||
},
|
||||
index: 2,
|
||||
),
|
||||
customChip(
|
||||
isSelected: data.value == 3,
|
||||
title: 'بازرسی نشده ها',
|
||||
onTap: (data) {
|
||||
controller.showIndex.value = data;
|
||||
},
|
||||
index: 3,
|
||||
),
|
||||
customChip(
|
||||
isSelected: data.value == 4,
|
||||
title: 'متخلفین',
|
||||
onTap: (data) {
|
||||
controller.showIndex.value = data;
|
||||
},
|
||||
index: 4,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}, controller.showIndex),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget markerDetailsWidget() {
|
||||
return Container(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
margin: EdgeInsets.all(35),
|
||||
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||
decoration: ShapeDecoration(
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
child: Column(
|
||||
spacing: 15,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
spacing: 12,
|
||||
children: [
|
||||
Text(
|
||||
'داود خرم پور',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan16.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
vecWidgetWithOnTap(
|
||||
assets: Assets.vecMapSvg,
|
||||
onTap: () {
|
||||
Get.toNamed(InspectionRoutes.inspectionLocationDetails);
|
||||
},
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
vecWidgetWithOnTap(
|
||||
assets: Assets.vecMessageAddSvg,
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: AppColor.greenNormal,
|
||||
onTap: () {
|
||||
Get.toNamed(InspectionRoutes.inspectionAddSupervision);
|
||||
},
|
||||
),
|
||||
|
||||
vecWidgetWithOnTap(
|
||||
assets: Assets.vecSecurityTimeSvg,
|
||||
color: AppColor.warning,
|
||||
height: 24,
|
||||
width: 24,
|
||||
onTap: () {},
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
height: 32,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||
decoration: ShapeDecoration(
|
||||
color: AppColor.blueLight,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 1, color: AppColor.blueLightHover),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'باقی مانده',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'0 کیلوگرم',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'شماره همراه',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'0326598653',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Text(
|
||||
'آخرین فعالیت',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
|
||||
Text(
|
||||
'1409/12/12',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Text(
|
||||
'موجودی',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'5کیلوگرم',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
...List.generate(
|
||||
5,
|
||||
(index) =>
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Text(
|
||||
'فروش رفته',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'0 کیلوگرم',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget customChip({
|
||||
bool isSelected = false,
|
||||
required String title,
|
||||
required int index,
|
||||
required Function(int) onTap,
|
||||
}) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
onTap.call(index);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected ? AppColor.blueNormal : AppColor.whiteGreyNormal,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border:
|
||||
isSelected
|
||||
? Border.fromBorderSide(BorderSide.none)
|
||||
: Border.all(width: 0.25, color: const Color(0xFFB0B0B0)),
|
||||
),
|
||||
child: Text(
|
||||
title,
|
||||
textAlign: TextAlign.center,
|
||||
style:
|
||||
isSelected
|
||||
? AppFonts.yekan10.copyWith(color: AppColor.whiteLight)
|
||||
: AppFonts.yekan10,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class LocationDetailsLogic extends GetxController {
|
||||
RxInt selectedSegment = 0.obs;
|
||||
|
||||
// The data for the segments
|
||||
final Map<int, Widget> segments = {
|
||||
0: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(50)),
|
||||
child: Text('همه', style: AppFonts.yekan13),
|
||||
),
|
||||
1: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(50)),
|
||||
child: Text('بر اساس تاریخ', style: AppFonts.yekan13),
|
||||
),
|
||||
};
|
||||
|
||||
RxBool seletected = false.obs;
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
230
features/inspection/lib/presentation/location_details/view.dart
Normal file
230
features/inspection/lib/presentation/location_details/view.dart
Normal file
@@ -0,0 +1,230 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_core/presentation/utils/color_utils.dart';
|
||||
import 'package:rasadyar_core/presentation/widget/tabs/new_tab.dart';
|
||||
import 'logic.dart';
|
||||
|
||||
class LocationDetailsPage extends GetView<LocationDetailsLogic> {
|
||||
const LocationDetailsPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColor.lightGreyLight,
|
||||
appBar: RAppBar(title: 'جزئیات محل'),
|
||||
body: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 22),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
headerInfo(description: 'ایداگل محمدی', title: 'نام مالک'),
|
||||
|
||||
headerInfo(
|
||||
description: '09415115545',
|
||||
title: 'شماره همراه',
|
||||
background: AppColor.green1Light,
|
||||
),
|
||||
|
||||
headerInfo(description: '183کیلوگرم', title: 'موجودی'),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(22, 13, 22, 4),
|
||||
child: Text(
|
||||
'نوع دریافت',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan13.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
),
|
||||
|
||||
ObxValue((data) {
|
||||
return NewCupertinoSegmentedControl<int>(
|
||||
padding: EdgeInsetsDirectional.symmetric(
|
||||
horizontal: 20,
|
||||
vertical: 10,
|
||||
),
|
||||
children: controller.segments,
|
||||
groupValue: data.value,
|
||||
selectedColor: AppColor.blueNormal,
|
||||
unselectedColor: Colors.white,
|
||||
borderColor: Colors.grey.shade300,
|
||||
onValueChanged: (int value) {
|
||||
data.value = value;
|
||||
},
|
||||
);
|
||||
}, controller.selectedSegment),
|
||||
Container(
|
||||
height: 32,
|
||||
margin: EdgeInsets.only(top: 10, left: 22, right: 22),
|
||||
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
spacing: 10,
|
||||
children: [
|
||||
Expanded(
|
||||
child: ROutlinedElevatedIcon(
|
||||
icon: FaIcon(FontAwesomeIcons.calendar),
|
||||
onPressed: () {},
|
||||
text: 'از تاریخ',
|
||||
textStyle: AppFonts.yekan16.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: ROutlinedElevatedIcon(
|
||||
icon: FaIcon(FontAwesomeIcons.calendar),
|
||||
onPressed: () {},
|
||||
text: 'تا تاریخ',
|
||||
textStyle: AppFonts.yekan16.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 20),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(child: Divider()),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 6),
|
||||
margin: EdgeInsets.symmetric(horizontal: 2),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: ShapeDecoration(
|
||||
color: AppColor.blueNormal.disabledColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(60),
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
'تعداد کل تراکنش ها : 0',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan10,
|
||||
),
|
||||
),
|
||||
Expanded(child: Divider()),
|
||||
],
|
||||
),
|
||||
|
||||
Expanded(
|
||||
child: GridView.builder(
|
||||
itemCount: 51,
|
||||
physics: BouncingScrollPhysics(),
|
||||
padding: EdgeInsets.fromLTRB(20, 14, 20, 50),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
crossAxisSpacing: 8,
|
||||
mainAxisSpacing: 8,
|
||||
),
|
||||
itemBuilder:
|
||||
(context, index) => Container(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: ShapeDecoration(
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 1,
|
||||
color: const Color(0xFFEFEFEF),
|
||||
),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 22,
|
||||
vertical: 25,
|
||||
),
|
||||
child: Column(
|
||||
spacing: 6,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'${index + 1}- تراکنش موفق',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan10,
|
||||
),
|
||||
SizedBox(height: 2),
|
||||
Text(
|
||||
'1043/12/12',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12,
|
||||
),
|
||||
|
||||
Text(
|
||||
'محصول : مرغ',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.lightGreyNormalActive,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'وزن : 5555 گرم',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.lightGreyNormalActive,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'مبلغ : 14،000،000',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.lightGreyNormalActive,
|
||||
),
|
||||
),
|
||||
|
||||
Text(
|
||||
'سرویس سامان کیش',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Container headerInfo({
|
||||
required String title,
|
||||
required String description,
|
||||
Color? background,
|
||||
}) {
|
||||
return Container(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
decoration: ShapeDecoration(
|
||||
color: background ?? AppColor.blueLight,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 1, color: AppColor.blackLightHover),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
alignment: AlignmentDirectional.center,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
spacing: 10,
|
||||
children: [
|
||||
Text(title, style: AppFonts.yekan10),
|
||||
|
||||
Text(description, style: AppFonts.yekan12),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
33
features/inspection/lib/presentation/profile/logic.dart
Normal file
33
features/inspection/lib/presentation/profile/logic.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class ProfileLogic extends GetxController {
|
||||
|
||||
|
||||
List<String> roles = <String>[
|
||||
'کاربر عادی',
|
||||
'کاربر ویژه',
|
||||
'کاربر VIP',
|
||||
'کاربر نقره ای',
|
||||
'کاربر طلایی',
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
RxInt selectedRole = 0.obs;
|
||||
RxInt selectedInformationType = 0.obs;
|
||||
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
256
features/inspection/lib/presentation/profile/view.dart
Normal file
256
features/inspection/lib/presentation/profile/view.dart
Normal file
@@ -0,0 +1,256 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class ProfilePage extends GetView<ProfileLogic> {
|
||||
const ProfilePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
spacing: 30,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: Get.height * 0.3,
|
||||
child: Stack(
|
||||
fit: StackFit.expand,
|
||||
alignment: Alignment.center,
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
vecWidget(Assets.vecBgHeaderUserProfileSvg, fit: BoxFit.cover),
|
||||
|
||||
Positioned(
|
||||
bottom: -20,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: SizedBox(
|
||||
width: 110,
|
||||
height: 110,
|
||||
child: CircleAvatar(
|
||||
backgroundColor: AppColor.blueLightHover,
|
||||
child: FaIcon(
|
||||
FontAwesomeIcons.user,
|
||||
size: 45,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: 16,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 75,
|
||||
child: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
padding: EdgeInsets.all(16),
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemBuilder:
|
||||
(context, index) => ObxValue((data) {
|
||||
return ChoiceChip(
|
||||
onSelected: (value) {
|
||||
data.value = index;
|
||||
},
|
||||
selectedColor: AppColor.blueNormal,
|
||||
labelStyle:
|
||||
data.value == index
|
||||
? AppFonts.yekan13.copyWith(
|
||||
color: AppColor.whiteLight,
|
||||
)
|
||||
: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.darkGreyNormalActive,
|
||||
),
|
||||
checkmarkColor: Colors.white,
|
||||
label: Text(controller.roles[index]),
|
||||
selected: index == data.value,
|
||||
);
|
||||
}, controller.selectedRole),
|
||||
|
||||
separatorBuilder: (context, index) => SizedBox(width: 8),
|
||||
itemCount: controller.roles.length,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 30,
|
||||
vertical: 10,
|
||||
),
|
||||
child: ObxValue((data) {
|
||||
return switch (data.value) {
|
||||
0 => userProfileInformation(),
|
||||
1 => bankInformationWidget(),
|
||||
2 => invoiceIssuanceInformation(),
|
||||
int() => Placeholder(),
|
||||
};
|
||||
}, controller.selectedInformationType),
|
||||
),
|
||||
),
|
||||
|
||||
ObxValue((data) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Wrap(
|
||||
spacing: 20,
|
||||
runSpacing: 10,
|
||||
children: [
|
||||
cardActionWidget(
|
||||
title: 'اطلاعات کاربری',
|
||||
onPressed: () {
|
||||
data.value = 0;
|
||||
},
|
||||
icon: Assets.vecProfileUserSvg,
|
||||
selected: data.value == 0,
|
||||
),
|
||||
cardActionWidget(
|
||||
title: 'اطلاعات بانکی',
|
||||
onPressed: () {
|
||||
data.value = 1;
|
||||
},
|
||||
icon: Assets.vecInformationSvg,
|
||||
selected: data.value == 1,
|
||||
),
|
||||
cardActionWidget(
|
||||
title: 'اطلاعات \nصدور فاکتور',
|
||||
onPressed: () {
|
||||
data.value = 2;
|
||||
},
|
||||
icon: Assets.vecReceiptDiscountSvg,
|
||||
selected: data.value == 2,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}, controller.selectedInformationType),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Container invoiceIssuanceInformation() => Container();
|
||||
|
||||
Widget bankInformationWidget() => Column(
|
||||
spacing: 16,
|
||||
children: [
|
||||
itemList(title: 'نام بانک', content: 'سامان'),
|
||||
itemList(title: 'نام صاحب حساب', content: 'رضا رضایی'),
|
||||
itemList(title: 'شماره کارت ', content: '54154545415'),
|
||||
itemList(title: 'شماره حساب', content: '62565263263652'),
|
||||
itemList(title: 'شماره شبا', content: '62565263263652'),
|
||||
],
|
||||
);
|
||||
|
||||
Column userProfileInformation() {
|
||||
return Column(
|
||||
spacing: 10,
|
||||
children: [
|
||||
itemList(
|
||||
title: 'نام و نام خانوادگی',
|
||||
content: 'آیدا گل محمدی',
|
||||
icon: Assets.vecUserSvg,
|
||||
),
|
||||
itemList(
|
||||
title: 'موبایل',
|
||||
content: '09302654896',
|
||||
icon: Assets.vecCallSvg,
|
||||
),
|
||||
itemList(
|
||||
title: 'کدملی',
|
||||
content: 'نا مشخص',
|
||||
icon: Assets.vecTagUserSvg,
|
||||
),
|
||||
itemList(
|
||||
title: 'شماره شناسنامه',
|
||||
content: 'نا مشخص',
|
||||
icon: Assets.vecUserSquareSvg,
|
||||
),
|
||||
itemList(
|
||||
title: 'تاریخ تولد',
|
||||
content: '1404/10/12',
|
||||
icon: Assets.vecCalendarSvg,
|
||||
),
|
||||
itemList(
|
||||
title: 'استان',
|
||||
content: 'لرستان',
|
||||
icon: Assets.vecPictureFrameSvg,
|
||||
),
|
||||
itemList(title: 'شهر', content: 'خرم آباد', icon: Assets.vecMapSvg),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget itemList({
|
||||
required String title,
|
||||
required String content,
|
||||
String? icon,
|
||||
}) => Row(
|
||||
spacing: 4,
|
||||
children: [
|
||||
if (icon != null)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: vecWidget(
|
||||
icon,
|
||||
width: 20,
|
||||
height: 20,
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Text(title, style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal)),
|
||||
Spacer(),
|
||||
Text(
|
||||
content,
|
||||
style: AppFonts.yekan13.copyWith(color: AppColor.darkGreyNormalHover),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
Widget cardActionWidget({
|
||||
required String title,
|
||||
required VoidCallback onPressed,
|
||||
required String icon,
|
||||
bool selected = false,
|
||||
}) {
|
||||
return GestureDetector(
|
||||
onTap: onPressed,
|
||||
child: Column(
|
||||
spacing: 4,
|
||||
children: [
|
||||
Container(
|
||||
width: 52,
|
||||
height: 52,
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: ShapeDecoration(
|
||||
color: selected ? AppColor.blueLightActive : AppColor.blueLight,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: vecWidget(
|
||||
icon,
|
||||
width: 40,
|
||||
height: 40,
|
||||
color: selected ? AppColor.blueNormalActive : AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 2),
|
||||
Text(
|
||||
title,
|
||||
style: AppFonts.yekan10.copyWith(
|
||||
color: selected ? AppColor.blueNormal : AppColor.blueLightActive,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class RegistrationOfViolationLogic extends GetxController {
|
||||
RxInt countViolation = 1.obs;
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_core/presentation/widget/buttons/elevated.dart';
|
||||
import 'package:rasadyar_core/presentation/widget/buttons/fab.dart';
|
||||
import 'package:rasadyar_core/presentation/widget/inputs/r_input.dart';
|
||||
import 'package:inspection/presentation/registration_of_violation/logic.dart';
|
||||
import 'package:inspection/presentation/routes/app_routes.dart';
|
||||
|
||||
class RegistrationOfViolationPage
|
||||
extends GetView<RegistrationOfViolationLogic> {
|
||||
const RegistrationOfViolationPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor:AppColor.bgLight,
|
||||
appBar: RAppBar(
|
||||
title: 'ثبت تخلف',
|
||||
leading: vecWidget(
|
||||
Assets.vecMessageAddSvg,
|
||||
color: AppColor.blueNormal,
|
||||
width: 16,
|
||||
height: 16,
|
||||
),
|
||||
additionalActions: [
|
||||
RFab.smallAdd(onPressed: () => controller.countViolation.value++),
|
||||
],
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20,vertical: 10),
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: ObxValue((data) {
|
||||
return ListView.separated(
|
||||
itemBuilder: (context, index) =>Container(
|
||||
padding:EdgeInsets.symmetric(horizontal: 8,vertical: 12),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1,color: AppColor.bgDark),
|
||||
|
||||
),
|
||||
child: Column(
|
||||
spacing:16 ,
|
||||
children: [
|
||||
|
||||
RTextField(
|
||||
label: 'عنوان تخلف',
|
||||
filled: true,
|
||||
filledColor: AppColor.whiteLight,
|
||||
|
||||
),
|
||||
RTextField(
|
||||
label: 'توضیحات تخلف',
|
||||
filled: true,
|
||||
filledColor: AppColor.whiteLight,
|
||||
maxLines: 5,
|
||||
minLines: 5,
|
||||
|
||||
),
|
||||
RTextField(
|
||||
label: 'عنوان تخلف',
|
||||
filled: true,
|
||||
filledColor: AppColor.whiteLight,
|
||||
|
||||
),
|
||||
RTextField(
|
||||
label: 'عنوان تخلف',
|
||||
filled: true,
|
||||
filledColor: AppColor.whiteLight,
|
||||
|
||||
),
|
||||
RTextField(
|
||||
label: 'توضیحات تخلف',
|
||||
filled: true,
|
||||
filledColor: AppColor.whiteLight,
|
||||
maxLines: 5,
|
||||
minLines: 5,
|
||||
|
||||
),
|
||||
|
||||
SizedBox(
|
||||
height: 40,
|
||||
child: Row(
|
||||
spacing: 16,
|
||||
children: [
|
||||
Expanded(child: RElevated(text: 'ثبت', onPressed: (){})),
|
||||
Expanded(child:ROutlinedElevated(text: 'انصراف',onPressed: (){},) ),
|
||||
|
||||
],
|
||||
),
|
||||
)
|
||||
|
||||
],
|
||||
),
|
||||
) ,
|
||||
separatorBuilder: (context, index) => SizedBox(height: 15,),
|
||||
itemCount: data.value,
|
||||
);
|
||||
},controller.countViolation),
|
||||
),
|
||||
|
||||
RElevated(
|
||||
text: 'مرحله بعد',
|
||||
onPressed: () {
|
||||
Get.toNamed(InspectionRoutes.inspectionDisplayInformation);
|
||||
},
|
||||
isFullWidth: true,
|
||||
height: 40,
|
||||
backgroundColor: AppColor.greenNormal,
|
||||
textStyle: AppFonts.yekan16.copyWith(color: Colors.white),
|
||||
),
|
||||
SizedBox(height: 25,)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
25
features/inspection/lib/presentation/root/logic.dart
Normal file
25
features/inspection/lib/presentation/root/logic.dart
Normal file
@@ -0,0 +1,25 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:inspection/presentation/action/view.dart';
|
||||
import 'package:inspection/presentation/filter/view.dart';
|
||||
import 'package:inspection/presentation/profile/view.dart';
|
||||
|
||||
class RootLogic extends GetxController {
|
||||
RxInt currentIndex = 0.obs;
|
||||
List<Widget> pages = [SupervisionFilterPage(), ActionPage(), ProfilePage()];
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
void changePage(int index) {
|
||||
currentIndex.value = index;
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
62
features/inspection/lib/presentation/root/view.dart
Normal file
62
features/inspection/lib/presentation/root/view.dart
Normal file
@@ -0,0 +1,62 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class RootPage extends GetView<RootLogic> {
|
||||
const RootPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Stack(
|
||||
children: [
|
||||
ObxValue(
|
||||
(currentIndex) => IndexedStack(
|
||||
index: currentIndex.value,
|
||||
children: controller.pages,
|
||||
),
|
||||
controller.currentIndex,
|
||||
),
|
||||
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: ObxValue(
|
||||
(index) => BottomNavigation1(
|
||||
items: [
|
||||
BottomNavigation1Item(
|
||||
icon: Assets.vecMapSvg,
|
||||
label: 'نقشه',
|
||||
isSelected: controller.currentIndex.value == 0,
|
||||
onTap: () {
|
||||
controller.changePage(0);
|
||||
},
|
||||
),
|
||||
BottomNavigation1Item(
|
||||
icon: Assets.vecSettingSvg,
|
||||
label: 'اقدام',
|
||||
isSelected: controller.currentIndex.value == 1,
|
||||
onTap: () {
|
||||
controller.changePage(1);
|
||||
},
|
||||
),
|
||||
BottomNavigation1Item(
|
||||
icon: Assets.vecProfileCircleSvg,
|
||||
label: 'پروفایل',
|
||||
isSelected: controller.currentIndex.value == 2,
|
||||
onTap: () {
|
||||
controller.changePage(2);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
controller.currentIndex,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
69
features/inspection/lib/presentation/routes/app_pages.dart
Normal file
69
features/inspection/lib/presentation/routes/app_pages.dart
Normal file
@@ -0,0 +1,69 @@
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:inspection/presentation/action/logic.dart';
|
||||
import 'package:inspection/presentation/add_mobile_inspector/logic.dart';
|
||||
import 'package:inspection/presentation/add_mobile_inspector/view.dart';
|
||||
import 'package:inspection/presentation/add_supervision/logic.dart';
|
||||
import 'package:inspection/presentation/add_supervision/view.dart';
|
||||
import 'package:inspection/presentation/display_information/logic.dart';
|
||||
import 'package:inspection/presentation/display_information/view.dart';
|
||||
import 'package:inspection/presentation/filter/logic.dart';
|
||||
import 'package:inspection/presentation/location_details/logic.dart';
|
||||
import 'package:inspection/presentation/location_details/view.dart';
|
||||
import 'package:inspection/presentation/profile/logic.dart';
|
||||
import 'package:inspection/presentation/profile/view.dart';
|
||||
import 'package:inspection/presentation/registration_of_violation/logic.dart';
|
||||
import 'package:inspection/presentation/registration_of_violation/view.dart';
|
||||
import 'package:inspection/presentation/root/logic.dart';
|
||||
import 'package:inspection/presentation/root/view.dart';
|
||||
import 'package:inspection/presentation/routes/app_routes.dart';
|
||||
|
||||
sealed class InspectionPages {
|
||||
InspectionPages._();
|
||||
|
||||
static final pages = [
|
||||
GetPage(
|
||||
name: InspectionRoutes.inspection,
|
||||
page: () => RootPage(),
|
||||
binding: BindingsBuilder(() {
|
||||
Get.put(RootLogic());
|
||||
Get.put(SupervisionFilterLogic());
|
||||
Get.lazyPut(() => LocationDetailsLogic(), fenix: true);
|
||||
Get.lazyPut(() => ActionLogic(), fenix: true);
|
||||
Get.lazyPut(() => ProfileLogic(), fenix: true);
|
||||
}),
|
||||
),
|
||||
|
||||
GetPage(
|
||||
name: InspectionRoutes.inspectionLocationDetails,
|
||||
page: () => LocationDetailsPage(),
|
||||
bindings: [BindingsBuilder.put(() => LocationDetailsLogic())],
|
||||
),
|
||||
|
||||
GetPage(
|
||||
name: InspectionRoutes.inspectionAddSupervision,
|
||||
page: () => AddSupervisionPage(),
|
||||
binding: BindingsBuilder.put(() => AddSupervisionLogic()),
|
||||
),
|
||||
GetPage(
|
||||
name: InspectionRoutes.inspectionRegistrationOfViolation,
|
||||
page: () => RegistrationOfViolationPage(),
|
||||
binding: BindingsBuilder.put(() => RegistrationOfViolationLogic()),
|
||||
),
|
||||
|
||||
GetPage(
|
||||
name: InspectionRoutes.inspectionDisplayInformation,
|
||||
page: () => DisplayInformationPage(),
|
||||
binding: BindingsBuilder.put(() => DisplayInformationLogic()),
|
||||
),
|
||||
GetPage(
|
||||
name: InspectionRoutes.inspectionUserProfile,
|
||||
page: () => ProfilePage(),
|
||||
binding: BindingsBuilder.put(() => ProfileLogic()),
|
||||
),
|
||||
GetPage(
|
||||
name: InspectionRoutes.inspectionAddMobileInspector,
|
||||
page: () => AddMobileInspectorPage(),
|
||||
binding: BindingsBuilder.put(() => AddMobileInspectorLogic()),
|
||||
),
|
||||
];
|
||||
}
|
||||
12
features/inspection/lib/presentation/routes/app_routes.dart
Normal file
12
features/inspection/lib/presentation/routes/app_routes.dart
Normal file
@@ -0,0 +1,12 @@
|
||||
sealed class InspectionRoutes {
|
||||
InspectionRoutes._();
|
||||
|
||||
static const inspection = '/supervision';
|
||||
static const inspectionAction = '$inspection/action';
|
||||
static const inspectionUserProfile = '$inspection/userSettings';
|
||||
static const inspectionLocationDetails = '$inspection/locationDetails';
|
||||
static const inspectionAddSupervision = '$inspectionLocationDetails/addSupervision';
|
||||
static const inspectionAddMobileInspector = '$inspectionLocationDetails/addMobileInspector';
|
||||
static const inspectionRegistrationOfViolation = '$inspectionAddSupervision/RegistrationOfViolation';
|
||||
static const inspectionDisplayInformation = '$inspectionRegistrationOfViolation/DisplayInformation';
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AnimatedClusterMarker extends StatefulWidget {
|
||||
final int count;
|
||||
|
||||
const AnimatedClusterMarker({super.key, required this.count});
|
||||
|
||||
@override
|
||||
State<AnimatedClusterMarker> createState() => _AnimatedClusterMarkerState();
|
||||
}
|
||||
|
||||
class _AnimatedClusterMarkerState extends State<AnimatedClusterMarker>
|
||||
with SingleTickerProviderStateMixin {
|
||||
late AnimationController _controller;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
_controller = AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
)..forward(); // start animation
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ScaleTransition(
|
||||
scale: CurvedAnimation(parent: _controller, curve: Curves.easeOutBack),
|
||||
child: Opacity(
|
||||
opacity: _controller.value,
|
||||
child: Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blueAccent,
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(color: Colors.white, width: 2),
|
||||
),
|
||||
child: Text(
|
||||
widget.count.toString(),
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user