This commit is contained in:
Juan Felipe Duarte
2023-04-14 08:53:10 -05:00
parent 232ca3df46
commit 86e3b47693
6 changed files with 1021 additions and 980 deletions
+120 -115
View File
@@ -350,7 +350,6 @@ class _ProfileScreenState extends State<ProfileScreen> {
return SafeArea(
child: Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
backgroundColor: Colors.white,
iconTheme: const IconThemeData(
@@ -369,120 +368,123 @@ class _ProfileScreenState extends State<ProfileScreen> {
userPhoneNumber: user?.phoneNumber ?? '',
userCity: city,
userState: state),
body: Center(
child: Column(
children: [
GestureDetector(
onTap: () {
_showChoiceDialog(context);
},
child: Container(
margin: const EdgeInsets.symmetric(vertical: 50),
child: (imagen_to_upload != null)
? LocalPhoto(
file: imagen_to_upload!,
)
: ReferencePhoto(
ref: storage.ref().child(_photo),
)),
),
Container(
width: 300,
padding: const EdgeInsets.only(top: 0),
child: Form(
key: _formKey,
child: Column(
children: [
TextFormField(
controller: _nameController,
decoration: const InputDecoration(
prefixIcon: Icon(Icons.person_outline),
hintText: 'Nombre (Obligatorio)'),
),
const SizedBox(
height:
20.0), // Agrega espacio vertical entre los TextFormFields
_email != null
? TextFormField(
onTap: () {
Navigator.pushNamed(
context, '/nuevaPassword');
},
readOnly: true,
controller: _emailController,
decoration: const InputDecoration(
prefixIcon: Icon(Icons.email_outlined),
hintText: 'Email (Obligatorio)'),
)
: TextFormField(
controller: _emailController,
decoration: const InputDecoration(
prefixIcon: Icon(Icons.email_outlined),
hintText: 'Email (Obligatorio)'),
),
const SizedBox(height: 20.0),
_email != null
? const SizedBox.shrink()
: TextFormField(
controller: _passwordController,
obscureText: _obscureText,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.lock_outline),
suffixIcon: IconButton(
icon: Icon(
_obscureText
? Icons.visibility
: Icons.visibility_off,
color: Colors.grey,
body: SingleChildScrollView(
reverse: true,
child: Center(
child: Column(
children: [
GestureDetector(
onTap: () {
_showChoiceDialog(context);
},
child: Container(
margin: const EdgeInsets.symmetric(vertical: 50),
child: (imagen_to_upload != null)
? LocalPhoto(
file: imagen_to_upload!,
)
: ReferencePhoto(
ref: storage.ref().child(_photo),
)),
),
Container(
width: 300,
padding: const EdgeInsets.only(top: 0),
child: Form(
key: _formKey,
child: Column(
children: [
TextFormField(
controller: _nameController,
decoration: const InputDecoration(
prefixIcon: Icon(Icons.person_outline),
hintText: 'Nombre (Obligatorio)'),
),
const SizedBox(
height:
20.0), // Agrega espacio vertical entre los TextFormFields
_email != null
? TextFormField(
onTap: () {
Navigator.pushNamed(
context, '/nuevaPassword');
},
readOnly: true,
controller: _emailController,
decoration: const InputDecoration(
prefixIcon: Icon(Icons.email_outlined),
hintText: 'Email (Obligatorio)'),
)
: TextFormField(
controller: _emailController,
decoration: const InputDecoration(
prefixIcon: Icon(Icons.email_outlined),
hintText: 'Email (Obligatorio)'),
),
const SizedBox(height: 20.0),
_email != null
? const SizedBox.shrink()
: TextFormField(
controller: _passwordController,
obscureText: _obscureText,
decoration: InputDecoration(
prefixIcon:
const Icon(Icons.lock_outline),
suffixIcon: IconButton(
icon: Icon(
_obscureText
? Icons.visibility
: Icons.visibility_off,
color: Colors.grey,
),
onPressed: () {
setState(() {
_obscureText = !_obscureText;
});
},
),
onPressed: () {
setState(() {
_obscureText = !_obscureText;
});
},
),
hintText: 'Contraseña (Obligatorio)'),
),
_email != null
? const SizedBox.shrink()
: const SizedBox(height: 20.0),
TextFormField(
readOnly: true,
onTap: () async {
final String? ciudad =
(await Navigator.pushNamed(context, '/city'))
as String?;
hintText: 'Contraseña (Obligatorio)'),
),
_email != null
? const SizedBox.shrink()
: const SizedBox(height: 20.0),
TextFormField(
readOnly: true,
onTap: () async {
final String? ciudad =
(await Navigator.pushNamed(context, '/city'))
as String?;
if (ciudad != null) {
setState(() {
_ciudad = ciudad as String;
});
}
},
decoration: InputDecoration(
prefixIcon: Icon(Icons.near_me),
suffixIcon: Icon(Icons.arrow_drop_down),
hintStyle: city == ''
? TextStyle()
: TextStyle(color: Colors.black87),
hintText: city == '' ? 'Ciudad' : '$city'),
),
const SizedBox(height: 20.0),
TextFormField(
controller: _phoneNumberController,
readOnly: true,
onTap: () {
Navigator.pushNamed(context, '/newNumber');
},
decoration: InputDecoration(
prefixIcon: Icon(Icons.phone_android),
suffixIcon: Icon(Icons.edit_outlined),
hintText: '+57'),
),
],
)),
),
Container(
if (ciudad != null) {
setState(() {
_ciudad = ciudad as String;
});
}
},
decoration: InputDecoration(
prefixIcon: Icon(Icons.near_me),
suffixIcon: Icon(Icons.arrow_drop_down),
hintStyle: city == ''
? TextStyle()
: TextStyle(color: Colors.black87),
hintText: city == '' ? 'Ciudad' : '$city'),
),
const SizedBox(height: 20.0),
TextFormField(
controller: _phoneNumberController,
readOnly: true,
onTap: () {
Navigator.pushNamed(context, '/newNumber');
},
decoration: InputDecoration(
prefixIcon: Icon(Icons.phone_android),
suffixIcon: Icon(Icons.edit_outlined),
hintText: '+57'),
),
],
)),
),
Container(
alignment: Alignment.bottomCenter,
margin: EdgeInsets.only(top: 100),
child: ElevatedButton(
@@ -505,8 +507,11 @@ class _ProfileScreenState extends State<ProfileScreen> {
elevation: 0,
minimumSize: Size(200, 50),
),
)),
],
),
padding: EdgeInsets.only(bottom: 30),
),
],
),
),
),
),