Cleanup
This commit is contained in:
@ -1,12 +1,8 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:jiffy/jiffy.dart';
|
||||
import 'package:marianum_mobile/api/marianumcloud/talk/room/getRoomResponse.dart';
|
||||
import 'package:marianum_mobile/data/chatList/chatListProps.dart';
|
||||
import 'package:marianum_mobile/widget/loadingPacket.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
@ -49,7 +45,7 @@ class _ChatListState extends State<ChatList> {
|
||||
|
||||
for (var chatRoom in data.getRoomsResponse.sortByLastActivity()) {
|
||||
|
||||
CircleAvatar _circleAvatar = CircleAvatar(
|
||||
CircleAvatar circleAvatar = CircleAvatar(
|
||||
foregroundImage: chatRoom.type == GetRoomResponseObjectConversationType.oneToOne ? Image.network("https://cloud.marianum-fulda.de/avatar/${chatRoom.name}/128").image : null,
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
foregroundColor: Colors.white,
|
||||
@ -81,13 +77,13 @@ class _ChatListState extends State<ChatList> {
|
||||
),
|
||||
),
|
||||
),
|
||||
leading: _circleAvatar,
|
||||
leading: circleAvatar,
|
||||
onTap: () async {
|
||||
Navigator.of(context).push(MaterialPageRoute(builder: (context) {
|
||||
return ChatView(
|
||||
user: chatRoom,
|
||||
selfId: username,
|
||||
avatar: _circleAvatar,
|
||||
avatar: circleAvatar,
|
||||
);
|
||||
}));
|
||||
},
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:bubble/bubble.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@ -63,7 +62,6 @@ class _ChatViewState extends State<ChatView> {
|
||||
List<Bubble> messages = List<Bubble>.empty(growable: true);
|
||||
|
||||
if(!data.primaryLoading()) {
|
||||
String lastActor = "";
|
||||
bool showMetadata = true;
|
||||
|
||||
data.getChatResponse.sortByTimestamp().forEach((element) {
|
||||
@ -93,7 +91,7 @@ class _ChatViewState extends State<ChatView> {
|
||||
child: Positioned(
|
||||
top: 0,
|
||||
left: 0,
|
||||
child: Text("${element.actorDisplayName}", style: TextStyle(fontWeight: FontWeight.bold, color: Theme.of(context).primaryColor)),
|
||||
child: Text(element.actorDisplayName, style: TextStyle(fontWeight: FontWeight.bold, color: Theme.of(context).primaryColor)),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
@ -114,8 +112,6 @@ class _ChatViewState extends State<ChatView> {
|
||||
],
|
||||
),
|
||||
));
|
||||
|
||||
lastActor = element.actorId;
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user