Strings quase feitas

This commit is contained in:
2026-03-18 16:20:18 +00:00
parent 7f80ed47f3
commit 6322e8d798
8 changed files with 324 additions and 228 deletions

View File

@@ -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),
),
),

View File

@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import '../services/supabase_service.dart';
import '../constants/app_colors.dart';
import '../constants/app_strings.dart';
import '../screens/logado_screen.dart';
class RegistrarSheet extends StatefulWidget {
@@ -39,8 +40,8 @@ class _RegistrarSheetState extends State<RegistrarSheet> {
// Show success message above the sheet
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Conta criada com sucesso! Verifique seu email.'),
SnackBar(
content: Text(AppStrings.registerSuccess),
backgroundColor: Colors.green,
),
);
@@ -133,9 +134,9 @@ class _RegistrarSheetState extends State<RegistrarSheet> {
const SizedBox(height: 24),
// Title
const Text(
'Registrar',
style: TextStyle(
Text(
AppStrings.registerTitle,
style: const TextStyle(
fontSize: 28,
fontWeight: FontWeight.bold,
color: Colors.white,
@@ -144,9 +145,9 @@ class _RegistrarSheetState extends State<RegistrarSheet> {
const SizedBox(height: 32),
// Name field
const Text(
'Nome',
style: TextStyle(fontSize: 16, color: Colors.white70),
Text(
AppStrings.labelName,
style: const TextStyle(fontSize: 16, color: Colors.white70),
),
const SizedBox(height: 8),
TextFormField(
@@ -158,16 +159,16 @@ class _RegistrarSheetState extends State<RegistrarSheet> {
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide.none,
),
hintText: 'Seu nome completo',
hintText: AppStrings.hintName,
hintStyle: const TextStyle(color: Colors.white38),
),
style: const TextStyle(color: Colors.white),
validator: (value) {
if (value == null || value.isEmpty) {
return 'Por favor, insira seu nome';
return AppStrings.validatorNameEmpty;
}
if (value.length < 3) {
return 'Nome deve ter pelo menos 3 caracteres';
return AppStrings.validatorNameLength;
}
return null;
},
@@ -175,9 +176,9 @@ class _RegistrarSheetState extends State<RegistrarSheet> {
const SizedBox(height: 20),
// Email field
const Text(
'Email',
style: TextStyle(fontSize: 16, color: Colors.white70),
Text(
AppStrings.labelEmail,
style: const TextStyle(fontSize: 16, color: Colors.white70),
),
const SizedBox(height: 8),
TextFormField(
@@ -189,16 +190,16 @@ class _RegistrarSheetState extends State<RegistrarSheet> {
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;
},
@@ -206,9 +207,9 @@ class _RegistrarSheetState extends State<RegistrarSheet> {
const SizedBox(height: 20),
// Password field
const Text(
'Senha',
style: TextStyle(fontSize: 16, color: Colors.white70),
Text(
AppStrings.labelPassword,
style: const TextStyle(fontSize: 16, color: Colors.white70),
),
const SizedBox(height: 8),
TextFormField(
@@ -221,16 +222,16 @@ class _RegistrarSheetState extends State<RegistrarSheet> {
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;
},
@@ -238,9 +239,9 @@ class _RegistrarSheetState extends State<RegistrarSheet> {
const SizedBox(height: 20),
// Confirm password field
const Text(
'Confirmar Senha',
style: TextStyle(fontSize: 16, color: Colors.white70),
Text(
AppStrings.labelConfirmPassword,
style: const TextStyle(fontSize: 16, color: Colors.white70),
),
const SizedBox(height: 8),
TextFormField(
@@ -253,16 +254,16 @@ class _RegistrarSheetState extends State<RegistrarSheet> {
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, confirme sua senha';
return AppStrings.validatorConfirmPasswordEmpty;
}
if (value != _passwordController.text) {
return 'Senhas não coincidem';
return AppStrings.validatorConfirmPasswordMatch;
}
return null;
},
@@ -285,16 +286,16 @@ class _RegistrarSheetState extends State<RegistrarSheet> {
),
child: _isLoading
? const CircularProgressIndicator(color: Colors.white)
: const Text(
'Registrar',
style: TextStyle(
: Text(
AppStrings.btnRegister,
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
),
),
SizedBox(height: 40),
const SizedBox(height: 40),
],
),
);