Created the populatedDrawer widget and the Avatar widget

This commit is contained in:
Mariano Uvalle 2019-04-15 20:27:42 -05:00
parent 0d47b271fe
commit 3c1c3c68b2
6 changed files with 192 additions and 32 deletions

View file

@ -0,0 +1,39 @@
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class Avatar extends StatelessWidget {
/// The url of hte image to be displayed.
final String imageUrl;
/// The size of the Avatar.
final double size;
Avatar({
this.imageUrl,
this.size = 60.0,
});
Widget build(BuildContext context) {
return imageUrl == null
? Container(
height: size,
width: size,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(30),
),
child: Center(
child: Icon(
FontAwesomeIcons.question,
),
),
)
: ClipOval(
child: Image.network(
imageUrl,
height: size,
width: size,
),
);
}
}