Skip to content

Commit

Permalink
Style(#59): Ajustes visuais na parte do edit profile
Browse files Browse the repository at this point in the history
  • Loading branch information
zDrNz committed Dec 11, 2024
1 parent 537e92a commit 5f14a1a
Showing 1 changed file with 65 additions and 59 deletions.
124 changes: 65 additions & 59 deletions lib/ui/edit_profile/view/EditProfileView.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,22 @@ class _EditProfileScreenState extends State<EditProfileScreen> {
final viewModel = Provider.of<EditProfileViewModel>(context);
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.transparent, // Define o fundo transparente
elevation: 0, // Remove a sombra da AppBar
backgroundColor: Colors.transparent,
elevation: 0,
title: Center(
child: Text(
'Editar perfil',
style: TextStyle(
color: Colors.black, // Muda a cor do texto
fontSize: 24, // Ajusta o tamanho (opcional)
color: Colors.black,
fontSize: 24,
),
'Editar perfil',
),
),
actions: [
IconButton(
color: Colors.black,
icon: Icon(Icons.notifications), // Ícone de notificação
onPressed: () {
// Ação quando o ícone de notificação for pressionado
},
icon: Icon(Icons.notifications),
onPressed: () {},
),
],
leading: IconButton(
Expand All @@ -58,51 +56,62 @@ class _EditProfileScreenState extends State<EditProfileScreen> {
onPressed: () {},
),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center, // Centraliza verticalmente
crossAxisAlignment:
CrossAxisAlignment.center, // Centraliza horizontalmente
children: [
_icon(context),
SizedBox(height: 50),
_buildForm(viewModel),
],
)),
body: LayoutBuilder(
builder: (context, constraints) {
final isSmallScreen = constraints.maxWidth < 600;
return Center(
child: SingleChildScrollView(
padding: const EdgeInsets.all(16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
_icon(context),
SizedBox(height: isSmallScreen ? 30 : 50),
_buildForm(viewModel, isSmallScreen),
],
),
),
);
},
),
);
}

Widget _buildForm(EditProfileViewModel viewModel) {
return SingleChildScrollView(
padding: const EdgeInsets.all(16.0),
child: Form(
key: viewModel.formKey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
TextName(
controller: viewModel.firstNameController,
padding: const EdgeInsets.symmetric(vertical: 16)),
SizedBox(height: 20),
TextEmail(
padding: const EdgeInsets.symmetric(vertical: 16),
controller: viewModel.emailController,
),
SizedBox(height: 20),
TextPassWord(
padding: const EdgeInsets.symmetric(vertical: 16),
controller: viewModel.passwordController,
),
SizedBox(height: 56),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
_saveButton(viewModel),
_deleteButton(context),
],
),
],
),
Widget _buildForm(EditProfileViewModel viewModel, bool isSmallScreen) {
return Form(
key: viewModel.formKey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
TextName(
controller: viewModel.firstNameController,
padding: const EdgeInsets.symmetric(vertical: 16),
),
SizedBox(height: 20),
TextEmail(
padding: const EdgeInsets.symmetric(vertical: 16),
controller: viewModel.emailController,
),
SizedBox(height: 20),
TextPassWord(
padding: const EdgeInsets.symmetric(vertical: 16),
controller: viewModel.passwordController,
),
SizedBox(height: isSmallScreen ? 40 : 56),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Expanded(
child: _saveButton(viewModel),
),
SizedBox(width: isSmallScreen ? 10 : 20),
Expanded(
child: _deleteButton(context),
),
],
),
],
),
);
}
Expand All @@ -123,7 +132,7 @@ class _EditProfileScreenState extends State<EditProfileScreen> {
}
},
style: ElevatedButton.styleFrom(
minimumSize: Size(150, 50), // Largura: 200, Altura: 50
minimumSize: Size(0, 50),
),
child: Consumer<EditProfileViewModel>(
builder: (context, value, child) => value.isLoading
Expand All @@ -137,25 +146,22 @@ class _EditProfileScreenState extends State<EditProfileScreen> {
return ElevatedButton(
onPressed: () => _showDeleteConfirmationDialog(context),
style: ElevatedButton.styleFrom(
minimumSize: Size(150, 50), // Largura: 200, Altura: 50
minimumSize: Size(0, 50),
),
child: const Text('Deletar Conta'),
);
}

Widget _icon(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(
left: 16.0), // Adiciona espaço da borda esquerda
padding: const EdgeInsets.only(left: 16.0),
child: Row(
children: [
// Ícone circular
CircleAvatar(
radius: 30, // Tamanho do círculo
radius: 30,
backgroundColor: Colors.grey,
),
SizedBox(width: 16), // Espaço entre a imagem e o texto
// Texto com o nome e o cargo
SizedBox(width: 16),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expand Down

0 comments on commit 5f14a1a

Please sign in to comment.