1 - search in map with api
2 - show details in selected location
This commit is contained in:
2025-07-30 12:31:47 +03:30
parent 2806301367
commit f563c6188e
25 changed files with 3960 additions and 337 deletions

View File

@@ -3,9 +3,16 @@ import 'package:flutter/material.dart';
import 'package:rasadyar_core/presentation/common/app_color.dart';
class BaseBottomSheet extends StatelessWidget {
const BaseBottomSheet({super.key, required this.child, this.height, this.bgColor});
const BaseBottomSheet({
super.key,
this.child,
this.height,
this.bgColor,
this.rootChild,
}):assert(child==null || rootChild==null, 'You can only provide one of child or rootChild');
final Widget child;
final Widget? child;
final Widget? rootChild;
final double? height;
final Color? bgColor;
@@ -51,8 +58,8 @@ class BaseBottomSheet extends StatelessWidget {
],
),
),
SizedBox(height:8),
Expanded(child: SingleChildScrollView(child: child)),
SizedBox(height: 8),
Expanded(child: rootChild ?? SingleChildScrollView(child: child)),
],
),
),

View File

@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
class ListItem2 extends StatelessWidget {
const ListItem2({
class ExpandableListItem2 extends StatelessWidget {
const ExpandableListItem2({
super.key,
required this.index,
required this.child,
@@ -115,3 +115,98 @@ class ListItem2 extends StatelessWidget {
);
}
}
class ListItem2 extends StatelessWidget {
const ListItem2({
super.key,
required this.index,
required this.child,
required this.labelColor,
required this.labelIcon,
this.onTap,
this.labelIconColor = AppColor.mediumGreyDarkHover,
});
final int index;
final Widget child;
final Color labelColor;
final String labelIcon;
final Color? labelIconColor;
final VoidCallback? onTap;
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onTap,
child: Container(
width: Get.width,
margin: const EdgeInsets.fromLTRB(0, 0, 10, 0),
decoration: BoxDecoration(
color: labelColor,
borderRadius: BorderRadius.circular(8),
border: Border.all(width: 1, color: AppColor.lightGreyNormalHover),
),
child: Stack(
clipBehavior: Clip.none,
alignment: Alignment.centerRight,
children: [
Row(
children: [
Expanded(
child: Container(
height: 75,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
bottomLeft: Radius.zero,
bottomRight: Radius.circular(8),
topLeft: Radius.zero,
topRight: Radius.circular(8),
),
),
clipBehavior: Clip.antiAlias,
child: child,
),
),
Container(
width: 20,
child: Center(
child: SvgGenImage.vec(labelIcon).svg(
width: 16.w,
height: 16.h,
//TODO
colorFilter: ColorFilter.mode(
labelIconColor ?? AppColor.mediumGreyDarkActive,
BlendMode.srcIn,
),
),
),
),
],
),
Positioned(
right: -12,
child: Container(
width: index < 999 ? 24 : null,
height: index < 999 ? 24 : null,
padding: EdgeInsets.all(2),
decoration: BoxDecoration(
color: AppColor.greenLightHover,
borderRadius: BorderRadius.circular(4),
border: Border.all(width: 0.50, color: AppColor.greenDarkActive),
),
alignment: Alignment.center,
child: Text(
(index + 1).toString(),
style: AppFonts.yekan12.copyWith(color: Colors.black),
),
),
),
],
),
),
);
}
}

View File

@@ -10,12 +10,8 @@ Map<String, dynamic> buildQueryParams({
DateTime? toDate,
String? role,
String? state,
}) {
final params = <String, dynamic>{};
if (fromDate != null) {
params['date1'] = fromDate.formattedDashedGregorian;
}
@@ -30,7 +26,6 @@ Map<String, dynamic> buildQueryParams({
params['value'] = value ?? '';
if (page != null) {
params['page'] = page;
}
@@ -53,3 +48,69 @@ Map<String, dynamic> buildQueryParams({
return params;
}
Map<String, dynamic>? buildRawQueryParams({
Map<String, dynamic>? queryParams,
String? search,
String? value,
int? page,
int? pageSize,
DateTime? fromDate,
DateTime? toDate,
String? role,
String? state,
double? centerLat,
double? centerLng,
double? radius,
}) {
final params = <String, dynamic>{};
if (fromDate != null) {
params['date1'] = fromDate.formattedDashedGregorian;
}
if (toDate != null) {
params['date2'] = toDate.formattedDashedGregorian;
}
if (search != null && search.isNotEmpty) {
params['search'] = search;
}
if (value != null) {
params['value'] = value ?? '';
}
if (page != null) {
params['page'] = page;
}
if (pageSize != null) {
params['page_size'] = pageSize;
}
if (role != null && role.isNotEmpty) {
params['role'] = role;
}
if (state != null && state.isNotEmpty) {
params['state'] = state;
}
if (queryParams != null) {
params.addAll(queryParams);
}
if (centerLat != null) {
params['center_lat'] = centerLat ?? '';
}
if (centerLng != null) {
params['center_lon'] = centerLng ?? '';
}
if (radius != null) {
params['radius'] = radius ?? '';
}
return params.keys.isEmpty ? null : params;
}