Skip to content

Commit

Permalink
Merge pull request #122 from DAB-Co/27-03-22
Browse files Browse the repository at this point in the history
27 03 22
  • Loading branch information
atillaturkmen authored Mar 29, 2022
2 parents 13d9c60 + f33ac35 commit 674ac52
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 10 deletions.
14 changes: 14 additions & 0 deletions lib/config/valid_chat_languages.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import 'package:language_picker/languages.dart';

final supportedLanguages = [
Languages.english,
Languages.turkish,
Languages.spanish,
Languages.japanese,
Languages.hindi,
Languages.russian,
Languages.french,
Languages.german,
Languages.italian,
Languages.korean,
];
2 changes: 2 additions & 0 deletions lib/pages/chat_language.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:jam/config/routes.dart';
import 'package:jam/config/valid_chat_languages.dart';
import 'package:jam/models/user.dart';
import 'package:jam/network/set_languages.dart';
import 'package:jam/providers/user_provider.dart';
Expand Down Expand Up @@ -100,6 +101,7 @@ class _ChatLanguageState extends State<ChatLanguage> {
builder: (context) => Theme(
data: Theme.of(context).copyWith(primaryColor: Colors.pink),
child: LanguagePickerDialog(
languages: supportedLanguages,
titlePadding: const EdgeInsets.all(8.0),
searchCursorColor: Colors.pinkAccent,
searchInputDecoration: InputDecoration(hintText: 'Search...'),
Expand Down
3 changes: 1 addition & 2 deletions lib/pages/homepage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,11 @@ class _HomepageState extends State<Homepage> {
progressColor: Colors.pinkAccent,
),
),
Divider(color: Colors.grey),
SizedBox(height: 10),
],
),
),
),
Divider(color: Colors.grey),
FutureBuilder(
future: Provider.of<MessageProvider>(context, listen: false).init(
Provider.of<UnreadMessageProvider>(context, listen: false),
Expand Down
23 changes: 15 additions & 8 deletions lib/widgets/messages_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:hive_flutter/hive_flutter.dart';
import 'package:jam/config/box_names.dart';
import 'package:jam/models/chat_pair_model.dart';
import 'package:jam/pages/dm.dart';
import 'package:jam/pages/profile_other.dart';
import 'package:jam/util/util_functions.dart';

messagesList(user, context) {
Expand Down Expand Up @@ -32,16 +33,22 @@ messagesList(user, context) {
? Padding(
padding: EdgeInsets.only(top: 5, bottom: 5),
child: ListTile(
leading: Image(
image: AssetImage("assets/avatar.png"),
leading: IconButton(
padding: EdgeInsets.all(0),
iconSize: 70,
icon: Image.asset("assets/avatar.png"),
onPressed: () => Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ProfileOther(
otherUsername: chats[index].username,
otherId: chats[index].userId,
),
),
),
),
title: Text(chats[index].username),
subtitle: chats[index].isBlocked
? Text(
"Blocked",
style: TextStyle(fontStyle: FontStyle.italic),
)
: Text(chats[index].lastMessage),
subtitle: Text(chats[index].lastMessage),
trailing: chats[index].unreadMessages == 0
? Text("")
: Container(
Expand Down

0 comments on commit 674ac52

Please sign in to comment.