I have a design for an appbar like this:

But I don't know how to set for the avatar exactly. All I can do is:

PreferredSize(
preferredSize: const Size.fromHeight(150),
child: Container(
height: 160,
child: AppBar(
centerTitle: true,
title: Text(
'Setting',
style: context.bodyLarge.copyWith(
color: Colors.white,
fontSize: 20.sp,
fontWeight: FontWeight.w200,
),
),
backgroundColor: context.theme.primaryColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
bottom: Radius.elliptical(
MediaQuery.of(context).size.width, 50.0)),
),
flexibleSpace: Stack(
children: [
Positioned(
left: (MediaQuery.of(context).size.width / 2) - 50,
top: 100,
child: CircleAvatar(
radius: 50,
backgroundImage: Image.network(
'https://avatars.githubusercontent.com/u/113747320?v=4')
.image,
),
),
],
),
),
),
)
I tried to achive it with a bigger parent preferredSize but still wont work
In my case it is working fine!
Try this!
OUTPUT:
CODE: