Added details for chats with participants list
This commit is contained in:
15
lib/widget/clickableAppBar.dart
Normal file
15
lib/widget/clickableAppBar.dart
Normal file
@ -0,0 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ClickableAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
final VoidCallback onTap;
|
||||
final AppBar appBar;
|
||||
const ClickableAppBar({required this.onTap, required this.appBar, super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(onTap: onTap, child: appBar);
|
||||
}
|
||||
|
||||
@override
|
||||
Size get preferredSize => appBar.preferredSize;
|
||||
}
|
22
lib/widget/largeProfilePictureView.dart
Normal file
22
lib/widget/largeProfilePictureView.dart
Normal file
@ -0,0 +1,22 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:photo_view/photo_view.dart';
|
||||
|
||||
import '../model/endpointData.dart';
|
||||
|
||||
class LargeProfilePictureView extends StatelessWidget {
|
||||
final String username;
|
||||
const LargeProfilePictureView(this.username, {super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text("Profilbild"),
|
||||
),
|
||||
body: PhotoView(
|
||||
imageProvider: Image.network("https://${EndpointData().nextcloud().full()}/avatar/$username/1024").image,
|
||||
backgroundDecoration: BoxDecoration(color: Theme.of(context).colorScheme.surface),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -5,16 +5,19 @@ import '../model/endpointData.dart';
|
||||
class UserAvatar extends StatelessWidget {
|
||||
final String username;
|
||||
final bool isGroup;
|
||||
const UserAvatar({required this.username, this.isGroup = false, super.key});
|
||||
final int size;
|
||||
const UserAvatar({required this.username, this.isGroup = false, this.size = 20, super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CircleAvatar(
|
||||
foregroundImage: !isGroup ? Image.network("https://${EndpointData().nextcloud().full()}/avatar/$username/128").image : null,
|
||||
foregroundImage: !isGroup ? Image.network("https://${EndpointData().nextcloud().full()}/avatar/$username/$size").image : null,
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
foregroundColor: Colors.white,
|
||||
onForegroundImageError: !isGroup ? (o, t) {} : null,
|
||||
child: isGroup ? const Icon(Icons.group) : const Icon(Icons.person),
|
||||
radius: size.toDouble(),
|
||||
child: isGroup ? Icon(Icons.group, size: size.toDouble()) : Icon(Icons.person, size: size.toDouble()),
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user