Strings quase feitas
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../constants/app_colors.dart';
|
||||
import '../constants/app_strings.dart';
|
||||
import '../services/supabase_service.dart';
|
||||
import '../screens/logado_screen.dart';
|
||||
|
||||
@@ -33,7 +34,7 @@ class _EntrarSheetState extends State<EntrarSheet> {
|
||||
// Show success message above the sheet
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('Login realizado com sucesso!'),
|
||||
content: Text(AppStrings.loginSuccess),
|
||||
backgroundColor: Colors.green,
|
||||
),
|
||||
);
|
||||
@@ -66,7 +67,7 @@ class _EntrarSheetState extends State<EntrarSheet> {
|
||||
if (email.isEmpty) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('Por favor, insira seu email'),
|
||||
content: Text(AppStrings.validatorEmailEmpty),
|
||||
backgroundColor: Colors.orange,
|
||||
),
|
||||
);
|
||||
@@ -82,7 +83,7 @@ class _EntrarSheetState extends State<EntrarSheet> {
|
||||
// Show success message above the sheet
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('Email de redefinição enviado!'),
|
||||
content: Text(AppStrings.resetPasswordEmailSent),
|
||||
backgroundColor: Colors.green,
|
||||
),
|
||||
);
|
||||
@@ -151,7 +152,7 @@ class _EntrarSheetState extends State<EntrarSheet> {
|
||||
|
||||
// Title
|
||||
const Text(
|
||||
'Entrar',
|
||||
AppStrings.loginTitle,
|
||||
style: TextStyle(
|
||||
fontSize: 28,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -162,7 +163,7 @@ class _EntrarSheetState extends State<EntrarSheet> {
|
||||
|
||||
// Email field
|
||||
const Text(
|
||||
'Email',
|
||||
AppStrings.labelEmail,
|
||||
style: TextStyle(fontSize: 16, color: Colors.white70),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
@@ -177,16 +178,16 @@ class _EntrarSheetState extends State<EntrarSheet> {
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
hintText: 'seu@email.com',
|
||||
hintText: AppStrings.hintEmail,
|
||||
hintStyle: const TextStyle(color: Colors.white38),
|
||||
),
|
||||
style: const TextStyle(color: Colors.white),
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Por favor, insira seu email';
|
||||
return AppStrings.validatorEmailEmpty;
|
||||
}
|
||||
if (!value.contains('@')) {
|
||||
return 'Email inválido';
|
||||
return AppStrings.validatorEmailInvalid;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
@@ -196,7 +197,7 @@ class _EntrarSheetState extends State<EntrarSheet> {
|
||||
|
||||
// Password field
|
||||
const Text(
|
||||
'Senha',
|
||||
AppStrings.labelPassword,
|
||||
style: TextStyle(fontSize: 16, color: Colors.white70),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
@@ -210,16 +211,16 @@ class _EntrarSheetState extends State<EntrarSheet> {
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
hintText: '••••••••',
|
||||
hintText: AppStrings.hintPassword,
|
||||
hintStyle: const TextStyle(color: Colors.white38),
|
||||
),
|
||||
style: const TextStyle(color: Colors.white),
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Por favor, insira sua senha';
|
||||
return AppStrings.validatorPasswordEmpty;
|
||||
}
|
||||
if (value.length < 6) {
|
||||
return 'Senha deve ter pelo menos 6 caracteres';
|
||||
return AppStrings.validatorPasswordLength;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
@@ -245,7 +246,7 @@ class _EntrarSheetState extends State<EntrarSheet> {
|
||||
color: Colors.white,
|
||||
)
|
||||
: const Text(
|
||||
'Entrar',
|
||||
AppStrings.btnLogin,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
@@ -260,7 +261,7 @@ class _EntrarSheetState extends State<EntrarSheet> {
|
||||
child: TextButton(
|
||||
onPressed: _handlePasswordReset,
|
||||
child: const Text(
|
||||
'Esqueceu a senha?',
|
||||
AppStrings.forgotPassword,
|
||||
style: TextStyle(color: Colors.white70, fontSize: 16),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user