imagenes falta especializaciones

This commit is contained in:
Juan Felipe Duarte
2023-06-07 17:29:43 -05:00
parent ebcc95d06a
commit 583d99b3bb
11 changed files with 1630 additions and 305 deletions
+10 -15
View File
@@ -5,13 +5,13 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'dart:io';
import 'package:intl/intl.dart';
import 'package:prosappco/src/authentication/authentication_repository.dart';
import 'package:prosappco/src/components/pop_appbar.dart';
import 'package:prosappco/src/controllers/add_name_email_city.dart';
import 'package:prosappco/src/screens/city.dart';
import 'package:prosappco/src/screens/new_number.dart';
import 'package:prosappco/src/screens/new_password.dart';
import 'package:prosappco/src/screens/service.dart';
import 'package:prosappco/src/services/select_image_profile.dart';
import '../components/photo_view.dart';
@@ -103,14 +103,13 @@ class _ProfileScreenState extends State<ProfileScreen> {
}
Future<bool> uploadImage(File image) async {
final String namefile = image.path.split('/').last;
final now = DateTime.now();
final formattedDate = DateFormat('HHmmssddMMyyyy').format(now);
final milliseconds = (now.microsecondsSinceEpoch / 1000).round();
final random = '$formattedDate$milliseconds';
Reference ref = storage
.ref()
.child('users')
.child(uid!)
.child('profile')
.child(namefile);
Reference ref =
storage.ref().child('users').child(uid!).child('profile').child(random);
final UploadTask uploadTask = ref.putFile(image);
@@ -231,7 +230,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
}
if (newEmail.isEmpty) {
// Si el nuevo nombre está vacío, no lo actualizamos y mostramos un mensaje al usuario
// Si el nuevo email está vacío, no lo actualizamos y mostramos un mensaje al usuario
Get.snackbar(
'Correo Invalido',
'Ingrese un email válido.',
@@ -374,12 +373,8 @@ class _ProfileScreenState extends State<ProfileScreen> {
child: Container(
margin: const EdgeInsets.symmetric(vertical: 50),
child: (imagen_to_upload != null)
? LocalPhoto(
file: imagen_to_upload!,
)
: ReferencePhoto(
ref: storage.ref().child(_photo),
)),
? LocalPhoto(file: imagen_to_upload!)
: ReferencePhoto(ref: storage.ref().child(_photo))),
),
Container(
width: 300,