puntaje pro

This commit is contained in:
Juan Felipe Duarte
2023-04-26 16:55:58 -05:00
parent 0a70d40d2d
commit c1747a45b9
12 changed files with 781 additions and 436 deletions
+154 -157
View File
@@ -341,169 +341,166 @@ class _ProfileScreenState extends State<ProfileScreen> {
Widget build(BuildContext context) {
String city = _ciudad.toString();
return SafeArea(
child: Scaffold(
appBar: PopAppbar(
onPressed: () {
Navigator.pop(context);
},
label: 'Perfil'),
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),
_email != null
? TextFormField(
onTap: () {
Navigator.push(context, CupertinoPageRoute(
builder: (BuildContext context) {
return NewPasswordScreen();
},
));
},
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;
});
},
return Scaffold(
appBar: PopAppbar(
onPressed: () {
Navigator.pop(context);
},
label: 'Perfil'),
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),
_email != null
? TextFormField(
onTap: () {
Navigator.push(context, CupertinoPageRoute(
builder: (BuildContext context) {
return NewPasswordScreen();
},
));
},
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,
),
hintText: 'Contraseña (Obligatorio)'),
),
_email != null
? const SizedBox.shrink()
: const SizedBox(height: 20.0),
TextFormField(
readOnly: true,
onTap: () async {
final String? ciudad = await Navigator.push(
context,
CupertinoPageRoute(
builder: (BuildContext context) {
return const CityScreen();
},
),
) as String?;
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.push(
context,
CupertinoPageRoute(
builder: (BuildContext context) {
return const CityScreen();
},
),
) as String?;
if (ciudad != null) {
setState(() {
_ciudad = ciudad;
});
}
},
decoration: InputDecoration(
prefixIcon: const Icon(Icons.near_me),
suffixIcon: const Icon(Icons.arrow_drop_down),
hintStyle: city == ''
? const TextStyle()
: const TextStyle(color: Colors.black87),
hintText: city == '' ? 'Ciudad' : city),
),
const SizedBox(height: 20.0),
TextFormField(
controller: _phoneNumberController,
readOnly: true,
onTap: () {
Navigator.of(context).push(
CupertinoPageRoute(
builder: (BuildContext context) {
return const NewNumberScreen();
},
),
);
},
decoration: const InputDecoration(
prefixIcon: Icon(Icons.phone_android),
suffixIcon: Icon(Icons.edit_outlined),
hintText: '+57'),
),
],
)),
),
Container(
alignment: Alignment.bottomCenter,
margin: const EdgeInsets.only(top: 100),
padding: const EdgeInsets.only(bottom: 30),
child: ElevatedButton(
onPressed: () async {
await updateInfo();
},
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xFF2BA4EC),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50),
),
elevation: 0,
minimumSize: const Size(200, 50),
if (ciudad != null) {
setState(() {
_ciudad = ciudad;
});
}
},
decoration: InputDecoration(
prefixIcon: const Icon(Icons.near_me),
suffixIcon: const Icon(Icons.arrow_drop_down),
hintStyle: city == ''
? const TextStyle()
: const TextStyle(color: Colors.black87),
hintText: city == '' ? 'Ciudad' : city),
),
const SizedBox(height: 20.0),
TextFormField(
controller: _phoneNumberController,
readOnly: true,
onTap: () {
Navigator.of(context).push(
CupertinoPageRoute(
builder: (BuildContext context) {
return const NewNumberScreen();
},
),
);
},
decoration: const InputDecoration(
prefixIcon: Icon(Icons.phone_android),
suffixIcon: Icon(Icons.edit_outlined),
hintText: '+57'),
),
],
)),
),
Container(
alignment: Alignment.bottomCenter,
margin: const EdgeInsets.only(top: 100),
padding: const EdgeInsets.only(bottom: 30),
child: ElevatedButton(
onPressed: () async {
await updateInfo();
},
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xFF2BA4EC),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50),
),
child: const Text(
'Guardar',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 17,
),
elevation: 0,
minimumSize: const Size(200, 50),
),
child: const Text(
'Guardar',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 17,
),
),
),
],
),
),
],
),
),
),