refactor: New private chat

This commit is contained in:
Krille 2022-12-30 14:37:13 +01:00
commit 6fc8aaa1bb
2 changed files with 80 additions and 83 deletions

View file

@ -11,7 +11,6 @@ class ContentBanner extends StatelessWidget {
final void Function()? onEdit;
final Client? client;
final double opacity;
final String heroTag;
const ContentBanner(
{this.mxContent,
@ -20,7 +19,6 @@ class ContentBanner extends StatelessWidget {
this.onEdit,
this.client,
this.opacity = 0.75,
this.heroTag = 'content_banner',
Key? key})
: super(key: key);
@ -42,27 +40,23 @@ class ContentBanner extends StatelessWidget {
bottom: 0,
child: Opacity(
opacity: opacity,
child: Hero(
tag: heroTag,
child: mxContent == null
? Center(
child: Icon(
defaultIcon,
color: Theme.of(context)
.colorScheme
.onSecondaryContainer,
size: 128,
),
)
: MxcImage(
key: Key(mxContent?.toString() ?? 'NoKey'),
uri: mxContent,
animated: true,
fit: BoxFit.cover,
height: 400,
width: 800,
child: mxContent == null
? Center(
child: Icon(
defaultIcon,
color:
Theme.of(context).colorScheme.onSecondaryContainer,
size: 128,
),
),
)
: MxcImage(
key: Key(mxContent?.toString() ?? 'NoKey'),
uri: mxContent,
animated: true,
fit: BoxFit.cover,
height: 400,
width: 800,
),
),
),
if (onEdit != null)
@ -71,6 +65,7 @@ class ContentBanner extends StatelessWidget {
alignment: Alignment.bottomRight,
child: FloatingActionButton(
mini: true,
heroTag: null,
onPressed: onEdit,
backgroundColor: Theme.of(context).backgroundColor,
foregroundColor: Theme.of(context).textTheme.bodyText1?.color,