implemented avatar management for user profiles and chat rooms, including 1:1 cropping, integrated OCS and Spreed avatar APIs, added cache invalidation logic, and updated the account settings view to display user info and profile pictures.
This commit is contained in:
@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:photo_view/photo_view.dart';
|
||||
|
||||
import '../model/account_data.dart';
|
||||
import '../model/endpoint_data.dart';
|
||||
import 'user_avatar.dart';
|
||||
|
||||
class LargeProfilePictureView extends StatelessWidget {
|
||||
final String id;
|
||||
@@ -14,14 +14,6 @@ class LargeProfilePictureView extends StatelessWidget {
|
||||
super.key,
|
||||
});
|
||||
|
||||
String _imageUrl() {
|
||||
final host = EndpointData().nextcloud().full();
|
||||
if (isGroup) {
|
||||
return 'https://$host/ocs/v2.php/apps/spreed/api/v1/room/$id/avatar';
|
||||
}
|
||||
return 'https://$host/avatar/$id/1024';
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => Scaffold(
|
||||
appBar: AppBar(title: Text(isGroup ? 'Gruppenbild' : 'Profilbild')),
|
||||
@@ -29,7 +21,7 @@ class LargeProfilePictureView extends StatelessWidget {
|
||||
minScale: 0.5,
|
||||
maxScale: 3.0,
|
||||
imageProvider: Image.network(
|
||||
_imageUrl(),
|
||||
avatarUrl(id: id, isGroup: isGroup, size: 1024),
|
||||
headers: {'Authorization': AccountData().getBasicAuthHeader()},
|
||||
).image,
|
||||
backgroundDecoration: BoxDecoration(
|
||||
|
||||
Reference in New Issue
Block a user