chore: remove unused assets and data source files related to the kill house module, and update import paths for better organization
This commit is contained in:
13
packages/chicken/lib/presentation/widget/sdui/sdui.json
Normal file
13
packages/chicken/lib/presentation/widget/sdui/sdui.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"type": "card_label_item",
|
||||
"visible": true,
|
||||
"data": {
|
||||
"title": "اطلاعات مزرعه",
|
||||
"padding_horizontal": 12.0,
|
||||
"padding_vertical": 11.0
|
||||
},
|
||||
"child": {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'model/card_label_item_sdui_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
Widget cardLabelItemSDUI({required CardLabelItemSDUI model}) {
|
||||
return farmInfoWidget(
|
||||
title: model.data?.title ?? '',
|
||||
child: Container(),
|
||||
padding:
|
||||
model.data?.paddingHorizontal != null &&
|
||||
model.data?.paddingVertical != null
|
||||
? EdgeInsets.symmetric(
|
||||
horizontal: model.data?.paddingHorizontal ?? 0,
|
||||
vertical: model.data?.paddingVertical ?? 0,
|
||||
)
|
||||
: null,
|
||||
);
|
||||
}
|
||||
|
||||
Widget farmInfoWidget({
|
||||
required String title,
|
||||
required Widget child,
|
||||
EdgeInsets? padding,
|
||||
}) {
|
||||
return Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 0.50, color: AppColor.mediumGrey),
|
||||
),
|
||||
|
||||
padding:
|
||||
padding ?? EdgeInsets.symmetric(horizontal: 12.w, vertical: 11.h),
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: -17,
|
||||
right: 7,
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 5.h),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 0.50, color: AppColor.mediumGrey),
|
||||
),
|
||||
child: Text(
|
||||
title,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.iconColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'card_label_item_sdui_model.freezed.dart';
|
||||
part 'card_label_item_sdui_model.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class CardLabelItemSDUI with _$CardLabelItemSDUI {
|
||||
const factory CardLabelItemSDUI({
|
||||
String? type,
|
||||
bool? visible,
|
||||
CardLabelItemData? data,
|
||||
Map<String, dynamic>? child,
|
||||
}) = _CardLabelItemSDUI;
|
||||
|
||||
factory CardLabelItemSDUI.fromJson(Map<String, dynamic> json) =>
|
||||
_$CardLabelItemSDUIFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class CardLabelItemData with _$CardLabelItemData {
|
||||
const factory CardLabelItemData({
|
||||
String? title,
|
||||
double? paddingHorizontal,
|
||||
double? paddingVertical,
|
||||
}) = _CardLabelItemData;
|
||||
|
||||
factory CardLabelItemData.fromJson(Map<String, dynamic> json) =>
|
||||
_$CardLabelItemDataFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,587 @@
|
||||
// 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 'card_label_item_sdui_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$CardLabelItemSDUI {
|
||||
|
||||
String? get type; bool? get visible; CardLabelItemData? get data; Map<String, dynamic>? get child;
|
||||
/// Create a copy of CardLabelItemSDUI
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$CardLabelItemSDUICopyWith<CardLabelItemSDUI> get copyWith => _$CardLabelItemSDUICopyWithImpl<CardLabelItemSDUI>(this as CardLabelItemSDUI, _$identity);
|
||||
|
||||
/// Serializes this CardLabelItemSDUI to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is CardLabelItemSDUI&&(identical(other.type, type) || other.type == type)&&(identical(other.visible, visible) || other.visible == visible)&&(identical(other.data, data) || other.data == data)&&const DeepCollectionEquality().equals(other.child, child));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,type,visible,data,const DeepCollectionEquality().hash(child));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CardLabelItemSDUI(type: $type, visible: $visible, data: $data, child: $child)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $CardLabelItemSDUICopyWith<$Res> {
|
||||
factory $CardLabelItemSDUICopyWith(CardLabelItemSDUI value, $Res Function(CardLabelItemSDUI) _then) = _$CardLabelItemSDUICopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? type, bool? visible, CardLabelItemData? data, Map<String, dynamic>? child
|
||||
});
|
||||
|
||||
|
||||
$CardLabelItemDataCopyWith<$Res>? get data;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$CardLabelItemSDUICopyWithImpl<$Res>
|
||||
implements $CardLabelItemSDUICopyWith<$Res> {
|
||||
_$CardLabelItemSDUICopyWithImpl(this._self, this._then);
|
||||
|
||||
final CardLabelItemSDUI _self;
|
||||
final $Res Function(CardLabelItemSDUI) _then;
|
||||
|
||||
/// Create a copy of CardLabelItemSDUI
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? type = freezed,Object? visible = freezed,Object? data = freezed,Object? child = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
||||
as String?,visible: freezed == visible ? _self.visible : visible // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable
|
||||
as CardLabelItemData?,child: freezed == child ? _self.child : child // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, dynamic>?,
|
||||
));
|
||||
}
|
||||
/// Create a copy of CardLabelItemSDUI
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$CardLabelItemDataCopyWith<$Res>? get data {
|
||||
if (_self.data == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $CardLabelItemDataCopyWith<$Res>(_self.data!, (value) {
|
||||
return _then(_self.copyWith(data: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [CardLabelItemSDUI].
|
||||
extension CardLabelItemSDUIPatterns on CardLabelItemSDUI {
|
||||
/// 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( _CardLabelItemSDUI value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _CardLabelItemSDUI() 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( _CardLabelItemSDUI value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _CardLabelItemSDUI():
|
||||
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( _CardLabelItemSDUI value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _CardLabelItemSDUI() 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? type, bool? visible, CardLabelItemData? data, Map<String, dynamic>? child)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _CardLabelItemSDUI() when $default != null:
|
||||
return $default(_that.type,_that.visible,_that.data,_that.child);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? type, bool? visible, CardLabelItemData? data, Map<String, dynamic>? child) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _CardLabelItemSDUI():
|
||||
return $default(_that.type,_that.visible,_that.data,_that.child);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? type, bool? visible, CardLabelItemData? data, Map<String, dynamic>? child)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _CardLabelItemSDUI() when $default != null:
|
||||
return $default(_that.type,_that.visible,_that.data,_that.child);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _CardLabelItemSDUI implements CardLabelItemSDUI {
|
||||
const _CardLabelItemSDUI({this.type, this.visible, this.data, final Map<String, dynamic>? child}): _child = child;
|
||||
factory _CardLabelItemSDUI.fromJson(Map<String, dynamic> json) => _$CardLabelItemSDUIFromJson(json);
|
||||
|
||||
@override final String? type;
|
||||
@override final bool? visible;
|
||||
@override final CardLabelItemData? data;
|
||||
final Map<String, dynamic>? _child;
|
||||
@override Map<String, dynamic>? get child {
|
||||
final value = _child;
|
||||
if (value == null) return null;
|
||||
if (_child is EqualUnmodifiableMapView) return _child;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableMapView(value);
|
||||
}
|
||||
|
||||
|
||||
/// Create a copy of CardLabelItemSDUI
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$CardLabelItemSDUICopyWith<_CardLabelItemSDUI> get copyWith => __$CardLabelItemSDUICopyWithImpl<_CardLabelItemSDUI>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$CardLabelItemSDUIToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _CardLabelItemSDUI&&(identical(other.type, type) || other.type == type)&&(identical(other.visible, visible) || other.visible == visible)&&(identical(other.data, data) || other.data == data)&&const DeepCollectionEquality().equals(other._child, _child));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,type,visible,data,const DeepCollectionEquality().hash(_child));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CardLabelItemSDUI(type: $type, visible: $visible, data: $data, child: $child)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$CardLabelItemSDUICopyWith<$Res> implements $CardLabelItemSDUICopyWith<$Res> {
|
||||
factory _$CardLabelItemSDUICopyWith(_CardLabelItemSDUI value, $Res Function(_CardLabelItemSDUI) _then) = __$CardLabelItemSDUICopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? type, bool? visible, CardLabelItemData? data, Map<String, dynamic>? child
|
||||
});
|
||||
|
||||
|
||||
@override $CardLabelItemDataCopyWith<$Res>? get data;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$CardLabelItemSDUICopyWithImpl<$Res>
|
||||
implements _$CardLabelItemSDUICopyWith<$Res> {
|
||||
__$CardLabelItemSDUICopyWithImpl(this._self, this._then);
|
||||
|
||||
final _CardLabelItemSDUI _self;
|
||||
final $Res Function(_CardLabelItemSDUI) _then;
|
||||
|
||||
/// Create a copy of CardLabelItemSDUI
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? type = freezed,Object? visible = freezed,Object? data = freezed,Object? child = freezed,}) {
|
||||
return _then(_CardLabelItemSDUI(
|
||||
type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
||||
as String?,visible: freezed == visible ? _self.visible : visible // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable
|
||||
as CardLabelItemData?,child: freezed == child ? _self._child : child // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, dynamic>?,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of CardLabelItemSDUI
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$CardLabelItemDataCopyWith<$Res>? get data {
|
||||
if (_self.data == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $CardLabelItemDataCopyWith<$Res>(_self.data!, (value) {
|
||||
return _then(_self.copyWith(data: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// @nodoc
|
||||
mixin _$CardLabelItemData {
|
||||
|
||||
String? get title; double? get paddingHorizontal; double? get paddingVertical;
|
||||
/// Create a copy of CardLabelItemData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$CardLabelItemDataCopyWith<CardLabelItemData> get copyWith => _$CardLabelItemDataCopyWithImpl<CardLabelItemData>(this as CardLabelItemData, _$identity);
|
||||
|
||||
/// Serializes this CardLabelItemData to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is CardLabelItemData&&(identical(other.title, title) || other.title == title)&&(identical(other.paddingHorizontal, paddingHorizontal) || other.paddingHorizontal == paddingHorizontal)&&(identical(other.paddingVertical, paddingVertical) || other.paddingVertical == paddingVertical));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,title,paddingHorizontal,paddingVertical);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CardLabelItemData(title: $title, paddingHorizontal: $paddingHorizontal, paddingVertical: $paddingVertical)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $CardLabelItemDataCopyWith<$Res> {
|
||||
factory $CardLabelItemDataCopyWith(CardLabelItemData value, $Res Function(CardLabelItemData) _then) = _$CardLabelItemDataCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? title, double? paddingHorizontal, double? paddingVertical
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$CardLabelItemDataCopyWithImpl<$Res>
|
||||
implements $CardLabelItemDataCopyWith<$Res> {
|
||||
_$CardLabelItemDataCopyWithImpl(this._self, this._then);
|
||||
|
||||
final CardLabelItemData _self;
|
||||
final $Res Function(CardLabelItemData) _then;
|
||||
|
||||
/// Create a copy of CardLabelItemData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? title = freezed,Object? paddingHorizontal = freezed,Object? paddingVertical = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
title: freezed == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
|
||||
as String?,paddingHorizontal: freezed == paddingHorizontal ? _self.paddingHorizontal : paddingHorizontal // ignore: cast_nullable_to_non_nullable
|
||||
as double?,paddingVertical: freezed == paddingVertical ? _self.paddingVertical : paddingVertical // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [CardLabelItemData].
|
||||
extension CardLabelItemDataPatterns on CardLabelItemData {
|
||||
/// 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( _CardLabelItemData value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _CardLabelItemData() 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( _CardLabelItemData value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _CardLabelItemData():
|
||||
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( _CardLabelItemData value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _CardLabelItemData() 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? title, double? paddingHorizontal, double? paddingVertical)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _CardLabelItemData() when $default != null:
|
||||
return $default(_that.title,_that.paddingHorizontal,_that.paddingVertical);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? title, double? paddingHorizontal, double? paddingVertical) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _CardLabelItemData():
|
||||
return $default(_that.title,_that.paddingHorizontal,_that.paddingVertical);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? title, double? paddingHorizontal, double? paddingVertical)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _CardLabelItemData() when $default != null:
|
||||
return $default(_that.title,_that.paddingHorizontal,_that.paddingVertical);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _CardLabelItemData implements CardLabelItemData {
|
||||
const _CardLabelItemData({this.title, this.paddingHorizontal, this.paddingVertical});
|
||||
factory _CardLabelItemData.fromJson(Map<String, dynamic> json) => _$CardLabelItemDataFromJson(json);
|
||||
|
||||
@override final String? title;
|
||||
@override final double? paddingHorizontal;
|
||||
@override final double? paddingVertical;
|
||||
|
||||
/// Create a copy of CardLabelItemData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$CardLabelItemDataCopyWith<_CardLabelItemData> get copyWith => __$CardLabelItemDataCopyWithImpl<_CardLabelItemData>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$CardLabelItemDataToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _CardLabelItemData&&(identical(other.title, title) || other.title == title)&&(identical(other.paddingHorizontal, paddingHorizontal) || other.paddingHorizontal == paddingHorizontal)&&(identical(other.paddingVertical, paddingVertical) || other.paddingVertical == paddingVertical));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,title,paddingHorizontal,paddingVertical);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CardLabelItemData(title: $title, paddingHorizontal: $paddingHorizontal, paddingVertical: $paddingVertical)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$CardLabelItemDataCopyWith<$Res> implements $CardLabelItemDataCopyWith<$Res> {
|
||||
factory _$CardLabelItemDataCopyWith(_CardLabelItemData value, $Res Function(_CardLabelItemData) _then) = __$CardLabelItemDataCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? title, double? paddingHorizontal, double? paddingVertical
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$CardLabelItemDataCopyWithImpl<$Res>
|
||||
implements _$CardLabelItemDataCopyWith<$Res> {
|
||||
__$CardLabelItemDataCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _CardLabelItemData _self;
|
||||
final $Res Function(_CardLabelItemData) _then;
|
||||
|
||||
/// Create a copy of CardLabelItemData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? title = freezed,Object? paddingHorizontal = freezed,Object? paddingVertical = freezed,}) {
|
||||
return _then(_CardLabelItemData(
|
||||
title: freezed == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
|
||||
as String?,paddingHorizontal: freezed == paddingHorizontal ? _self.paddingHorizontal : paddingHorizontal // ignore: cast_nullable_to_non_nullable
|
||||
as double?,paddingVertical: freezed == paddingVertical ? _self.paddingVertical : paddingVertical // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,39 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'card_label_item_sdui_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_CardLabelItemSDUI _$CardLabelItemSDUIFromJson(Map<String, dynamic> json) =>
|
||||
_CardLabelItemSDUI(
|
||||
type: json['type'] as String?,
|
||||
visible: json['visible'] as bool?,
|
||||
data: json['data'] == null
|
||||
? null
|
||||
: CardLabelItemData.fromJson(json['data'] as Map<String, dynamic>),
|
||||
child: json['child'] as Map<String, dynamic>?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$CardLabelItemSDUIToJson(_CardLabelItemSDUI instance) =>
|
||||
<String, dynamic>{
|
||||
'type': instance.type,
|
||||
'visible': instance.visible,
|
||||
'data': instance.data,
|
||||
'child': instance.child,
|
||||
};
|
||||
|
||||
_CardLabelItemData _$CardLabelItemDataFromJson(Map<String, dynamic> json) =>
|
||||
_CardLabelItemData(
|
||||
title: json['title'] as String?,
|
||||
paddingHorizontal: (json['padding_horizontal'] as num?)?.toDouble(),
|
||||
paddingVertical: (json['padding_vertical'] as num?)?.toDouble(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$CardLabelItemDataToJson(_CardLabelItemData instance) =>
|
||||
<String, dynamic>{
|
||||
'title': instance.title,
|
||||
'padding_horizontal': instance.paddingHorizontal,
|
||||
'padding_vertical': instance.paddingVertical,
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"type": "card_label_item",
|
||||
"visible": true,
|
||||
"data": {
|
||||
"title": "اطلاعات مزرعه",
|
||||
"padding_horizontal": 12.0,
|
||||
"padding_vertical": 11.0
|
||||
},
|
||||
"child": {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'text_form_field_sdui_model.freezed.dart';
|
||||
part 'text_form_field_sdui_model.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class TextFormFieldSDUIModel with _$TextFormFieldSDUIModel {
|
||||
const factory TextFormFieldSDUIModel({
|
||||
String? key,
|
||||
String? label,
|
||||
String? hintText,
|
||||
String? variant,
|
||||
String? keyboardType,
|
||||
String? value,
|
||||
int? maxLength,
|
||||
int? minLine,
|
||||
int? maxLine,
|
||||
bool? required,
|
||||
bool? enabled,
|
||||
bool? readonly,
|
||||
bool? commaSperator,
|
||||
bool? decimal,
|
||||
int? decimalPlaces,
|
||||
String? type,
|
||||
}) = _TextFormFieldSDUIModel;
|
||||
|
||||
factory TextFormFieldSDUIModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$TextFormFieldSDUIModelFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,322 @@
|
||||
// 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 'text_form_field_sdui_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$TextFormFieldSDUIModel {
|
||||
|
||||
String? get key; String? get label; String? get hintText; String? get variant; String? get keyboardType; String? get value; int? get maxLength; int? get minLine; int? get maxLine; bool? get required; bool? get enabled; bool? get readonly; bool? get commaSperator; bool? get decimal; int? get decimalPlaces; String? get type;
|
||||
/// Create a copy of TextFormFieldSDUIModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$TextFormFieldSDUIModelCopyWith<TextFormFieldSDUIModel> get copyWith => _$TextFormFieldSDUIModelCopyWithImpl<TextFormFieldSDUIModel>(this as TextFormFieldSDUIModel, _$identity);
|
||||
|
||||
/// Serializes this TextFormFieldSDUIModel to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is TextFormFieldSDUIModel&&(identical(other.key, key) || other.key == key)&&(identical(other.label, label) || other.label == label)&&(identical(other.hintText, hintText) || other.hintText == hintText)&&(identical(other.variant, variant) || other.variant == variant)&&(identical(other.keyboardType, keyboardType) || other.keyboardType == keyboardType)&&(identical(other.value, value) || other.value == value)&&(identical(other.maxLength, maxLength) || other.maxLength == maxLength)&&(identical(other.minLine, minLine) || other.minLine == minLine)&&(identical(other.maxLine, maxLine) || other.maxLine == maxLine)&&(identical(other.required, required) || other.required == required)&&(identical(other.enabled, enabled) || other.enabled == enabled)&&(identical(other.readonly, readonly) || other.readonly == readonly)&&(identical(other.commaSperator, commaSperator) || other.commaSperator == commaSperator)&&(identical(other.decimal, decimal) || other.decimal == decimal)&&(identical(other.decimalPlaces, decimalPlaces) || other.decimalPlaces == decimalPlaces)&&(identical(other.type, type) || other.type == type));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,key,label,hintText,variant,keyboardType,value,maxLength,minLine,maxLine,required,enabled,readonly,commaSperator,decimal,decimalPlaces,type);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'TextFormFieldSDUIModel(key: $key, label: $label, hintText: $hintText, variant: $variant, keyboardType: $keyboardType, value: $value, maxLength: $maxLength, minLine: $minLine, maxLine: $maxLine, required: $required, enabled: $enabled, readonly: $readonly, commaSperator: $commaSperator, decimal: $decimal, decimalPlaces: $decimalPlaces, type: $type)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $TextFormFieldSDUIModelCopyWith<$Res> {
|
||||
factory $TextFormFieldSDUIModelCopyWith(TextFormFieldSDUIModel value, $Res Function(TextFormFieldSDUIModel) _then) = _$TextFormFieldSDUIModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? key, String? label, String? hintText, String? variant, String? keyboardType, String? value, int? maxLength, int? minLine, int? maxLine, bool? required, bool? enabled, bool? readonly, bool? commaSperator, bool? decimal, int? decimalPlaces, String? type
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$TextFormFieldSDUIModelCopyWithImpl<$Res>
|
||||
implements $TextFormFieldSDUIModelCopyWith<$Res> {
|
||||
_$TextFormFieldSDUIModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final TextFormFieldSDUIModel _self;
|
||||
final $Res Function(TextFormFieldSDUIModel) _then;
|
||||
|
||||
/// Create a copy of TextFormFieldSDUIModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? label = freezed,Object? hintText = freezed,Object? variant = freezed,Object? keyboardType = freezed,Object? value = freezed,Object? maxLength = freezed,Object? minLine = freezed,Object? maxLine = freezed,Object? required = freezed,Object? enabled = freezed,Object? readonly = freezed,Object? commaSperator = freezed,Object? decimal = freezed,Object? decimalPlaces = freezed,Object? type = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
|
||||
as String?,label: freezed == label ? _self.label : label // ignore: cast_nullable_to_non_nullable
|
||||
as String?,hintText: freezed == hintText ? _self.hintText : hintText // ignore: cast_nullable_to_non_nullable
|
||||
as String?,variant: freezed == variant ? _self.variant : variant // ignore: cast_nullable_to_non_nullable
|
||||
as String?,keyboardType: freezed == keyboardType ? _self.keyboardType : keyboardType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,value: freezed == value ? _self.value : value // ignore: cast_nullable_to_non_nullable
|
||||
as String?,maxLength: freezed == maxLength ? _self.maxLength : maxLength // ignore: cast_nullable_to_non_nullable
|
||||
as int?,minLine: freezed == minLine ? _self.minLine : minLine // ignore: cast_nullable_to_non_nullable
|
||||
as int?,maxLine: freezed == maxLine ? _self.maxLine : maxLine // ignore: cast_nullable_to_non_nullable
|
||||
as int?,required: freezed == required ? _self.required : required // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,enabled: freezed == enabled ? _self.enabled : enabled // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,readonly: freezed == readonly ? _self.readonly : readonly // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,commaSperator: freezed == commaSperator ? _self.commaSperator : commaSperator // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,decimal: freezed == decimal ? _self.decimal : decimal // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,decimalPlaces: freezed == decimalPlaces ? _self.decimalPlaces : decimalPlaces // ignore: cast_nullable_to_non_nullable
|
||||
as int?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [TextFormFieldSDUIModel].
|
||||
extension TextFormFieldSDUIModelPatterns on TextFormFieldSDUIModel {
|
||||
/// 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( _TextFormFieldSDUIModel value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _TextFormFieldSDUIModel() 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( _TextFormFieldSDUIModel value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _TextFormFieldSDUIModel():
|
||||
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( _TextFormFieldSDUIModel value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _TextFormFieldSDUIModel() 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? key, String? label, String? hintText, String? variant, String? keyboardType, String? value, int? maxLength, int? minLine, int? maxLine, bool? required, bool? enabled, bool? readonly, bool? commaSperator, bool? decimal, int? decimalPlaces, String? type)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _TextFormFieldSDUIModel() when $default != null:
|
||||
return $default(_that.key,_that.label,_that.hintText,_that.variant,_that.keyboardType,_that.value,_that.maxLength,_that.minLine,_that.maxLine,_that.required,_that.enabled,_that.readonly,_that.commaSperator,_that.decimal,_that.decimalPlaces,_that.type);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? key, String? label, String? hintText, String? variant, String? keyboardType, String? value, int? maxLength, int? minLine, int? maxLine, bool? required, bool? enabled, bool? readonly, bool? commaSperator, bool? decimal, int? decimalPlaces, String? type) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _TextFormFieldSDUIModel():
|
||||
return $default(_that.key,_that.label,_that.hintText,_that.variant,_that.keyboardType,_that.value,_that.maxLength,_that.minLine,_that.maxLine,_that.required,_that.enabled,_that.readonly,_that.commaSperator,_that.decimal,_that.decimalPlaces,_that.type);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? key, String? label, String? hintText, String? variant, String? keyboardType, String? value, int? maxLength, int? minLine, int? maxLine, bool? required, bool? enabled, bool? readonly, bool? commaSperator, bool? decimal, int? decimalPlaces, String? type)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _TextFormFieldSDUIModel() when $default != null:
|
||||
return $default(_that.key,_that.label,_that.hintText,_that.variant,_that.keyboardType,_that.value,_that.maxLength,_that.minLine,_that.maxLine,_that.required,_that.enabled,_that.readonly,_that.commaSperator,_that.decimal,_that.decimalPlaces,_that.type);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _TextFormFieldSDUIModel implements TextFormFieldSDUIModel {
|
||||
const _TextFormFieldSDUIModel({this.key, this.label, this.hintText, this.variant, this.keyboardType, this.value, this.maxLength, this.minLine, this.maxLine, this.required, this.enabled, this.readonly, this.commaSperator, this.decimal, this.decimalPlaces, this.type});
|
||||
factory _TextFormFieldSDUIModel.fromJson(Map<String, dynamic> json) => _$TextFormFieldSDUIModelFromJson(json);
|
||||
|
||||
@override final String? key;
|
||||
@override final String? label;
|
||||
@override final String? hintText;
|
||||
@override final String? variant;
|
||||
@override final String? keyboardType;
|
||||
@override final String? value;
|
||||
@override final int? maxLength;
|
||||
@override final int? minLine;
|
||||
@override final int? maxLine;
|
||||
@override final bool? required;
|
||||
@override final bool? enabled;
|
||||
@override final bool? readonly;
|
||||
@override final bool? commaSperator;
|
||||
@override final bool? decimal;
|
||||
@override final int? decimalPlaces;
|
||||
@override final String? type;
|
||||
|
||||
/// Create a copy of TextFormFieldSDUIModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$TextFormFieldSDUIModelCopyWith<_TextFormFieldSDUIModel> get copyWith => __$TextFormFieldSDUIModelCopyWithImpl<_TextFormFieldSDUIModel>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$TextFormFieldSDUIModelToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _TextFormFieldSDUIModel&&(identical(other.key, key) || other.key == key)&&(identical(other.label, label) || other.label == label)&&(identical(other.hintText, hintText) || other.hintText == hintText)&&(identical(other.variant, variant) || other.variant == variant)&&(identical(other.keyboardType, keyboardType) || other.keyboardType == keyboardType)&&(identical(other.value, value) || other.value == value)&&(identical(other.maxLength, maxLength) || other.maxLength == maxLength)&&(identical(other.minLine, minLine) || other.minLine == minLine)&&(identical(other.maxLine, maxLine) || other.maxLine == maxLine)&&(identical(other.required, required) || other.required == required)&&(identical(other.enabled, enabled) || other.enabled == enabled)&&(identical(other.readonly, readonly) || other.readonly == readonly)&&(identical(other.commaSperator, commaSperator) || other.commaSperator == commaSperator)&&(identical(other.decimal, decimal) || other.decimal == decimal)&&(identical(other.decimalPlaces, decimalPlaces) || other.decimalPlaces == decimalPlaces)&&(identical(other.type, type) || other.type == type));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,key,label,hintText,variant,keyboardType,value,maxLength,minLine,maxLine,required,enabled,readonly,commaSperator,decimal,decimalPlaces,type);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'TextFormFieldSDUIModel(key: $key, label: $label, hintText: $hintText, variant: $variant, keyboardType: $keyboardType, value: $value, maxLength: $maxLength, minLine: $minLine, maxLine: $maxLine, required: $required, enabled: $enabled, readonly: $readonly, commaSperator: $commaSperator, decimal: $decimal, decimalPlaces: $decimalPlaces, type: $type)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$TextFormFieldSDUIModelCopyWith<$Res> implements $TextFormFieldSDUIModelCopyWith<$Res> {
|
||||
factory _$TextFormFieldSDUIModelCopyWith(_TextFormFieldSDUIModel value, $Res Function(_TextFormFieldSDUIModel) _then) = __$TextFormFieldSDUIModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? key, String? label, String? hintText, String? variant, String? keyboardType, String? value, int? maxLength, int? minLine, int? maxLine, bool? required, bool? enabled, bool? readonly, bool? commaSperator, bool? decimal, int? decimalPlaces, String? type
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$TextFormFieldSDUIModelCopyWithImpl<$Res>
|
||||
implements _$TextFormFieldSDUIModelCopyWith<$Res> {
|
||||
__$TextFormFieldSDUIModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _TextFormFieldSDUIModel _self;
|
||||
final $Res Function(_TextFormFieldSDUIModel) _then;
|
||||
|
||||
/// Create a copy of TextFormFieldSDUIModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? label = freezed,Object? hintText = freezed,Object? variant = freezed,Object? keyboardType = freezed,Object? value = freezed,Object? maxLength = freezed,Object? minLine = freezed,Object? maxLine = freezed,Object? required = freezed,Object? enabled = freezed,Object? readonly = freezed,Object? commaSperator = freezed,Object? decimal = freezed,Object? decimalPlaces = freezed,Object? type = freezed,}) {
|
||||
return _then(_TextFormFieldSDUIModel(
|
||||
key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
|
||||
as String?,label: freezed == label ? _self.label : label // ignore: cast_nullable_to_non_nullable
|
||||
as String?,hintText: freezed == hintText ? _self.hintText : hintText // ignore: cast_nullable_to_non_nullable
|
||||
as String?,variant: freezed == variant ? _self.variant : variant // ignore: cast_nullable_to_non_nullable
|
||||
as String?,keyboardType: freezed == keyboardType ? _self.keyboardType : keyboardType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,value: freezed == value ? _self.value : value // ignore: cast_nullable_to_non_nullable
|
||||
as String?,maxLength: freezed == maxLength ? _self.maxLength : maxLength // ignore: cast_nullable_to_non_nullable
|
||||
as int?,minLine: freezed == minLine ? _self.minLine : minLine // ignore: cast_nullable_to_non_nullable
|
||||
as int?,maxLine: freezed == maxLine ? _self.maxLine : maxLine // ignore: cast_nullable_to_non_nullable
|
||||
as int?,required: freezed == required ? _self.required : required // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,enabled: freezed == enabled ? _self.enabled : enabled // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,readonly: freezed == readonly ? _self.readonly : readonly // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,commaSperator: freezed == commaSperator ? _self.commaSperator : commaSperator // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,decimal: freezed == decimal ? _self.decimal : decimal // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,decimalPlaces: freezed == decimalPlaces ? _self.decimalPlaces : decimalPlaces // ignore: cast_nullable_to_non_nullable
|
||||
as int?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,49 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'text_form_field_sdui_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_TextFormFieldSDUIModel _$TextFormFieldSDUIModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _TextFormFieldSDUIModel(
|
||||
key: json['key'] as String?,
|
||||
label: json['label'] as String?,
|
||||
hintText: json['hint_text'] as String?,
|
||||
variant: json['variant'] as String?,
|
||||
keyboardType: json['keyboard_type'] as String?,
|
||||
value: json['value'] as String?,
|
||||
maxLength: (json['max_length'] as num?)?.toInt(),
|
||||
minLine: (json['min_line'] as num?)?.toInt(),
|
||||
maxLine: (json['max_line'] as num?)?.toInt(),
|
||||
required: json['required'] as bool?,
|
||||
enabled: json['enabled'] as bool?,
|
||||
readonly: json['readonly'] as bool?,
|
||||
commaSperator: json['comma_sperator'] as bool?,
|
||||
decimal: json['decimal'] as bool?,
|
||||
decimalPlaces: (json['decimal_places'] as num?)?.toInt(),
|
||||
type: json['type'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$TextFormFieldSDUIModelToJson(
|
||||
_TextFormFieldSDUIModel instance,
|
||||
) => <String, dynamic>{
|
||||
'key': instance.key,
|
||||
'label': instance.label,
|
||||
'hint_text': instance.hintText,
|
||||
'variant': instance.variant,
|
||||
'keyboard_type': instance.keyboardType,
|
||||
'value': instance.value,
|
||||
'max_length': instance.maxLength,
|
||||
'min_line': instance.minLine,
|
||||
'max_line': instance.maxLine,
|
||||
'required': instance.required,
|
||||
'enabled': instance.enabled,
|
||||
'readonly': instance.readonly,
|
||||
'comma_sperator': instance.commaSperator,
|
||||
'decimal': instance.decimal,
|
||||
'decimal_places': instance.decimalPlaces,
|
||||
'type': instance.type,
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"type": "text_form_field",
|
||||
|
||||
"data": {
|
||||
|
||||
"key": "user_full_name",
|
||||
"label": "نام و نام خانوادگی",
|
||||
"hintText": "لطفاً نام خود را وارد کنید",
|
||||
"variant": "normal",
|
||||
"keyboardType": "text",
|
||||
"maxLength": 100,
|
||||
"minLine":1,
|
||||
"maxLine":1,
|
||||
"required": true,
|
||||
"enabled": true,
|
||||
"readonly": true,
|
||||
"commaSperator":true,
|
||||
"decimal":true,
|
||||
"decimalPlaces":2,
|
||||
"type": "normal"
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// type => normal / date_picker /
|
||||
// keyboardType => text / number
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'model/text_form_field_sdui_model.dart';
|
||||
|
||||
Widget textFormFiledSDUI({required TextFormFieldSDUIModel model}) {
|
||||
List<TextInputFormatter>? inputFormatters = [];
|
||||
TextInputType? keyboardType;
|
||||
|
||||
if (model.keyboardType == 'text') {
|
||||
keyboardType = TextInputType.text;
|
||||
} else if (model.keyboardType == 'number') {
|
||||
keyboardType = TextInputType.numberWithOptions(
|
||||
decimal: model.decimal ?? false,
|
||||
);
|
||||
|
||||
inputFormatters.add(FilteringTextInputFormatter.digitsOnly);
|
||||
}
|
||||
|
||||
if (model.commaSperator ?? false) {
|
||||
inputFormatters.add(SeparatorInputFormatter());
|
||||
}
|
||||
|
||||
return RTextField(
|
||||
controller: TextEditingController(text: model.value),
|
||||
label: model.label,
|
||||
filled: true,
|
||||
filledColor: AppColor.bgLight,
|
||||
hintText: model.hintText,
|
||||
keyboardType: keyboardType,
|
||||
maxLength: model.maxLength,
|
||||
minLines: model.minLine,
|
||||
maxLines: model.maxLine,
|
||||
enabled: model.enabled ?? false,
|
||||
inputFormatters: inputFormatters,
|
||||
readonly: model.readonly ?? false,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user