Strings quase feitas
This commit is contained in:
@@ -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),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user