-
Notifications
You must be signed in to change notification settings - Fork 104
/
Copy pathcircle_avatar.dart
34 lines (32 loc) · 952 Bytes
/
circle_avatar.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import 'package:flutter/material.dart';
class MyCircleAvatar extends StatelessWidget {
const MyCircleAvatar({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white24,
appBar: AppBar(
backgroundColor: Colors.black26,
title: const Text('Circle Avatar'),
),
body: Stack(
// clipBehavior helps to display profile pic like that
clipBehavior: Clip.none,
alignment: Alignment.center,
children: [
Image.asset('assets/images/background_image/brick_back.jpeg'),
const Positioned(
top: 100,
child: CircleAvatar(
radius: 70,
backgroundColor: Colors.white,
backgroundImage: AssetImage(
'assets/images/profile_pic/profile_pic.jpeg',
),
),
),
],
),
);
}
}