1import 'package:connect/core/localization/app_localizations.dart';
2import 'package:connect/features/authentication/domain/entities/credentials_entity.dart';
3import 'package:flutter/material.dart';
4import 'package:flutter_bloc/flutter_bloc.dart';
5import 'package:flutter_screenutil/flutter_screenutil.dart';
6import 'package:flutter_svg/svg.dart';
7import 'package:hugeicons/hugeicons.dart';
9import '../../../../../../core/constants/assets.dart';
10import '../../../../../../core/ui/widgets/custom_text_form_field.dart';
11import '../../../logic/authentication_bloc/authentication_bloc.dart';
12import '../widgets/terms_and_conditions_checkbox.dart';
18 State<SignInFormView>
createState() => _SignInFormViewState();
21class _SignInFormViewState
extends State<SignInFormView> {
31 context.read<AuthenticationBloc>().add(LoadEmailEvent());
35 if (
_formKey.currentState!.validate()) {
36 context.read<AuthenticationBloc>().add(
48 Widget
build(BuildContext context) {
49 return BlocListener<AuthenticationBloc, AuthenticationState>(
50 listener: (context, state) {
51 if (state is EmailLoadedState) {
55 child: SingleChildScrollView(
65 padding: EdgeInsets.symmetric(vertical: 20.sp),
66 child: SvgPicture.asset(
68 colorFilter: ColorFilter.mode(
69 Theme.of(context).colorScheme.onSurface,
78 crossAxisAlignment: CrossAxisAlignment.center,
85 inputType: TextInputType.emailAddress,
87 suffix:
const Icon(HugeIcons.strokeRoundedMail02),
89 if (value == null || value.isEmpty) {
90 return AppLocalizations.of(context)
91 .translate(
'Email is required');
96 SizedBox(height: 15.sp),
105 if (value == null || value.isEmpty) {
106 return AppLocalizations.of(context)
107 .translate(
'Password is required');
119 ? HugeIcons.strokeRoundedViewOffSlash
120 : HugeIcons.strokeRoundedView,
124 SizedBox(height: 40.sp),
125 TermsAndConditionsCheckbox(
127 onCheckStatuschanged: (
value) {
133 SizedBox(height: 34.sp),
135 width: MediaQuery.of(context).size.width,
136 child: ElevatedButton(
AppLocalizations(this.locale)
const SignInEvent({required this.reqEntity})
sealed class AuthenticationEvent extends Equatable reqEntity
String translate(String key)
static AppLocalizations of(BuildContext context)
static const String headerLogo
override void initState()
override Widget build(BuildContext context)