forked from eatvio/eatvio_app
Some further logic fixes
This commit is contained in:
@@ -16,7 +16,7 @@ class CredentialsBloc extends Bloc<CredentialsEvent, CredentialsState> {
|
||||
Emitter<CredentialsState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(
|
||||
emailController: TextEditingController(),
|
||||
valueController: TextEditingController(),
|
||||
passwordController: TextEditingController(),
|
||||
passwordConfirmationController: TextEditingController()));
|
||||
}
|
||||
|
||||
@@ -5,13 +5,13 @@ part of 'credentials_bloc.dart';
|
||||
/// Represents the state of Credentials in the application.
|
||||
class CredentialsState extends Equatable {
|
||||
CredentialsState({
|
||||
this.emailController,
|
||||
this.valueController,
|
||||
this.passwordController,
|
||||
this.passwordConfirmationController,
|
||||
this.credentialsModelObj,
|
||||
});
|
||||
|
||||
TextEditingController? emailController;
|
||||
TextEditingController? valueController;
|
||||
|
||||
TextEditingController? passwordController;
|
||||
|
||||
@@ -21,19 +21,19 @@ class CredentialsState extends Equatable {
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
emailController,
|
||||
valueController,
|
||||
passwordController,
|
||||
passwordConfirmationController,
|
||||
credentialsModelObj,
|
||||
];
|
||||
CredentialsState copyWith({
|
||||
TextEditingController? emailController,
|
||||
TextEditingController? valueController,
|
||||
TextEditingController? passwordController,
|
||||
TextEditingController? passwordConfirmationController,
|
||||
CredentialsModel? credentialsModelObj,
|
||||
}) {
|
||||
return CredentialsState(
|
||||
emailController: emailController ?? this.emailController,
|
||||
valueController: valueController ?? this.valueController,
|
||||
passwordController: passwordController ?? this.passwordController,
|
||||
passwordConfirmationController:
|
||||
passwordConfirmationController ?? this.passwordConfirmationController,
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||
|
||||
import 'bloc/credentials_bloc.dart';
|
||||
import 'models/credentials_model.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/appbar_title_image.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/custom_app_bar.dart';
|
||||
import 'package:eatvio_app/widgets/custom_outlined_button.dart';
|
||||
import 'package:eatvio_app/widgets/next_step_button.dart';
|
||||
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -55,10 +57,10 @@ class CredentialsScreen extends StatelessWidget {
|
||||
SizedBox(height: 3.v),
|
||||
BlocSelector<CredentialsBloc, CredentialsState,
|
||||
TextEditingController?>(
|
||||
selector: (state) => state.passwordController,
|
||||
builder: (context, passwordController) {
|
||||
selector: (state) => state.valueController,
|
||||
builder: (context, valueController) {
|
||||
return CustomTextFormField(
|
||||
controller: passwordController,
|
||||
controller: valueController,
|
||||
textInputAction: TextInputAction.done);
|
||||
}),
|
||||
SizedBox(height: 19.v),
|
||||
@@ -66,11 +68,11 @@ class CredentialsScreen extends StatelessWidget {
|
||||
SizedBox(height: 5.v),
|
||||
BlocSelector<CredentialsBloc, CredentialsState,
|
||||
TextEditingController?>(
|
||||
selector: (state) => state.passwordConfirmationController,
|
||||
builder: (context, passwordConfirmationController) {
|
||||
selector: (state) => state.passwordController,
|
||||
builder: (context, passwordController) {
|
||||
return CustomTextFormField(
|
||||
obscureText: true,
|
||||
controller: passwordConfirmationController,
|
||||
controller: passwordController,
|
||||
);
|
||||
}),
|
||||
SizedBox(height: 21.v),
|
||||
@@ -79,15 +81,15 @@ class CredentialsScreen extends StatelessWidget {
|
||||
SizedBox(height: 3.v),
|
||||
BlocSelector<CredentialsBloc, CredentialsState,
|
||||
TextEditingController?>(
|
||||
selector: (state) => state.emailController,
|
||||
builder: (context, emailController3) {
|
||||
selector: (state) => state.passwordConfirmationController,
|
||||
builder: (context, passwordConfirmationController) {
|
||||
return CustomTextFormField(
|
||||
obscureText: true,
|
||||
controller: emailController3,
|
||||
controller: passwordConfirmationController,
|
||||
textInputAction: TextInputAction.done);
|
||||
}),
|
||||
Spacer(),
|
||||
CustomOutlinedButton(
|
||||
NextStepButton(
|
||||
text: "continue".tr.toUpperCase(),
|
||||
buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
|
||||
onPressed: () {
|
||||
|
||||
Reference in New Issue
Block a user