Skip to content

Instantly share code, notes, and snippets.

@this-is-richard
Created March 10, 2019 16:51
Show Gist options
  • Save this-is-richard/d4a8224365efffdc43849457c3ac2d68 to your computer and use it in GitHub Desktop.
Save this-is-richard/d4a8224365efffdc43849457c3ac2d68 to your computer and use it in GitHub Desktop.
// Inside the build() method of our ChatRoom() widget
return Scaffold(
backgroundColor: Color(0xFFECE5DD),
appBar: AppBar(
title: SizedBox(
width: double.infinity,
child: Stack(
overflow: Overflow.visible,
children: <Widget>[
Positioned(
left: leftOffset,
top: defaultIconButtonPadding,
child: CircleAvatar(
radius: avatarRadius,
child: chatItem.avatar,
),
),
Positioned(
left: leftOffset + avatarRadius * 2 + 8.0,
top: defaultIconButtonPadding +
avatarRadius / 2 -
titleLineHeight,
child: Text(chatItem.name),
),
],
// ...below remains the same
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment