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,4 @@
sdk.dir=C:/Users/Housh11/AppData/Local/Android/Sdk sdk.dir=C:\\Users\\Housh11\\AppData\\Local\\Android\\sdk
flutter.sdk=C:\\src\\flutter flutter.sdk=C:\\src\\flutter
flutter.buildMode=debug flutter.buildMode=debug
flutter.versionName=1.3.33 flutter.versionName=1.3.33

View File

@@ -1,7 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart'; import 'package:integration_test/integration_test.dart';
import 'package:get/get.dart';
import 'package:mocktail/mocktail.dart'; import 'package:mocktail/mocktail.dart';
import 'package:rasadyar_app/main.dart' as app; import 'package:rasadyar_app/main.dart' as app;
import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_core/core.dart';

View File

@@ -1,7 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart'; import 'package:integration_test/integration_test.dart';
import 'package:get/get.dart';
import 'package:mocktail/mocktail.dart'; import 'package:mocktail/mocktail.dart';
import 'package:rasadyar_app/presentation/pages/modules/view.dart'; import 'package:rasadyar_app/presentation/pages/modules/view.dart';
import 'package:rasadyar_app/presentation/pages/modules/logic.dart'; import 'package:rasadyar_app/presentation/pages/modules/logic.dart';

View File

@@ -66,10 +66,6 @@ class ModulesLogic extends GetxController {
getSliders(); getSliders();
} }
@override
void onClose() {
super.onClose();
}
@override @override
void dispose() { void dispose() {

View File

@@ -10,7 +10,7 @@ class SystemDesignPage extends StatefulWidget {
} }
class _SystemDesignPageState extends State<SystemDesignPage> { class _SystemDesignPageState extends State<SystemDesignPage> {
List<bool> _isOpen = [false, false, false, false, false, false]; final List<bool> _isOpen = [false, false, false, false, false, false];
@override @override

View File

@@ -0,0 +1,25 @@
import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/chicken_commission_prices/chicken_commission_prices.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_house/kill_house_response.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_request_list/kill_request_list.dart'
as listModel;
abstract class KillHouseRemoteDataSource {
Future<List<KillHouseResponse>?> getKillHouseList({
required String token,
Map<String, dynamic>? queryParameters,
});
Future<ChickenCommissionPrices?> getCommissionPrice({
required String token,
Map<String, dynamic>? queryParameters,
});
Future<void> submitKillHouseRequest({required String token, required Map<String, dynamic> data});
Future<List<listModel.KillRequestList>?> getListKillRequest({
required String token,
Map<String, dynamic>? queryParameters,
});
Future<void> deleteKillRequest({required String token, required int requestId});
}

View File

@@ -1,20 +1,80 @@
import 'package:rasadyar_chicken/data/data_source/remote/kill_house/kill_house_remote.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/chicken_commission_prices/chicken_commission_prices.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_house/kill_house_response.dart'; import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_house/kill_house_response.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_request_list/kill_request_list.dart'
as listModel;
import 'package:rasadyar_core/core.dart';
abstract class KillHouseRemoteDataSource { class KillHouseRemoteDataSourceImpl extends KillHouseRemoteDataSource {
Future<List<KillHouseResponse>> getKillHouseList({ final DioRemote _httpClient;
KillHouseRemoteDataSourceImpl(this._httpClient);
@override
Future<ChickenCommissionPrices?> getCommissionPrice({
required String token, required String token,
Map<String, dynamic>? queryParameters, Map<String, dynamic>? queryParameters,
}); }) async {
var res = await _httpClient.get(
'/chicken-commission-prices/',
headers: {'Authorization': 'Bearer $token'},
fromJson: (json) {
var data = json['results'] as List<dynamic>;
return ChickenCommissionPrices.fromJson(data.first as Map<String, dynamic>);
},
);
Future<List<KillHouseResponse>> getCommissionPrice({ return res.data;
}
@override
Future<List<KillHouseResponse>?> getKillHouseList({
required String token, required String token,
Map<String, dynamic>? queryParameters, Map<String, dynamic>? queryParameters,
}); }) async {
var res = await _httpClient.get(
'/kill_house/?kill_house',
headers: {'Authorization': 'Bearer $token'},
fromJsonList: (json) =>
json.map((e) => KillHouseResponse.fromJson(e as Map<String, dynamic>)).toList(),
);
return res.data;
}
Future<void> submitKillHouseReport({ @override
Future<void> submitKillHouseRequest({
required String token, required String token,
required Map<String, dynamic> data, required Map<String, dynamic> data,
}); }) async {
await _httpClient.post(
'/kill_request/',
headers: {'Authorization': 'Bearer $token'},
data: data,
);
}
@override
Future<List<listModel.KillRequestList>?> getListKillRequest({
required String token,
Map<String, dynamic>? queryParameters,
}) async {
var res = await _httpClient.get(
'/kill_request/',
headers: {'Authorization': 'Bearer $token'},
queryParameters: queryParameters,
fromJsonList: (json) =>
json.map((e) => listModel.KillRequestList.fromJson(e as Map<String, dynamic>)).toList(),
);
return res.data;
}
@override
Future<void> deleteKillRequest({required String token, required int requestId}) async {
await _httpClient.delete(
'/kill_request/$requestId/',
headers: {'Authorization': 'Bearer $token'},
);
}
} }

View File

@@ -6,12 +6,16 @@ import 'package:rasadyar_chicken/data/data_source/remote/auth/auth_remote.dart';
import 'package:rasadyar_chicken/data/data_source/remote/auth/auth_remote_imp.dart'; import 'package:rasadyar_chicken/data/data_source/remote/auth/auth_remote_imp.dart';
import 'package:rasadyar_chicken/data/data_source/remote/chicken/chicken_remote.dart'; import 'package:rasadyar_chicken/data/data_source/remote/chicken/chicken_remote.dart';
import 'package:rasadyar_chicken/data/data_source/remote/chicken/chicken_remote_imp.dart'; import 'package:rasadyar_chicken/data/data_source/remote/chicken/chicken_remote_imp.dart';
import 'package:rasadyar_chicken/data/data_source/remote/kill_house/kill_house_remote.dart';
import 'package:rasadyar_chicken/data/data_source/remote/kill_house/kill_house_remote_impl.dart';
import 'package:rasadyar_chicken/data/data_source/remote/poultry_science/poultry_science_remote.dart'; import 'package:rasadyar_chicken/data/data_source/remote/poultry_science/poultry_science_remote.dart';
import 'package:rasadyar_chicken/data/data_source/remote/poultry_science/poultry_science_remote_imp.dart'; import 'package:rasadyar_chicken/data/data_source/remote/poultry_science/poultry_science_remote_imp.dart';
import 'package:rasadyar_chicken/data/repositories/auth/auth_repository.dart'; import 'package:rasadyar_chicken/data/repositories/auth/auth_repository.dart';
import 'package:rasadyar_chicken/data/repositories/auth/auth_repository_imp.dart'; import 'package:rasadyar_chicken/data/repositories/auth/auth_repository_imp.dart';
import 'package:rasadyar_chicken/data/repositories/chicken/chicken_repository.dart'; import 'package:rasadyar_chicken/data/repositories/chicken/chicken_repository.dart';
import 'package:rasadyar_chicken/data/repositories/chicken/chicken_repository_imp.dart'; import 'package:rasadyar_chicken/data/repositories/chicken/chicken_repository_imp.dart';
import 'package:rasadyar_chicken/data/repositories/kill_house/kill_house_repository.dart';
import 'package:rasadyar_chicken/data/repositories/kill_house/kill_house_repository_impl.dart';
import 'package:rasadyar_chicken/data/repositories/poultry_science/poultry_science_repository.dart'; import 'package:rasadyar_chicken/data/repositories/poultry_science/poultry_science_repository.dart';
import 'package:rasadyar_chicken/data/repositories/poultry_science/poultry_science_repository_imp.dart'; import 'package:rasadyar_chicken/data/repositories/poultry_science/poultry_science_repository_imp.dart';
import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_core/core.dart';
@@ -80,6 +84,15 @@ Future<void> setupChickenDI() async {
diChicken.registerLazySingleton<PoultryScienceRepository>( diChicken.registerLazySingleton<PoultryScienceRepository>(
() => PoultryScienceRepositoryImp(diChicken.get<PoultryScienceRemoteDatasource>()), () => PoultryScienceRepositoryImp(diChicken.get<PoultryScienceRemoteDatasource>()),
); );
//region kill house module DI
diChicken.registerLazySingleton<KillHouseRemoteDataSource>(
() => KillHouseRemoteDataSourceImpl(diChicken.get<DioRemote>()),
);
diChicken.registerLazySingleton<KillHouseRepository>(
() => KillHouseRepositoryImpl(diChicken.get<KillHouseRemoteDataSource>()),
);
//endregion
} }
Future<void> newSetupAuthDI(String newUrl) async { Future<void> newSetupAuthDI(String newUrl) async {

View File

@@ -0,0 +1,26 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'kill_request_response.freezed.dart';
part 'kill_request_response.g.dart';
@freezed
abstract class KillRequestResponse with _$KillRequestResponse {
const factory KillRequestResponse({
int? killCapacity,
String? reciveTime,
String? reciveDate,
bool? lowWeight,
bool? highWeight,
@JsonKey(name: "Index_weight") double? indexWeight,
String? chickenBreed,
bool? cash,
bool? credit,
bool? smsPayment,
String? killHouseKey,
String? killerKillHouseKey,
String? role,
}) = _KillRequestResponse;
factory KillRequestResponse.fromJson(Map<String, dynamic> json) =>
_$KillRequestResponseFromJson(json);
}

View File

@@ -0,0 +1,313 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'kill_request_response.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$KillRequestResponse {
int? get killCapacity; String? get reciveTime; String? get reciveDate; bool? get lowWeight; bool? get highWeight;@JsonKey(name: "Index_weight") double? get indexWeight; String? get chickenBreed; bool? get cash; bool? get credit; bool? get smsPayment; String? get killHouseKey; String? get killerKillHouseKey; String? get role;
/// Create a copy of KillRequestResponse
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$KillRequestResponseCopyWith<KillRequestResponse> get copyWith => _$KillRequestResponseCopyWithImpl<KillRequestResponse>(this as KillRequestResponse, _$identity);
/// Serializes this KillRequestResponse to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is KillRequestResponse&&(identical(other.killCapacity, killCapacity) || other.killCapacity == killCapacity)&&(identical(other.reciveTime, reciveTime) || other.reciveTime == reciveTime)&&(identical(other.reciveDate, reciveDate) || other.reciveDate == reciveDate)&&(identical(other.lowWeight, lowWeight) || other.lowWeight == lowWeight)&&(identical(other.highWeight, highWeight) || other.highWeight == highWeight)&&(identical(other.indexWeight, indexWeight) || other.indexWeight == indexWeight)&&(identical(other.chickenBreed, chickenBreed) || other.chickenBreed == chickenBreed)&&(identical(other.cash, cash) || other.cash == cash)&&(identical(other.credit, credit) || other.credit == credit)&&(identical(other.smsPayment, smsPayment) || other.smsPayment == smsPayment)&&(identical(other.killHouseKey, killHouseKey) || other.killHouseKey == killHouseKey)&&(identical(other.killerKillHouseKey, killerKillHouseKey) || other.killerKillHouseKey == killerKillHouseKey)&&(identical(other.role, role) || other.role == role));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,killCapacity,reciveTime,reciveDate,lowWeight,highWeight,indexWeight,chickenBreed,cash,credit,smsPayment,killHouseKey,killerKillHouseKey,role);
@override
String toString() {
return 'KillRequestResponse(killCapacity: $killCapacity, reciveTime: $reciveTime, reciveDate: $reciveDate, lowWeight: $lowWeight, highWeight: $highWeight, indexWeight: $indexWeight, chickenBreed: $chickenBreed, cash: $cash, credit: $credit, smsPayment: $smsPayment, killHouseKey: $killHouseKey, killerKillHouseKey: $killerKillHouseKey, role: $role)';
}
}
/// @nodoc
abstract mixin class $KillRequestResponseCopyWith<$Res> {
factory $KillRequestResponseCopyWith(KillRequestResponse value, $Res Function(KillRequestResponse) _then) = _$KillRequestResponseCopyWithImpl;
@useResult
$Res call({
int? killCapacity, String? reciveTime, String? reciveDate, bool? lowWeight, bool? highWeight,@JsonKey(name: "Index_weight") double? indexWeight, String? chickenBreed, bool? cash, bool? credit, bool? smsPayment, String? killHouseKey, String? killerKillHouseKey, String? role
});
}
/// @nodoc
class _$KillRequestResponseCopyWithImpl<$Res>
implements $KillRequestResponseCopyWith<$Res> {
_$KillRequestResponseCopyWithImpl(this._self, this._then);
final KillRequestResponse _self;
final $Res Function(KillRequestResponse) _then;
/// Create a copy of KillRequestResponse
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? killCapacity = freezed,Object? reciveTime = freezed,Object? reciveDate = freezed,Object? lowWeight = freezed,Object? highWeight = freezed,Object? indexWeight = freezed,Object? chickenBreed = freezed,Object? cash = freezed,Object? credit = freezed,Object? smsPayment = freezed,Object? killHouseKey = freezed,Object? killerKillHouseKey = freezed,Object? role = freezed,}) {
return _then(_self.copyWith(
killCapacity: freezed == killCapacity ? _self.killCapacity : killCapacity // ignore: cast_nullable_to_non_nullable
as int?,reciveTime: freezed == reciveTime ? _self.reciveTime : reciveTime // ignore: cast_nullable_to_non_nullable
as String?,reciveDate: freezed == reciveDate ? _self.reciveDate : reciveDate // ignore: cast_nullable_to_non_nullable
as String?,lowWeight: freezed == lowWeight ? _self.lowWeight : lowWeight // ignore: cast_nullable_to_non_nullable
as bool?,highWeight: freezed == highWeight ? _self.highWeight : highWeight // ignore: cast_nullable_to_non_nullable
as bool?,indexWeight: freezed == indexWeight ? _self.indexWeight : indexWeight // ignore: cast_nullable_to_non_nullable
as double?,chickenBreed: freezed == chickenBreed ? _self.chickenBreed : chickenBreed // ignore: cast_nullable_to_non_nullable
as String?,cash: freezed == cash ? _self.cash : cash // ignore: cast_nullable_to_non_nullable
as bool?,credit: freezed == credit ? _self.credit : credit // ignore: cast_nullable_to_non_nullable
as bool?,smsPayment: freezed == smsPayment ? _self.smsPayment : smsPayment // ignore: cast_nullable_to_non_nullable
as bool?,killHouseKey: freezed == killHouseKey ? _self.killHouseKey : killHouseKey // ignore: cast_nullable_to_non_nullable
as String?,killerKillHouseKey: freezed == killerKillHouseKey ? _self.killerKillHouseKey : killerKillHouseKey // ignore: cast_nullable_to_non_nullable
as String?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// Adds pattern-matching-related methods to [KillRequestResponse].
extension KillRequestResponsePatterns on KillRequestResponse {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _KillRequestResponse value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _KillRequestResponse() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _KillRequestResponse value) $default,){
final _that = this;
switch (_that) {
case _KillRequestResponse():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _KillRequestResponse value)? $default,){
final _that = this;
switch (_that) {
case _KillRequestResponse() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int? killCapacity, String? reciveTime, String? reciveDate, bool? lowWeight, bool? highWeight, @JsonKey(name: "Index_weight") double? indexWeight, String? chickenBreed, bool? cash, bool? credit, bool? smsPayment, String? killHouseKey, String? killerKillHouseKey, String? role)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _KillRequestResponse() when $default != null:
return $default(_that.killCapacity,_that.reciveTime,_that.reciveDate,_that.lowWeight,_that.highWeight,_that.indexWeight,_that.chickenBreed,_that.cash,_that.credit,_that.smsPayment,_that.killHouseKey,_that.killerKillHouseKey,_that.role);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int? killCapacity, String? reciveTime, String? reciveDate, bool? lowWeight, bool? highWeight, @JsonKey(name: "Index_weight") double? indexWeight, String? chickenBreed, bool? cash, bool? credit, bool? smsPayment, String? killHouseKey, String? killerKillHouseKey, String? role) $default,) {final _that = this;
switch (_that) {
case _KillRequestResponse():
return $default(_that.killCapacity,_that.reciveTime,_that.reciveDate,_that.lowWeight,_that.highWeight,_that.indexWeight,_that.chickenBreed,_that.cash,_that.credit,_that.smsPayment,_that.killHouseKey,_that.killerKillHouseKey,_that.role);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int? killCapacity, String? reciveTime, String? reciveDate, bool? lowWeight, bool? highWeight, @JsonKey(name: "Index_weight") double? indexWeight, String? chickenBreed, bool? cash, bool? credit, bool? smsPayment, String? killHouseKey, String? killerKillHouseKey, String? role)? $default,) {final _that = this;
switch (_that) {
case _KillRequestResponse() when $default != null:
return $default(_that.killCapacity,_that.reciveTime,_that.reciveDate,_that.lowWeight,_that.highWeight,_that.indexWeight,_that.chickenBreed,_that.cash,_that.credit,_that.smsPayment,_that.killHouseKey,_that.killerKillHouseKey,_that.role);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _KillRequestResponse implements KillRequestResponse {
const _KillRequestResponse({this.killCapacity, this.reciveTime, this.reciveDate, this.lowWeight, this.highWeight, @JsonKey(name: "Index_weight") this.indexWeight, this.chickenBreed, this.cash, this.credit, this.smsPayment, this.killHouseKey, this.killerKillHouseKey, this.role});
factory _KillRequestResponse.fromJson(Map<String, dynamic> json) => _$KillRequestResponseFromJson(json);
@override final int? killCapacity;
@override final String? reciveTime;
@override final String? reciveDate;
@override final bool? lowWeight;
@override final bool? highWeight;
@override@JsonKey(name: "Index_weight") final double? indexWeight;
@override final String? chickenBreed;
@override final bool? cash;
@override final bool? credit;
@override final bool? smsPayment;
@override final String? killHouseKey;
@override final String? killerKillHouseKey;
@override final String? role;
/// Create a copy of KillRequestResponse
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$KillRequestResponseCopyWith<_KillRequestResponse> get copyWith => __$KillRequestResponseCopyWithImpl<_KillRequestResponse>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$KillRequestResponseToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _KillRequestResponse&&(identical(other.killCapacity, killCapacity) || other.killCapacity == killCapacity)&&(identical(other.reciveTime, reciveTime) || other.reciveTime == reciveTime)&&(identical(other.reciveDate, reciveDate) || other.reciveDate == reciveDate)&&(identical(other.lowWeight, lowWeight) || other.lowWeight == lowWeight)&&(identical(other.highWeight, highWeight) || other.highWeight == highWeight)&&(identical(other.indexWeight, indexWeight) || other.indexWeight == indexWeight)&&(identical(other.chickenBreed, chickenBreed) || other.chickenBreed == chickenBreed)&&(identical(other.cash, cash) || other.cash == cash)&&(identical(other.credit, credit) || other.credit == credit)&&(identical(other.smsPayment, smsPayment) || other.smsPayment == smsPayment)&&(identical(other.killHouseKey, killHouseKey) || other.killHouseKey == killHouseKey)&&(identical(other.killerKillHouseKey, killerKillHouseKey) || other.killerKillHouseKey == killerKillHouseKey)&&(identical(other.role, role) || other.role == role));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,killCapacity,reciveTime,reciveDate,lowWeight,highWeight,indexWeight,chickenBreed,cash,credit,smsPayment,killHouseKey,killerKillHouseKey,role);
@override
String toString() {
return 'KillRequestResponse(killCapacity: $killCapacity, reciveTime: $reciveTime, reciveDate: $reciveDate, lowWeight: $lowWeight, highWeight: $highWeight, indexWeight: $indexWeight, chickenBreed: $chickenBreed, cash: $cash, credit: $credit, smsPayment: $smsPayment, killHouseKey: $killHouseKey, killerKillHouseKey: $killerKillHouseKey, role: $role)';
}
}
/// @nodoc
abstract mixin class _$KillRequestResponseCopyWith<$Res> implements $KillRequestResponseCopyWith<$Res> {
factory _$KillRequestResponseCopyWith(_KillRequestResponse value, $Res Function(_KillRequestResponse) _then) = __$KillRequestResponseCopyWithImpl;
@override @useResult
$Res call({
int? killCapacity, String? reciveTime, String? reciveDate, bool? lowWeight, bool? highWeight,@JsonKey(name: "Index_weight") double? indexWeight, String? chickenBreed, bool? cash, bool? credit, bool? smsPayment, String? killHouseKey, String? killerKillHouseKey, String? role
});
}
/// @nodoc
class __$KillRequestResponseCopyWithImpl<$Res>
implements _$KillRequestResponseCopyWith<$Res> {
__$KillRequestResponseCopyWithImpl(this._self, this._then);
final _KillRequestResponse _self;
final $Res Function(_KillRequestResponse) _then;
/// Create a copy of KillRequestResponse
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? killCapacity = freezed,Object? reciveTime = freezed,Object? reciveDate = freezed,Object? lowWeight = freezed,Object? highWeight = freezed,Object? indexWeight = freezed,Object? chickenBreed = freezed,Object? cash = freezed,Object? credit = freezed,Object? smsPayment = freezed,Object? killHouseKey = freezed,Object? killerKillHouseKey = freezed,Object? role = freezed,}) {
return _then(_KillRequestResponse(
killCapacity: freezed == killCapacity ? _self.killCapacity : killCapacity // ignore: cast_nullable_to_non_nullable
as int?,reciveTime: freezed == reciveTime ? _self.reciveTime : reciveTime // ignore: cast_nullable_to_non_nullable
as String?,reciveDate: freezed == reciveDate ? _self.reciveDate : reciveDate // ignore: cast_nullable_to_non_nullable
as String?,lowWeight: freezed == lowWeight ? _self.lowWeight : lowWeight // ignore: cast_nullable_to_non_nullable
as bool?,highWeight: freezed == highWeight ? _self.highWeight : highWeight // ignore: cast_nullable_to_non_nullable
as bool?,indexWeight: freezed == indexWeight ? _self.indexWeight : indexWeight // ignore: cast_nullable_to_non_nullable
as double?,chickenBreed: freezed == chickenBreed ? _self.chickenBreed : chickenBreed // ignore: cast_nullable_to_non_nullable
as String?,cash: freezed == cash ? _self.cash : cash // ignore: cast_nullable_to_non_nullable
as bool?,credit: freezed == credit ? _self.credit : credit // ignore: cast_nullable_to_non_nullable
as bool?,smsPayment: freezed == smsPayment ? _self.smsPayment : smsPayment // ignore: cast_nullable_to_non_nullable
as bool?,killHouseKey: freezed == killHouseKey ? _self.killHouseKey : killHouseKey // ignore: cast_nullable_to_non_nullable
as String?,killerKillHouseKey: freezed == killerKillHouseKey ? _self.killerKillHouseKey : killerKillHouseKey // ignore: cast_nullable_to_non_nullable
as String?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
// dart format on

View File

@@ -0,0 +1,42 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'kill_request_response.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_KillRequestResponse _$KillRequestResponseFromJson(Map<String, dynamic> json) =>
_KillRequestResponse(
killCapacity: (json['kill_capacity'] as num?)?.toInt(),
reciveTime: json['recive_time'] as String?,
reciveDate: json['recive_date'] as String?,
lowWeight: json['low_weight'] as bool?,
highWeight: json['high_weight'] as bool?,
indexWeight: (json['Index_weight'] as num?)?.toDouble(),
chickenBreed: json['chicken_breed'] as String?,
cash: json['cash'] as bool?,
credit: json['credit'] as bool?,
smsPayment: json['sms_payment'] as bool?,
killHouseKey: json['kill_house_key'] as String?,
killerKillHouseKey: json['killer_kill_house_key'] as String?,
role: json['role'] as String?,
);
Map<String, dynamic> _$KillRequestResponseToJson(
_KillRequestResponse instance,
) => <String, dynamic>{
'kill_capacity': instance.killCapacity,
'recive_time': instance.reciveTime,
'recive_date': instance.reciveDate,
'low_weight': instance.lowWeight,
'high_weight': instance.highWeight,
'Index_weight': instance.indexWeight,
'chicken_breed': instance.chickenBreed,
'cash': instance.cash,
'credit': instance.credit,
'sms_payment': instance.smsPayment,
'kill_house_key': instance.killHouseKey,
'killer_kill_house_key': instance.killerKillHouseKey,
'role': instance.role,
};

View File

@@ -0,0 +1,12 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'chicken_commission_prices.freezed.dart';
part 'chicken_commission_prices.g.dart';
@freezed
abstract class ChickenCommissionPrices with _$ChickenCommissionPrices {
const factory ChickenCommissionPrices({double? chickenAveragePrice}) = _ChickenCommissionPrices;
factory ChickenCommissionPrices.fromJson(Map<String, dynamic> json) =>
_$ChickenCommissionPricesFromJson(json);
}

View File

@@ -0,0 +1,277 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'chicken_commission_prices.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$ChickenCommissionPrices {
double? get chickenAveragePrice;
/// Create a copy of ChickenCommissionPrices
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$ChickenCommissionPricesCopyWith<ChickenCommissionPrices> get copyWith => _$ChickenCommissionPricesCopyWithImpl<ChickenCommissionPrices>(this as ChickenCommissionPrices, _$identity);
/// Serializes this ChickenCommissionPrices to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is ChickenCommissionPrices&&(identical(other.chickenAveragePrice, chickenAveragePrice) || other.chickenAveragePrice == chickenAveragePrice));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,chickenAveragePrice);
@override
String toString() {
return 'ChickenCommissionPrices(chickenAveragePrice: $chickenAveragePrice)';
}
}
/// @nodoc
abstract mixin class $ChickenCommissionPricesCopyWith<$Res> {
factory $ChickenCommissionPricesCopyWith(ChickenCommissionPrices value, $Res Function(ChickenCommissionPrices) _then) = _$ChickenCommissionPricesCopyWithImpl;
@useResult
$Res call({
double? chickenAveragePrice
});
}
/// @nodoc
class _$ChickenCommissionPricesCopyWithImpl<$Res>
implements $ChickenCommissionPricesCopyWith<$Res> {
_$ChickenCommissionPricesCopyWithImpl(this._self, this._then);
final ChickenCommissionPrices _self;
final $Res Function(ChickenCommissionPrices) _then;
/// Create a copy of ChickenCommissionPrices
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? chickenAveragePrice = freezed,}) {
return _then(_self.copyWith(
chickenAveragePrice: freezed == chickenAveragePrice ? _self.chickenAveragePrice : chickenAveragePrice // ignore: cast_nullable_to_non_nullable
as double?,
));
}
}
/// Adds pattern-matching-related methods to [ChickenCommissionPrices].
extension ChickenCommissionPricesPatterns on ChickenCommissionPrices {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _ChickenCommissionPrices value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _ChickenCommissionPrices() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _ChickenCommissionPrices value) $default,){
final _that = this;
switch (_that) {
case _ChickenCommissionPrices():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _ChickenCommissionPrices value)? $default,){
final _that = this;
switch (_that) {
case _ChickenCommissionPrices() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( double? chickenAveragePrice)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _ChickenCommissionPrices() when $default != null:
return $default(_that.chickenAveragePrice);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( double? chickenAveragePrice) $default,) {final _that = this;
switch (_that) {
case _ChickenCommissionPrices():
return $default(_that.chickenAveragePrice);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( double? chickenAveragePrice)? $default,) {final _that = this;
switch (_that) {
case _ChickenCommissionPrices() when $default != null:
return $default(_that.chickenAveragePrice);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _ChickenCommissionPrices implements ChickenCommissionPrices {
const _ChickenCommissionPrices({this.chickenAveragePrice});
factory _ChickenCommissionPrices.fromJson(Map<String, dynamic> json) => _$ChickenCommissionPricesFromJson(json);
@override final double? chickenAveragePrice;
/// Create a copy of ChickenCommissionPrices
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$ChickenCommissionPricesCopyWith<_ChickenCommissionPrices> get copyWith => __$ChickenCommissionPricesCopyWithImpl<_ChickenCommissionPrices>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$ChickenCommissionPricesToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ChickenCommissionPrices&&(identical(other.chickenAveragePrice, chickenAveragePrice) || other.chickenAveragePrice == chickenAveragePrice));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,chickenAveragePrice);
@override
String toString() {
return 'ChickenCommissionPrices(chickenAveragePrice: $chickenAveragePrice)';
}
}
/// @nodoc
abstract mixin class _$ChickenCommissionPricesCopyWith<$Res> implements $ChickenCommissionPricesCopyWith<$Res> {
factory _$ChickenCommissionPricesCopyWith(_ChickenCommissionPrices value, $Res Function(_ChickenCommissionPrices) _then) = __$ChickenCommissionPricesCopyWithImpl;
@override @useResult
$Res call({
double? chickenAveragePrice
});
}
/// @nodoc
class __$ChickenCommissionPricesCopyWithImpl<$Res>
implements _$ChickenCommissionPricesCopyWith<$Res> {
__$ChickenCommissionPricesCopyWithImpl(this._self, this._then);
final _ChickenCommissionPrices _self;
final $Res Function(_ChickenCommissionPrices) _then;
/// Create a copy of ChickenCommissionPrices
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? chickenAveragePrice = freezed,}) {
return _then(_ChickenCommissionPrices(
chickenAveragePrice: freezed == chickenAveragePrice ? _self.chickenAveragePrice : chickenAveragePrice // ignore: cast_nullable_to_non_nullable
as double?,
));
}
}
// dart format on

View File

@@ -0,0 +1,17 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'chicken_commission_prices.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_ChickenCommissionPrices _$ChickenCommissionPricesFromJson(
Map<String, dynamic> json,
) => _ChickenCommissionPrices(
chickenAveragePrice: (json['chicken_average_price'] as num?)?.toDouble(),
);
Map<String, dynamic> _$ChickenCommissionPricesToJson(
_ChickenCommissionPrices instance,
) => <String, dynamic>{'chicken_average_price': instance.chickenAveragePrice};

View File

@@ -0,0 +1,12 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'kill_house_response.freezed.dart';
part 'kill_house_response.g.dart';
@freezed
abstract class KillHouseResponse with _$KillHouseResponse {
const factory KillHouseResponse({String? name, String? key}) = _KillHouseResponse;
factory KillHouseResponse.fromJson(Map<String, dynamic> json) =>
_$KillHouseResponseFromJson(json);
}

View File

@@ -0,0 +1,280 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'kill_house_response.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$KillHouseResponse {
String? get name; String? get key;
/// Create a copy of KillHouseResponse
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$KillHouseResponseCopyWith<KillHouseResponse> get copyWith => _$KillHouseResponseCopyWithImpl<KillHouseResponse>(this as KillHouseResponse, _$identity);
/// Serializes this KillHouseResponse to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is KillHouseResponse&&(identical(other.name, name) || other.name == name)&&(identical(other.key, key) || other.key == key));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,name,key);
@override
String toString() {
return 'KillHouseResponse(name: $name, key: $key)';
}
}
/// @nodoc
abstract mixin class $KillHouseResponseCopyWith<$Res> {
factory $KillHouseResponseCopyWith(KillHouseResponse value, $Res Function(KillHouseResponse) _then) = _$KillHouseResponseCopyWithImpl;
@useResult
$Res call({
String? name, String? key
});
}
/// @nodoc
class _$KillHouseResponseCopyWithImpl<$Res>
implements $KillHouseResponseCopyWith<$Res> {
_$KillHouseResponseCopyWithImpl(this._self, this._then);
final KillHouseResponse _self;
final $Res Function(KillHouseResponse) _then;
/// Create a copy of KillHouseResponse
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? name = freezed,Object? key = freezed,}) {
return _then(_self.copyWith(
name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// Adds pattern-matching-related methods to [KillHouseResponse].
extension KillHouseResponsePatterns on KillHouseResponse {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _KillHouseResponse value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _KillHouseResponse() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _KillHouseResponse value) $default,){
final _that = this;
switch (_that) {
case _KillHouseResponse():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _KillHouseResponse value)? $default,){
final _that = this;
switch (_that) {
case _KillHouseResponse() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String? name, String? key)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _KillHouseResponse() when $default != null:
return $default(_that.name,_that.key);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String? name, String? key) $default,) {final _that = this;
switch (_that) {
case _KillHouseResponse():
return $default(_that.name,_that.key);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String? name, String? key)? $default,) {final _that = this;
switch (_that) {
case _KillHouseResponse() when $default != null:
return $default(_that.name,_that.key);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _KillHouseResponse implements KillHouseResponse {
const _KillHouseResponse({this.name, this.key});
factory _KillHouseResponse.fromJson(Map<String, dynamic> json) => _$KillHouseResponseFromJson(json);
@override final String? name;
@override final String? key;
/// Create a copy of KillHouseResponse
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$KillHouseResponseCopyWith<_KillHouseResponse> get copyWith => __$KillHouseResponseCopyWithImpl<_KillHouseResponse>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$KillHouseResponseToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _KillHouseResponse&&(identical(other.name, name) || other.name == name)&&(identical(other.key, key) || other.key == key));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,name,key);
@override
String toString() {
return 'KillHouseResponse(name: $name, key: $key)';
}
}
/// @nodoc
abstract mixin class _$KillHouseResponseCopyWith<$Res> implements $KillHouseResponseCopyWith<$Res> {
factory _$KillHouseResponseCopyWith(_KillHouseResponse value, $Res Function(_KillHouseResponse) _then) = __$KillHouseResponseCopyWithImpl;
@override @useResult
$Res call({
String? name, String? key
});
}
/// @nodoc
class __$KillHouseResponseCopyWithImpl<$Res>
implements _$KillHouseResponseCopyWith<$Res> {
__$KillHouseResponseCopyWithImpl(this._self, this._then);
final _KillHouseResponse _self;
final $Res Function(_KillHouseResponse) _then;
/// Create a copy of KillHouseResponse
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? name = freezed,Object? key = freezed,}) {
return _then(_KillHouseResponse(
name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
// dart format on

View File

@@ -0,0 +1,16 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'kill_house_response.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_KillHouseResponse _$KillHouseResponseFromJson(Map<String, dynamic> json) =>
_KillHouseResponse(
name: json['name'] as String?,
key: json['key'] as String?,
);
Map<String, dynamic> _$KillHouseResponseToJson(_KillHouseResponse instance) =>
<String, dynamic>{'name': instance.name, 'key': instance.key};

View File

@@ -0,0 +1,125 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'kill_request_list.freezed.dart';
part 'kill_request_list.g.dart';
@freezed
abstract class KillRequestList with _$KillRequestList {
const factory KillRequestList({
int? id,
KillHouseResponse? killHouse,
KillHouseVetResponse? killHouseVet,
int? numberOfAllocated,
String? key,
String? createDate,
String? modifyDate,
bool? trash,
int? killCapacity,
int? previousKillCapacity,
int? remainQuantityForPoultry,
int? remainQuantity,
String? reciveTime,
String? reciveDate,
String? state,
String? provinceState,
BuyTypeResponse? buyType,
WeightTypeResponse? weightType,
String? chickenBreed,
double? indexWeight,
bool? smsPayment,
RegistrarResponse? registrar,
}) = _KillRequestList;
factory KillRequestList.fromJson(Map<String, dynamic> json) => _$KillRequestListFromJson(json);
}
///////////////////////////////////////////////////
/// SUB MODELS
///////////////////////////////////////////////////
@freezed
abstract class KillHouseResponse with _$KillHouseResponse {
const factory KillHouseResponse({
KillHouseOperator? killHouseOperator,
String? name,
bool? killer,
String? key,
}) = _KillHouseResponse;
factory KillHouseResponse.fromJson(Map<String, dynamic> json) =>
_$KillHouseResponseFromJson(json);
}
@freezed
abstract class KillHouseOperator with _$KillHouseOperator {
const factory KillHouseOperator({UserResponse? user}) = _KillHouseOperator;
factory KillHouseOperator.fromJson(Map<String, dynamic> json) =>
_$KillHouseOperatorFromJson(json);
}
@freezed
abstract class UserResponse with _$UserResponse {
const factory UserResponse({
String? fullname,
String? firstName,
String? lastName,
String? mobile,
String? key,
CityResponse? city,
}) = _UserResponse;
factory UserResponse.fromJson(Map<String, dynamic> json) => _$UserResponseFromJson(json);
}
@freezed
abstract class CityResponse with _$CityResponse {
const factory CityResponse({int? id, String? name, String? provinceName}) = _CityResponse;
factory CityResponse.fromJson(Map<String, dynamic> json) => _$CityResponseFromJson(json);
}
@freezed
abstract class KillHouseVetResponse with _$KillHouseVetResponse {
const factory KillHouseVetResponse({
int? id,
VetResponse? vet,
KillHouseResponse? killHouse,
String? key,
bool? trash,
}) = _KillHouseVetResponse;
factory KillHouseVetResponse.fromJson(Map<String, dynamic> json) =>
_$KillHouseVetResponseFromJson(json);
}
@freezed
abstract class VetResponse with _$VetResponse {
const factory VetResponse({UserResponse? user}) = _VetResponse;
factory VetResponse.fromJson(Map<String, dynamic> json) => _$VetResponseFromJson(json);
}
@freezed
abstract class BuyTypeResponse with _$BuyTypeResponse {
const factory BuyTypeResponse({bool? cash, bool? credit}) = _BuyTypeResponse;
factory BuyTypeResponse.fromJson(Map<String, dynamic> json) => _$BuyTypeResponseFromJson(json);
}
@freezed
abstract class WeightTypeResponse with _$WeightTypeResponse {
const factory WeightTypeResponse({bool? lowWeight, bool? highWeight}) = _WeightTypeResponse;
factory WeightTypeResponse.fromJson(Map<String, dynamic> json) =>
_$WeightTypeResponseFromJson(json);
}
@freezed
abstract class RegistrarResponse with _$RegistrarResponse {
const factory RegistrarResponse({String? date, String? role, String? fullName}) =
_RegistrarResponse;
factory RegistrarResponse.fromJson(Map<String, dynamic> json) =>
_$RegistrarResponseFromJson(json);
}

View File

@@ -0,0 +1,209 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'kill_request_list.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_KillRequestList _$KillRequestListFromJson(
Map<String, dynamic> json,
) => _KillRequestList(
id: (json['id'] as num?)?.toInt(),
killHouse: json['kill_house'] == null
? null
: KillHouseResponse.fromJson(json['kill_house'] as Map<String, dynamic>),
killHouseVet: json['kill_house_vet'] == null
? null
: KillHouseVetResponse.fromJson(
json['kill_house_vet'] as Map<String, dynamic>,
),
numberOfAllocated: (json['number_of_allocated'] as num?)?.toInt(),
key: json['key'] as String?,
createDate: json['create_date'] as String?,
modifyDate: json['modify_date'] as String?,
trash: json['trash'] as bool?,
killCapacity: (json['kill_capacity'] as num?)?.toInt(),
previousKillCapacity: (json['previous_kill_capacity'] as num?)?.toInt(),
remainQuantityForPoultry: (json['remain_quantity_for_poultry'] as num?)
?.toInt(),
remainQuantity: (json['remain_quantity'] as num?)?.toInt(),
reciveTime: json['recive_time'] as String?,
reciveDate: json['recive_date'] as String?,
state: json['state'] as String?,
provinceState: json['province_state'] as String?,
buyType: json['buy_type'] == null
? null
: BuyTypeResponse.fromJson(json['buy_type'] as Map<String, dynamic>),
weightType: json['weight_type'] == null
? null
: WeightTypeResponse.fromJson(
json['weight_type'] as Map<String, dynamic>,
),
chickenBreed: json['chicken_breed'] as String?,
indexWeight: (json['index_weight'] as num?)?.toDouble(),
smsPayment: json['sms_payment'] as bool?,
registrar: json['registrar'] == null
? null
: RegistrarResponse.fromJson(json['registrar'] as Map<String, dynamic>),
);
Map<String, dynamic> _$KillRequestListToJson(_KillRequestList instance) =>
<String, dynamic>{
'id': instance.id,
'kill_house': instance.killHouse,
'kill_house_vet': instance.killHouseVet,
'number_of_allocated': instance.numberOfAllocated,
'key': instance.key,
'create_date': instance.createDate,
'modify_date': instance.modifyDate,
'trash': instance.trash,
'kill_capacity': instance.killCapacity,
'previous_kill_capacity': instance.previousKillCapacity,
'remain_quantity_for_poultry': instance.remainQuantityForPoultry,
'remain_quantity': instance.remainQuantity,
'recive_time': instance.reciveTime,
'recive_date': instance.reciveDate,
'state': instance.state,
'province_state': instance.provinceState,
'buy_type': instance.buyType,
'weight_type': instance.weightType,
'chicken_breed': instance.chickenBreed,
'index_weight': instance.indexWeight,
'sms_payment': instance.smsPayment,
'registrar': instance.registrar,
};
_KillHouseResponse _$KillHouseResponseFromJson(Map<String, dynamic> json) =>
_KillHouseResponse(
killHouseOperator: json['kill_house_operator'] == null
? null
: KillHouseOperator.fromJson(
json['kill_house_operator'] as Map<String, dynamic>,
),
name: json['name'] as String?,
killer: json['killer'] as bool?,
key: json['key'] as String?,
);
Map<String, dynamic> _$KillHouseResponseToJson(_KillHouseResponse instance) =>
<String, dynamic>{
'kill_house_operator': instance.killHouseOperator,
'name': instance.name,
'killer': instance.killer,
'key': instance.key,
};
_KillHouseOperator _$KillHouseOperatorFromJson(Map<String, dynamic> json) =>
_KillHouseOperator(
user: json['user'] == null
? null
: UserResponse.fromJson(json['user'] as Map<String, dynamic>),
);
Map<String, dynamic> _$KillHouseOperatorToJson(_KillHouseOperator instance) =>
<String, dynamic>{'user': instance.user};
_UserResponse _$UserResponseFromJson(Map<String, dynamic> json) =>
_UserResponse(
fullname: json['fullname'] as String?,
firstName: json['first_name'] as String?,
lastName: json['last_name'] as String?,
mobile: json['mobile'] as String?,
key: json['key'] as String?,
city: json['city'] == null
? null
: CityResponse.fromJson(json['city'] as Map<String, dynamic>),
);
Map<String, dynamic> _$UserResponseToJson(_UserResponse instance) =>
<String, dynamic>{
'fullname': instance.fullname,
'first_name': instance.firstName,
'last_name': instance.lastName,
'mobile': instance.mobile,
'key': instance.key,
'city': instance.city,
};
_CityResponse _$CityResponseFromJson(Map<String, dynamic> json) =>
_CityResponse(
id: (json['id'] as num?)?.toInt(),
name: json['name'] as String?,
provinceName: json['province_name'] as String?,
);
Map<String, dynamic> _$CityResponseToJson(_CityResponse instance) =>
<String, dynamic>{
'id': instance.id,
'name': instance.name,
'province_name': instance.provinceName,
};
_KillHouseVetResponse _$KillHouseVetResponseFromJson(
Map<String, dynamic> json,
) => _KillHouseVetResponse(
id: (json['id'] as num?)?.toInt(),
vet: json['vet'] == null
? null
: VetResponse.fromJson(json['vet'] as Map<String, dynamic>),
killHouse: json['kill_house'] == null
? null
: KillHouseResponse.fromJson(json['kill_house'] as Map<String, dynamic>),
key: json['key'] as String?,
trash: json['trash'] as bool?,
);
Map<String, dynamic> _$KillHouseVetResponseToJson(
_KillHouseVetResponse instance,
) => <String, dynamic>{
'id': instance.id,
'vet': instance.vet,
'kill_house': instance.killHouse,
'key': instance.key,
'trash': instance.trash,
};
_VetResponse _$VetResponseFromJson(Map<String, dynamic> json) => _VetResponse(
user: json['user'] == null
? null
: UserResponse.fromJson(json['user'] as Map<String, dynamic>),
);
Map<String, dynamic> _$VetResponseToJson(_VetResponse instance) =>
<String, dynamic>{'user': instance.user};
_BuyTypeResponse _$BuyTypeResponseFromJson(Map<String, dynamic> json) =>
_BuyTypeResponse(
cash: json['cash'] as bool?,
credit: json['credit'] as bool?,
);
Map<String, dynamic> _$BuyTypeResponseToJson(_BuyTypeResponse instance) =>
<String, dynamic>{'cash': instance.cash, 'credit': instance.credit};
_WeightTypeResponse _$WeightTypeResponseFromJson(Map<String, dynamic> json) =>
_WeightTypeResponse(
lowWeight: json['low_weight'] as bool?,
highWeight: json['high_weight'] as bool?,
);
Map<String, dynamic> _$WeightTypeResponseToJson(_WeightTypeResponse instance) =>
<String, dynamic>{
'low_weight': instance.lowWeight,
'high_weight': instance.highWeight,
};
_RegistrarResponse _$RegistrarResponseFromJson(Map<String, dynamic> json) =>
_RegistrarResponse(
date: json['date'] as String?,
role: json['role'] as String?,
fullName: json['full_name'] as String?,
);
Map<String, dynamic> _$RegistrarResponseToJson(_RegistrarResponse instance) =>
<String, dynamic>{
'date': instance.date,
'role': instance.role,
'full_name': instance.fullName,
};

View File

@@ -1,5 +1,4 @@
import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_core/core.dart';
import 'package:rasadyar_core/utils/utils.dart';
part 'widely_used_local_model.g.dart'; part 'widely_used_local_model.g.dart';

View File

@@ -0,0 +1,27 @@
import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/request/kill_request_response.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/chicken_commission_prices/chicken_commission_prices.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_house/kill_house_response.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_request_list/kill_request_list.dart'
as listModel
show KillRequestList;
abstract class KillHouseRepository {
Future<List<KillHouseResponse>?> getKillHouseList({
required String token,
Map<String, dynamic>? queryParameters,
});
Future<ChickenCommissionPrices?> getCommissionPrice({
required String token,
Map<String, dynamic>? queryParameters,
});
Future<void> submitKillHouseRequest({required String token, required KillRequestResponse data});
Future<List<listModel.KillRequestList>?> getListKillRequest({
required String token,
Map<String, dynamic>? queryParameters,
});
Future<void> deleteKillRequest({required String token, required int requestId});
}

View File

@@ -1,16 +1,58 @@
import 'package:rasadyar_chicken/data/data_source/remote/kill_house/kill_house_remote.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/request/kill_request_response.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/chicken_commission_prices/chicken_commission_prices.dart'; import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/chicken_commission_prices/chicken_commission_prices.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_house/kill_house_response.dart'; import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_house/kill_house_response.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_request_list/kill_request_list.dart'
as listModel;
abstract class KillHouseRepository { import 'kill_house_repository.dart';
class KillHouseRepositoryImpl extends KillHouseRepository {
final KillHouseRemoteDataSource remoteDataSource;
KillHouseRepositoryImpl(this.remoteDataSource);
@override
Future<List<KillHouseResponse>?> getKillHouseList({ Future<List<KillHouseResponse>?> getKillHouseList({
required String token, required String token,
Map<String, dynamic>? queryParameters, Map<String, dynamic>? queryParameters,
}); }) async {
return await remoteDataSource.getKillHouseList(token: token, queryParameters: queryParameters);
}
@override
Future<ChickenCommissionPrices?> getCommissionPrice({ Future<ChickenCommissionPrices?> getCommissionPrice({
required String token, required String token,
Map<String, dynamic>? queryParameters, Map<String, dynamic>? queryParameters,
}); }) async {
return await remoteDataSource.getCommissionPrice(
token: token,
queryParameters: queryParameters,
);
}
Future<void> submitKillHouseReport({required String token, required Map<String, dynamic> data}); @override
Future<void> submitKillHouseRequest({
required String token,
required KillRequestResponse data,
}) async {
var jsonData = data.toJson();
return await remoteDataSource.submitKillHouseRequest(token: token, data: jsonData);
}
@override
Future<List<listModel.KillRequestList>?> getListKillRequest({
required String token,
Map<String, dynamic>? queryParameters,
}) async {
return await remoteDataSource.getListKillRequest(
token: token,
queryParameters: queryParameters,
);
}
@override
Future<void> deleteKillRequest({required String token, required int requestId}) async {
await remoteDataSource.deleteKillRequest(token: token, requestId: requestId);
}
} }

View File

@@ -37,7 +37,7 @@ class ProfileLogic extends GetxController {
GlobalKey<FormState> formKey = GlobalKey(); GlobalKey<FormState> formKey = GlobalKey();
ImagePicker imagePicker = ImagePicker(); ImagePicker imagePicker = ImagePicker();
Rxn<XFile> selectedImage = Rxn<XFile>(); Rxn<XFile> selectedImage = Rxn<XFile>();
RxnString _base64Image = RxnString(); final RxnString _base64Image = RxnString();
RxBool isOnLoading = false.obs; RxBool isOnLoading = false.obs;
RxBool isUserInformationOpen = true.obs; RxBool isUserInformationOpen = true.obs;
@@ -79,10 +79,6 @@ class ProfileLogic extends GetxController {
}); });
} }
@override
void onClose() {
super.onClose();
}
Future<void> getUserProfile() async { Future<void> getUserProfile() async {
userProfile.value = Resource.loading(); userProfile.value = Resource.loading();

View File

@@ -1,8 +1,13 @@
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_core/core.dart';
class KillHouseActionLogic extends GetxController { class KillHouseActionLogic extends GetxController {
List<GlassMorphismCardItem> items = [ List<GlassMorphismCardItem> items = [
GlassMorphismCardItem(title: "ثبت درخواست", icon: Assets.vec.submitRequestSvg.path, route: ''), GlassMorphismCardItem(
title: "ثبت درخواست",
icon: Assets.vec.submitRequestSvg.path,
route: ChickenRoutes.submitRequestKillHouse,
),
GlassMorphismCardItem( GlassMorphismCardItem(
title: "انبار و توزیع", title: "انبار و توزیع",
icon: Assets.vec.warehouseDistributionSvg.path, icon: Assets.vec.warehouseDistributionSvg.path,

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart'; import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_core/core.dart';
@@ -13,8 +14,8 @@ class KillHouseActionPage extends GetView<KillHouseActionLogic> {
isBase: true, isBase: true,
child: GlassMorphismGrid( child: GlassMorphismGrid(
items: controller.items, items: controller.items,
onTap: () { onTap: (item) {
iLog("Hoooooura 😍😍😍😍😍"); Get.toNamed(item.route, id: killHouseActionKey);
}, },
), ),
); );

View File

@@ -1,4 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
import 'package:rasadyar_chicken/data/repositories/kill_house/kill_house_repository.dart';
import 'package:rasadyar_chicken/presentation/pages/common/profile/view.dart'; import 'package:rasadyar_chicken/presentation/pages/common/profile/view.dart';
import 'package:rasadyar_chicken/presentation/routes/pages.dart'; import 'package:rasadyar_chicken/presentation/routes/pages.dart';
import 'package:rasadyar_chicken/presentation/routes/routes.dart'; import 'package:rasadyar_chicken/presentation/routes/routes.dart';
@@ -6,11 +8,21 @@ import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_core/core.dart';
class KillHouseRootLogic extends GetxController { class KillHouseRootLogic extends GetxController {
RxInt currentPage = 2.obs; RxInt currentPage = 1.obs;
var tokenService = Get.find<TokenStorageService>();
late KillHouseRepository killHouseRepository;
@override
void onInit() {
super.onInit();
killHouseRepository = diChicken.get<KillHouseRepository>();
}
final pages = [ final pages = [
Navigator( Navigator(
key: Get.nestedKey(killHouseFirstKey), key: Get.nestedKey(killHouseActionKey),
onGenerateRoute: (settings) { onGenerateRoute: (settings) {
final page = ChickenPages.pages.firstWhere( final page = ChickenPages.pages.firstWhere(
(e) => e.name == settings.name, (e) => e.name == settings.name,

View File

@@ -0,0 +1,378 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:rasadyar_core/core.dart';
import 'logic.dart';
Widget addKillRequestBottomSheet(SubmitRequestKillHouseLogic controller) {
return ObxValue(
(data) => AnimatedContainer(
duration: Duration(milliseconds: 300),
height: data.value ? 680.h : 580.h,
child: BaseBottomSheet(
child: Column(
children: [
Row(
children: [
SizedBox(width: 12),
Text(
"ثبت درخواست کشتار",
style: AppFonts.yekan18Bold.copyWith(color: AppColor.iconColor),
),
],
),
Divider(),
SizedBox(height: 8),
InformationTag(
data: InformationTagData(
labelTitle: 'قیمت روز مرغ (${Jalali.now().formatCompactDate()})',
labelTitleStyle: AppFonts.yekan14,
isLoading: false,
height: 40.h,
value: controller.commissionPrices.chickenAveragePrice.separatedByComma.addReal,
valueStyle: AppFonts.yekan14,
borderColor: AppColor.greenNormal,
radiusWidth: 1,
valueBgColor: Colors.white,
labelGradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [AppColor.greenLightActive, Colors.white],
),
),
),
SizedBox(height: 12),
ResourceOverlayDropdown(
height: 40.h,
items: controller.killHouseList,
itemBuilder: (item) => Text(item.name ?? 'بدون نام'),
labelBuilder: (selected) => Text(selected?.name ?? 'محل کشتار'),
onChanged: controller.setKillHouse,
),
SizedBox(height: 8),
UnitTextField(
controller: controller.breedCountController,
keyboardType: TextInputType.number,
maxLines: 1,
minLines: 1,
inputFormatters: [FilteringTextInputFormatter.digitsOnly, SeparatorInputFormatter()],
unit: 'قطعه',
hint: 'حجم کشتار',
initialValue: 0.separatedByComma,
),
SizedBox(height: 8),
ResourceOverlayDropdown(
items: controller.timeFrameOfKilling,
itemBuilder: (item) => Text(item),
labelBuilder: (selected) => Text(selected ?? 'زمان دریافت'),
onChanged: (selected) => controller.setTimeFrameOfKilling(selected),
),
SizedBox(height: 8),
RTextField(
controller: controller.dateOfSlaughterTextEditor,
hintText: 'تاریخ کشتار',
filled: true,
filledColor: AppColor.bgLight,
prefixIcon: Padding(
padding: const EdgeInsets.all(8.0),
child: Assets.vec.calendarSvg.svg(
width: 16.w,
height: 16.h,
colorFilter: ColorFilter.mode(AppColor.bgIcon, BlendMode.srcIn),
),
),
readonly: true,
onTap: () {
Get.bottomSheet(
modalDatePicker(
onDateSelected: (value) {
controller.dateOfSlaughterTextEditor.text = value.formatCompactDate();
controller.dateOfSlaughter = value;
},
),
isScrollControlled: true,
isDismissible: true,
ignoreSafeArea: false,
);
},
),
SizedBox(height: 8),
buildAnimatedLabelContainer(controller),
SizedBox(height: 8),
Container(
height: 40.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
border: Border.all(color: AppColor.blueDark, width: 0.5),
),
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
if (controller.isAgreedUndertaking.value == false) {
undertakingDialog(controller);
}
else{
controller.toggleAgreeUndertaking(false);
}
},
child: Row(
spacing: 2,
children: [
ObxValue((data) {
return Checkbox(
value: data.value,
onChanged: (value) {
if (controller.isAgreedUndertaking.value == false) {
undertakingDialog(controller);
}
else {
controller.toggleAgreeUndertaking(false);
}
},
);
}, controller.isAgreedUndertaking),
Text(
"با تعهدنامه موافق هستم !",
style: AppFonts.yekan14Bold.copyWith(color: AppColor.blueDark),
),
],
),
),
),
SizedBox(height: 8),
Container(
height: 40.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
border: Border.all(color: AppColor.mediumGrey, width: 1),
),
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () => controller.toggleAgreeSmsNotification(),
child: Row(
spacing: 2,
children: [
ObxValue((selected) {
return Checkbox(
value: selected.value,
onChanged: (value) => controller.toggleAgreeSmsNotification(),
);
}, controller.isAgreedSmsNotification),
Text(
"دریافت پیامک اطلاع رسانی",
style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor2),
),
],
),
),
),
SizedBox(height: 16),
Row(
spacing: 16,
mainAxisAlignment: .center,
children: [
RElevated(
width: 160.w,
height: 40.h,
backgroundColor: AppColor.greenNormal,
text: 'ثبت',
onPressed: () async {
await controller.submitKillRequest();
},
),
ROutlinedElevated(
height: 40,
text: 'انصراف',
borderColor: AppColor.redNormal,
onPressed: () {
Get.back();
},
),
],
),
],
),
),
),
controller.isBreedWeightSelected,
);
}
void undertakingDialog(SubmitRequestKillHouseLogic controller) {
Get.dialog(
AlertDialog(
title: Text("تعهد نامه", textAlign: TextAlign.center),
titleTextStyle: AppFonts.yekan20.copyWith(color: AppColor.textColor3),
content: Column(
mainAxisSize: .min,
spacing: 10,
children: [
Text(
"اینجانب ${controller.baseLogic.userProfile.value.data?.fullname} موافقت خود را نسبت به موارد ذکر شده اعلام می نمایم.",
style: AppFonts.yekan13.copyWith(color: AppColor.textColor3),
),
Text(
"✅ بر اساس این توافق نامه در صورت لغو کشتار جریمه خواهم شد.",
style: AppFonts.yekan13.copyWith(color: AppColor.textColor3),
),
],
),
actions: [
Row(
spacing: 10,
children: [
Expanded(
child: RElevated(
text: 'موافقم',
height: 32.h,
onPressed: () {
controller.toggleAgreeUndertaking(true);
Get.back();
},
textStyle: AppFonts.yekan20Bold.copyWith(color: Colors.white),
backgroundColor: AppColor.greenNormal,
),
),
Expanded(
child: ROutlinedElevated(
text: 'رد',
textStyle: AppFonts.yekan20.copyWith(color: AppColor.redNormal),
height: 32.h,
onPressed: () {
controller.toggleAgreeUndertaking(false);
Get.back();
},
borderColor: AppColor.redNormal,
),
),
],
),
],
),
);
}
Widget buildAnimatedLabelContainer(SubmitRequestKillHouseLogic controller) {
return ObxValue((data) {
return AnimatedCrossFade(
firstChild: GestureDetector(
onTap: () {
controller.toggleBreedWeightSelection();
},
child: Container(
height: 40.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
border: Border.all(color: AppColor.mediumGrey, width: 0.5),
),
child: Row(
spacing: 7,
children: [
Directionality(
textDirection: TextDirection.ltr,
child: Switch(
value: data.value,
onChanged: (data) => controller.toggleBreedWeightSelection(),
),
),
Text(
"تعیین نژاد / وزن مرغ",
style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor2),
),
],
),
),
),
secondChild: SizedBox(
height: 140.h,
child: Stack(
fit: StackFit.passthrough,
children: [
Positioned(
bottom: 0,
left: 0,
right: 0,
child: Container(
height: 121.h,
padding: EdgeInsets.fromLTRB(8.r, 18.r, 8.r, 8.r),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
border: Border.all(color: AppColor.mediumGrey, width: (0.5).w),
),
child: Column(
spacing: 8,
children: [
ResourceOverlayDropdown(
items: controller.chickenBreedList,
itemBuilder: (item) => Text(item),
labelBuilder: (selected) => Text(selected ?? 'نژاد مرغ'),
onChanged: (selected) => controller.setChickenBreed(selected),
),
RTextField(
controller: controller.chickenWeight,
label: ' وزن مرغ (کیلوگرم) ',
filled: true,
filledColor: AppColor.bgLight,
keyboardType: TextInputType.number,
inputFormatters: [
FilteringTextInputFormatter.digitsOnly,
SeparatorInputFormatter(),
],
),
],
),
),
),
Positioned(
top: 0,
right: 7,
child: GestureDetector(
onTap: () {
controller.toggleBreedWeightSelection();
},
child: Container(
height: 30.h,
padding: EdgeInsets.symmetric(horizontal: 4.w, vertical: 4.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: AppColor.mediumGrey, width: 0.5),
),
child: Row(
spacing: 7,
children: [
Directionality(
textDirection: TextDirection.ltr,
child: FittedBox(
fit: BoxFit.scaleDown,
child: Switch(
value: data.value,
onChanged: (_) => controller.toggleBreedWeightSelection(),
),
),
),
Text(
"تعیین نژاد / وزن مرغ",
style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor2),
),
],
),
),
),
),
],
),
),
crossFadeState: data.value ? CrossFadeState.showSecond : CrossFadeState.showFirst,
duration: Duration(milliseconds: 500),
);
}, controller.isBreedWeightSelected);
}

View File

@@ -0,0 +1,225 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/request/kill_request_response.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/chicken_commission_prices/chicken_commission_prices.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_house/kill_house_response.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_request_list/kill_request_list.dart'
as listModel;
import 'package:rasadyar_chicken/presentation/pages/kill_house/root/logic.dart';
import 'package:rasadyar_chicken/presentation/widget/base_page/logic.dart';
import 'package:rasadyar_core/core.dart';
class SubmitRequestKillHouseLogic extends GetxController {
ChickenBaseLogic baseLogic = Get.find<ChickenBaseLogic>();
RxList<String> routesName = ["عملیات", "ثبت درخواست کشتار"].obs;
late KillHouseRootLogic rootLogic;
RxInt expandedItemIndex = RxInt(-1);
Rx<Jalali> fromDateFilter = Jalali.now().obs;
Rx<Jalali> toDateFilter = Jalali.now().obs;
RxnString searchedValue = RxnString();
RxBool isBreedWeightSelected = false.obs;
TextEditingController breedCountController = TextEditingController();
TextEditingController dateOfSlaughterTextEditor = TextEditingController();
Jalali dateOfSlaughter = Jalali.now();
TextEditingController chickenWeight = TextEditingController();
Resource<List<String>> timeFrameOfKilling = Resource.success([
'12 - 14',
'14 - 16',
'16 - 18',
'18 - 20',
'20 - 22',
'22 - 24',
]);
RxString timeFrameOfKillingSelected = ''.obs;
Resource<List<String>> chickenBreedList = Resource.success([
'آرین',
'راس',
'آربراکوز (آیلاس)',
'کاب',
'هوبارد',
'ترکیبی',
'وارداتی',
]);
RxString chickenBreedSelected = ''.obs;
RxBool isAgreedUndertaking = false.obs;
RxBool isAgreedSmsNotification = false.obs;
KillHouseResponse? selectedKillHouse;
late Resource<List<KillHouseResponse>> killHouseList;
late ChickenCommissionPrices commissionPrices;
Rx<Resource<List<listModel.KillRequestList>>> killRequestList = Rx(
Resource.initial(),
);
@override
void onInit() {
super.onInit();
rootLogic = Get.find<KillHouseRootLogic>();
getCommissionPrice();
getKillHouseList();
getListOfKillRequests();
dateOfSlaughterTextEditor.text = Jalali.now().formatCompactDate();
dateOfSlaughter = Jalali.now();
chickenWeight.text = '2.7';
}
@override
void onClose() {
// TODO: implement onClose
super.onClose();
}
void onRefresh() {
getCommissionPrice();
getKillHouseList();
getListOfKillRequests();
}
void toggleExpandedItem(int index) {
if (expandedItemIndex.value == index) {
expandedItemIndex.value = -1;
} else {
expandedItemIndex.value = index;
}
}
void toggleBreedWeightSelection() {
isBreedWeightSelected.value = !isBreedWeightSelected.value;
}
void clearPage() {
expandedItemIndex.value = -1;
isBreedWeightSelected.value = false;
isAgreedUndertaking.value = false;
isAgreedSmsNotification.value = false;
breedCountController.clear();
dateOfSlaughter = Jalali.now();
dateOfSlaughterTextEditor.text = Jalali.now().formatCompactDate();
chickenWeight.text = '2.7';
timeFrameOfKillingSelected.value = '';
chickenBreedSelected.value = '';
}
void setKillHouse(KillHouseResponse killHouse) {
selectedKillHouse = killHouse;
iLog(selectedKillHouse?.key);
}
void setTimeFrameOfKilling(String timeFrame) {
timeFrameOfKillingSelected.value = timeFrame;
}
void setChickenBreed(String breed) {
chickenBreedSelected.value = breed;
}
void toggleAgreeUndertaking(bool item) {
isAgreedUndertaking.value = item;
}
void toggleAgreeSmsNotification() {
isAgreedSmsNotification.value = !isAgreedSmsNotification.value;
}
Future<void> getKillHouseList() async {
await safeCall(
call: () => rootLogic.killHouseRepository.getKillHouseList(
token: rootLogic.tokenService.accessToken.value ?? '',
),
onSuccess: (result) => killHouseList = Resource.success(result ?? []),
);
}
Future<void> getCommissionPrice() async {
await safeCall(
call: () => rootLogic.killHouseRepository.getCommissionPrice(
token: rootLogic.tokenService.accessToken.value ?? '',
),
onSuccess: (result) => commissionPrices =
result ?? ChickenCommissionPrices(chickenAveragePrice: 0),
);
}
Future<void> submitKillRequest() async {
KillRequestResponse request = KillRequestResponse(
killCapacity: int.parse(breedCountController.text),
reciveTime: timeFrameOfKillingSelected.value,
reciveDate: dateOfSlaughter
.toDateTime()
.formattedGregorianDateWithoutMillisecond,
lowWeight: false,
highWeight: false,
indexWeight: double.parse(chickenWeight.text),
chickenBreed: chickenBreedSelected.value,
cash: true,
credit: false,
smsPayment: isAgreedSmsNotification.value,
killHouseKey: selectedKillHouse?.key,
killerKillHouseKey: null,
role: 'KillHouse',
);
await safeCall(
showError: true,
call: () => rootLogic.killHouseRepository.submitKillHouseRequest(
token: rootLogic.tokenService.accessToken.value ?? '',
data: request,
),
onSuccess: (result) {
onRefresh();
Get.back();
Future.delayed(
Duration(seconds: 3),
() => defaultShowSuccessMessage("عملیات با موفقیت انجام شد"),
);
},
);
}
Future<void> getListOfKillRequests() async {
await safeCall(
showError: true,
call: () => rootLogic.killHouseRepository.getListKillRequest(
token: rootLogic.tokenService.accessToken.value ?? '',
queryParameters: buildRawQueryParams(
role: 'KillHouse',
fromDate: fromDateFilter.value.toDateTime(),
toDate: toDateFilter.value.toDateTime(),
),
),
onSuccess: (result) {
if (result == null || result.isEmpty) {
killRequestList.value = Resource.empty();
return;
}
killRequestList.value = Resource.success(result);
},
onError: (error, stackTrace) {
killRequestList.value = Resource.error(error);
},
);
}
Future<void> deleteRequest(int id) async {
await safeCall(
showError: true,
call: () => rootLogic.killHouseRepository.deleteKillRequest(
token: rootLogic.tokenService.accessToken.value ?? '',
requestId: id,
),
onSuccess: (result) {
onRefresh();
Get.back();
},
);
}
}

View File

@@ -0,0 +1,232 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_request_list/kill_request_list.dart'
as listModel
show KillRequestList;
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
import 'package:rasadyar_core/core.dart';
import 'add_request_bottom_sheet.dart';
import 'logic.dart';
class SubmitRequestKillHousePage extends GetView<SubmitRequestKillHouseLogic> {
const SubmitRequestKillHousePage({super.key});
@override
Widget build(BuildContext context) {
return ChickenBasePage(
hasBack: true,
hasFilter: true,
hasSearch: true,
onBackTap: () => Get.back(id: killHouseActionKey),
onSearchChanged: (data) {
//Todo
},
onRefresh: () async => controller.onRefresh(),
routesWidget: ContainerBreadcrumb(rxRoutes: controller.routesName),
child: Stack(
fit: .expand,
children: [
Positioned.fill(
right: 13,
left: 14,
child: Obx(() {
return RListView.separated(
itemCount: controller.killRequestList.value.data?.length ?? 0,
itemBuilder: (context, index) {
var item = controller.killRequestList.value.data![index];
return ObxValue((data) {
return ExpandableListItem2(
index: index,
child: itemListWidget(item),
secondChild: itemListExpandedWidget(item),
onTap: () => controller.toggleExpandedItem(index),
selected: data.value == index,
labelColor: AppColor.blueLight,
labelIcon: Assets.vec.virtualSvg.path,
);
}, controller.expandedItemIndex);
},
separatorBuilder: (context, index) => SizedBox(height: 8),
resource: controller.killRequestList.value,
);
}),
),
Positioned(
right: 8,
bottom: 92,
child: RFab.add(
onPressed: () {
Get.bottomSheet(
isScrollControlled: true,
addKillRequestBottomSheet(controller),
).then((value) {
controller.clearPage();
});
},
),
),
],
),
);
}
Row itemListWidget(listModel.KillRequestList item) {
return Row(
children: [
SizedBox(width: 30),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
item.killHouse?.name ?? 'بدون نام',
style: AppFonts.yekan14Bold.copyWith(color: AppColor.blueNormal),
),
SizedBox(height: 4),
Text(
item.createDate?.toJalali.formatCompactDate() ?? "-",
style: AppFonts.yekan14.copyWith(color: AppColor.bgDark),
),
],
),
Spacer(),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'درخواست ${item.killCapacity}'.addCountEXT,
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
),
SizedBox(height: 4),
Text(
'تعداد مورد تایید 150 قطعه',
style: AppFonts.yekan14.copyWith(color: AppColor.bgDark),
),
],
),
Spacer(),
Assets.vec.scanSvg.svg(
width: 32.w,
height: 32.h,
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
),
SizedBox(width: 12),
],
);
}
Container itemListExpandedWidget(listModel.KillRequestList item) {
Jalali date = item.createDate.toJalali;
return Container(
padding: EdgeInsets.symmetric(horizontal: 8),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
child: Column(
spacing: 8,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
item.killHouse?.name ?? 'بدون نام',
textAlign: TextAlign.center,
style: AppFonts.yekan16.copyWith(color: AppColor.greenDark),
),
Spacer(),
//todo
Text(
'در انتظار تایید استان',
textAlign: TextAlign.center,
style: AppFonts.yekan10.copyWith(color: AppColor.darkGreyDark),
),
SizedBox(width: 7),
Assets.vec.clockSvg.svg(width: 16.w, height: 16.h),
],
),
Container(
height: 32,
padding: EdgeInsets.symmetric(horizontal: 8),
decoration: ShapeDecoration(
color: AppColor.blueLight,
shape: RoundedRectangleBorder(
side: BorderSide(width: 1, color: AppColor.blueLightHover),
borderRadius: BorderRadius.circular(8),
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
spacing: 3,
children: [
Text(
date.formatter.wN,
style: AppFonts.yekan14.copyWith(
color: AppColor.textColor,
),
),
Text(
'${date.formatter.d} ${date.formatter.mN ?? 'N/A'}',
style: AppFonts.yekan14.copyWith(
color: AppColor.blueNormal,
),
),
],
),
Text(
date.formatter.y,
style: AppFonts.yekan20.copyWith(color: AppColor.textColor),
),
Text(
'${date.formatter.tHH}:${date.formatter.tMM ?? 'N/A'}',
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
),
],
),
),
buildRow(
title: 'تعداد درخواست اولیه',
value: item.killCapacity.separatedByComma.addCountEXT,
),
//todo
buildRow(
title: 'تعداد مورد تایید',
value: item.numberOfAllocated.separatedByComma.addCountEXT,
),
buildRow(title: 'زمان دریافت', value: item.reciveTime ?? '-'),
buildRow(
title: 'تاریخ درخواستی کشتار',
value: item.reciveDate.toJalali.formatCompactDate(),
),
ROutlinedElevated(
text: 'حذف',
height: 40.h,
textStyle: AppFonts.yekan20.copyWith(color: AppColor.redNormal),
isFullWidth: true,
onPressed: () {
buildWarningDialog(
title: 'اخطار',
middleText: 'آیا از حذف شدن این مورد اطمینان دارید؟',
onConfirm: () async {
controller.deleteRequest(item.id!);
},
onRefresh: () async {
controller.onRefresh();
},
);
},
borderColor: AppColor.redNormal,
),
],
),
);
}
}

