I am using BlocBuilder to create an account with firebase but it shows me the error message as a text, I need to show it in an alertdialog
BlocBuilder<AuthCubit, AuthState>( builder: (_, state) { return Form( key: _formKey, child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 30),
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
if (state is AuthSigningIn)
const Center(child: CircularProgressIndicator()),
if (state is AuthError)
Text(
state.message,
style: const TextStyle(color: Colors.red, fontSize: 24),
),
const SizedBox(height: 8),
TextField(
controller: _emailController,
decoration: const InputDecoration(labelText: 'Email'),
),
In this code I need a ShowDialog if (state is AuthError) Text( state.message, style: const TextStyle(color: Colors.red, fontSize: 24), ),