update
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class BottomSheetExpanded extends StatelessWidget {
|
||||
final List<Widget> children;
|
||||
final double horizontalPadding;
|
||||
|
||||
const BottomSheetExpanded({
|
||||
super.key,
|
||||
required this.children,
|
||||
this.horizontalPadding = 35,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
backgroundColor: const Color(0xFFD6F4FF),
|
||||
body: Column(
|
||||
children: [
|
||||
const Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(15.0),
|
||||
child: Image(
|
||||
image: AssetImage('images/logo_prosapp.png'),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(30),
|
||||
topRight: Radius.circular(30),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: horizontalPadding,
|
||||
vertical: 15,
|
||||
),
|
||||
child: Column(children: children),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ColumnPadding extends StatelessWidget {
|
||||
final List<Widget> children;
|
||||
final EdgeInsetsGeometry padding;
|
||||
|
||||
const ColumnPadding({
|
||||
super.key,
|
||||
required this.children,
|
||||
required this.padding,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(padding: padding, child: Column(children: children));
|
||||
}
|
||||
}
|
||||
@@ -2,18 +2,23 @@ import 'dart:io';
|
||||
|
||||
import 'package:firebase_storage/firebase_storage.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_animate/flutter_animate.dart';
|
||||
|
||||
const double photoSize = 100;
|
||||
const double iconSize = 55;
|
||||
|
||||
class ReferencePhoto extends StatelessWidget {
|
||||
Reference? ref;
|
||||
double size;
|
||||
double sizeIcon;
|
||||
double sizeCircle;
|
||||
ReferencePhoto(
|
||||
{super.key,
|
||||
required this.ref,
|
||||
this.size = photoSize,
|
||||
this.sizeCircle = photoSize});
|
||||
ReferencePhoto({
|
||||
super.key,
|
||||
required this.ref,
|
||||
this.sizeIcon = iconSize,
|
||||
this.size = photoSize,
|
||||
this.sizeCircle = photoSize,
|
||||
});
|
||||
|
||||
Future<Widget> downloadImage() async {
|
||||
try {
|
||||
@@ -33,7 +38,10 @@ class ReferencePhoto extends StatelessWidget {
|
||||
// ignore: empty_catches
|
||||
} catch (e) {}
|
||||
|
||||
return DefaultPhoto(sizeDefault: sizeCircle);
|
||||
return DefaultPhoto(
|
||||
sizeDefault: sizeCircle,
|
||||
iconDefault: sizeIcon,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -43,12 +51,13 @@ class ReferencePhoto extends StatelessWidget {
|
||||
builder: (BuildContext context, AsyncSnapshot<Widget> snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
// mientras la llamada asíncrona está en proceso, muestra un mensaje de carga
|
||||
return const SizedBox(
|
||||
width: photoSize,
|
||||
height: photoSize,
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(),
|
||||
));
|
||||
return SizedBox(
|
||||
width: size,
|
||||
height: size,
|
||||
child: const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
);
|
||||
} else if (snapshot.connectionState == ConnectionState.done &&
|
||||
snapshot.hasData) {
|
||||
return snapshot.data!;
|
||||
@@ -61,7 +70,12 @@ class ReferencePhoto extends StatelessWidget {
|
||||
|
||||
class DefaultPhoto extends StatelessWidget {
|
||||
double sizeDefault;
|
||||
DefaultPhoto({super.key, this.sizeDefault = photoSize});
|
||||
double iconDefault;
|
||||
DefaultPhoto({
|
||||
super.key,
|
||||
this.sizeDefault = photoSize,
|
||||
this.iconDefault = iconSize,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -72,12 +86,12 @@ class DefaultPhoto extends StatelessWidget {
|
||||
color: const Color(0xFF2BA4EC),
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
),
|
||||
child: const Icon(
|
||||
child: Icon(
|
||||
Icons.person,
|
||||
color: Color.fromARGB(255, 255, 255, 255),
|
||||
size: 55,
|
||||
color: const Color.fromARGB(255, 255, 255, 255),
|
||||
size: iconDefault,
|
||||
),
|
||||
);
|
||||
).animate().shake();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user