View File

@@ -1,7 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_core/core.dart';
import '../widgets/step1_page.dart';
class PoultryFarmInspectionHomeLogic extends GetxController class PoultryFarmInspectionHomeLogic extends GetxController
with GetTickerProviderStateMixin { with GetTickerProviderStateMixin {

View File

@@ -49,10 +49,6 @@ class PoultryScienceRootLogic extends GetxController {
poultryRepository = diChicken.get<PoultryScienceRepository>(); poultryRepository = diChicken.get<PoultryScienceRepository>();
} }
@override
void onClose() {
super.onClose();
}
void toggleExpanded(int index) { void toggleExpanded(int index) {
if (homeExpandedList.keys.contains(index)) { if (homeExpandedList.keys.contains(index)) {

View File

@@ -5,10 +5,6 @@ class BuyLogic extends GetxController {
List<String> routesName = ['خرید']; List<String> routesName = ['خرید'];
DateTime? _lastBackPressed; DateTime? _lastBackPressed;
@override
void onInit() {
super.onInit();
}
@override @override
void onReady() { void onReady() {

View File

@@ -133,7 +133,7 @@ class BuyInProvinceAllPage extends GetView<BuyInProvinceAllLogic> {
), ),
Spacer(), Spacer(),
Text( Text(
item.receiverState?.faItem, item.receiverState?.faItem ?? 'N/A',
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: AppFonts.yekan10.copyWith(color: AppColor.darkGreyDark), style: AppFonts.yekan10.copyWith(color: AppColor.darkGreyDark),
), ),

View File

@@ -29,7 +29,7 @@ class BuyOutOfProvinceLogic extends GetxController {
Rxn<IranProvinceCityModel> selectedProvince = Rxn(); Rxn<IranProvinceCityModel> selectedProvince = Rxn();
Rxn<IranProvinceCityModel> selectedCity = Rxn(); Rxn<IranProvinceCityModel> selectedCity = Rxn();
Rxn<XFile> selectedImage = Rxn<XFile>(); Rxn<XFile> selectedImage = Rxn<XFile>();
RxnString _base64Image = RxnString(); final RxnString _base64Image = RxnString();
RxnString editImageUrl = RxnString(); RxnString editImageUrl = RxnString();
RxnString editFreeBarKey = RxnString(); RxnString editFreeBarKey = RxnString();

View File

@@ -464,7 +464,7 @@ class SalesInProvinceLogic extends GetxController {
} }
Steward? getBuyerInformation(AllocatedMadeModel model) { Steward? getBuyerInformation(AllocatedMadeModel model) {
if (model.allocationType?.buyerIsGuild) { if (model.allocationType?.buyerIsGuild ?? false) {
return model.toGuilds; return model.toGuilds;
} else { } else {
return model.steward; return model.steward;

View File

@@ -111,7 +111,7 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
onSubmit: () => controller.submitFilter(), onSubmit: () => controller.submitFilter(),
); );
itemListWidget(StewardFreeSaleBar item) { Row itemListWidget(StewardFreeSaleBar item) {
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
@@ -182,7 +182,7 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
); );
} }
itemListExpandedWidget(StewardFreeSaleBar item, int index) { Container itemListExpandedWidget(StewardFreeSaleBar item, int index) {
return Container( return Container(
padding: EdgeInsets.symmetric(horizontal: 8), padding: EdgeInsets.symmetric(horizontal: 8),
decoration: BoxDecoration( decoration: BoxDecoration(

View File

@@ -277,7 +277,7 @@ class SalesOutOfProvinceBuyersPage extends GetView<SalesOutOfProvinceBuyersLogic
); );
} }
itemListExpandedWidget(OutProvinceCarcassesBuyer item) { Container itemListExpandedWidget(OutProvinceCarcassesBuyer item) {
return Container( return Container(
padding: EdgeInsets.symmetric(horizontal: 8), padding: EdgeInsets.symmetric(horizontal: 8),

View File

@@ -70,7 +70,7 @@ class SalesOutOfProvinceSalesListPage extends GetView<SalesOutOfProvinceSalesLis
); );
} }
itemListWidget(StewardFreeSaleBar item) { Row itemListWidget(StewardFreeSaleBar item) {
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
@@ -128,7 +128,7 @@ class SalesOutOfProvinceSalesListPage extends GetView<SalesOutOfProvinceSalesLis
); );
} }
itemListExpandedWidget(StewardFreeSaleBar item, int index) { Container itemListExpandedWidget(StewardFreeSaleBar item, int index) {
return Container( return Container(
padding: EdgeInsets.symmetric(horizontal: 8), padding: EdgeInsets.symmetric(horizontal: 8),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)), decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)),

View File

@@ -90,10 +90,6 @@ class SegmentationLogic extends GetxController {
setUpListener(); setUpListener();
} }
@override
void onClose() {
super.onClose();
}
void setSearchValue(String? value) { void setSearchValue(String? value) {
searchedValue.value = value?.trim(); searchedValue.value = value?.trim();

View File

@@ -81,7 +81,7 @@ class SegmentationPage extends GetView<SegmentationLogic> {
onSubmit: () => controller.getAllSegmentation(), onSubmit: () => controller.getAllSegmentation(),
); );
itemListWidget(SegmentationModel item) { Row itemListWidget(SegmentationModel item) {
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
@@ -160,7 +160,7 @@ class SegmentationPage extends GetView<SegmentationLogic> {
); );
} }
itemListExpandedWidget(SegmentationModel item, int index) { Container itemListExpandedWidget(SegmentationModel item, int index) {
return Container( return Container(
padding: EdgeInsets.symmetric(horizontal: 8), padding: EdgeInsets.symmetric(horizontal: 8),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)), decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)),

View File

@@ -6,6 +6,8 @@ import 'package:rasadyar_chicken/presentation/pages/kill_house/action/logic.dart
import 'package:rasadyar_chicken/presentation/pages/kill_house/action/view.dart'; import 'package:rasadyar_chicken/presentation/pages/kill_house/action/view.dart';
import 'package:rasadyar_chicken/presentation/pages/kill_house/root/logic.dart'; import 'package:rasadyar_chicken/presentation/pages/kill_house/root/logic.dart';
import 'package:rasadyar_chicken/presentation/pages/kill_house/root/view.dart'; import 'package:rasadyar_chicken/presentation/pages/kill_house/root/view.dart';
import 'package:rasadyar_chicken/presentation/pages/kill_house/submit_request/logic.dart';
import 'package:rasadyar_chicken/presentation/pages/kill_house/submit_request/view.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_farm_inspection/poultry_farm_inspection.dart'; import 'package:rasadyar_chicken/presentation/pages/poultry_farm_inspection/poultry_farm_inspection.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/active_hatching/logic.dart'; import 'package:rasadyar_chicken/presentation/pages/poultry_science/active_hatching/logic.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/active_hatching/view.dart'; import 'package:rasadyar_chicken/presentation/pages/poultry_science/active_hatching/view.dart';
@@ -25,6 +27,7 @@ import 'package:rasadyar_chicken/presentation/pages/poultry_science/root/view.da
import 'package:rasadyar_chicken/presentation/pages/steward/steward.dart'; import 'package:rasadyar_chicken/presentation/pages/steward/steward.dart';
import 'package:rasadyar_chicken/presentation/routes/global_binding.dart'; import 'package:rasadyar_chicken/presentation/routes/global_binding.dart';
import 'package:rasadyar_chicken/presentation/routes/routes.dart'; import 'package:rasadyar_chicken/presentation/routes/routes.dart';
import 'package:rasadyar_chicken/presentation/widget/base_page/logic.dart';
import 'package:rasadyar_chicken/presentation/widget/captcha/logic.dart'; import 'package:rasadyar_chicken/presentation/widget/captcha/logic.dart';
import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_core/core.dart';
@@ -38,7 +41,7 @@ sealed class ChickenPages {
binding: BindingsBuilder(() { binding: BindingsBuilder(() {
Get.lazyPut(() => AuthLogic()); Get.lazyPut(() => AuthLogic());
Get.lazyPut(() => CaptchaWidgetLogic()); Get.lazyPut(() => CaptchaWidgetLogic());
Get.lazyPut(() => BaseLogic(), fenix: true); Get.lazyPut(() => ChickenBaseLogic(), fenix: true);
}), }),
), ),
@@ -47,7 +50,7 @@ sealed class ChickenPages {
page: () => RolePage(), page: () => RolePage(),
binding: BindingsBuilder(() { binding: BindingsBuilder(() {
Get.lazyPut(() => RoleLogic()); Get.lazyPut(() => RoleLogic());
Get.lazyPut(() => BaseLogic(), fenix: true); Get.lazyPut(() => ChickenBaseLogic(), fenix: true);
}), }),
), ),
@@ -59,7 +62,7 @@ sealed class ChickenPages {
bindings: [ bindings: [
GlobalBinding(), GlobalBinding(),
BindingsBuilder(() { BindingsBuilder(() {
Get.lazyPut(() => BaseLogic(), fenix: true); Get.lazyPut(() => ChickenBaseLogic(), fenix: true);
Get.lazyPut(() => StewardRootLogic()); Get.lazyPut(() => StewardRootLogic());
Get.lazyPut(() => HomeLogic()); Get.lazyPut(() => HomeLogic());
Get.lazyPut(() => BuyLogic()); Get.lazyPut(() => BuyLogic());
@@ -75,7 +78,7 @@ sealed class ChickenPages {
middlewares: [AuthMiddleware()], middlewares: [AuthMiddleware()],
binding: BindingsBuilder(() { binding: BindingsBuilder(() {
Get.put(HomeLogic()); Get.put(HomeLogic());
Get.lazyPut(() => BaseLogic()); Get.lazyPut(() => ChickenBaseLogic());
}), }),
), ),
@@ -86,7 +89,7 @@ sealed class ChickenPages {
middlewares: [AuthMiddleware()], middlewares: [AuthMiddleware()],
binding: BindingsBuilder(() { binding: BindingsBuilder(() {
Get.lazyPut(() => SaleLogic()); Get.lazyPut(() => SaleLogic());
Get.lazyPut(() => BaseLogic()); Get.lazyPut(() => ChickenBaseLogic());
Get.lazyPut(() => SalesOutOfProvinceLogic()); Get.lazyPut(() => SalesOutOfProvinceLogic());
Get.lazyPut(() => SalesOutOfProvinceBuyersLogic()); Get.lazyPut(() => SalesOutOfProvinceBuyersLogic());
Get.lazyPut(() => StewardRootLogic()); Get.lazyPut(() => StewardRootLogic());
@@ -117,7 +120,7 @@ sealed class ChickenPages {
page: () => SalesInProvincePage(), page: () => SalesInProvincePage(),
middlewares: [AuthMiddleware()], middlewares: [AuthMiddleware()],
binding: BindingsBuilder(() { binding: BindingsBuilder(() {
Get.lazyPut(() => BaseLogic()); Get.lazyPut(() => ChickenBaseLogic());
Get.lazyPut(() => SalesInProvinceLogic()); Get.lazyPut(() => SalesInProvinceLogic());
}), }),
), ),
@@ -128,7 +131,7 @@ sealed class ChickenPages {
page: () => BuyPage(), page: () => BuyPage(),
middlewares: [AuthMiddleware()], middlewares: [AuthMiddleware()],
binding: BindingsBuilder(() { binding: BindingsBuilder(() {
Get.lazyPut(() => BaseLogic()); Get.lazyPut(() => ChickenBaseLogic());
Get.lazyPut(() => BuyLogic()); Get.lazyPut(() => BuyLogic());
}), }),
), ),
@@ -137,7 +140,7 @@ sealed class ChickenPages {
page: () => BuyOutOfProvincePage(), page: () => BuyOutOfProvincePage(),
middlewares: [AuthMiddleware()], middlewares: [AuthMiddleware()],
binding: BindingsBuilder(() { binding: BindingsBuilder(() {
Get.lazyPut(() => BaseLogic()); Get.lazyPut(() => ChickenBaseLogic());
Get.lazyPut(() => BuyOutOfProvinceLogic()); Get.lazyPut(() => BuyOutOfProvinceLogic());
}), }),
), ),
@@ -146,7 +149,7 @@ sealed class ChickenPages {
page: () => BuyInProvincePage(), page: () => BuyInProvincePage(),
middlewares: [AuthMiddleware()], middlewares: [AuthMiddleware()],
binding: BindingsBuilder(() { binding: BindingsBuilder(() {
Get.lazyPut(() => BaseLogic()); Get.lazyPut(() => ChickenBaseLogic());
Get.lazyPut(() => BuyInProvinceLogic()); Get.lazyPut(() => BuyInProvinceLogic());
Get.lazyPut(() => BuyInProvinceWaitingLogic()); Get.lazyPut(() => BuyInProvinceWaitingLogic());
Get.lazyPut(() => BuyInProvinceAllLogic()); Get.lazyPut(() => BuyInProvinceAllLogic());
@@ -234,7 +237,7 @@ sealed class ChickenPages {
page: () => PoultryFarmInspectionHomePage(), page: () => PoultryFarmInspectionHomePage(),
binding: BindingsBuilder(() { binding: BindingsBuilder(() {
Get.lazyPut(() => PoultryFarmInspectionHomeLogic()); Get.lazyPut(() => PoultryFarmInspectionHomeLogic());
Get.lazyPut(() => BaseLogic(), fenix: true); Get.lazyPut(() => ChickenBaseLogic(), fenix: true);
}), }),
), ),
//endregion //endregion
@@ -245,7 +248,7 @@ sealed class ChickenPages {
page: () => KillHouseRootPage(), page: () => KillHouseRootPage(),
binding: BindingsBuilder(() { binding: BindingsBuilder(() {
Get.lazyPut(() => KillHouseRootLogic()); Get.lazyPut(() => KillHouseRootLogic());
Get.lazyPut(() => BaseLogic(), fenix: true); Get.lazyPut(() => ChickenBaseLogic(), fenix: true);
}), }),
), ),
GetPage( GetPage(
@@ -255,7 +258,19 @@ sealed class ChickenPages {
GlobalBinding(), GlobalBinding(),
BindingsBuilder(() { BindingsBuilder(() {
Get.lazyPut(() => KillHouseActionLogic()); Get.lazyPut(() => KillHouseActionLogic());
Get.lazyPut(() => BaseLogic(), fenix: true); Get.lazyPut(() => ChickenBaseLogic(), fenix: true);
}),
],
),
GetPage(
name: ChickenRoutes.submitRequestKillHouse,
page: () => SubmitRequestKillHousePage(),
bindings: [
GlobalBinding(),
BindingsBuilder(() {
Get.lazyPut(() => SubmitRequestKillHouseLogic());
Get.lazyPut(() => ChickenBaseLogic(), fenix: true);
}), }),
], ],
), ),

View File

@@ -48,6 +48,7 @@ sealed class ChickenRoutes {
static const _killHouse = '$_base/killHouse'; static const _killHouse = '$_base/killHouse';
static const initKillHouse = '$_killHouse/home'; static const initKillHouse = '$_killHouse/home';
static const actionKillHouse = '$_killHouse/action'; static const actionKillHouse = '$_killHouse/action';
static const submitRequestKillHouse = '$actionKillHouse/submitRequest';
//endregion //endregion
} }

View File

@@ -13,6 +13,6 @@ const int poultryThirdKey = 107;
//endregion //endregion
//region kill house Keys //region kill house Keys
const int killHouseFirstKey = 108; const int killHouseActionKey = 108;
//endregion //endregion

View File

@@ -1,5 +1,5 @@
extension XStringUtils on String { extension XStringUtils on String {
get faAllocationType { String get faAllocationType {
final tmp = split('_'); final tmp = split('_');
tmp.insert(1, '_'); tmp.insert(1, '_');
if (tmp.length > 1) { if (tmp.length > 1) {
@@ -9,9 +9,9 @@ extension XStringUtils on String {
} }
} }
get faItem => utilsMap[this] ?? this; String get faItem => utilsMap[this] ?? this;
get buyerIsGuild { bool get buyerIsGuild {
final tmp = split('_'); final tmp = split('_');
if (tmp.length > 1) { if (tmp.length > 1) {
return tmp.last == 'guild'; return tmp.last == 'guild';

View File

@@ -0,0 +1,32 @@
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
import 'package:rasadyar_chicken/data/repositories/chicken/chicken_repository.dart';
import 'package:rasadyar_core/core.dart';
import '../../../data/models/response/user_profile/user_profile.dart';
class ChickenBaseLogic extends BasePageLogic {
var tokenService = Get.find<TokenStorageService>();
ChickenRepository chickenRepository = diChicken.get<ChickenRepository>();
Rx<Resource<UserProfile>> userProfile = Rx<Resource<UserProfile>>(Resource.loading());
@override
void onInit() {
super.onInit();
getUserProfile();
}
Future<void> getUserProfile() async {
userProfile.value = Resource.loading();
await safeCall<UserProfile?>(
call: () async =>
await chickenRepository.getUserProfile(token: tokenService.accessToken.value!),
onSuccess: (result) {
if (result != null) {
userProfile.value = Resource.success(result);
}
},
onError: (error, stackTrace) {},
);
}
}

View File

@@ -3,7 +3,9 @@ import 'package:rasadyar_chicken/presentation/widget/app_bar.dart';
import 'package:rasadyar_chicken/presentation/widget/base_page/back_ground.dart'; import 'package:rasadyar_chicken/presentation/widget/base_page/back_ground.dart';
import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_core/core.dart';
class ChickenBasePage extends GetView<BaseLogic> { import 'logic.dart';
class ChickenBasePage extends GetView<ChickenBaseLogic> {
const ChickenBasePage({ const ChickenBasePage({
super.key, super.key,
this.hasBack = true, this.hasBack = true,

View File

@@ -62,7 +62,7 @@ Widget _itemList({required String title, required String? value, String? unit,Co
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text( Text(
value!, value,
textAlign: TextAlign.right, textAlign: TextAlign.right,
style: AppFonts.yekan16.copyWith(color: const Color(0xFF5B5B5B)), style: AppFonts.yekan16.copyWith(color: const Color(0xFF5B5B5B)),
), ),

View File

@@ -9,10 +9,6 @@ class WidelyUsedLogic extends GetxController {
StewardRootLogic rootLogic = Get.find<StewardRootLogic>(); StewardRootLogic rootLogic = Get.find<StewardRootLogic>();
@override
void onReady() {
super.onReady();
}
@override @override
void onClose() { void onClose() {

View File

@@ -1,4 +1,3 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:mocktail/mocktail.dart'; import 'package:mocktail/mocktail.dart';
import 'package:rasadyar_chicken/data/common/dio_error_handler.dart'; import 'package:rasadyar_chicken/data/common/dio_error_handler.dart';

View File

@@ -4,7 +4,6 @@ import 'package:rasadyar_chicken/data/data_source/remote/auth/auth_remote_imp.da
import 'package:rasadyar_chicken/data/models/response/user_info/user_info_model.dart'; import 'package:rasadyar_chicken/data/models/response/user_info/user_info_model.dart';
import 'package:rasadyar_chicken/data/models/response/user_profile_model/user_profile_model.dart'; import 'package:rasadyar_chicken/data/models/response/user_profile_model/user_profile_model.dart';
import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_core/core.dart';
import 'package:dio/dio.dart';
class MockDioRemote extends Mock implements DioRemote {} class MockDioRemote extends Mock implements DioRemote {}

View File

@@ -4,319 +4,137 @@ class AppColor {
AppColor._(); AppColor._();
//region --- Blue Colors --- //region --- Blue Colors ---
static const Color blueLight = Color( static const Color blueLight = Color(0xFFeaefff); // #eaefff rgb(234, 239, 255)
0xFFeaefff, static const Color blueLightHover = Color(0xFFe0e7ff); // #e0e7ff rgb(224, 231, 255)
); // #eaefff rgb(234, 239, 255) static const Color blueLightActive = Color(0xFFbecdff); // #becdff rgb(190, 205, 255)
static const Color blueLightHover = Color( static const Color blueNormalOld = Color(0xFF2d5fff); // #2d5fff rgb(45, 95, 255)
0xFFe0e7ff,
); // #e0e7ff rgb(224, 231, 255)
static const Color blueLightActive = Color(
0xFFbecdff,
); // #becdff rgb(190, 205, 255)
static const Color blueNormalOld = Color(
0xFF2d5fff,
); // #2d5fff rgb(45, 95, 255)
static const Color blueNormal = blueDark; static const Color blueNormal = blueDark;
static const Color blueNormalHover = Color( static const Color blueNormalHover = Color(0xFF2956e6); // #2956e6 rgb(41, 86, 230)
0xFF2956e6, static const Color blueNormalActive = Color(0xFF244ccc); // #244ccc rgb(36, 76, 204)
); // #2956e6 rgb(41, 86, 230)
static const Color blueNormalActive = Color(
0xFF244ccc,
); // #244ccc rgb(36, 76, 204)
static const Color blueDark = Color(0xFF2247bf); // #2247bf rgb(34, 71, 191) static const Color blueDark = Color(0xFF2247bf); // #2247bf rgb(34, 71, 191)
static const Color blueDarkHover = Color( static const Color blueDarkHover = Color(0xFF1b3999); // #1b3999 rgb(27, 57, 153)
0xFF1b3999, static const Color blueDarkActive = Color(0xFF142b73); // #142b73 rgb(20, 43, 115)
); // #1b3999 rgb(27, 57, 153)
static const Color blueDarkActive = Color(
0xFF142b73,
); // #142b73 rgb(20, 43, 115)
static const Color blueDarker = Color(0xFF102159); // #102159 rgb(16, 33, 89) static const Color blueDarker = Color(0xFF102159); // #102159 rgb(16, 33, 89)
static const Color blueFlashing = Color( static const Color blueFlashing = Color(0xFF6F91FF); // #6F91FF rgb(111, 145, 255)
0xFF6F91FF,
); // #6F91FF rgb(111, 145, 255)
//endregion //endregion
//region --- Green Colors --- //region --- Green Colors ---
static const Color greenLight = Color( static const Color greenLight = Color(0xFFe6faf5); // #e6faf5 rgb(230, 250, 245)
0xFFe6faf5, static const Color greenLightHover = Color(0xFFd9f7f0); // #d9f7f0 rgb(217, 247, 240)
); // #e6faf5 rgb(230, 250, 245) static const Color greenLightActive = Color(0xFFb0efdf); // #b0efdf rgb(176, 239, 223)
static const Color greenLightHover = Color( static const Color greenNormal = Color(0xFF00cc99); // #00cc99 rgb(0, 204, 153)
0xFFd9f7f0, static const Color greenNormalHover = Color(0xFF00b88a); // #00b88a rgb(0, 184, 138)
); // #d9f7f0 rgb(217, 247, 240) static const Color greenNormalActive = Color(0xFF00a37a); // #00a37a rgb(0, 163, 122)
static const Color greenLightActive = Color(
0xFFb0efdf,
); // #b0efdf rgb(176, 239, 223)
static const Color greenNormal = Color(
0xFF00cc99,
); // #00cc99 rgb(0, 204, 153)
static const Color greenNormalHover = Color(
0xFF00b88a,
); // #00b88a rgb(0, 184, 138)
static const Color greenNormalActive = Color(
0xFF00a37a,
); // #00a37a rgb(0, 163, 122)
static const Color greenDark = Color(0xFF009973); // #009973 rgb(0, 153, 115) static const Color greenDark = Color(0xFF009973); // #009973 rgb(0, 153, 115)
static const Color greenDarkHover = Color( static const Color greenDarkHover = Color(0xFF007a5c); // #007a5c rgb(0, 122, 92)
0xFF007a5c, static const Color greenDarkActive = Color(0xFF005c45); // #005c45 rgb(0, 92, 69)
); // #007a5c rgb(0, 122, 92)
static const Color greenDarkActive = Color(
0xFF005c45,
); // #005c45 rgb(0, 92, 69)
static const Color greenDarker = Color(0xFF004736); // #004736 rgb(0, 71, 54) static const Color greenDarker = Color(0xFF004736); // #004736 rgb(0, 71, 54)
//endregion //endregion
//region --- Black Colors --- //region --- Black Colors ---
static const Color blackLight = Color( static const Color blackLight = Color(0xFFe6e6e6); // #e6e6e6 rgb(230, 230, 230)
0xFFe6e6e6, static const Color blackLightHover = Color(0xFFd9d9d9); // #d9d9d9 rgb(217, 217, 217)
); // #e6e6e6 rgb(230, 230, 230) static const Color blackLightActive = Color(0xFFb0b0b0); // #b0b0b0 rgb(176, 176, 176)
static const Color blackLightHover = Color(
0xFFd9d9d9,
); // #d9d9d9 rgb(217, 217, 217)
static const Color blackLightActive = Color(
0xFFb0b0b0,
); // #b0b0b0 rgb(176, 176, 176)
static const Color blackNormal = Color(0xFF000000); // #000000 rgb(0, 0, 0) static const Color blackNormal = Color(0xFF000000); // #000000 rgb(0, 0, 0)
static const Color blackNormalHover = Color( static const Color blackNormalHover = Color(0xFF000000); // #000000 rgb(0, 0, 0)
0xFF000000, static const Color blackNormalActive = Color(0xFF000000); // #000000 rgb(0, 0, 0)
); // #000000 rgb(0, 0, 0)
static const Color blackNormalActive = Color(
0xFF000000,
); // #000000 rgb(0, 0, 0)
static const Color blackDark = Color(0xFF000000); // #000000 rgb(0, 0, 0) static const Color blackDark = Color(0xFF000000); // #000000 rgb(0, 0, 0)
static const Color blackDarkHover = Color(0xFF000000); // #000000 rgb(0, 0, 0) static const Color blackDarkHover = Color(0xFF000000); // #000000 rgb(0, 0, 0)
static const Color blackDarkActive = Color( static const Color blackDarkActive = Color(0xFF000000); // #000000 rgb(0, 0, 0)
0xFF000000,
); // #000000 rgb(0, 0, 0)
static const Color blackDarker = Color(0xFF000000); // #000000 rgb(0, 0, 0) static const Color blackDarker = Color(0xFF000000); // #000000 rgb(0, 0, 0)
//endregion //endregion
//region --- Grey Colors --- //region --- Grey Colors ---
static const Color darkGreyLight = Color( static const Color darkGreyLight = Color(0xFFeaeaea); // #eaeaea rgb(234, 234, 234)
0xFFeaeaea, static const Color darkGreyLightHover = Color(0xFFdfdfdf); // #dfdfdf rgb(223, 223, 223)
); // #eaeaea rgb(234, 234, 234) static const Color darkGreyLightActive = Color(0xFFbdbdbd); // #bdbdbd rgb(189, 189, 189)
static const Color darkGreyLightHover = Color( static const Color darkGreyNormal = Color(0xFF2a2a2a); // #2a2a2a rgb(42, 42, 42)
0xFFdfdfdf, static const Color darkGreyNormalHover = Color(0xFF262626); // #262626 rgb(38, 38, 38)
); // #dfdfdf rgb(223, 223, 223) static const Color darkGreyNormalActive = Color(0xFF222222); // #222222 rgb(34, 34, 34)
static const Color darkGreyLightActive = Color( static const Color darkGreyDark = Color(0xFF202020); // #202020 rgb(32, 32, 32)
0xFFbdbdbd, static const Color darkGreyDarkHover = Color(0xFF191919); // #191919 rgb(25, 25, 25)
); // #bdbdbd rgb(189, 189, 189) static const Color darkGreyDarkActive = Color(0xFF131313); // #131313 rgb(19, 19, 19)
static const Color darkGreyNormal = Color( static const Color darkGreyDarker = Color(0xFF0f0f0f); // #0f0f0f rgb(15, 15, 15)
0xFF2a2a2a,
); // #2a2a2a rgb(42, 42, 42)
static const Color darkGreyNormalHover = Color(
0xFF262626,
); // #262626 rgb(38, 38, 38)
static const Color darkGreyNormalActive = Color(
0xFF222222,
); // #222222 rgb(34, 34, 34)
static const Color darkGreyDark = Color(
0xFF202020,
); // #202020 rgb(32, 32, 32)
static const Color darkGreyDarkHover = Color(
0xFF191919,
); // #191919 rgb(25, 25, 25)
static const Color darkGreyDarkActive = Color(
0xFF131313,
); // #131313 rgb(19, 19, 19)
static const Color darkGreyDarker = Color(
0xFF0f0f0f,
); // #0f0f0f rgb(15, 15, 15)
//endregion //endregion
//region ---Medium Grey Colors --- //region ---Medium Grey Colors ---
static const Color mediumGrey = Color( static const Color mediumGrey = Color(0xFF979797); // #979797 rgb(151, 151, 151)
0xFF979797, static const Color mediumGreyLight = Color(0xFFf4f4f4); // #f4f4f4 rgb(244, 244, 244)
); // #979797 rgb(151, 151, 151) static const Color mediumGreyLightHover = Color(0xFFeeeeee); // #eeeeee rgb(238, 238, 238)
static const Color mediumGreyLight = Color( static const Color mediumGreyLightActive = Color(0xFFdcdcdc); // #dcdcdc rgb(220, 220, 220)
0xFFf4f4f4, static const Color mediumGreyNormal = Color(0xFF8f8f8f); // #8f8f8f rgb(143, 143, 143)
); // #f4f4f4 rgb(244, 244, 244) static const Color mediumGreyNormalHover = Color(0xFF818181); // #818181 rgb(129, 129, 129)
static const Color mediumGreyLightHover = Color( static const Color mediumGreyNormalActive = Color(0xFF727272); // #727272 rgb(114, 114, 114)
0xFFeeeeee, static const Color mediumGreyDark = Color(0xFF6b6b6b); // #6b6b6b rgb(107, 107, 107)
); // #eeeeee rgb(238, 238, 238) static const Color mediumGreyDarkHover = Color(0xFF565656); // #565656 rgb(86, 86, 86)
static const Color mediumGreyLightActive = Color( static const Color mediumGreyDarkActive = Color(0xFF404040); // #404040 rgb(64, 64, 64)
0xFFdcdcdc, static const Color mediumGreyDarker = Color(0xFF323232); // #323232 rgb(50, 50, 50)
); // #dcdcdc rgb(220, 220, 220) static const Color customGrey = Color(0xFF808081); // #808081 rgb(128, 128, 129)
static const Color mediumGreyNormal = Color(
0xFF8f8f8f,
); // #8f8f8f rgb(143, 143, 143)
static const Color mediumGreyNormalHover = Color(
0xFF818181,
); // #818181 rgb(129, 129, 129)
static const Color mediumGreyNormalActive = Color(
0xFF727272,
); // #727272 rgb(114, 114, 114)
static const Color mediumGreyDark = Color(
0xFF6b6b6b,
); // #6b6b6b rgb(107, 107, 107)
static const Color mediumGreyDarkHover = Color(
0xFF565656,
); // #565656 rgb(86, 86, 86)
static const Color mediumGreyDarkActive = Color(
0xFF404040,
); // #404040 rgb(64, 64, 64)
static const Color mediumGreyDarker = Color(
0xFF323232,
); // #323232 rgb(50, 50, 50)
static const Color customGrey = Color(
0xFF808081,
); // #808081 rgb(128, 128, 129)
//endregion //endregion
//region ---Light Grey Colors --- //region ---Light Grey Colors ---
static const Color lightGreyLight = Color( static const Color lightGreyLight = Color(0xFFfdfdfd); // #fdfdfd rgb(253, 253, 253)
0xFFfdfdfd, static const Color lightGreyLightHover = Color(0xFFfcfcfc); // #fcfcfc rgb(252, 252, 252)
); // #fdfdfd rgb(253, 253, 253) static const Color lightGreyLightActive = Color(0xFFfafafa); // #fafafa rgb(250, 250, 250)
static const Color lightGreyLightHover = Color( static const Color lightGreyNormal = Color(0xFFeeeeee); // #eeeeee rgb(238, 238, 238)
0xFFfcfcfc, static const Color lightGreyNormalHover = Color(0xFFd6d6d6); // #d6d6d6 rgb(214, 214, 214)
); // #fcfcfc rgb(252, 252, 252) static const Color lightGreyNormalActive = Color(0xFFbebebe); // #bebebe rgb(190, 190, 190)
static const Color lightGreyLightActive = Color( static const Color lightGreyDark = Color(0xFFb3b3b3); // #b3b3b3 rgb(179, 179, 179)
0xFFfafafa, static const Color lightGreyDarkHover = Color(0xFF8f8f8f); // #8f8f8f rgb(143, 143, 143)
); // #fafafa rgb(250, 250, 250) static const Color lightGreyDarkActive = Color(0xFF6b6b6b); // #6b6b6b rgb(107, 107, 107)
static const Color lightGreyNormal = Color( static const Color lightGreyDarker = Color(0xFF535353); // #535353 rgb(83, 83, 83)
0xFFeeeeee,
); // #eeeeee rgb(238, 238, 238)
static const Color lightGreyNormalHover = Color(
0xFFd6d6d6,
); // #d6d6d6 rgb(214, 214, 214)
static const Color lightGreyNormalActive = Color(
0xFFbebebe,
); // #bebebe rgb(190, 190, 190)
static const Color lightGreyDark = Color(
0xFFb3b3b3,
); // #b3b3b3 rgb(179, 179, 179)
static const Color lightGreyDarkHover = Color(
0xFF8f8f8f,
); // #8f8f8f rgb(143, 143, 143)
static const Color lightGreyDarkActive = Color(
0xFF6b6b6b,
); // #6b6b6b rgb(107, 107, 107)
static const Color lightGreyDarker = Color(
0xFF535353,
); // #535353 rgb(83, 83, 83)
//endregion //endregion
//region ---WhiteGrey Colors --- //region ---WhiteGrey Colors ---
static const Color whiteGreyLight = Color( static const Color whiteGreyLight = Color(0xFFfefefe); // #fefefe rgb(254, 254, 254)
0xFFfefefe, static const Color whiteGreyLightHover = Color(0xFFfefefe); // #fefefe rgb(254, 254, 254)
); // #fefefe rgb(254, 254, 254) static const Color whiteGreyLightActive = Color(0xFFfdfdfd); // #fdfdfd rgb(253, 253, 253)
static const Color whiteGreyLightHover = Color( static const Color whiteGreyNormal = Color(0xFFf9f9f9); // #f9f9f9 rgb(249, 249, 249)
0xFFfefefe, static const Color whiteGreyNormalHover = Color(0xFFe0e0e0); // #e0e0e0 rgb(224, 224, 224)
); // #fefefe rgb(254, 254, 254) static const Color whiteGreyNormalActive = Color(0xFFc7c7c7); // #c7c7c7 rgb(199, 199, 199)
static const Color whiteGreyLightActive = Color( static const Color whiteGreyDark = Color(0xFFbbbbbb); // #bbbbbb rgb(187, 187, 187)
0xFFfdfdfd, static const Color whiteGreyDarkHover = Color(0xFF959595); // #959595 rgb(149, 149, 149)
); // #fdfdfd rgb(253, 253, 253) static const Color whiteGreyDarkActive = Color(0xFF707070); // #707070 rgb(112, 112, 112)
static const Color whiteGreyNormal = Color( static const Color whiteGreyDarker = Color(0xFF575757); // #575757 rgb(87, 87, 87)
0xFFf9f9f9,
); // #f9f9f9 rgb(249, 249, 249)
static const Color whiteGreyNormalHover = Color(
0xFFe0e0e0,
); // #e0e0e0 rgb(224, 224, 224)
static const Color whiteGreyNormalActive = Color(
0xFFc7c7c7,
); // #c7c7c7 rgb(199, 199, 199)
static const Color whiteGreyDark = Color(
0xFFbbbbbb,
); // #bbbbbb rgb(187, 187, 187)
static const Color whiteGreyDarkHover = Color(
0xFF959595,
); // #959595 rgb(149, 149, 149)
static const Color whiteGreyDarkActive = Color(
0xFF707070,
); // #707070 rgb(112, 112, 112)
static const Color whiteGreyDarker = Color(
0xFF575757,
); // #575757 rgb(87, 87, 87)
//endregion //endregion
//region ---White Colors --- //region ---White Colors ---
static const Color whiteLight = Color( static const Color whiteLight = Color(0xFFffffff); // #ffffff rgb(255, 255, 255)
0xFFffffff, static const Color whiteLightHover = Color(0xFFffffff); // #ffffff rgb(255, 255, 255)
); // #ffffff rgb(255, 255, 255) static const Color whiteLightActive = Color(0xFFffffff); // #ffffff rgb(255, 255, 255)
static const Color whiteLightHover = Color( static const Color whiteNormal = Color(0xFFffffff); // #ffffff rgb(255, 255, 255)
0xFFffffff, static const Color whiteNormalHover = Color(0xFFe6e6e6); // #e6e6e6 rgb(230, 230, 230)
); // #ffffff rgb(255, 255, 255) static const Color whiteNormalActive = Color(0xFFcccccc); // #cccccc rgb(204, 204, 204)
static const Color whiteLightActive = Color( static const Color whiteDark = Color(0xFFbfbfbf); // #bfbfbf rgb(191, 191, 191)
0xFFffffff, static const Color whiteDarkHover = Color(0xFF999999); // #999999 rgb(153, 153, 153)
); // #ffffff rgb(255, 255, 255) static const Color whiteDarkActive = Color(0xFF737373); // #737373 rgb(115, 115, 115)
static const Color whiteNormal = Color(
0xFFffffff,
); // #ffffff rgb(255, 255, 255)
static const Color whiteNormalHover = Color(
0xFFe6e6e6,
); // #e6e6e6 rgb(230, 230, 230)
static const Color whiteNormalActive = Color(
0xFFcccccc,
); // #cccccc rgb(204, 204, 204)
static const Color whiteDark = Color(
0xFFbfbfbf,
); // #bfbfbf rgb(191, 191, 191)
static const Color whiteDarkHover = Color(
0xFF999999,
); // #999999 rgb(153, 153, 153)
static const Color whiteDarkActive = Color(
0xFF737373,
); // #737373 rgb(115, 115, 115)
static const Color whiteDarker = Color(0xFF595959); // #595959 rgb(89, 89, 89) static const Color whiteDarker = Color(0xFF595959); // #595959 rgb(89, 89, 89)
//endregion //endregion
//region --- green1 Colors --- //region --- green1 Colors ---
static const Color green1Light = Color( static const Color green1Light = Color(0xFFe6f6f4); // #e6f6f4 rgb(230, 246, 244)
0xFFe6f6f4, static const Color green1LightHover = Color(0xFFd9f2ef); // #d9f2ef rgb(217, 242, 239)
); // #e6f6f4 rgb(230, 246, 244) static const Color green1LightActive = Color(0xFFb0e4dd); // #b0e4dd rgb(176, 228, 221)
static const Color green1LightHover = Color( static const Color green1Normal = Color(0xFF00a991); // #00a991 rgb(0, 169, 145)
0xFFd9f2ef, static const Color green1NormalHover = Color(0xFF009883); // #009883 rgb(0, 152, 131)
); // #d9f2ef rgb(217, 242, 239) static const Color green1NormalActive = Color(0xFF008774); // #008774 rgb(0, 135, 116)
static const Color green1LightActive = Color(
0xFFb0e4dd,
); // #b0e4dd rgb(176, 228, 221)
static const Color green1Normal = Color(
0xFF00a991,
); // #00a991 rgb(0, 169, 145)
static const Color green1NormalHover = Color(
0xFF009883,
); // #009883 rgb(0, 152, 131)
static const Color green1NormalActive = Color(
0xFF008774,
); // #008774 rgb(0, 135, 116)
static const Color green1Dark = Color(0xFF007f6d); // #007f6d rgb(0, 127, 109) static const Color green1Dark = Color(0xFF007f6d); // #007f6d rgb(0, 127, 109)
static const Color green1DarkHover = Color( static const Color green1DarkHover = Color(0xFF006557); // #006557 rgb(0, 101, 87)
0xFF006557, static const Color green1DarkActive = Color(0xFF004c41); // #004c41 rgb(0, 76, 65)
); // #006557 rgb(0, 101, 87)
static const Color green1DarkActive = Color(
0xFF004c41,
); // #004c41 rgb(0, 76, 65)
static const Color green1Darker = Color(0xFF003b33); // #003b33 rgb(0, 59, 51) static const Color green1Darker = Color(0xFF003b33); // #003b33 rgb(0, 59, 51)
//endregion //endregion
//region --- Yellow Colors --- //region --- Yellow Colors ---
static const Color yellowLight = Color( static const Color yellowLight = Color(0xFFfff9e6); // #fff9e6 rgb(255, 249, 230)
0xFFfff9e6, static const Color yellowLightHover = Color(0xFFfff6da); // #fff6da rgb(255, 246, 218)
); // #fff9e6 rgb(255, 249, 230) static const Color yellowLightActive = Color(0xFFffecb2); // #ffecb2 rgb(255, 236, 178)
static const Color yellowLightHover = Color( static const Color yellowNormal = Color(0xFFffc107); // #ffc107 rgb(255, 193, 7)
0xFFfff6da, static const Color yellowNormal2 = Color(0xFFFF9800); // #FF9800 rgb(255, 152, 0)
); // #fff6da rgb(255, 246, 218) static const Color yellowNormalHover = Color(0xFFe6ae06); // #e6ae06 rgb(230, 174, 6)
static const Color yellowLightActive = Color( static const Color yellowNormalActive = Color(0xFFcc9a06); // #cc9a06 rgb(204, 154, 6)
0xFFffecb2,
); // #ffecb2 rgb(255, 236, 178)
static const Color yellowNormal = Color(
0xFFffc107,
); // #ffc107 rgb(255, 193, 7)
static const Color yellowNormal2 = Color(
0xFFFF9800,
); // #FF9800 rgb(255, 152, 0)
static const Color yellowNormalHover = Color(
0xFFe6ae06,
); // #e6ae06 rgb(230, 174, 6)
static const Color yellowNormalActive = Color(
0xFFcc9a06,
); // #cc9a06 rgb(204, 154, 6)
static const Color yellowDark = Color(0xFFbf9105); // #bf9105 rgb(191, 145, 5) static const Color yellowDark = Color(0xFFbf9105); // #bf9105 rgb(191, 145, 5)
static const Color yellowDarkHover = Color( static const Color yellowDarkHover = Color(0xFF997404); // #997404 rgb(153, 116, 4)
0xFF997404, static const Color yellowDarkActive = Color(0xFF735703); // #735703 rgb(115, 87, 3)
); // #997404 rgb(153, 116, 4)
static const Color yellowDarkActive = Color(
0xFF735703,
); // #735703 rgb(115, 87, 3)
static const Color yellowDarker = Color(0xFF594402); // #594402 rgb(89, 68, 2) static const Color yellowDarker = Color(0xFF594402); // #594402 rgb(89, 68, 2)
// #594402 rgb(89, 68, 2) // #594402 rgb(89, 68, 2)
@@ -324,65 +142,31 @@ class AppColor {
//region --- red Colors --- //region --- red Colors ---
static const Color redLight = Color(0xFFfdeeee); // #fdeeee rgb(253, 238, 238) static const Color redLight = Color(0xFFfdeeee); // #fdeeee rgb(253, 238, 238)
static const Color redLightHover = Color( static const Color redLightHover = Color(0xFFfce6e6); // #fce6e6 rgb(252, 230, 230)
0xFFfce6e6, static const Color redLightActive = Color(0xFFf9cbcb); // #f9cbcb rgb(249, 203, 203)
); // #fce6e6 rgb(252, 230, 230)
static const Color redLightActive = Color(
0xFFf9cbcb,
); // #f9cbcb rgb(249, 203, 203)
static const Color redNormal = Color(0xFFeb5757); // #eb5757 rgb(235, 87, 87) static const Color redNormal = Color(0xFFeb5757); // #eb5757 rgb(235, 87, 87)
static const Color redNormalHover = Color( static const Color redNormalHover = Color(0xFFd44e4e); // #d44e4e rgb(212, 78, 78)
0xFFd44e4e, static const Color redNormalActive = Color(0xFFbc4646); // #bc4646 rgb(188, 70, 70)
); // #d44e4e rgb(212, 78, 78)
static const Color redNormalActive = Color(
0xFFbc4646,
); // #bc4646 rgb(188, 70, 70)
static const Color redDark = Color(0xFFb04141); // #b04141 rgb(176, 65, 65) static const Color redDark = Color(0xFFb04141); // #b04141 rgb(176, 65, 65)
static const Color redDarkHover = Color( static const Color redDarkHover = Color(0xFF8d3434); // #8d3434 rgb(141, 52, 52)
0xFF8d3434, static const Color redDarkActive = Color(0xFF6a2727); // #6a2727 rgb(106, 39, 39)
); // #8d3434 rgb(141, 52, 52)
static const Color redDarkActive = Color(
0xFF6a2727,
); // #6a2727 rgb(106, 39, 39)
static const Color redDarker = Color(0xFF521e1e); // #521e1e rgb(82, 30, 30) static const Color redDarker = Color(0xFF521e1e); // #521e1e rgb(82, 30, 30)
static const Color redDarkerText = Color( static const Color redDarkerText = Color(0xFFD24E4E); // #D34E4E rgba(211, 78, 78, 1)
0xFFD24E4E,
); // #D34E4E rgba(211, 78, 78, 1)
static const Color redLight2 = Color( static const Color redLight2 = Color(0xFFEDDCE0); // #EDDCE0 rgb(237, 220, 224)
0xFFEDDCE0, static const Color redLightActive2 = Color(0xFFE0BCC5); // #E0BCC5 rgb(224, 188, 197)
); // #EDDCE0 rgb(237, 220, 224)
static const Color redLightActive2 = Color(
0xFFE0BCC5,
); // #E0BCC5 rgb(224, 188, 197)
//endregion //endregion
//region --- Teal Colors --- //region --- Teal Colors ---
static const Color tealLight = Color( static const Color tealLight = Color(0xFFe8f6f8); // #e8f6f8 rgb(232, 246, 248)
0xFFe8f6f8, static const Color tealLightHover = Color(0xFFdcf1f4); // #dcf1f4 rgb(220, 241, 244)
); // #e8f6f8 rgb(232, 246, 248) static const Color tealLightActive = Color(0xFFb7e2e9); // #b7e2e9 rgb(183, 226, 233)
static const Color tealLightHover = Color( static const Color tealNormal = Color(0xFF17a2b8); // #17a2b8 rgb(23, 162, 184)
0xFFdcf1f4, static const Color tealNormalHover = Color(0xFF1592a6); // #1592a6 rgb(21, 146, 166)
); // #dcf1f4 rgb(220, 241, 244) static const Color tealNormalActive = Color(0xFF128293); // #128293 rgb(18, 130, 147)
static const Color tealLightActive = Color(
0xFFb7e2e9,
); // #b7e2e9 rgb(183, 226, 233)
static const Color tealNormal = Color(
0xFF17a2b8,
); // #17a2b8 rgb(23, 162, 184)
static const Color tealNormalHover = Color(
0xFF1592a6,
); // #1592a6 rgb(21, 146, 166)
static const Color tealNormalActive = Color(
0xFF128293,
); // #128293 rgb(18, 130, 147)
static const Color tealDark = Color(0xFF117a8a); // #117a8a rgb(17, 122, 138) static const Color tealDark = Color(0xFF117a8a); // #117a8a rgb(17, 122, 138)
static const Color tealDarkHover = Color( static const Color tealDarkHover = Color(0xFF0e616e); // #0e616e rgb(14, 97, 110)
0xFF0e616e, static const Color tealDarkActive = Color(0xFF0a4953); // #0a4953 rgb(10, 73, 83)
); // #0e616e rgb(14, 97, 110)
static const Color tealDarkActive = Color(
0xFF0a4953,
); // #0a4953 rgb(10, 73, 83)
static const Color tealDarker = Color(0xFF083940); // #083940 rgb(8, 57, 64) static const Color tealDarker = Color(0xFF083940); // #083940 rgb(8, 57, 64)
static const Color bgLight = Color(0xFFF5F5F5); // #083940 rgb(8, 57, 64) static const Color bgLight = Color(0xFFF5F5F5); // #083940 rgb(8, 57, 64)
@@ -390,12 +174,11 @@ class AppColor {
static const Color bgDark = Color(0xFF979797); // #083940 rgb(8, 57, 64) static const Color bgDark = Color(0xFF979797); // #083940 rgb(8, 57, 64)
static const Color textColor = Color(0xFF5B5B5B); // #083940 rgb(8, 57, 64) static const Color textColor = Color(0xFF5B5B5B); // #083940 rgb(8, 57, 64)
static const Color textColor2 = Color(0xFF636363); // #636363 rgb(99, 99, 99) static const Color textColor2 = Color(0xFF636363); // #636363 rgb(99, 99, 99)
static const Color textColor3 = Color(0xFF717171); // #717171 rgb(113, 113, 113)
static const Color labelTextColor = Color(0xFF808080); static const Color labelTextColor = Color(0xFF808080);
static const Color textColorLight = Color(0xFFB2B2B2); static const Color textColorLight = Color(0xFFB2B2B2);
static const Color iconColor = Color(0xFF444444); // #444444 rgb(68, 68, 68) static const Color iconColor = Color(0xFF444444); // #444444 rgb(68, 68, 68)
static const Color borderColor = Color( static const Color borderColor = Color(0xFFC7CFCD); // #C7CFCD rgb(199, 207, 205)`
0xFFC7CFCD,
); // #C7CFCD rgb(199, 207, 205)`
static const Color unselectTextColor = Color(0xFF888888); // static const Color unselectTextColor = Color(0xFF888888); //
static const Color accent1 = Color(0xffffe5ce); // static const Color accent1 = Color(0xffffe5ce); //
static const Color bgLight2 = Color(0xFFEFEFEF); // #EFEFEF rgb(239, 239, 239) static const Color bgLight2 = Color(0xFFEFEFEF); // #EFEFEF rgb(239, 239, 239)

View File

@@ -9,15 +9,15 @@ extension ColorUtils on Color {
return hslDarkerColor.toColor(); return hslDarkerColor.toColor();
} }
get disabledColor{ Color get disabledColor{
return withAlpha(38); return withAlpha(38);
} }
get hoverColor{ Color get hoverColor{
return _darken(0.5); return _darken(0.5);
} }
get pressedColor{ Color get pressedColor{
return _darken(0.10); return _darken(0.10);
} }

View File

@@ -1,13 +1,15 @@
import 'package:intl/intl.dart';
extension XDataTime on DateTime { extension XDataTime on DateTime {
String get formattedGregorianDate { String get formattedGregorianDate {
return "$year/${month.toString().padLeft(2, '0')}/${day.toString().padLeft(2, '0')}"; return "$year/${month.toString().padLeft(2, '0')}/${day.toString().padLeft(2, '0')}";
} }
String get formattedDashedGregorian { String get formattedDashedGregorian {
return "$year-${month.toString().padLeft(2, '0')}-${day.toString().padLeft(2, '0')}"; return "$year-${month.toString().padLeft(2, '0')}-${day.toString().padLeft(2, '0')}";
} }
String get formattedGregorianDateWithoutMillisecond {
} return DateFormat('yyyy-MM-dd HH:mm:ss').format(this).toString();
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -6,7 +6,7 @@ class ResourceOverlayDropdown<T> extends StatefulWidget {
final Resource<List<T>> items; final Resource<List<T>> items;
final T? selectedItem; final T? selectedItem;
final T? initialValue; final T? initialValue;
final int? height; final double? height;
final Color? background; final Color? background;
final bool? hasDropIcon; final bool? hasDropIcon;
final Widget Function(T item) itemBuilder; final Widget Function(T item) itemBuilder;
@@ -31,10 +31,12 @@ class ResourceOverlayDropdown<T> extends StatefulWidget {
}); });
@override @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(); final GlobalKey _key = GlobalKey();
OverlayEntry? _overlayEntry; OverlayEntry? _overlayEntry;
bool _isOpen = false; bool _isOpen = false;
@@ -100,7 +102,10 @@ class _ResourceOverlayDropdownState<T> extends State<ResourceOverlayDropdown<T>>
child: Padding( child: Padding(
padding: padding:
widget.contentPadding ?? widget.contentPadding ??
const EdgeInsets.symmetric(horizontal: 8, vertical: 4), const EdgeInsets.symmetric(
horizontal: 8,
vertical: 4,
),
child: widget.itemBuilder(item), child: widget.itemBuilder(item),
), ),
); );
@@ -139,13 +144,15 @@ class _ResourceOverlayDropdownState<T> extends State<ResourceOverlayDropdown<T>>
builder: (context, constraints) { builder: (context, constraints) {
return GestureDetector( return GestureDetector(
key: _key, key: _key,
onTap: (widget.isDisabled || widget.items.status == ResourceStatus.loading) onTap:
(widget.isDisabled ||
widget.items.status == ResourceStatus.loading)
? null ? null
: () { : () {
_isOpen ? _removeOverlay() : _showOverlay(); _isOpen ? _removeOverlay() : _showOverlay();
}, },
child: Container( child: Container(
height: widget.height?.toDouble() ?? 40, height: widget.height?.toDouble() ?? 40.h,
width: constraints.maxWidth, width: constraints.maxWidth,
padding: const EdgeInsets.symmetric(horizontal: 12), padding: const EdgeInsets.symmetric(horizontal: 12),
decoration: BoxDecoration( decoration: BoxDecoration(
@@ -171,14 +178,25 @@ class _ResourceOverlayDropdownState<T> extends State<ResourceOverlayDropdown<T>>
children: [ children: [
Expanded(child: widget.labelBuilder(selectedItem)), Expanded(child: widget.labelBuilder(selectedItem)),
if (widget.hasDropIcon ?? true) 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: 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: 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( Positioned(
left: 4, left: 4,
top: 4, top: 4,
child: Container( child: SizedBox(
width: 40, width: 40,
height: 40, height: 40,
child: Stack( child: Stack(
@@ -95,7 +95,7 @@ class _PaginationFromUntilState extends State<PaginationFromUntil> {
Positioned( Positioned(
left: 0, left: 0,
top: 0, top: 0,
child: Container( child: SizedBox(
width: 40, width: 40,
height: 40, height: 40,
child: Stack( child: Stack(
@@ -103,7 +103,7 @@ class _PaginationFromUntilState extends State<PaginationFromUntil> {
Positioned( Positioned(
left: 0, left: 0,
top: 0, top: 0,
child: Container( child: SizedBox(
width: 40, width: 40,
height: 40, height: 40,
child: Stack( child: Stack(
@@ -147,7 +147,7 @@ class _PaginationFromUntilState extends State<PaginationFromUntil> {
Positioned( Positioned(
left: 8, left: 8,
top: 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( Positioned(
left: 120, left: 120,
top: 3, top: 3,
child: Container( child: SizedBox(
width: 40, width: 40,
height: 40, height: 40,
child: Stack( child: Stack(
@@ -176,7 +176,7 @@ class _PaginationFromUntilState extends State<PaginationFromUntil> {
Positioned( Positioned(
left: 0, left: 0,
top: 0, top: 0,
child: Container( child: SizedBox(
width: 40, width: 40,
height: 40, height: 40,
child: Stack( child: Stack(
@@ -184,7 +184,7 @@ class _PaginationFromUntilState extends State<PaginationFromUntil> {
Positioned( Positioned(
left: 0, left: 0,
top: 0, top: 0,
child: Container( child: SizedBox(
width: 40, width: 40,
height: 40, height: 40,
child: Stack( child: Stack(
@@ -229,7 +229,7 @@ class _PaginationFromUntilState extends State<PaginationFromUntil> {
Positioned( Positioned(
left: 8, left: 8,
top: 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/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:rasadyar_core/presentation/common/app_color.dart'; import 'package:rasadyar_core/presentation/common/app_color.dart';
import 'package:rasadyar_core/presentation/common/app_fonts.dart'; import 'package:rasadyar_core/presentation/common/app_fonts.dart';

View File

@@ -1,8 +1,5 @@
import 'package:flutter/material.dart'; 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({ Widget vecWidgetWithOnTap({

View File

@@ -1,4 +1,3 @@
import 'dart:io';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';

View File

@@ -171,6 +171,25 @@ void defaultShowSuccessMessage(
); );
} }
void rawShowSuccessMessage(
String message, {
int durationInSeconds = 1500,
VoidCallback? onDismissed,
}) {
Get.rawSnackbar(
titleText: Text('موفقیت', style: AppFonts.yekan14.copyWith(color: Colors.white)),
messageText: Text(message, style: AppFonts.yekan12.copyWith(color: Colors.white)),
duration: Duration(milliseconds: durationInSeconds),
snackPosition: SnackPosition.TOP,
backgroundColor: Colors.green,
snackbarStatus: (status) {
if (status == SnackbarStatus.CLOSED) {
onDismissed?.call();
}
},
);
}
void defaultShowErrorMessage(String message) { void defaultShowErrorMessage(String message) {
Get.snackbar( Get.snackbar(
'خطا', 'خطا',

View File

@@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:rasadyar_core/presentation/widget/overlay_dropdown_widget/multi_select_dropdown/multi_select_dropdown.dart'; import 'package:rasadyar_core/presentation/widget/overlay_dropdown_widget/multi_select_dropdown/multi_select_dropdown.dart';

View File

@@ -1,7 +1,6 @@
import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_core/core.dart';
import 'package:rasadyar_inspection/data/model/response/auth/auth_response_model.dart'; import 'package:rasadyar_inspection/data/model/response/auth/auth_response_model.dart';
import 'package:rasadyar_inspection/data/model/response/captcha/captcha_response_model.dart'; import 'package:rasadyar_inspection/data/model/response/captcha/captcha_response_model.dart';
import 'package:rasadyar_inspection/data/model/response/user_profile/user_profile_model.dart';
import 'auth_remote.dart'; import 'auth_remote.dart';

View File

@@ -1,5 +1,4 @@
import 'dart:async'; import 'dart:async';
import 'dart:convert';
import 'dart:math'; import 'dart:math';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';

View File

@@ -1,4 +1,3 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_core/core.dart';
class ActionLogic extends GetxController with GetTickerProviderStateMixin { class ActionLogic extends GetxController with GetTickerProviderStateMixin {

View File

@@ -1,6 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_core/core.dart';
import 'package:rasadyar_core/presentation/widget/buttons/fab.dart';
import 'package:rasadyar_inspection/presentation/routes/app_routes.dart'; import 'package:rasadyar_inspection/presentation/routes/app_routes.dart';
import 'logic.dart'; import 'logic.dart';

View File

@@ -53,13 +53,6 @@ List<String> routes = [
@override
void onReady() {
super.onReady();
}
@override @override
void onClose() { void onClose() {

View File

@@ -61,11 +61,6 @@ class AuthLogic extends GetxController with GetTickerProviderStateMixin {
textAnimation = CurvedAnimation(parent: _textAnimationController, curve: Curves.easeInOut); textAnimation = CurvedAnimation(parent: _textAnimationController, curve: Curves.easeInOut);
} }
@override
void onReady() {
super.onReady();
//_textAnimationController.forward();
}
@override @override
void onClose() { void onClose() {

View File

@@ -1,6 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_core/core.dart';
import 'package:rasadyar_core/presentation/widget/buttons/fab.dart';
import 'package:rasadyar_inspection/presentation/routes/app_routes.dart'; import 'package:rasadyar_inspection/presentation/routes/app_routes.dart';
import 'package:rasadyar_inspection/presentation/widget/custom_chips.dart'; import 'package:rasadyar_inspection/presentation/widget/custom_chips.dart';

View File

@@ -42,16 +42,7 @@ class InspectionMapLogic extends GetxController {
}, time: Duration(seconds: 2)); }, time: Duration(seconds: 2));
} }
@override
void onReady() {
super.onReady();
//determineCurrentPosition();
}
@override
void onClose() {
super.onClose();
}
Future<void> fetchAllPoultryLocations() async { Future<void> fetchAllPoultryLocations() async {
allPoultryLocation.value = Resource<List<PoultryLocationModel>>.loading(); allPoultryLocation.value = Resource<List<PoultryLocationModel>>.loading();

View File

@@ -1,8 +1,6 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.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'; import 'logic.dart';
class LocationDetailsPage extends GetView<LocationDetailsLogic> { class LocationDetailsPage extends GetView<LocationDetailsLogic> {

View File

@@ -25,7 +25,7 @@ class ProfilePage extends GetView<ProfileLogic> {
final status = data.value.status; final status = data.value.status;
if (status == ResourceStatus.loading) { if (status == ResourceStatus.loading) {
return Container( return SizedBox(
width: 128.w, width: 128.w,
height: 128.h, height: 128.h,
child: Center(child: CupertinoActivityIndicator(color: AppColor.greenNormal)), child: Center(child: CupertinoActivityIndicator(color: AppColor.greenNormal)),
@@ -33,7 +33,7 @@ class ProfilePage extends GetView<ProfileLogic> {
} }
if (status == ResourceStatus.error) { if (status == ResourceStatus.error) {
return Container( return SizedBox(
width: 128.w, width: 128.w,
height: 128.h, height: 128.h,
child: Center(child: Text('خطا در دریافت اطلاعات')), child: Center(child: Text('خطا در دریافت اطلاعات')),

View File

@@ -49,7 +49,7 @@ class BasePage extends StatefulWidget {
class _BasePageState extends State<BasePage> { class _BasePageState extends State<BasePage> {
BaseLogic get controller => Get.find<BaseLogic>(); BaseLogic get controller => Get.find<BaseLogic>();
Worker? filterWorker; Worker? filterWorker;
bool _isBottomSheetOpen = false; final bool _isBottomSheetOpen = false;
@override @override
void initState() { void initState() {

View File

@@ -1,6 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_core/core.dart';
import 'package:rasadyar_inspection/presentation/widget/base_page/logic.dart' hide BaseLogic;
class SearchWidget2 extends StatefulWidget { class SearchWidget2 extends StatefulWidget {

View File

@@ -3,13 +3,5 @@ import 'package:rasadyar_core/core.dart';
import 'package:rasadyar_livestock/injection/live_stock_di.dart'; import 'package:rasadyar_livestock/injection/live_stock_di.dart';
class CheckDiMiddleWare extends GetMiddleware { class CheckDiMiddleWare extends GetMiddleware {
@override
Future<GetNavConfig?> redirectDelegate(GetNavConfig route) async {
return super.redirectDelegate(route);
}
@override
GetPage? onPageCalled(GetPage? page) {
return super.onPageCalled(page);
}
} }

View File

@@ -1,4 +1,3 @@
import 'package:rasadyar_livestock/data/model/response/address/address.dart';
import 'package:rasadyar_livestock/data/model/response/auth/auth_response_model.dart'; import 'package:rasadyar_livestock/data/model/response/auth/auth_response_model.dart';
import 'package:rasadyar_livestock/data/model/response/captcha/captcha_response_model.dart'; import 'package:rasadyar_livestock/data/model/response/captcha/captcha_response_model.dart';

View File

@@ -1,6 +1,4 @@
import 'package:rasadyar_livestock/data/data_source/remote/auth/auth_remote.dart'; import 'package:rasadyar_livestock/data/data_source/remote/auth/auth_remote.dart';
import 'package:rasadyar_livestock/data/data_source/remote/livestock/livestock_remote.dart';
import 'package:rasadyar_livestock/data/model/response/address/address.dart';
import 'package:rasadyar_livestock/data/model/response/auth/auth_response_model.dart'; import 'package:rasadyar_livestock/data/model/response/auth/auth_response_model.dart';
import 'package:rasadyar_livestock/data/model/response/captcha/captcha_response_model.dart'; import 'package:rasadyar_livestock/data/model/response/captcha/captcha_response_model.dart';

View File

@@ -62,11 +62,6 @@ class AuthLogic extends GetxController with GetTickerProviderStateMixin {
textAnimation = CurvedAnimation(parent: _textAnimationController, curve: Curves.easeInOut); textAnimation = CurvedAnimation(parent: _textAnimationController, curve: Curves.easeInOut);
} }
@override
void onReady() {
super.onReady();
//_textAnimationController.forward();
}
@override @override
void onClose() { void onClose() {

View File

@@ -1,5 +1,4 @@
import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_core/core.dart';
import 'package:rasadyar_livestock/presentation/widgets/base_page/logic.dart' hide BaseLogic;
class MapLogic extends GetxController { class MapLogic extends GetxController {
BaseLogic baseLogic = Get.find<BaseLogic>(); BaseLogic baseLogic = Get.find<BaseLogic>();

View File

@@ -3,7 +3,6 @@ import 'dart:math';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_core/core.dart';
import 'package:rasadyar_livestock/data/common/constant.dart';
import 'package:rasadyar_livestock/data/repository/livestock/livestock_repository.dart'; import 'package:rasadyar_livestock/data/repository/livestock/livestock_repository.dart';
import 'package:rasadyar_livestock/injection/live_stock_di.dart'; import 'package:rasadyar_livestock/injection/live_stock_di.dart';
import 'package:rasadyar_livestock/presentation/page/root/logic.dart'; import 'package:rasadyar_livestock/presentation/page/root/logic.dart';

View File

@@ -28,7 +28,7 @@ class ProfileLogic extends GetxController {
GlobalKey<FormState> formKey = GlobalKey(); GlobalKey<FormState> formKey = GlobalKey();
ImagePicker imagePicker = ImagePicker(); ImagePicker imagePicker = ImagePicker();
Rxn<XFile> selectedImage = Rxn<XFile>(); Rxn<XFile> selectedImage = Rxn<XFile>();
RxnString _base64Image = RxnString(); final RxnString _base64Image = RxnString();
RxBool isOnLoading = false.obs; RxBool isOnLoading = false.obs;
@override @override
@@ -65,10 +65,6 @@ class ProfileLogic extends GetxController {
});*/ });*/
} }
@override
void onClose() {
super.onClose();
}
Future<void> getUserProfile() async { Future<void> getUserProfile() async {
/*userProfile.value = Resource.loading(); /*userProfile.value = Resource.loading();

View File

@@ -110,10 +110,6 @@ class RequestTaggingLogic extends GetxController {
livestockList.addAll(s); livestockList.addAll(s);
} }
@override
void onClose() {
super.onClose();
}
void onNext() async { void onNext() async {
if (currentIndex.value < maxStep) { if (currentIndex.value < maxStep) {

View File

@@ -1083,7 +1083,7 @@ class RequestTaggingPage extends GetView<RequestTaggingLogic> {
), ),
Text( Text(
'${Jalali.now().formatter.y}', Jalali.now().formatter.y,
style: AppFonts.yekan20.copyWith(color: AppColor.textColor), style: AppFonts.yekan20.copyWith(color: AppColor.textColor),
), ),

View File

@@ -1,5 +1,4 @@
import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_core/core.dart';
import 'package:rasadyar_livestock/presentation/page/root/logic.dart';
class RequestsLogic extends GetxController { class RequestsLogic extends GetxController {
RxList<int> filterSelected = <int>[].obs; RxList<int> filterSelected = <int>[].obs;

View File

@@ -45,21 +45,9 @@ class RootLogic extends GetxController {
RxInt currentIndex = 0.obs; RxInt currentIndex = 0.obs;
TokenStorageService tokenService = Get.find<TokenStorageService>(); TokenStorageService tokenService = Get.find<TokenStorageService>();
@override
void onInit() {
super.onInit();
}
@override
void onReady() {
super.onReady();
}
@override
void onClose() {
super.onClose();
}
void changePage(int index) { void changePage(int index) {
if (index == currentIndex.value) { if (index == currentIndex.value) {

View File

@@ -1,5 +1,4 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_core/core.dart';
import 'logic.dart'; import 'logic.dart';

View File

@@ -1,7 +1,6 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_core/core.dart';
import 'package:rasadyar_core/presentation/widget/buttons/fab.dart';
import 'logic.dart'; import 'logic.dart';

View File

@@ -14,7 +14,6 @@ import 'package:rasadyar_livestock/presentation/page/tagging/view.dart';
import 'package:rasadyar_livestock/presentation/widgets/base_page/logic.dart'; import 'package:rasadyar_livestock/presentation/widgets/base_page/logic.dart';
import 'package:rasadyar_livestock/presentation/widgets/captcha/logic.dart'; import 'package:rasadyar_livestock/presentation/widgets/captcha/logic.dart';
import '../../injection/live_stock_di.dart';
part 'app_routes.dart'; part 'app_routes.dart';

View File

@@ -55,7 +55,7 @@ class BasePage extends StatefulWidget {
class _BasePageState extends State<BasePage> { class _BasePageState extends State<BasePage> {
BaseLogic get controller => Get.find<BaseLogic>(); BaseLogic get controller => Get.find<BaseLogic>();
Worker? filterWorker; Worker? filterWorker;
bool _isBottomSheetOpen = false; final bool _isBottomSheetOpen = false;
@override @override
void initState() { void initState() {