1import 'package:connect/features/authentication/domain/entities/credentials_entity.dart';
2import 'package:connect/features/authentication/presentation/screens/signin_screen/views/signin_form_view.dart';
3import 'package:connect/features/authentication/presentation/screens/signin_screen/views/signin_with_biometric_view.dart';
4import 'package:flutter/material.dart';
5import 'package:flutter_bloc/flutter_bloc.dart';
7import '../../../../../core/ui/widgets/custom_scaffold.dart';
8import '../../../../../core/ui/widgets/custom_snackbar.dart';
9import '../../logic/authentication_bloc/authentication_bloc.dart';
15 Widget
build(BuildContext context) {
16 return BlocConsumer<AuthenticationBloc, AuthenticationState>(
17 listenWhen: (previous, current) =>
20 listener: (context, state) {
22 if (state.credentials != null &&
23 state.credentials?.email != null &&
24 state.credentials?.password != null) {
25 context.read<AuthenticationBloc>().add(
28 email: state.credentials!.email!,
29 password: state.credentials!.password!,
39 state.failure.message,
43 builder: (context, state) => CustomScaffold(
44 isLoading: state is AuthenticatingState,
46 child: SingleChildScrollView(
50 SigninWithBiometricView(),
const SignInEvent({required this.reqEntity})
sealed class AuthenticationEvent extends Equatable reqEntity
const CredentialsLoadedState({required this.credentials})
const AuthenticationFailureState({required this.failure})
static display(final BuildContext context, final Color color, final String message,)