Skip to content

Commit

Permalink
fix(#59) Arrumando cores e padronizando
Browse files Browse the repository at this point in the history
Co-authored-by: zDrNz  <[email protected]>
  • Loading branch information
R1K4S and zDrNz committed Dec 20, 2024
1 parent d144b15 commit 16d4f97
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 79 deletions.
2 changes: 1 addition & 1 deletion lib/ui/navbar/view/navBarView.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Widget page(BuildContext context) {
currentIndex: viewModel.selectedIndex,
onTap: viewModel.changeTab,
selectedItemColor: Theme.of(context).colorScheme.primary,
unselectedItemColor: Colors.black,
unselectedItemColor: Theme.of(context).colorScheme.onSurface,
items: const [
BottomNavigationBarItem(
icon: Icon(Icons.home_outlined),
Expand Down
107 changes: 36 additions & 71 deletions lib/ui/profile/view/ProfileView.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import 'package:aranduapp/ui/profile/viewModel/ProfileViewModel.dart';
// Componentes
import 'package:aranduapp/ui/shared/ProfileHeader.dart';
import 'package:aranduapp/ui/shared/ProfileSection.dart';
//import 'package:aranduapp/ui/shared/ProfileSection.dart';
// Bibliotecas
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
Expand All @@ -28,23 +28,23 @@ class Profile extends StatelessWidget {
/// AppBar
AppBar _buildAppBar(BuildContext context) {
return AppBar(
backgroundColor: Theme.of(context).colorScheme.onInverseSurface,
backgroundColor: Theme.of(context).colorScheme.onPrimary,
scrolledUnderElevation: 0,
title: Text(
'Perfil',
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
color: Colors.black,
color: Theme.of(context).colorScheme.onSurface,
),
),
centerTitle: true,
actions: [
Padding(
padding: const EdgeInsets.only(right: 16.0),
child: Container(
child: const Center(
child: Center(
child: Icon(
Icons.notifications_none_outlined,
color: Colors.black,
color: Theme.of(context).colorScheme.primary,
size: 32,
),
),
Expand All @@ -61,8 +61,14 @@ class Profile extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buildProfileHeader(context),
const SizedBox(height: 16),
_buildProfileSection(context), // Chama as seções
const SizedBox(height: 80),
_buildLogoutButton(
context,
() {
// Lógica de logout
print('Usuário deslogado!');
},
),
],
),
);
Expand All @@ -82,73 +88,32 @@ class Profile extends StatelessWidget {
);
}

/// Seções do Perfil
Widget _buildProfileSection(BuildContext context) {
return Column(
children: [
// Seção "Conta"
ProfileSection(
title: 'Conta',
items: [
ProfileLinkItem(
icon: Icons.person_outline,
name: 'Dados Pessoais',
onTap: () {
print("Dados Pessoais");
},
),
ProfileLinkItem(
icon: Icons.emoji_events_outlined,
name: 'Conquistas',
onTap: () {
print("Conquistas");
},
),
ProfileLinkItem(
icon: Icons.history_outlined,
name: 'Histórico',
onTap: () {
print("Histórico");
},
),
],
),
const SizedBox(height: 16),
// Seção "Notificações"
ProfileSection(
title: 'Notificações',
items: [
ProfileLinkItem(
icon: Icons.notifications_none_outlined,
name: 'Notificação Pop-up',
hasSwitch: true,
switchValue: true,
onSwitchChanged: (value) {
print("Switch Notificação: $value");
},
),
],
),
const SizedBox(height: 16),
// Seção "Outros"
ProfileSection(
title: 'Outros',
items: [
ProfileLinkItem(
icon: Icons.email_outlined,
name: 'Contate-nos',
),
ProfileLinkItem(
icon: Icons.privacy_tip_outlined,
name: 'Política de Privacidade',
/// Botão Deslogar
Widget _buildLogoutButton(BuildContext context, VoidCallback onPressed) {
final colorScheme = Theme.of(context).colorScheme;

return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: onPressed,
style: ElevatedButton.styleFrom(
backgroundColor: colorScheme.error,
foregroundColor: colorScheme.onError,
padding: const EdgeInsets.symmetric(vertical: 16),
textStyle: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
ProfileLinkItem(
icon: Icons.settings_outlined,
name: 'Configurações',
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12), // Bordas arredondadas
),
],
elevation: 6,
),
child: const Text('Deslogar'),
),
],
),
);
}
}
16 changes: 9 additions & 7 deletions lib/ui/shared/ProfileHeader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ class ProfileHeader extends StatelessWidget {
Container(
width: 80,
height: 80,
decoration: const BoxDecoration(
color: Color(0xFFE5E1E1), // Cor cinza claro
decoration: BoxDecoration(
color:
Theme.of(context).colorScheme.primary, // Cor cinza claro
shape: BoxShape.circle,
),
),
Expand All @@ -39,10 +40,10 @@ class ProfileHeader extends StatelessWidget {
children: [
Text(
name,
style: const TextStyle(
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.black87,
color: Theme.of(context).colorScheme.onSurface,
),
),
const SizedBox(height: 4),
Expand All @@ -61,18 +62,19 @@ class ProfileHeader extends StatelessWidget {
ElevatedButton(
onPressed: onEditPressed ?? () {}, // Não faz nada se nulo
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xFFD1410A), // Cor do botão
backgroundColor:
Theme.of(context).colorScheme.primary, // Cor do botão
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
elevation: 2,
),
child: const Text(
child: Text(
"Editar",
style: TextStyle(
fontSize: 16,
color: Colors.white,
color: Theme.of(context).colorScheme.onPrimary,
fontWeight: FontWeight.w400,
),
),
Expand Down

0 comments on commit 16d4f97

Please sign in to comment.