diff --git a/lib/constants/app_strings.dart b/lib/constants/app_strings.dart index e985c5a..1aed80a 100644 --- a/lib/constants/app_strings.dart +++ b/lib/constants/app_strings.dart @@ -1,84 +1,170 @@ +enum AppLanguage { pt, en, es } + class AppStrings { + static AppLanguage _currentLanguage = AppLanguage.pt; + + static void setLanguage(String language) { + if (language == 'English') { + _currentLanguage = AppLanguage.en; + } else if (language == 'Español') { + _currentLanguage = AppLanguage.es; + } else { + _currentLanguage = AppLanguage.pt; + } + } + + static String get _lang => _currentLanguage.name; + + static String _get(Map values) => values[_lang] ?? values['pt']!; + // Main Screen - static const String complete = "COMPLETO"; - static const String steps = "PASSOS"; - static const String bpm = "BPM"; - static const String kcal = "K/CAL"; - static const String mapPreview = "MAPA"; - static const String settings = "Configurações"; - static const String groups = "Grupos"; - static const String history = "Histórico"; - static const String notifications = "Notificações"; - static const String profile = "Perfil"; - static const String welcome = "Bem-vindo"; - static const String myActivities = "Minhas Atividades"; - static const String bestDistance = "Melhor Distância"; - static const String bestSpeed = "Velocidade Máxima"; - static const String connectDevice = "Conectar Dispositivo"; - static const String viewMap = "Ver Mapa"; - static const String dailyGoal = "Meta Diária"; - static const String startTraining = "INICIAR TREINO"; + static String get complete => _get({'pt': "COMPLETO", 'en': "COMPLETE", 'es': "COMPLETO"}); + static String get steps => _get({'pt': "PASSOS", 'en': "STEPS", 'es': "PASOS"}); + static String get bpm => _get({'pt': "BPM", 'en': "BPM", 'es': "BPM"}); + static String get kcal => _get({'pt': "K/CAL", 'en': "K/CAL", 'es': "K/CAL"}); + static String get mapPreview => _get({'pt': "MAPA", 'en': "MAP", 'es': "MAPA"}); + static String get settings => _get({'pt': "Configurações", 'en': "Settings", 'es': "Configuración"}); + static String get groups => _get({'pt': "Grupos", 'en': "Groups", 'es': "Grupos"}); + static String get history => _get({'pt': "Histórico", 'en': "History", 'es': "Historial"}); + static String get notifications => _get({'pt': "Notificações", 'en': "Notifications", 'es': "Notificaciones"}); + static String get profile => _get({'pt': "Perfil", 'en': "Profile", 'es': "Perfil"}); + static String get welcome => _get({'pt': "Bem-vindo", 'en': "Welcome", 'es': "Bienvenido"}); + static String get myActivities => _get({'pt': "Minhas Atividades", 'en': "My Activities", 'es': "Mis Actividades"}); + static String get bestDistance => _get({'pt': "Melhor Distância", 'en': "Best Distance", 'es': "Mejor Distancia"}); + static String get bestSpeed => _get({'pt': "Velocidade Máxima", 'en': "Max Speed", 'es': "Velocidad Máxima"}); + static String get connectDevice => _get({'pt': "Conectar Dispositivo", 'en': "Connect Device", 'es': "Conectar Dispositivo"}); + static String get viewMap => _get({'pt': "Ver Mapa", 'en': "View Map", 'es': "Ver Mapa"}); + static String get dailyGoal => _get({'pt': "Meta Diária", 'en': "Daily Goal", 'es': "Meta Diaria"}); + static String get startTraining => _get({'pt': "INICIAR TREINO", 'en': "START TRAINING", 'es': "INICIAR ENTRENAMIENTO"}); + static String get generalActivity => _get({'pt': "ATIVIDADE GERAL", 'en': "GENERAL ACTIVITY", 'es': "ACTIVIDAD GENERAL"}); + static String get personalRecords => _get({'pt': "RECORDS PESSOAIS", 'en': "PERSONAL RECORDS", 'es': "RÉCORDS PERSONALES"}); + static String get stepsToday => _get({'pt': "passos hoje", 'en': "steps today", 'es': "pasos hoy"}); + static String get setGoal => _get({'pt': "DEFINIR META", 'en': "SET GOAL", 'es': "DEFINIR META"}); + static String get distance => _get({'pt': "DISTÂNCIA", 'en': "DISTANCE", 'es': "DISTANCIA"}); + static String get time => _get({'pt': "TEMPO", 'en': "TIME", 'es': "TIEMPO"}); // Bluetooth Screen - static const String bluetoothTitle = "DISPOSITIVOS"; - static const String bluetoothConnect = "CONECTAR BLUETOOTH"; - static const String stopSearch = "PARAR BUSCA"; - static const String startSearch = "BUSCAR AGORA"; - static const String searching = "STATUS: BUSCANDO..."; - static const String statusReady = "STATUS: PRONTO"; - static const String statusConnected = "STATUS: CONECTADO"; - static const String nearbyDevices = "Dispositivos próximos"; - static const String active = "ATIVO"; - static const String startSearchInstruction = "Inicie a busca para conectar"; - static const String connect = "CONECTAR"; - static const String noDevicesFound = "Nenhum dispositivo encontrado."; - static const String foundDevices = "Encontrados"; - static const String oneDevice = "1 Dispositivo"; - static const String permissionsDenied = "Permissões de Bluetooth negadas."; - static const String turnOnBluetooth = - "Ligue o Bluetooth para buscar dispositivos."; - static const String scanError = "Erro ao iniciar scan: "; - static const String stopScanError = "Erro ao parar scan: "; - static const String defaultDeviceName = "Dispositivo"; - static const String connectingTo = "Conectando a "; - static const String connectedSuccess = "Conectado com sucesso!"; - static const String connectFail = "Falha ao conectar: "; - static const String deviceIdPrefix = "Disp. ["; - static const String unknownDevice = "Dispositivo Desconhecido"; + static String get bluetoothTitle => _get({'pt': "DISPOSITIVOS", 'en': "DEVICES", 'es': "DISPOSITIVOS"}); + static String get bluetoothConnect => _get({'pt': "CONECTAR BLUETOOTH", 'en': "CONNECT BLUETOOTH", 'es': "CONECTAR BLUETOOTH"}); + static String get stopSearch => _get({'pt': "PARAR BUSCA", 'en': "STOP SEARCH", 'es': "DETENER BÚSQUEDA"}); + static String get startSearch => _get({'pt': "BUSCAR AGORA", 'en': "SEARCH NOW", 'es': "BUSCAR AHORA"}); + static String get searching => _get({'pt': "STATUS: BUSCANDO...", 'en': "STATUS: SEARCHING...", 'es': "ESTADO: BUSCANDO..."}); + static String get statusReady => _get({'pt': "STATUS: PRONTO", 'en': "STATUS: READY", 'es': "ESTADO: LISTO"}); + static String get statusConnected => _get({'pt': "STATUS: CONECTADO", 'en': "STATUS: CONNECTED", 'es': "ESTADO: CONECTADO"}); + static String get nearbyDevices => _get({'pt': "Dispositivos próximos", 'en': "Nearby devices", 'es': "Dispositivos cercanos"}); + static String get active => _get({'pt': "ATIVO", 'en': "ACTIVE", 'es': "ACTIVO"}); + static String get startSearchInstruction => _get({'pt': "Inicie a busca para conectar", 'en': "Start search to connect", 'es': "Inicie la búsqueda para conectar"}); + static String get connect => _get({'pt': "CONECTAR", 'en': "CONNECT", 'es': "CONECTAR"}); + static String get noDevicesFound => _get({'pt': "Nenhum dispositivo encontrado.", 'en': "No devices found.", 'es': "No se encontraron dispositivos."}); + static String get foundDevices => _get({'pt': "Encontrados", 'en': "Found", 'es': "Encontrados"}); + static String get oneDevice => _get({'pt': "1 Dispositivo", 'en': "1 Device", 'es': "1 Dispositivo"}); + static String get permissionsDenied => _get({'pt': "Permissões de Bluetooth negadas.", 'en': "Bluetooth permissions denied.", 'es': "Permisos de Bluetooth denegados."}); + static String get turnOnBluetooth => _get({'pt': "Ligue o Bluetooth para buscar dispositivos.", 'en': "Turn on Bluetooth to search for devices.", 'es': "Active el Bluetooth para buscar dispositivos."}); + static String get scanError => _get({'pt': "Erro ao iniciar scan: ", 'en': "Error starting scan: ", 'es': "Error al iniciar el escaneo: "}); + static String get stopScanError => _get({'pt': "Erro ao parar scan: ", 'en': "Error stopping scan: ", 'es': "Error al detener el escaneo: "}); + static String get defaultDeviceName => _get({'pt': "Dispositivo", 'en': "Device", 'es': "Dispositivo"}); + static String get connectingTo => _get({'pt': "Conectando a ", 'en': "Connecting to ", 'es': "Conectando a "}); + static String get connectedSuccess => _get({'pt': "Conectado com sucesso!", 'en': "Connected successfully!", 'es': "¡Conectado con éxito!"}); + static String get connectFail => _get({'pt': "Falha ao conectar: ", 'en': "Failed to connect: ", 'es': "Error al conectar: "}); + static String get deviceIdPrefix => _get({'pt': "Disp. [", 'en': "Dev. [", 'es': "Disp. ["}); + static String get unknownDevice => _get({'pt': "Dispositivo Desconhecido", 'en': "Unknown Device", 'es': "Dispositivo Desconhecido"}); + static String get permissionsNeeded => _get({'pt': "Permissões Necessárias", 'en': "Permissions Needed", 'es': "Permisos Necesarios"}); + static String get permissionsDeniedPermanent => _get({ + 'pt': "As permissões de Bluetooth foram negadas permanentemente. Por favor, habilite-as nas configurações do sistema para continuar.", + 'en': "Bluetooth permissions were permanently denied. Please enable them in system settings to continue.", + 'es': "Los permisos de Bluetooth han sido denegados permanentemente. Por favor, habilítelos en la configuración del sistema para continuar." + }); // Map Screen - static const String mapTitleTracking = "TRACKING ATIVO"; - static const String mapTitlePlanning = "PLANEJAR TRAJETO"; - static const String mapTitleRunning = "CORRIDA"; - static const String mapPace = "RITMO"; - static const String mapRoute = "TRAJETO"; - static const String mapTime = "TEMPO"; - static const String kmhUnit = "KM/H"; - static const String kmUnit = "KM"; - static const String metersUnit = "m"; - static const String planningInstruction = "Toque para definir Início e Fim"; - static const String btnStop = "PARAR"; - static const String btnSimulate = "SIMULAR"; - static const String btnStartRun = "INICIAR CORRIDA"; - static const String btnStopRun = "PARAR CORRIDA"; - static const String startPoint = "Partida"; - static const String finishPoint = "Chegada"; - static const String markDestination = "Marcar Destino"; - static const String chooseRoute = "Escolher Rota"; - static const String confirmDestination = "Confirmar Destino?"; - static const String startRunQuestion = "Iniciar Corrida?"; - static const String startRunDescription = "Deseja começar o monitoramento agora?"; - static const String prepare = "PREPARAR"; - static const String maxSpeed = "VELOCIDADE MÁX"; - static const String cancel = "Cancelar"; - static const String yes = "Sim"; - static const String runFinished = "Corrida Finalizada!"; - static const String totalDistance = "Distância Total"; - static const String totalTime = "Tempo Total"; - static const String close = "Fechar"; + static String get mapTitleTracking => _get({'pt': "TRACKING ATIVO", 'en': "ACTIVE TRACKING", 'es': "SEGUIMIENTO ACTIVO"}); + static String get mapTitlePlanning => _get({'pt': "PLANEJAR TRAJETO", 'en': "PLAN ROUTE", 'es': "PLANIFICAR TRAYECTO"}); + static String get mapTitleRunning => _get({'pt': "CORRIDA", 'en': "RUN", 'es': "CARRERA"}); + static String get mapPace => _get({'pt': "RITMO", 'en': "PACE", 'es': "RITMO"}); + static String get mapRoute => _get({'pt': "TRAJETO", 'en': "ROUTE", 'es': "TRAYECTO"}); + static String get mapTime => _get({'pt': "TEMPO", 'en': "TIME", 'es': "TIEMPO"}); + static String get kmhUnit => _get({'pt': "KM/H", 'en': "KM/H", 'es': "KM/H"}); + static String get kmUnit => _get({'pt': "KM", 'en': "KM", 'es': "KM"}); + static String get metersUnit => _get({'pt': "m", 'en': "m", 'es': "m"}); + static String get planningInstruction => _get({'pt': "Toque para definir Início e Fim", 'en': "Tap to set Start and Finish", 'es': "Toque para definir Inicio y Fin"}); + static String get btnStop => _get({'pt': "PARAR", 'en': "STOP", 'es': "PARAR"}); + static String get btnSimulate => _get({'pt': "SIMULAR", 'en': "SIMULATE", 'es': "SIMULAR"}); + static String get btnStartRun => _get({'pt': "INICIAR CORRIDA", 'en': "START RUN", 'es': "INICIAR CARRERA"}); + static String get btnStopRun => _get({'pt': "PARAR CORRIDA", 'en': "STOP RUN", 'es': "PARAR CARRERA"}); + static String get startPoint => _get({'pt': "Partida", 'en': "Start", 'es': "Salida"}); + static String get finishPoint => _get({'pt': "Chegada", 'en': "Finish", 'es': "Llegada"}); + static String get markDestination => _get({'pt': "Marcar Destino", 'en': "Mark Destination", 'es': "Marcar Destino"}); + static String get chooseRoute => _get({'pt': "Escolher Rota", 'en': "Choose Route", 'es': "Elegir Ruta"}); + static String get confirmDestination => _get({'pt': "Confirmar Destino?", 'en': "Confirm Destination?", 'es': "¿Confirmar Destino?"}); + static String get startRunQuestion => _get({'pt': "Iniciar Corrida?", 'en': "Start Run?", 'es': "¿Iniciar Carrera?"}); + static String get startRunDescription => _get({'pt': "Deseja começar o monitoramento agora?", 'en': "Do you want to start monitoring now?", 'es': "¿Desea comenzar el monitoreo ahora?"}); + static String get prepare => _get({'pt': "PREPARAR", 'en': "PREPARE", 'es': "PREPARAR"}); + static String get maxSpeed => _get({'pt': "VELOCIDADE MÁX", 'en': "MAX SPEED", 'es': "VELOCIDAD MÁXIMA"}); + static String get cancel => _get({'pt': "Cancelar", 'en': "Cancel", 'es': "Cancelar"}); + static String get yes => _get({'pt': "Sim", 'en': "Yes", 'es': "Sí"}); + static String get runFinished => _get({'pt': "Corrida Finalizada!", 'en': "Run Finished!", 'es': "¡Carrera Finalizada!"}); + static String get totalDistance => _get({'pt': "Distância Total", 'en': "Total Distance", 'es': "Distancia Total"}); + static String get totalTime => _get({'pt': "Tempo Total", 'en': "Total Time", 'es': "Tiempo Total"}); + static String get close => _get({'pt': "Fechar", 'en': "Close", 'es': "Cerrar"}); + static String get results => _get({'pt': "Resultados", 'en': "Results", 'es': "Resultados"}); // Auth Screens - static const String entrar = "ENTRAR"; - static const String registrar = "REGISTRAR"; - static const String appTitle = "Run Vision Pro"; + static String get entrar => _get({'pt': "ENTRAR", 'en': "LOGIN", 'es': "ENTRAR"}); + static String get registrar => _get({'pt': "REGISTRAR", 'en': "REGISTER", 'es': "REGISTRAR"}); + static String get appTitle => _get({'pt': "Run Vision Pro", 'en': "Run Vision Pro", 'es': "Run Vision Pro"}); + + // Shared Auth Strings + static String get labelEmail => _get({'pt': "Email", 'en': "Email", 'es': "Email"}); + static String get hintEmail => _get({'pt': "seu@email.com", 'en': "your@email.com", 'es': "tu@email.com"}); + static String get validatorEmailEmpty => _get({'pt': "Por favor, insira seu email", 'en': "Please enter your email", 'es': "Por favor, introduce tu email"}); + static String get validatorEmailInvalid => _get({'pt': "Email inválido", 'en': "Invalid email", 'es': "Email inválido"}); + static String get labelPassword => _get({'pt': "Senha", 'en': "Password", 'es': "Contraseña"}); + static String get hintPassword => _get({'pt': "••••••••", 'en': "••••••••", 'es': "••••••••"}); + static String get validatorPasswordEmpty => _get({'pt': "Por favor, insira sua senha", 'en': "Please enter your password", 'es': "Por favor, introduce tu contraseña"}); + static String get validatorPasswordLength => _get({'pt': "Senha deve ter pelo menos 6 caracteres", 'en': "Password must be at least 6 characters", 'es': "La contraseña debe tener al menos 6 caracteres"}); + + // Registrar Sheet + static String get registerSuccess => _get({'pt': "Conta criada com sucesso! Verifique seu email.", 'en': "Account created successfully! Check your email.", 'es': "¡Cuenta creada con éxito! Revisa tu email."}); + static String get registerTitle => _get({'pt': "Registrar", 'en': "Register", 'es': "Registrar"}); + static String get labelName => _get({'pt': "Nome", 'en': "Name", 'es': "Nombre"}); + static String get hintName => _get({'pt': "Seu nome completo", 'en': "Your full name", 'es': "Tu nombre completo"}); + static String get validatorNameEmpty => _get({'pt': "Por favor, insira seu nome", 'en': "Please enter your name", 'es': "Por favor, introduce tu nombre"}); + static String get validatorNameLength => _get({'pt': "Nome deve ter pelo menos 3 caracteres", 'en': "Name must be at least 3 characters", 'es': "El nombre debe tener al menos 3 caracteres"}); + static String get labelConfirmPassword => _get({'pt': "Confirmar Senha", 'en': "Confirm Password", 'es': "Confirmar Contraseña"}); + static String get validatorConfirmPasswordEmpty => _get({'pt': "Por favor, confirme sua senha", 'en': "Please confirm your password", 'es': "Por favor, confirma tu contraseña"}); + static String get validatorConfirmPasswordMatch => _get({'pt': "Senhas não coincidem", 'en': "Passwords do not match", 'es': "Las contraseñas no coinciden"}); + static String get btnRegister => _get({'pt': "Registrar", 'en': "Register", 'es': "Registrar"}); + + // Entrar Sheet + static String get loginTitle => _get({'pt': "Entrar", 'en': "Login", 'es': "Entrar"}); + static String get loginSuccess => _get({'pt': "Login realizado com sucesso!", 'en': "Login successful!", 'es': "¡Login realizado con éxito!"}); + static String get resetPasswordEmailSent => _get({'pt': "Email de redefinição enviado!", 'en': "Reset email sent!", 'es': "¡Email de restablecimiento enviado!"}); + static String get forgotPassword => _get({'pt': "Esqueceu a senha?", 'en': "Forgot password?", 'es': "¿Olvidaste la contraseña?"}); + static String get btnLogin => _get({'pt': "Entrar", 'en': "Login", 'es': "Entrar"}); + + // Settings Screen + static String get settingsTitle => _get({'pt': "CONFIGURAÇÕES", 'en': "SETTINGS", 'es': "CONFIGURACIÓN"}); + static String get userPlaceholder => _get({'pt': "Usuário", 'en': "User", 'es': "Usuario"}); + static String get editProfile => _get({'pt': "Editar perfil", 'en': "Edit profile", 'es': "Editar perfil"}); + static String get adjustDateTime => _get({'pt': "Ajustar Data e Hora", 'en': "Adjust Date and Time", 'es': "Ajustar Fecha y Hora"}); + static String get nightMode => _get({'pt': "Modo Noturno", 'en': "Night Mode", 'es': "Modo Nocturno"}); + static String get language => _get({'pt': "Idioma", 'en': "Language", 'es': "Idioma"}); + static String get accessibility => _get({'pt': "Acessibilidade", 'en': "Accessibility", 'es': "Accesibilidad"}); + static String get privacySecurity => _get({'pt': "Privacidade e Segurança", 'en': "Privacy and Security", 'es': "Privacidad y Seguridad"}); + static String get termsOfUse => _get({'pt': "Termos de Uso", 'en': "Terms of Use", 'es': "Términos de Uso"}); + static String get about => _get({'pt': "Sobre", 'en': "About", 'es': "Sobre"}); + static String get logout => _get({'pt': "Sair", 'en': "Logout", 'es': "Salir"}); + static String get confirmLogout => _get({'pt': "Confirmar Logout", 'en': "Confirm Logout", 'es': "Confirmar Salida"}); + static String get confirmLogoutMessage => _get({'pt': "Tem certeza que deseja sair?", 'en': "Are you sure you want to logout?", 'es': "¿Estás seguro de que quieres salir?"}); + static String get selectLanguage => _get({'pt': "Selecionar Idioma", 'en': "Select Language", 'es': "Seleccionar Idioma"}); + static String get version => _get({'pt': "Versão", 'en': "Version", 'es': "Versión"}); + static String get appDescription => _get({'pt': "Aplicativo de corrida com estatísticas e mapas", 'en': "Running app with stats and maps", 'es': "Aplicación de carrera con estadísticas y mapas"}); + static String get dateSelected => _get({'pt': "Data selecionada", 'en': "Date selected", 'es': "Fecha seleccionada"}); + static String get btnOk => _get({'pt': "OK", 'en': "OK", 'es': "OK"}); + static String get btnCancel => _get({'pt': "Cancelar", 'en': "Cancel", 'es': "Cancelar"}); + static String get btnDefine => _get({'pt': "DEFINIR", 'en': "DEFINE", 'es': "DEFINIR"}); + + // Logado Screen + static String get defineDailyGoal => _get({'pt': "Definir Meta Diária", 'en': "Set Daily Goal", 'es': "Definir Meta Diaria"}); + static String get customGoal => _get({'pt': "Personalizado", 'en': "Custom", 'es': "Personalizado"}); + static String get customGoalTitle => _get({'pt': "Meta Personalizada", 'en': "Custom Goal", 'es': "Meta Personalizada"}); } diff --git a/lib/screens/bluetooth_connection_screen.dart b/lib/screens/bluetooth_connection_screen.dart index 19b558d..0548b3e 100644 --- a/lib/screens/bluetooth_connection_screen.dart +++ b/lib/screens/bluetooth_connection_screen.dart @@ -77,7 +77,7 @@ class _BluetoothConnectionScreenState extends State { } else { if (mounted) { ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( + SnackBar( content: Text(AppStrings.permissionsDenied), behavior: SnackBarBehavior.floating, ), @@ -93,19 +93,19 @@ class _BluetoothConnectionScreenState extends State { showDialog( context: context, builder: (context) => AlertDialog( - title: const Text("Permissões Necessárias"), - content: const Text("As permissões de Bluetooth foram negadas permanentemente. Por favor, habilite-as nas configurações do sistema para continuar."), + title: Text(AppStrings.permissionsNeeded), + content: Text(AppStrings.permissionsDeniedPermanent), actions: [ TextButton( onPressed: () => Navigator.pop(context), - child: const Text("CANCELAR"), + child: Text(AppStrings.btnCancel), ), TextButton( onPressed: () { openAppSettings(); Navigator.pop(context); }, - child: const Text("CONFIGURAÇÕES"), + child: Text(AppStrings.settingsTitle), ), ], ), @@ -117,7 +117,7 @@ class _BluetoothConnectionScreenState extends State { if (await FlutterBluePlus.adapterState.first != BluetoothAdapterState.on) { if (mounted) { ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( + SnackBar( content: Text(AppStrings.turnOnBluetooth), behavior: SnackBarBehavior.floating, ), @@ -174,7 +174,7 @@ class _BluetoothConnectionScreenState extends State { }); FlutterBluePlus.stopScan(); ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( + SnackBar( content: Text(AppStrings.connectedSuccess), backgroundColor: AppColors.success, behavior: SnackBarBehavior.floating, @@ -208,9 +208,9 @@ class _BluetoothConnectionScreenState extends State { return Scaffold( backgroundColor: AppColors.background, appBar: AppBar( - title: const Text( + title: Text( AppStrings.bluetoothTitle, - style: TextStyle( + style: const TextStyle( fontWeight: FontWeight.w900, letterSpacing: 2, color: Colors.white, diff --git a/lib/screens/google_map_screen.dart b/lib/screens/google_map_screen.dart index e69ebea..c2ab2c0 100644 --- a/lib/screens/google_map_screen.dart +++ b/lib/screens/google_map_screen.dart @@ -192,17 +192,17 @@ class _GoogleMapScreenState extends State { builder: (context) => AlertDialog( backgroundColor: AppColors.backgroundGrey, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25)), - title: const Text("Iniciar Corrida?", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), - content: const Text("Deseja começar o monitoramento agora?", style: TextStyle(color: Colors.white70)), + title: Text(AppStrings.startRunQuestion, style: const TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), + content: Text(AppStrings.startRunDescription, style: const TextStyle(color: Colors.white70)), actions: [ - TextButton(onPressed: () => Navigator.pop(context), child: const Text(AppStrings.cancel, style: TextStyle(color: Colors.white54))), + TextButton(onPressed: () => Navigator.pop(context), child: Text(AppStrings.cancel, style: const TextStyle(color: Colors.white54))), ElevatedButton( onPressed: () { Navigator.pop(context); _startCountdown(); }, style: ElevatedButton.styleFrom(backgroundColor: AppColors.coral, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15))), - child: const Text(AppStrings.yes, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), + child: Text(AppStrings.yes, style: const TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), ), ], ), @@ -256,7 +256,7 @@ class _GoogleMapScreenState extends State { showGeneralDialog( context: context, barrierDismissible: false, - barrierLabel: "Resultados", + barrierLabel: AppStrings.results, pageBuilder: (context, anim1, anim2) => const SizedBox(), transitionBuilder: (context, anim1, anim2, child) { return FadeTransition( @@ -279,7 +279,7 @@ class _GoogleMapScreenState extends State { child: const Icon(Icons.emoji_events_rounded, color: Colors.white, size: 40), ), const SizedBox(height: 20), - const Text(AppStrings.runFinished, style: TextStyle(color: Colors.white, fontSize: 24, fontWeight: FontWeight.w900, letterSpacing: 1)), + Text(AppStrings.runFinished, style: const TextStyle(color: Colors.white, fontSize: 24, fontWeight: FontWeight.w900, letterSpacing: 1)), const SizedBox(height: 30), Container( height: 180, @@ -317,7 +317,7 @@ class _GoogleMapScreenState extends State { const Divider(color: Colors.white10, height: 25), _buildResultRow(AppStrings.totalTime, _formatTime(finalTime)), const Divider(color: Colors.white10, height: 25), - _buildResultRow("VELOCIDADE MÁX", "${finalMaxSpeed.toStringAsFixed(1)} ${AppStrings.kmhUnit}"), + _buildResultRow(AppStrings.maxSpeed, "${finalMaxSpeed.toStringAsFixed(1)} ${AppStrings.kmhUnit}"), const SizedBox(height: 35), SizedBox( width: double.infinity, @@ -459,7 +459,7 @@ class _GoogleMapScreenState extends State { child: Column( mainAxisSize: MainAxisSize.min, children: [ - const Text("PREPARAR", style: TextStyle(color: Colors.white54, fontSize: 24, fontWeight: FontWeight.bold, letterSpacing: 5)), + Text(AppStrings.prepare, style: const TextStyle(color: Colors.white54, fontSize: 24, fontWeight: FontWeight.bold, letterSpacing: 5)), const SizedBox(height: 20), Text("$_countdownValue", style: const TextStyle(color: AppColors.coral, fontSize: 160, fontWeight: FontWeight.w900)), ], diff --git a/lib/screens/logado_screen.dart b/lib/screens/logado_screen.dart index 3483db4..ef6685f 100644 --- a/lib/screens/logado_screen.dart +++ b/lib/screens/logado_screen.dart @@ -47,12 +47,12 @@ class _LogadoScreenState extends State { builder: (context) => AlertDialog( backgroundColor: AppColors.backgroundGrey, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)), - title: const Text("Definir Meta Diária", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), + title: Text(AppStrings.defineDailyGoal, style: const TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), content: Column( mainAxisSize: MainAxisSize.min, children: [ ...[5, 10, 15, 20].map((km) => ListTile( - title: Text("$km KM", style: const TextStyle(color: Colors.white)), + title: Text("$km ${AppStrings.kmUnit}", style: const TextStyle(color: Colors.white)), onTap: () { setState(() { _dailyGoal = km.toDouble(); @@ -63,7 +63,7 @@ class _LogadoScreenState extends State { const Divider(color: Colors.white10), ListTile( leading: const Icon(Icons.edit_note_rounded, color: AppColors.coral), - title: const Text("Personalizado", style: TextStyle(color: AppColors.coral, fontWeight: FontWeight.bold)), + title: Text(AppStrings.customGoal, style: const TextStyle(color: AppColors.coral, fontWeight: FontWeight.bold)), onTap: () { Navigator.pop(context); _showCustomGoalDialog(); @@ -82,7 +82,7 @@ class _LogadoScreenState extends State { builder: (context) => AlertDialog( backgroundColor: AppColors.backgroundGrey, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)), - title: const Text("Meta Personalizada", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), + title: Text(AppStrings.customGoalTitle, style: const TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), content: TextField( controller: controller, keyboardType: const TextInputType.numberWithOptions(decimal: true), @@ -91,17 +91,17 @@ class _LogadoScreenState extends State { decoration: InputDecoration( hintText: "Ex: 12.5", hintStyle: const TextStyle(color: Colors.white24), - suffixText: "KM", + suffixText: AppStrings.kmUnit, suffixStyle: const TextStyle(color: Colors.white54), - enabledBorder: UnderlineInputBorder(borderSide: BorderSide(color: Colors.white24)), - focusedBorder: UnderlineInputBorder(borderSide: BorderSide(color: AppColors.coral)), + enabledBorder: const UnderlineInputBorder(borderSide: BorderSide(color: Colors.white24)), + focusedBorder: const UnderlineInputBorder(borderSide: BorderSide(color: AppColors.coral)), ), autofocus: true, ), actions: [ TextButton( onPressed: () => Navigator.pop(context), - child: const Text("CANCELAR", style: TextStyle(color: Colors.white54)), + child: Text(AppStrings.btnCancel, style: const TextStyle(color: Colors.white54)), ), ElevatedButton( onPressed: () { @@ -117,7 +117,7 @@ class _LogadoScreenState extends State { backgroundColor: AppColors.coral, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), ), - child: const Text("DEFINIR", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), + child: Text(AppStrings.btnDefine, style: const TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), ), ], ), @@ -127,7 +127,7 @@ class _LogadoScreenState extends State { @override Widget build(BuildContext context) { final user = SupabaseService.currentUser; - final userName = user?.userMetadata?['name'] ?? user?.email?.split('@')[0] ?? 'Corredor'; + final userName = user?.userMetadata?['name'] ?? user?.email?.split('@')[0] ?? AppStrings.userPlaceholder; return Scaffold( backgroundColor: AppColors.background, @@ -210,9 +210,9 @@ class _LogadoScreenState extends State { const SizedBox(height: 30), // Personal Bests Section - const Text( - "RECORDS PESSOAIS", - style: TextStyle( + Text( + AppStrings.personalRecords, + style: const TextStyle( color: Colors.white38, fontSize: 11, fontWeight: FontWeight.w900, @@ -247,9 +247,9 @@ class _LogadoScreenState extends State { const SizedBox(height: 25), // Steps Section (Atividade Geral) - const Text( - "ATIVIDADE GERAL", - style: TextStyle( + Text( + AppStrings.generalActivity, + style: const TextStyle( color: Colors.white38, fontSize: 11, fontWeight: FontWeight.w900, @@ -260,7 +260,7 @@ class _LogadoScreenState extends State { _buildWideRecordCard( AppStrings.steps, _steps.toString(), - "passos hoje", + AppStrings.stepsToday, Icons.directions_walk_rounded, AppColors.success, ), @@ -347,9 +347,9 @@ class _LogadoScreenState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - const Text( + Text( AppStrings.dailyGoal, - style: TextStyle(color: Colors.white54, fontWeight: FontWeight.bold, letterSpacing: 1), + style: const TextStyle(color: Colors.white54, fontWeight: FontWeight.bold, letterSpacing: 1), ), if (_dailyGoal > 0) Text( @@ -388,9 +388,9 @@ class _LogadoScreenState extends State { child: const Icon(Icons.add_task_rounded, color: AppColors.coral, size: 40), ), const SizedBox(height: 10), - const Text( - "DEFINIR META", - style: TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w900, letterSpacing: 1), + Text( + AppStrings.setGoal, + style: const TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w900, letterSpacing: 1), ), ], ), @@ -399,7 +399,7 @@ class _LogadoScreenState extends State { Column( mainAxisSize: MainAxisSize.min, children: [ - const Text("DISTÂNCIA", style: TextStyle(color: Colors.white38, fontSize: 10, fontWeight: FontWeight.bold, letterSpacing: 2)), + Text(AppStrings.distance, style: const TextStyle(color: Colors.white38, fontSize: 10, fontWeight: FontWeight.bold, letterSpacing: 2)), Text( _currentDistance.toStringAsFixed(1), style: const TextStyle(color: Colors.white, fontSize: 48, fontWeight: FontWeight.w900), @@ -416,9 +416,9 @@ class _LogadoScreenState extends State { Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - _buildSimpleStat("PASSOS", "${(_steps / 1000).toStringAsFixed(1)}k"), + _buildSimpleStat(AppStrings.steps, "${(_steps / 1000).toStringAsFixed(1)}k"), const SizedBox(width: 40), - _buildSimpleStat("TEMPO", "${_totalTimeMinutes}m"), + _buildSimpleStat(AppStrings.time, "${_totalTimeMinutes}m"), ], ) ], diff --git a/lib/screens/setting_screen.dart b/lib/screens/setting_screen.dart index f855e9e..3c4f95a 100644 --- a/lib/screens/setting_screen.dart +++ b/lib/screens/setting_screen.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import '../constants/app_colors.dart'; +import '../constants/app_strings.dart'; import '../services/supabase_service.dart'; class SettingsScreen extends StatefulWidget { @@ -18,15 +19,15 @@ class _SettingsScreenState extends State { Widget build(BuildContext context) { final user = SupabaseService.currentUser; final userName = - user?.userMetadata?['name'] ?? user?.email?.split('@')[0] ?? 'Usuário'; + user?.userMetadata?['name'] ?? user?.email?.split('@')[0] ?? AppStrings.userPlaceholder; final userEmail = user?.email ?? 'usuario@exemplo.com'; return Scaffold( backgroundColor: AppColors.background, appBar: AppBar( - title: const Text( - 'CONFIGURAÇÕES', - style: TextStyle( + title: Text( + AppStrings.settingsTitle, + style: const TextStyle( color: Colors.white, fontSize: 20, fontWeight: FontWeight.bold, @@ -93,8 +94,8 @@ class _SettingsScreenState extends State { icon: const Icon(Icons.edit, color: AppColors.buttonColor), onPressed: () { ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( - content: Text('Editar perfil'), + SnackBar( + content: Text(AppStrings.editProfile), backgroundColor: AppColors.buttonColor, ), ); @@ -116,7 +117,7 @@ class _SettingsScreenState extends State { children: [ _buildSettingsItem( icon: Icons.schedule, - title: 'Ajustar Data e Hora', + title: AppStrings.adjustDateTime, onTap: () { _showDatePicker(context); }, @@ -124,7 +125,7 @@ class _SettingsScreenState extends State { _buildDivider(), _buildSettingsItem( icon: Icons.dark_mode, - title: 'Modo Noturno', + title: AppStrings.nightMode, trailing: Switch( value: _isNightMode, activeThumbColor: AppColors.buttonColor, @@ -138,7 +139,7 @@ class _SettingsScreenState extends State { _buildDivider(), _buildSettingsItem( icon: Icons.language, - title: 'Idioma', + title: AppStrings.language, trailing: Text( _selectedLanguage, style: TextStyle( @@ -153,11 +154,11 @@ class _SettingsScreenState extends State { _buildDivider(), _buildSettingsItem( icon: Icons.accessibility, - title: 'Acessibilidade', + title: AppStrings.accessibility, onTap: () { ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( - content: Text('Acessibilidade'), + SnackBar( + content: Text(AppStrings.accessibility), backgroundColor: AppColors.buttonColor, ), ); @@ -166,7 +167,7 @@ class _SettingsScreenState extends State { _buildDivider(), _buildSettingsItem( icon: Icons.notifications, - title: 'Notificações', + title: AppStrings.notifications, trailing: Switch( value: _notificationsEnabled, onChanged: (value) { @@ -180,11 +181,11 @@ class _SettingsScreenState extends State { _buildDivider(), _buildSettingsItem( icon: Icons.privacy_tip, - title: 'Privacidade e Segurança', + title: AppStrings.privacySecurity, onTap: () { ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( - content: Text('Privacidade e Segurança'), + SnackBar( + content: Text(AppStrings.privacySecurity), backgroundColor: AppColors.buttonColor, ), ); @@ -193,11 +194,11 @@ class _SettingsScreenState extends State { _buildDivider(), _buildSettingsItem( icon: Icons.description, - title: 'Termos de Uso', + title: AppStrings.termsOfUse, onTap: () { ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( - content: Text('Termos de Uso'), + SnackBar( + content: Text(AppStrings.termsOfUse), backgroundColor: AppColors.buttonColor, ), ); @@ -206,7 +207,7 @@ class _SettingsScreenState extends State { _buildDivider(), _buildSettingsItem( icon: Icons.info, - title: 'Sobre', + title: AppStrings.about, onTap: () { _showAboutDialog(context); }, @@ -231,9 +232,9 @@ class _SettingsScreenState extends State { borderRadius: BorderRadius.circular(12), ), ), - child: const Text( - 'Sair', - style: TextStyle( + child: Text( + AppStrings.logout, + style: const TextStyle( color: Colors.white, fontSize: 16, fontWeight: FontWeight.bold, @@ -287,7 +288,7 @@ class _SettingsScreenState extends State { if (date != null && mounted) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text('Data selecionada: ${date.toString().split(' ')[0]}'), + content: Text('${AppStrings.dateSelected}: ${date.toString().split(' ')[0]}'), backgroundColor: AppColors.buttonColor, ), ); @@ -300,9 +301,9 @@ class _SettingsScreenState extends State { context: context, builder: (context) => AlertDialog( backgroundColor: AppColors.backgroundGrey, - title: const Text( - 'Selecionar Idioma', - style: TextStyle(color: Colors.white), + title: Text( + AppStrings.selectLanguage, + style: const TextStyle(color: Colors.white), ), content: Column( mainAxisSize: MainAxisSize.min, @@ -315,9 +316,9 @@ class _SettingsScreenState extends State { actions: [ TextButton( onPressed: () => Navigator.pop(context), - child: const Text( - 'Cancelar', - style: TextStyle(color: AppColors.buttonColor), + child: Text( + AppStrings.btnCancel, + style: const TextStyle(color: AppColors.buttonColor), ), ), ], @@ -332,18 +333,25 @@ class _SettingsScreenState extends State { value: language, groupValue: _selectedLanguage, onChanged: (value) { - setState(() { - _selectedLanguage = value!; - }); - Navigator.pop(context); + if (value != null) { + setState(() { + _selectedLanguage = value; + AppStrings.setLanguage(value); + }); + Navigator.pop(context); + // Force rebuild of current screen to apply changes + setState(() {}); + } }, fillColor: WidgetStateProperty.all(AppColors.buttonColor), ), onTap: () { setState(() { _selectedLanguage = language; + AppStrings.setLanguage(language); }); Navigator.pop(context); + setState(() {}); }, ); } @@ -353,33 +361,33 @@ class _SettingsScreenState extends State { context: context, builder: (context) => AlertDialog( backgroundColor: AppColors.backgroundGrey, - title: const Text('Sobre', style: TextStyle(color: Colors.white)), - content: const Column( + title: Text(AppStrings.about, style: const TextStyle(color: Colors.white)), + content: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - 'Run Vision Pro', - style: TextStyle( + AppStrings.appTitle, + style: const TextStyle( color: Colors.white, fontWeight: FontWeight.bold, ), ), - SizedBox(height: 8), - Text('Versão: 1.0.0', style: TextStyle(color: Colors.white70)), - SizedBox(height: 8), + const SizedBox(height: 8), + Text('${AppStrings.version}: 1.0.0', style: const TextStyle(color: Colors.white70)), + const SizedBox(height: 8), Text( - 'Aplicativo de corrida com estatísticas e mapas', - style: TextStyle(color: Colors.white70), + AppStrings.appDescription, + style: const TextStyle(color: Colors.white70), ), ], ), actions: [ TextButton( onPressed: () => Navigator.pop(context), - child: const Text( - 'OK', - style: TextStyle(color: AppColors.buttonColor), + child: Text( + AppStrings.btnOk, + style: const TextStyle(color: AppColors.buttonColor), ), ), ], @@ -392,20 +400,20 @@ class _SettingsScreenState extends State { context: context, builder: (context) => AlertDialog( backgroundColor: AppColors.backgroundGrey, - title: const Text( - 'Confirmar Logout', - style: TextStyle(color: Colors.white), + title: Text( + AppStrings.confirmLogout, + style: const TextStyle(color: Colors.white), ), - content: const Text( - 'Tem certeza que deseja sair?', - style: TextStyle(color: Colors.white70), + content: Text( + AppStrings.confirmLogoutMessage, + style: const TextStyle(color: Colors.white70), ), actions: [ TextButton( onPressed: () => Navigator.pop(context), - child: const Text( - 'Cancelar', - style: TextStyle(color: AppColors.buttonColor), + child: Text( + AppStrings.btnCancel, + style: const TextStyle(color: AppColors.buttonColor), ), ), TextButton( @@ -413,7 +421,7 @@ class _SettingsScreenState extends State { Navigator.pop(context); Navigator.pushReplacementNamed(context, '/'); }, - child: const Text('Sair', style: TextStyle(color: Colors.red)), + child: Text(AppStrings.logout, style: const TextStyle(color: Colors.red)), ), ], ), diff --git a/lib/sheets/entrar_sheet.dart b/lib/sheets/entrar_sheet.dart index e5557d5..88b0e50 100644 --- a/lib/sheets/entrar_sheet.dart +++ b/lib/sheets/entrar_sheet.dart @@ -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 { // 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 { 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 { // 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 { // Title const Text( - 'Entrar', + AppStrings.loginTitle, style: TextStyle( fontSize: 28, fontWeight: FontWeight.bold, @@ -162,7 +163,7 @@ class _EntrarSheetState extends State { // 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 { 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 { // 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 { 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 { color: Colors.white, ) : const Text( - 'Entrar', + AppStrings.btnLogin, style: TextStyle( fontSize: 18, fontWeight: FontWeight.w600, @@ -260,7 +261,7 @@ class _EntrarSheetState extends State { child: TextButton( onPressed: _handlePasswordReset, child: const Text( - 'Esqueceu a senha?', + AppStrings.forgotPassword, style: TextStyle(color: Colors.white70, fontSize: 16), ), ), diff --git a/lib/sheets/registrar_sheet.dart b/lib/sheets/registrar_sheet.dart index 3b79465..85304c6 100644 --- a/lib/sheets/registrar_sheet.dart +++ b/lib/sheets/registrar_sheet.dart @@ -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 { // 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { ), 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), ], ), ); diff --git a/pubspec.lock b/pubspec.lock index 889f011..396dc00 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -85,10 +85,10 @@ packages: dependency: transitive description: name: characters - sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 url: "https://pub.dev" source: hosted - version: "1.4.1" + version: "1.4.0" clock: dependency: transitive description: @@ -548,18 +548,18 @@ packages: dependency: transitive description: name: matcher - sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 url: "https://pub.dev" source: hosted - version: "0.12.19" + version: "0.12.17" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.13.0" + version: "0.11.1" meta: dependency: transitive description: @@ -945,10 +945,10 @@ packages: dependency: transitive description: name: test_api - sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a" + sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 url: "https://pub.dev" source: hosted - version: "0.7.10" + version: "0.7.7" typed_data: dependency: transitive description: