Skip to content

Commit

Permalink
🔥 chore(.gitignore): add .firebase/hosting.YnVpbGRcd2Vi.cache to igno…
Browse files Browse the repository at this point in the history
…re list

🎨 style(README.md): update README with project description and screenshot
🔧 chore(firebase.json): add firebase hosting configuration for chat-app-ws site
🐛 fix(chat_page.dart): remove condition to check if message is from other user to fix bug where messages are not received
🎨 style(contacts_page.dart): use const for Icon widget in FloatingActionButton widget
  • Loading branch information
iqfareez committed Apr 30, 2023
1 parent 4fb020e commit e19324f
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "jam-8-apps"
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release
.firebase/hosting.YnVpbGRcd2Vi.cache
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# app_chat

A new Flutter project.
Chat App with WebSocket Backend

![Flutter Chat App UI and websocket](https://imgur.com/TVqui84.png)

## Getting Started

Expand Down
13 changes: 13 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"hosting": {
"public": "build/web",
"site": "chat-app-ws",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
6 changes: 3 additions & 3 deletions lib/screens/chat_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ class _ChatPageState extends State<ChatPage> {
String msg = data['msg'];
String timestamp = data['timestamp'];

if (id == otherUser.id) {
onMessageReceived(msg);
}
// if (id == otherUser.id) {
onMessageReceived(msg);
// }
});
}

Expand Down
2 changes: 1 addition & 1 deletion lib/screens/contacts_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class _ContactsPageState extends State<ContactsPage> {
);
},
label: const Text('Send a message'),
icon: Icon(Icons.message_outlined),
icon: const Icon(Icons.message_outlined),
),
);
}
Expand Down

0 comments on commit e19324f

Please sign in to comment.