feat: enhance kill house - submit request module with submit request functionality, including new models, repository updates, and UI integration

This commit is contained in:
2025-12-01 09:42:26 +03:30
parent b5904d753c
commit 6861e873ba
99 changed files with 5764 additions and 606 deletions

View File

@@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';

View File

@@ -17,6 +17,7 @@ class ROutlinedElevated extends StatefulWidget {
this.width,
this.height,
this.enabled = true,
this.isFullWidth = false,
}) : assert(text != null || child != null, 'Either text or child must be provided');
final String? text;
@@ -32,6 +33,7 @@ class ROutlinedElevated extends StatefulWidget {
TextStyle? textStyle;
Widget? child;
bool enabled;
final bool isFullWidth;
@override
State<ROutlinedElevated> createState() => _ROutlinedElevatedState();
@@ -67,65 +69,65 @@ class _ROutlinedElevatedState extends State<ROutlinedElevated> {
@override
Widget build(BuildContext context) {
return ConstrainedBox(
constraints: BoxConstraints.tightFor(
width: widget.width ?? 150.w,
height: widget.height ?? 40.h,
),
child: OutlinedButton(
key: _widgetKey,
statesController: _statesController,
onPressed: widget.enabled ? widget.onPressed : null,
style: ButtonStyle(
side: WidgetStateProperty.resolveWith<BorderSide?>((states) {
if (states.contains(WidgetState.pressed)) {
return BorderSide(color: widget.borderColor ?? AppColor.blueNormal, width: 2);
} else if (states.contains(WidgetState.disabled)) {
return BorderSide(
color: widget.borderColor?.disabledColor ?? AppColor.blueNormal.withAlpha(38),
width: 2,
);
}
return OutlinedButton(
key: _widgetKey,
statesController: _statesController,
onPressed: widget.enabled ? widget.onPressed : null,
style: ButtonStyle(
side: WidgetStateProperty.resolveWith<BorderSide?>((states) {
if (states.contains(WidgetState.pressed)) {
return BorderSide(color: widget.borderColor ?? AppColor.blueNormal, width: 2);
}),
backgroundColor: WidgetStateProperty.resolveWith<Color?>((states) {
if (states.contains(WidgetState.pressed)) {
if (widget.pressedBackgroundColor != null) {
return widget.pressedBackgroundColor;
}
return widget.backgroundColor?.pressedColor ?? widget.borderColor?.pressedColor;
} else if (states.contains(WidgetState.hovered)) {
return widget.backgroundColor?.hoverColor ?? AppColor.blueNormal.hoverColor;
} else if (states.contains(WidgetState.disabled)) {
return widget.backgroundColor?.disabledColor ?? Colors.transparent;
} else if (states.contains(WidgetState.disabled)) {
return BorderSide(
color: widget.borderColor?.disabledColor ?? AppColor.blueNormal.withAlpha(38),
width: 2,
);
}
return BorderSide(color: widget.borderColor ?? AppColor.blueNormal, width: 2);
}),
backgroundColor: WidgetStateProperty.resolveWith<Color?>((states) {
if (states.contains(WidgetState.pressed)) {
if (widget.pressedBackgroundColor != null) {
return widget.pressedBackgroundColor;
}
return widget.backgroundColor;
}),
foregroundColor: WidgetStateProperty.resolveWith<Color?>((states) {
if (states.contains(WidgetState.pressed)) {
return Colors.white;
} else if (states.contains(WidgetState.disabled)) {
return widget.foregroundColor?.disabledColor ??
widget.borderColor?.disabledColor ??
AppColor.blueNormal.disabledColor;
}
return widget.foregroundColor ?? widget.borderColor ?? AppColor.blueNormal;
}),
shape: WidgetStatePropertyAll(
RoundedRectangleBorder(borderRadius: BorderRadius.circular(widget.radius ?? 8)),
),
fixedSize: WidgetStatePropertyAll(Size(widget.width ?? 150.w, widget.height ?? 56.h)),
padding: WidgetStatePropertyAll(EdgeInsets.zero),
textStyle: WidgetStateProperty.resolveWith<TextStyle?>((states) {
if (states.contains(WidgetState.pressed)) {
return widget.textStyle?.copyWith(color: Colors.white) ??
AppFonts.yekan18.copyWith(color: Colors.white);
}
return widget.textStyle ?? AppFonts.yekan18.copyWith(color: AppColor.blueNormal);
}),
return widget.backgroundColor?.pressedColor ?? widget.borderColor?.pressedColor;
} else if (states.contains(WidgetState.hovered)) {
return widget.backgroundColor?.hoverColor ?? AppColor.blueNormal.hoverColor;
} else if (states.contains(WidgetState.disabled)) {
return widget.backgroundColor?.disabledColor ?? Colors.transparent;
}
return widget.backgroundColor;
}),
foregroundColor: WidgetStateProperty.resolveWith<Color?>((states) {
if (states.contains(WidgetState.pressed)) {
return Colors.white;
} else if (states.contains(WidgetState.disabled)) {
return widget.foregroundColor?.disabledColor ??
widget.borderColor?.disabledColor ??
AppColor.blueNormal.disabledColor;
}
return widget.foregroundColor ?? widget.borderColor ?? AppColor.blueNormal;
}),
shape: WidgetStatePropertyAll(
RoundedRectangleBorder(borderRadius: BorderRadius.circular(widget.radius ?? 8)),
),
fixedSize: WidgetStatePropertyAll(Size(widget.width ?? 150.w, widget.height ?? 56.h)),
padding: WidgetStatePropertyAll(EdgeInsets.zero),
textStyle: WidgetStateProperty.resolveWith<TextStyle?>((states) {
if (states.contains(WidgetState.pressed)) {
return widget.textStyle?.copyWith(color: Colors.white) ??
AppFonts.yekan18.copyWith(color: Colors.white);
}
return widget.textStyle ?? AppFonts.yekan18.copyWith(color: AppColor.blueNormal);
}),
minimumSize: WidgetStatePropertyAll(
Size(
widget.isFullWidth ? double.maxFinite : (widget.width ?? 150.w),
widget.height ?? 40.h,
),
),
child: widget.child ?? Text(widget.text ?? ''),
),
child: widget.child ?? Text(widget.text ?? ''),
);
}
}

View File

@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
class ROutlinedElevatedIcon extends StatefulWidget {
ROutlinedElevatedIcon({
const ROutlinedElevatedIcon({
super.key,
required this.text,
required this.onPressed,

View File

@@ -238,7 +238,7 @@ class GlassMorphismGrid extends StatelessWidget {
const GlassMorphismGrid({super.key, required this.items, required this.onTap});
final List<GlassMorphismCardItem> items;
final VoidCallback onTap;
final void Function(GlassMorphismCardItem item) onTap;
@override
Widget build(BuildContext context) {
@@ -254,7 +254,11 @@ class GlassMorphismGrid extends StatelessWidget {
hitTestBehavior: HitTestBehavior.opaque,
itemBuilder: (BuildContext context, int index) {
var item = items[index];
return GlassMorphismCardIcon(title: item.title, vecIcon: item.icon, onTap: onTap);
return GlassMorphismCardIcon(
title: item.title,
vecIcon: item.icon,
onTap: () => onTap(item),
);
},
);
}

View File

@@ -30,7 +30,9 @@ class InformationTagData {
//global
final int? width;
final int? height;
final double? height;
final Color borderColor;
final double radiusWidth;
InformationTagData({
this.labelVecIcon,
@@ -55,9 +57,11 @@ class InformationTagData {
this.heightIcon,
this.widthIcon,
this.blendMode,
this.borderColor = const Color(0xFFA9A9A9),
this.radiusWidth = 0.5,
}) : assert(
(labelVecIcon != null) ^ (labelSvgIcon != null),
'Either labelVecIcon or labelSvgIcon must be provided, but not both.',
labelVecIcon == null || labelSvgIcon == null,
'You cannot provide both labelVecIcon and labelSvgIcon.',
),
assert(isLoading || value != null, 'When isLoading is false, value must not be null.'),
assert(
@@ -91,8 +95,10 @@ class InformationTagData {
TextStyle? unitStyle,
Color? unitColor,
int? width,
int? height,
double? height,
BlendMode? blendMode,
Color? borderColor,
double? radiusWidth,
}) {
return InformationTagData(
labelVecIcon: labelVecIcon ?? this.labelVecIcon,
@@ -117,6 +123,8 @@ class InformationTagData {
width: width ?? this.width,
height: height ?? this.height,
blendMode: blendMode ?? this.blendMode,
borderColor: borderColor ?? this.borderColor,
radiusWidth: radiusWidth ?? this.radiusWidth,
);
}
}
@@ -131,8 +139,9 @@ class InformationTag extends StatelessWidget {
return Container(
height: (data.height ?? 82).h,
decoration: BoxDecoration(
border: Border.all(color: const Color(0xFFA9A9A9) ,width:0.50),
borderRadius: BorderRadius.circular(8)),
border: Border.all(color: data.borderColor, width: data.radiusWidth),
borderRadius: BorderRadius.circular(8),
),
clipBehavior: Clip.hardEdge,
child: Row(
children: [
@@ -151,26 +160,29 @@ class InformationTag extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
spacing: 4,
children: [
data.labelVecIcon != null
? ClipRRect(
borderRadius: BorderRadius.circular(8),
child: SvgGenImage.vec(data.labelVecIcon!).svg(
width: (data.widthIcon ?? 24).w,
height: (data.heightIcon ?? 24).h,
colorFilter: ColorFilter.mode(
data.iconColor ?? AppColor.mediumGreyDarkActive,
data.blendMode ?? BlendMode.srcIn,
),
),
)
: SvgGenImage(data.labelSvgIcon!).svg(
width: (data.widthIcon ?? 24).w,
height: (data.heightIcon ?? 24).h,
colorFilter: ColorFilter.mode(
data.iconColor ?? AppColor.mediumGreyDarkActive,
data.blendMode ?? BlendMode.srcIn,
),
if (data.labelVecIcon != null)
ClipRRect(
borderRadius: BorderRadius.circular(8),
child: SvgGenImage.vec(data.labelVecIcon!).svg(
width: (data.widthIcon ?? 24).w,
height: (data.heightIcon ?? 24).h,
colorFilter: ColorFilter.mode(
data.iconColor ?? AppColor.mediumGreyDarkActive,
data.blendMode ?? BlendMode.srcIn,
),
),
),
if (data.labelSvgIcon != null)
SvgGenImage(data.labelSvgIcon!).svg(
width: (data.widthIcon ?? 24).w,
height: (data.heightIcon ?? 24).h,
colorFilter: ColorFilter.mode(
data.iconColor ?? AppColor.mediumGreyDarkActive,
data.blendMode ?? BlendMode.srcIn,
),
),
Visibility(
visible: data.labelTitle != null,
child: Text(

View File

@@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:rasadyar_core/core.dart';
import 'draggable_bottom_sheet.dart';
/*class DraggableBottomSheetController extends GetxController {
final RxList<DraggableBottomSheet> bottomSheets =

View File

@@ -47,7 +47,7 @@ class RTextField extends StatefulWidget {
final bool? autocorrect;
final bool? enableSuggestions;
final TextInputAction? textInputAction;
final double? height;
final double height;
final Iterable<String>? autofillHints;
final InputBorder? focusedBorder;
@@ -61,7 +61,7 @@ class RTextField extends StatefulWidget {
this.onChanged,
this.onSubmitted,
this.onTap,
this.height,
this.height = 40,
// 🔸 Behavior
this.obscure = false,
@@ -158,7 +158,9 @@ class _RTextFieldState extends State<RTextField> {
obscure = widget.obscure;
textDirection = _detectDirection(
widget.controller.text.isNotEmpty ? widget.controller.text : widget.initText ?? 'سلام',
widget.controller.text.isNotEmpty
? widget.controller.text
: widget.initText ?? 'سلام',
);
widget.controller.addListener(_debouncedUpdateTextDirection);
@@ -195,7 +197,7 @@ class _RTextFieldState extends State<RTextField> {
@override
Widget build(BuildContext context) {
return SizedBox(
height: widget.height,
height: (widget.height).h,
child: Padding(
padding: widget.padding ?? EdgeInsets.zero,
child: TextFormField(
@@ -218,7 +220,8 @@ class _RTextFieldState extends State<RTextField> {
textDirection: textDirection,
style: widget.style,
keyboardType: widget.keyboardType,
autovalidateMode: widget.autoValidateMode ?? AutovalidateMode.disabled,
autovalidateMode:
widget.autoValidateMode ?? AutovalidateMode.disabled,
cursorColor: widget.cursorColor,
textCapitalization: widget.textCapitalization,
autocorrect: widget.autocorrect ?? true,
@@ -241,7 +244,8 @@ class _RTextFieldState extends State<RTextField> {
labelStyle: AppFonts.yekan14
.copyWith(color: AppColor.lightGreyDarkActive)
.merge(widget.labelStyle),
filled: widget.filled || widget._noBorder || widget._passwordNoBorder,
filled:
widget.filled || widget._noBorder || widget._passwordNoBorder,
fillColor: widget.filledColor,
counter: widget.showCounter ? null : const SizedBox(),
hintStyle: widget.hintStyle,

View File

@@ -85,7 +85,7 @@ class ListItem extends StatelessWidget {
duration: Duration(milliseconds: 300),
),
),
Container(
SizedBox(
width: 20,
child: Center(
child: SvgGenImage.vec(labelIcon).svg(

View File

@@ -190,7 +190,7 @@ class ListItem2 extends StatelessWidget {
child: child,
),
),
Container(
SizedBox(
width: 20,
child: Center(
child: SvgGenImage.vec(labelIcon).svg(

View File

@@ -81,7 +81,7 @@ class ListItemWithOutCounter extends StatelessWidget {
),
Visibility(
visible: selected==false,
child: Container(
child: SizedBox(
width: 20,
child: Center(
child: SvgGenImage.vec(labelIcon).svg(

View File

@@ -1,5 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
enum ListType { builder, separated }

View File

@@ -6,7 +6,7 @@ class ResourceOverlayDropdown<T> extends StatefulWidget {
final Resource<List<T>> items;
final T? selectedItem;
final T? initialValue;
final int? height;
final double? height;
final Color? background;
final bool? hasDropIcon;
final Widget Function(T item) itemBuilder;
@@ -31,10 +31,12 @@ class ResourceOverlayDropdown<T> extends StatefulWidget {
});
@override
State<ResourceOverlayDropdown<T>> createState() => _ResourceOverlayDropdownState<T>();
State<ResourceOverlayDropdown<T>> createState() =>
_ResourceOverlayDropdownState<T>();
}
class _ResourceOverlayDropdownState<T> extends State<ResourceOverlayDropdown<T>> {
class _ResourceOverlayDropdownState<T>
extends State<ResourceOverlayDropdown<T>> {
final GlobalKey _key = GlobalKey();
OverlayEntry? _overlayEntry;
bool _isOpen = false;
@@ -100,7 +102,10 @@ class _ResourceOverlayDropdownState<T> extends State<ResourceOverlayDropdown<T>>
child: Padding(
padding:
widget.contentPadding ??
const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 4,
),
child: widget.itemBuilder(item),
),
);
@@ -139,13 +144,15 @@ class _ResourceOverlayDropdownState<T> extends State<ResourceOverlayDropdown<T>>
builder: (context, constraints) {
return GestureDetector(
key: _key,
onTap: (widget.isDisabled || widget.items.status == ResourceStatus.loading)
onTap:
(widget.isDisabled ||
widget.items.status == ResourceStatus.loading)
? null
: () {
_isOpen ? _removeOverlay() : _showOverlay();
},
child: Container(
height: widget.height?.toDouble() ?? 40,
height: widget.height?.toDouble() ?? 40.h,
width: constraints.maxWidth,
padding: const EdgeInsets.symmetric(horizontal: 12),
decoration: BoxDecoration(
@@ -171,14 +178,25 @@ class _ResourceOverlayDropdownState<T> extends State<ResourceOverlayDropdown<T>>
children: [
Expanded(child: widget.labelBuilder(selectedItem)),
if (widget.hasDropIcon ?? true)
Icon(_isOpen ? CupertinoIcons.chevron_up : CupertinoIcons.chevron_down, size: 14),
Icon(
_isOpen
? CupertinoIcons.chevron_up
: CupertinoIcons.chevron_down,
size: 14,
),
],
);
case ResourceStatus.error:
return Text('Error', style: AppFonts.yekan12.copyWith(color: AppColor.redNormal));
return Text(
'Error',
style: AppFonts.yekan12.copyWith(color: AppColor.redNormal),
);
case ResourceStatus.empty:
return Text('بدون نتیجه', style: AppFonts.yekan12.copyWith(color: AppColor.textColor));
return Text(
'بدون نتیجه',
style: AppFonts.yekan12.copyWith(color: AppColor.textColor),
);
}
}
}

View File

@@ -75,7 +75,7 @@ class _PaginationFromUntilState extends State<PaginationFromUntil> {
Positioned(
left: 4,
top: 4,
child: Container(
child: SizedBox(
width: 40,
height: 40,
child: Stack(
@@ -95,7 +95,7 @@ class _PaginationFromUntilState extends State<PaginationFromUntil> {
Positioned(
left: 0,
top: 0,
child: Container(
child: SizedBox(
width: 40,
height: 40,
child: Stack(
@@ -103,7 +103,7 @@ class _PaginationFromUntilState extends State<PaginationFromUntil> {
Positioned(
left: 0,
top: 0,
child: Container(
child: SizedBox(
width: 40,
height: 40,
child: Stack(
@@ -147,7 +147,7 @@ class _PaginationFromUntilState extends State<PaginationFromUntil> {
Positioned(
left: 8,
top: 8,
child: Container(width: 24, height: 24, child: Stack()),
child: SizedBox(width: 24, height: 24, child: Stack()),
),
],
),
@@ -156,7 +156,7 @@ class _PaginationFromUntilState extends State<PaginationFromUntil> {
Positioned(
left: 120,
top: 3,
child: Container(
child: SizedBox(
width: 40,
height: 40,
child: Stack(
@@ -176,7 +176,7 @@ class _PaginationFromUntilState extends State<PaginationFromUntil> {
Positioned(
left: 0,
top: 0,
child: Container(
child: SizedBox(
width: 40,
height: 40,
child: Stack(
@@ -184,7 +184,7 @@ class _PaginationFromUntilState extends State<PaginationFromUntil> {
Positioned(
left: 0,
top: 0,
child: Container(
child: SizedBox(
width: 40,
height: 40,
child: Stack(
@@ -229,7 +229,7 @@ class _PaginationFromUntilState extends State<PaginationFromUntil> {
Positioned(
left: 8,
top: 8,
child: Container(width: 24, height: 24, child: Stack()),
child: SizedBox(width: 24, height: 24, child: Stack()),
),
],
),

View File

@@ -1,5 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:rasadyar_core/presentation/common/app_color.dart';
import 'package:rasadyar_core/presentation/common/app_fonts.dart';

View File

@@ -1,8 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:vector_graphics/vector_graphics.dart';
import '../common/assets.gen.dart';
Widget vecWidgetWithOnTap({