feat : module page

This commit is contained in:
2025-08-27 11:56:29 +03:30
parent 5ffda97e54
commit d3e5ab7d61
31 changed files with 1313 additions and 93 deletions

View File

@@ -0,0 +1,15 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'slider_model.freezed.dart';
part 'slider_model.g.dart';
@freezed
abstract class SliderModel with _$SliderModel {
const factory SliderModel({
List<String>? up,
List<String>? down,
}) = _SliderModel;
factory SliderModel.fromJson(Map<String, dynamic> json) =>
_$SliderModelFromJson(json);
}

View File

@@ -0,0 +1,296 @@
// 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 'slider_model.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$SliderModel {
List<String>? get up; List<String>? get down;
/// Create a copy of SliderModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$SliderModelCopyWith<SliderModel> get copyWith => _$SliderModelCopyWithImpl<SliderModel>(this as SliderModel, _$identity);
/// Serializes this SliderModel to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is SliderModel&&const DeepCollectionEquality().equals(other.up, up)&&const DeepCollectionEquality().equals(other.down, down));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(up),const DeepCollectionEquality().hash(down));
@override
String toString() {
return 'SliderModel(up: $up, down: $down)';
}
}
/// @nodoc
abstract mixin class $SliderModelCopyWith<$Res> {
factory $SliderModelCopyWith(SliderModel value, $Res Function(SliderModel) _then) = _$SliderModelCopyWithImpl;
@useResult
$Res call({
List<String>? up, List<String>? down
});
}
/// @nodoc
class _$SliderModelCopyWithImpl<$Res>
implements $SliderModelCopyWith<$Res> {
_$SliderModelCopyWithImpl(this._self, this._then);
final SliderModel _self;
final $Res Function(SliderModel) _then;
/// Create a copy of SliderModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? up = freezed,Object? down = freezed,}) {
return _then(_self.copyWith(
up: freezed == up ? _self.up : up // ignore: cast_nullable_to_non_nullable
as List<String>?,down: freezed == down ? _self.down : down // ignore: cast_nullable_to_non_nullable
as List<String>?,
));
}
}
/// Adds pattern-matching-related methods to [SliderModel].
extension SliderModelPatterns on SliderModel {
/// 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( _SliderModel value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _SliderModel() 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( _SliderModel value) $default,){
final _that = this;
switch (_that) {
case _SliderModel():
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( _SliderModel value)? $default,){
final _that = this;
switch (_that) {
case _SliderModel() 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( List<String>? up, List<String>? down)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _SliderModel() when $default != null:
return $default(_that.up,_that.down);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( List<String>? up, List<String>? down) $default,) {final _that = this;
switch (_that) {
case _SliderModel():
return $default(_that.up,_that.down);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( List<String>? up, List<String>? down)? $default,) {final _that = this;
switch (_that) {
case _SliderModel() when $default != null:
return $default(_that.up,_that.down);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _SliderModel implements SliderModel {
const _SliderModel({final List<String>? up, final List<String>? down}): _up = up,_down = down;
factory _SliderModel.fromJson(Map<String, dynamic> json) => _$SliderModelFromJson(json);
final List<String>? _up;
@override List<String>? get up {
final value = _up;
if (value == null) return null;
if (_up is EqualUnmodifiableListView) return _up;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(value);
}
final List<String>? _down;
@override List<String>? get down {
final value = _down;
if (value == null) return null;
if (_down is EqualUnmodifiableListView) return _down;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(value);
}
/// Create a copy of SliderModel
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$SliderModelCopyWith<_SliderModel> get copyWith => __$SliderModelCopyWithImpl<_SliderModel>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$SliderModelToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SliderModel&&const DeepCollectionEquality().equals(other._up, _up)&&const DeepCollectionEquality().equals(other._down, _down));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_up),const DeepCollectionEquality().hash(_down));
@override
String toString() {
return 'SliderModel(up: $up, down: $down)';
}
}
/// @nodoc
abstract mixin class _$SliderModelCopyWith<$Res> implements $SliderModelCopyWith<$Res> {
factory _$SliderModelCopyWith(_SliderModel value, $Res Function(_SliderModel) _then) = __$SliderModelCopyWithImpl;
@override @useResult
$Res call({
List<String>? up, List<String>? down
});
}
/// @nodoc
class __$SliderModelCopyWithImpl<$Res>
implements _$SliderModelCopyWith<$Res> {
__$SliderModelCopyWithImpl(this._self, this._then);
final _SliderModel _self;
final $Res Function(_SliderModel) _then;
/// Create a copy of SliderModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? up = freezed,Object? down = freezed,}) {
return _then(_SliderModel(
up: freezed == up ? _self._up : up // ignore: cast_nullable_to_non_nullable
as List<String>?,down: freezed == down ? _self._down : down // ignore: cast_nullable_to_non_nullable
as List<String>?,
));
}
}
// dart format on

View File

@@ -0,0 +1,15 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'slider_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_SliderModel _$SliderModelFromJson(Map<String, dynamic> json) => _SliderModel(
up: (json['up'] as List<dynamic>?)?.map((e) => e as String).toList(),
down: (json['down'] as List<dynamic>?)?.map((e) => e as String).toList(),
);
Map<String, dynamic> _$SliderModelToJson(_SliderModel instance) =>
<String, dynamic>{'up': instance.up, 'down': instance.down};