forked from eatvio/eatvio_app
added plan pagination and updated plans creation screen
This commit is contained in:
11
lib/features/plans/presentation/cubit/about_plan_cubit.dart
Normal file
11
lib/features/plans/presentation/cubit/about_plan_cubit.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
import 'package:eatvio_app/features/plans/presentation/cubit/about_plan_state.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
class AboutPlanCubit extends Cubit<AboutPlanState> {
|
||||
AboutPlanCubit() : super(AboutPlanState.initial());
|
||||
|
||||
|
||||
Future<void> getPlan() async{
|
||||
|
||||
}
|
||||
}
|
||||
18
lib/features/plans/presentation/cubit/about_plan_state.dart
Normal file
18
lib/features/plans/presentation/cubit/about_plan_state.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
|
||||
import 'package:eatvio_app/features/feed/models/plan_pagination_model.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'about_plan_state.freezed.dart';
|
||||
|
||||
@freezed
|
||||
class AboutPlanState with _$AboutPlanState {
|
||||
|
||||
const factory AboutPlanState({
|
||||
required bool isLoading,
|
||||
required String? error,
|
||||
required PlanModel? planModel,
|
||||
}) = _AboutPlanState;
|
||||
|
||||
factory AboutPlanState.initial() => const AboutPlanState(isLoading: false, error: null, planModel: null);
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// 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 'about_plan_state.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$AboutPlanState {
|
||||
bool get isLoading => throw _privateConstructorUsedError;
|
||||
String? get error => throw _privateConstructorUsedError;
|
||||
PlanModel? get planModel => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of AboutPlanState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$AboutPlanStateCopyWith<AboutPlanState> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $AboutPlanStateCopyWith<$Res> {
|
||||
factory $AboutPlanStateCopyWith(
|
||||
AboutPlanState value, $Res Function(AboutPlanState) then) =
|
||||
_$AboutPlanStateCopyWithImpl<$Res, AboutPlanState>;
|
||||
@useResult
|
||||
$Res call({bool isLoading, String? error, PlanModel? planModel});
|
||||
|
||||
$PlanModelCopyWith<$Res>? get planModel;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$AboutPlanStateCopyWithImpl<$Res, $Val extends AboutPlanState>
|
||||
implements $AboutPlanStateCopyWith<$Res> {
|
||||
_$AboutPlanStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of AboutPlanState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? isLoading = null,
|
||||
Object? error = freezed,
|
||||
Object? planModel = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
isLoading: null == isLoading
|
||||
? _value.isLoading
|
||||
: isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
error: freezed == error
|
||||
? _value.error
|
||||
: error // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
planModel: freezed == planModel
|
||||
? _value.planModel
|
||||
: planModel // ignore: cast_nullable_to_non_nullable
|
||||
as PlanModel?,
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
/// Create a copy of AboutPlanState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$PlanModelCopyWith<$Res>? get planModel {
|
||||
if (_value.planModel == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $PlanModelCopyWith<$Res>(_value.planModel!, (value) {
|
||||
return _then(_value.copyWith(planModel: value) as $Val);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$AboutPlanStateImplCopyWith<$Res>
|
||||
implements $AboutPlanStateCopyWith<$Res> {
|
||||
factory _$$AboutPlanStateImplCopyWith(_$AboutPlanStateImpl value,
|
||||
$Res Function(_$AboutPlanStateImpl) then) =
|
||||
__$$AboutPlanStateImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({bool isLoading, String? error, PlanModel? planModel});
|
||||
|
||||
@override
|
||||
$PlanModelCopyWith<$Res>? get planModel;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$AboutPlanStateImplCopyWithImpl<$Res>
|
||||
extends _$AboutPlanStateCopyWithImpl<$Res, _$AboutPlanStateImpl>
|
||||
implements _$$AboutPlanStateImplCopyWith<$Res> {
|
||||
__$$AboutPlanStateImplCopyWithImpl(
|
||||
_$AboutPlanStateImpl _value, $Res Function(_$AboutPlanStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of AboutPlanState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? isLoading = null,
|
||||
Object? error = freezed,
|
||||
Object? planModel = freezed,
|
||||
}) {
|
||||
return _then(_$AboutPlanStateImpl(
|
||||
isLoading: null == isLoading
|
||||
? _value.isLoading
|
||||
: isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
error: freezed == error
|
||||
? _value.error
|
||||
: error // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
planModel: freezed == planModel
|
||||
? _value.planModel
|
||||
: planModel // ignore: cast_nullable_to_non_nullable
|
||||
as PlanModel?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$AboutPlanStateImpl implements _AboutPlanState {
|
||||
const _$AboutPlanStateImpl(
|
||||
{required this.isLoading, required this.error, required this.planModel});
|
||||
|
||||
@override
|
||||
final bool isLoading;
|
||||
@override
|
||||
final String? error;
|
||||
@override
|
||||
final PlanModel? planModel;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AboutPlanState(isLoading: $isLoading, error: $error, planModel: $planModel)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$AboutPlanStateImpl &&
|
||||
(identical(other.isLoading, isLoading) ||
|
||||
other.isLoading == isLoading) &&
|
||||
(identical(other.error, error) || other.error == error) &&
|
||||
(identical(other.planModel, planModel) ||
|
||||
other.planModel == planModel));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, isLoading, error, planModel);
|
||||
|
||||
/// Create a copy of AboutPlanState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$AboutPlanStateImplCopyWith<_$AboutPlanStateImpl> get copyWith =>
|
||||
__$$AboutPlanStateImplCopyWithImpl<_$AboutPlanStateImpl>(
|
||||
this, _$identity);
|
||||
}
|
||||
|
||||
abstract class _AboutPlanState implements AboutPlanState {
|
||||
const factory _AboutPlanState(
|
||||
{required final bool isLoading,
|
||||
required final String? error,
|
||||
required final PlanModel? planModel}) = _$AboutPlanStateImpl;
|
||||
|
||||
@override
|
||||
bool get isLoading;
|
||||
@override
|
||||
String? get error;
|
||||
@override
|
||||
PlanModel? get planModel;
|
||||
|
||||
/// Create a copy of AboutPlanState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$AboutPlanStateImplCopyWith<_$AboutPlanStateImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
Reference in New Issue
Block a user