Commit 3afc89a9 authored by Wilko Manger's avatar Wilko Manger

Reflect Chat name change in widgets

parent 43952f2e
{"_info":"// This is a generated file; do not edit or check into version control.","dependencyGraph":[{"name":"device_info","dependencies":[]},{"name":"firebase_core","dependencies":[]},{"name":"firebase_messaging","dependencies":[]},{"name":"flutter_local_notifications","dependencies":[]},{"name":"image_picker","dependencies":[]},{"name":"moor_ffi","dependencies":[]},{"name":"package_info","dependencies":[]},{"name":"path_provider","dependencies":[]},{"name":"respect_24_hour","dependencies":[]},{"name":"shared_preferences","dependencies":[]},{"name":"sqflite","dependencies":[]},{"name":"url_launcher","dependencies":[]}]}
\ No newline at end of file
{
"project_info": {
"project_number": "674206684257",
"firebase_url": "https://api-5266270474180827635-19517.firebaseio.com",
"project_id": "api-5266270474180827635-19517",
"storage_bucket": "api-5266270474180827635-19517.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:674206684257:android:e3434676a7337b3abd4620",
"android_client_info": {
"package_name": "im.pattle.app"
}
},
"oauth_client": [
{
"client_id": "674206684257-smh8pioi0l0o8024eonuke5l4o0hij9q.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyBqXGm0qL1-7Iu8xygiyK3EdV-_OOYVbJ0"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "674206684257-smh8pioi0l0o8024eonuke5l4o0hij9q.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
\ No newline at end of file
......@@ -31,7 +31,7 @@ import 'resources/theme.dart';
import 'section/main/chat/page.dart';
import 'section/main/chat/image/page.dart';
import 'section/main/chat/settings/page.dart';
import 'section/main/chats/models/chat_overview.dart';
import 'section/main/chats/models/chat.dart';
import 'section/main/chats/page.dart';
import 'section/main/chats/create/group/details_page.dart';
import 'section/main/chats/create/group/members_page.dart';
......
......@@ -26,7 +26,7 @@ import 'package:pattle/src/app.dart';
import 'package:pattle/src/resources/localizations.dart';
import 'package:pattle/src/resources/theme.dart';
import 'package:pattle/src/section/main/chats/models/chat_overview.dart';
import 'package:pattle/src/section/main/chats/models/chat.dart';
import 'package:pattle/src/section/main/widgets/chat_name.dart';
import 'package:pattle/src/section/main/widgets/error.dart';
import 'package:pattle/src/section/main/widgets/title_with_sub.dart';
......
......@@ -23,7 +23,7 @@ import 'package:matrix_sdk/matrix_sdk.dart';
import 'package:pattle/src/resources/localizations.dart';
import 'package:pattle/src/resources/theme.dart';
import 'package:pattle/src/section/main/chats/models/chat_overview.dart';
import 'package:pattle/src/section/main/chats/models/chat.dart';
import 'package:pattle/src/section/main/widgets/chat_name.dart';
import 'package:pattle/src/section/main/widgets/user_item.dart';
......
......@@ -21,7 +21,7 @@ import 'package:pattle/src/section/main/models/chat_message.dart';
import '../../../matrix.dart';
import '../../../util/room.dart';
import 'models/chat_overview.dart';
import 'models/chat.dart';
import 'event.dart';
export 'event.dart';
......
......@@ -23,7 +23,7 @@ import 'package:pattle/src/resources/localizations.dart';
import '../../../matrix.dart';
import 'bloc.dart';
import 'widgets/chat_overview_list.dart';
import 'widgets/chat_list.dart';
class ChatsPage extends StatefulWidget {
ChatsPage._();
......@@ -114,7 +114,7 @@ class _ChatsTab extends StatelessWidget {
Widget build(BuildContext context) {
return BlocBuilder<ChatsBloc, ChatsState>(builder: (context, state) {
if (state is ChatsLoaded) {
return ChatOverviewList(
return ChatList(
chats: personal ? state.personal : state.public,
);
} else {
......
import 'package:meta/meta.dart';
import 'package:equatable/equatable.dart';
import 'package:pattle/src/section/main/chats/models/chat_overview.dart';
import 'package:pattle/src/section/main/chats/models/chat.dart';
abstract class ChatsState extends Equatable {
@override
......
......@@ -17,23 +17,23 @@
import 'package:flutter/material.dart';
import 'package:pattle/src/app.dart';
import 'package:pattle/src/section/main/chats/models/chat_overview.dart';
import 'package:pattle/src/section/main/chats/models/chat.dart';
import 'package:pattle/src/section/main/widgets/chat_name.dart';
import 'package:pattle/src/util/date_format.dart';
import 'chat_avatar.dart';
import 'subtitle.dart';
class ChatOverviewList extends StatefulWidget {
class ChatList extends StatefulWidget {
final List<Chat> chats;
const ChatOverviewList({Key key, this.chats}) : super(key: key);
const ChatList({Key key, this.chats}) : super(key: key);
@override
State<StatefulWidget> createState() => ChatOverviewListState();
State<StatefulWidget> createState() => ChatListState();
}
class ChatOverviewListState extends State<ChatOverviewList> {
class ChatListState extends State<ChatList> {
@override
Widget build(BuildContext context) {
return Scrollbar(
......@@ -45,13 +45,13 @@ class ChatOverviewListState extends State<ChatOverviewList> {
),
itemCount: widget.chats.length,
itemBuilder: (context, index) {
return _buildChatOverview(widget.chats[index]);
return _buildChat(widget.chats[index]);
},
),
);
}
Widget _buildChatOverview(Chat chat) {
Widget _buildChat(Chat chat) {
final time = formatAsListItem(context, chat.latestMessage?.event?.time);
return ListTile(
......
......@@ -22,7 +22,7 @@ import 'package:pattle/src/section/main/chat/widgets/bubble/state/content/creati
import 'package:pattle/src/section/main/chat/widgets/bubble/state/content/member_change.dart';
import 'package:pattle/src/section/main/chat/widgets/bubble/state/content/topic_change.dart';
import 'package:pattle/src/section/main/chat/widgets/bubble/state/content/upgrade.dart';
import 'package:pattle/src/section/main/chats/models/chat_overview.dart';
import 'package:pattle/src/section/main/chats/models/chat.dart';
import 'package:provider/provider.dart';
import '../../../../matrix.dart';
......
......@@ -18,7 +18,7 @@
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:pattle/src/resources/localizations.dart';
import 'package:pattle/src/section/main/chats/models/chat_overview.dart';
import 'package:pattle/src/section/main/chats/models/chat.dart';
class ChatName extends StatelessWidget {
final Chat chat;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment