forked from eatvio/eatvio_app
go router fix
This commit is contained in:
@@ -21,7 +21,9 @@ class AuthScreen extends StatelessWidget {
|
||||
AuthState(
|
||||
authModelObj: AuthModel(),
|
||||
),
|
||||
)..add(AuthInitialEvent()),
|
||||
)..add(
|
||||
AuthInitialEvent(),
|
||||
),
|
||||
child: AuthScreen(),
|
||||
);
|
||||
}
|
||||
@@ -61,10 +63,11 @@ class AuthScreen extends StatelessWidget {
|
||||
}),
|
||||
SizedBox(height: 50.v),
|
||||
NextStepButton(
|
||||
text: "no_account".tr.toUpperCase(),
|
||||
margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v),
|
||||
buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
|
||||
onPressed: onTapNoAccount(context)),
|
||||
text: "no_account".tr.toUpperCase(),
|
||||
margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v),
|
||||
buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
|
||||
onPressed: onTapNoAccount(context),
|
||||
),
|
||||
/*NextStepButton(
|
||||
text: "Тест дневника".toUpperCase(),
|
||||
margin:
|
||||
@@ -143,13 +146,29 @@ class AuthScreen extends StatelessWidget {
|
||||
};
|
||||
}
|
||||
|
||||
onTapOk(BuildContext context) => GoRouter.of(context).pop(context);
|
||||
onTapOk(BuildContext context) {
|
||||
return () {
|
||||
GoRouter.of(context).pop(context);
|
||||
};
|
||||
}
|
||||
|
||||
onTapDiaryTest(BuildContext context) => GoRouter.of(context).goNamed('diaryScreen');
|
||||
onTapDiaryTest(BuildContext context) {
|
||||
return () {
|
||||
GoRouter.of(context).goNamed('diaryScreen');
|
||||
};
|
||||
}
|
||||
|
||||
onTapProfileTest(BuildContext context) => GoRouter.of(context).goNamed('mySettingsScreen');
|
||||
onTapProfileTest(BuildContext context) {
|
||||
return () {
|
||||
GoRouter.of(context).goNamed('mySettingsScreen');
|
||||
};
|
||||
}
|
||||
|
||||
onTapNoAccount(BuildContext context) => GoRouter.of(context).goNamed('languageSelectScreen');
|
||||
onTapNoAccount(BuildContext context) {
|
||||
return () {
|
||||
GoRouter.of(context).goNamed('languageSelectScreen');
|
||||
};
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
_buildAppBar(BuildContext context) {
|
||||
|
||||
@@ -2,7 +2,9 @@ import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/auth/auth_screen/models/auth_model.dart';
|
||||
|
||||
part 'auth_event.dart';
|
||||
|
||||
part 'auth_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a Auth according to the event that is dispatched to it.
|
||||
@@ -15,8 +17,11 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
AuthInitialEvent event,
|
||||
Emitter<AuthState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(
|
||||
emit(
|
||||
state.copyWith(
|
||||
emailController: TextEditingController(),
|
||||
passwordController: TextEditingController()));
|
||||
passwordController: TextEditingController(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user