Doubt in flutter

31 views
Skip to first unread message

P Sanjeevi

unread,
May 5, 2021, 11:16:40 AM5/5/21
to flutt...@googlegroups.com
Hi guys I am trying to create a fully functional dating app in flutter where we match 2 users and upon matching I need to chat with them and I tried implementing it using firebase, firestore and mobx but what happens is that it is taking the user id that I have already registered and I am not able to do the matching of 2 users can anyone help 

Suzuki Tomohiro

unread,
May 5, 2021, 11:51:26 AM5/5/21
to P Sanjeevi, Flutter Development (flutter-dev)
> it is taking the user id that I have already registered and I am not able to do the matching of 2 users

Can you describe the challenge in more detail?

On Wed, May 5, 2021 at 11:16 AM P Sanjeevi <patnamsa...@gmail.com> wrote:
Hi guys I am trying to create a fully functional dating app in flutter where we match 2 users and upon matching I need to chat with them and I tried implementing it using firebase, firestore and mobx but what happens is that it is taking the user id that I have already registered and I am not able to do the matching of 2 users can anyone help 

--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/CAC8nu7RFq%2BY7eAp-nDH%3DaNshHwnNFiNUPKaZfm2OfJi3_B3%3DRQ%40mail.gmail.com.

Suzuki Tomohiro

unread,
May 5, 2021, 12:05:26 PM5/5/21
to P Sanjeevi, Flutter Development (flutter-dev)
(Please respond to flutter-dev mailing list; otherwise I will stop responding to you.)

> it is not working as I am taking only 1 user id that is registered user id

It's not clear why it's a problem. It's normal for 1 user to have 1 user ID. Would you describe the expected behavior of the app in your words? (Use your words; please don't say "it should work as the same way as tinder or bumble")

On Wed, May 5, 2021 at 12:03 PM Suzuki Tomohiro <suz...@gmail.com> wrote:
> it is not working as I am taking only 1 user id that is registered user id

It's not clear why it's a problem. It's normal for 1 user to have 1 user ID. Would you describe the expected behavior of the app in your words? (Use your words; please don't say "it should work as the same way as tinder or bumble")



On Wed, May 5, 2021 at 11:57 AM P Sanjeevi <patnamsa...@gmail.com> wrote:
Ok so generally I am trying to recreate the same functionality present in tinder or bumble apps where we do the match request but in my case it is not working as I am taking only 1 user id that is registered user id

P Sanjeevi

unread,
May 5, 2021, 12:09:32 PM5/5/21
to Suzuki Tomohiro, flutt...@googlegroups.com
Ok so I need my app to display the list of other registered users and when I press a button I need a new collection to be added where it needs to store the registered user details and also the one that I am sending the match request and upon that I need to have another button where upon clicking I need to chat with that person this is what I want to achieve 

On Wed, 5 May, 2021, 9:38 pm P Sanjeevi, <patnamsa...@gmail.com> wrote:
I am doing that only bro 

Suzuki Tomohiro

unread,
May 5, 2021, 12:14:50 PM5/5/21
to P Sanjeevi, Flutter Development (flutter-dev)
I see 3 elements in your statements. Let's see one by one.

1. my app to display the list of other registered users
2. when I press a button I need a new collection to be added where it needs to store the registered user details the one that I am sending the match request
3. upon that I need to have another button where upon clicking I need to chat with that person

You seem to know what to do. What is the challenge?
  • Do you know how to display the list of other registered users?
  • Do you know how to place a button in UI?




P Sanjeevi

unread,
May 5, 2021, 12:17:42 PM5/5/21
to Suzuki Tomohiro, flutt...@googlegroups.com
Yes I have already written the code but it's not working according to the elements that u mentioned 

Suzuki Tomohiro

unread,
May 5, 2021, 12:19:13 PM5/5/21
to P Sanjeevi, Flutter Development (flutter-dev)
Which part is not working? Do you want to share your code and screenshots?

P Sanjeevi

unread,
May 5, 2021, 12:21:11 PM5/5/21
to Suzuki Tomohiro, flutt...@googlegroups.com
The part where we need to match 2 people and sure I will send u screenshots and videos 

P Sanjeevi

unread,
May 5, 2021, 12:22:28 PM5/5/21
to Suzuki Tomohiro, flutt...@googlegroups.com
And shall I share my code to you through zip if that's OK with you?

P Sanjeevi

unread,
May 5, 2021, 12:33:16 PM5/5/21
to Suzuki Tomohiro, flutt...@googlegroups.com
20210505_215740.jpg
20210505_215750.jpg

P Sanjeevi

unread,
May 5, 2021, 12:33:42 PM5/5/21
to Suzuki Tomohiro, flutt...@googlegroups.com
These are all the screenshots bro 
20210505_215920.jpg
20210505_215908.jpg
20210505_215928.jpg

Suzuki Tomohiro

unread,
May 5, 2021, 1:47:53 PM5/5/21
to P Sanjeevi, flutt...@googlegroups.com
shall I share my code to you through zip if that's OK with you?

I only read public GitHub repositories.

P Sanjeevi

unread,
May 5, 2021, 1:49:48 PM5/5/21
to Suzuki Tomohiro, flutt...@googlegroups.com
Sorry for the above one shall I share the public github link with you?

On Wed, 5 May, 2021, 11:18 pm P Sanjeevi, <patnamsa...@gmail.com> wrote:
Well ok shall I share the github link with you?

Suzuki Tomohiro

unread,
May 5, 2021, 2:07:36 PM5/5/21
to P Sanjeevi, flutt...@googlegroups.com
Yes, share the URL to this flutter-dev mailing list.

P Sanjeevi

unread,
May 5, 2021, 2:37:48 PM5/5/21
to Suzuki Tomohiro, flutt...@googlegroups.com
Sorry for the late reply but here is the github link that u asked bro

Suzuki Tomohiro

unread,
May 5, 2021, 6:30:57 PM5/5/21
to P Sanjeevi, flutt...@googlegroups.com
The error is about missing documents in “chats” collection. Your code needs to specify correct location of documents.

What do you need help?

P Sanjeevi

unread,
May 6, 2021, 2:09:03 AM5/6/21
to Suzuki Tomohiro, flutt...@googlegroups.com
Well if u see the firestore photos that I sent u all the uids look the same but it needs to have different uid only then the match request functionality and chat functionality becomes correct so can u just look at the code and tell me where it needs to change so that I can change 

P Sanjeevi

unread,
May 6, 2021, 5:02:58 AM5/6/21
to Suzuki Tomohiro, flutt...@googlegroups.com
And also the length getting null where all the matched users will be shown if u have chatted with them 

Suzuki Tomohiro

unread,
May 6, 2021, 7:51:00 AM5/6/21
to P Sanjeevi, flutt...@googlegroups.com
Let’s solve one problem at a time.

the firestore photos that I sent u all the uids look the same but it needs to have different uid only

Which code is responsible for this?

P Sanjeevi

unread,
May 6, 2021, 7:53:00 AM5/6/21
to Suzuki Tomohiro, flutt...@googlegroups.com
chat_screen.dart and match_screen.dart file bro

P Sanjeevi

unread,
May 6, 2021, 7:55:42 AM5/6/21
to Suzuki Tomohiro, flutt...@googlegroups.com
In chat_screen.dart file I need to display the matched users that I have chatted with and in match_screen.dart file I need the other users who are registered to the users apart from the registered user to be displayed

Suzuki Tomohiro

unread,
May 6, 2021, 7:59:03 AM5/6/21
to P Sanjeevi, flutt...@googlegroups.com
Which line of the code created the bad firestore document?

P Sanjeevi

unread,
May 6, 2021, 8:03:34 AM5/6/21
to Suzuki Tomohiro, flutt...@googlegroups.com

I guess it's the chat_screen inside second future builder there is           if(connectionState.waiting) condition

On Thu, 6 May, 2021, 5:31 pm P Sanjeevi, <patnamsa...@gmail.com> wrote:
I guess it's the chat_screen inside second future builder there is           if(connectionState.waiting) condition 

Suzuki Tomohiro

unread,
May 6, 2021, 8:15:59 AM5/6/21
to P Sanjeevi, flutt...@googlegroups.com
Good. Set a breakpoint at that line that created the bad document. Read the stack trace to see why it has two uids with the same value.

P Sanjeevi

unread,
May 6, 2021, 8:20:14 AM5/6/21
to Suzuki Tomohiro, flutt...@googlegroups.com
It's because I set the same id so how to place 2 different ids

Suzuki Tomohiro

unread,
May 6, 2021, 8:23:26 AM5/6/21
to P Sanjeevi, flutt...@googlegroups.com
Can you share the stack trace as text? It has line numbers and clarifies why it happens.

P Sanjeevi

unread,
May 6, 2021, 8:26:07 AM5/6/21
to Suzuki Tomohiro, flutt...@googlegroups.com
Ok just a minute 

P Sanjeevi

unread,
May 6, 2021, 8:36:34 AM5/6/21
to Suzuki Tomohiro, flutt...@googlegroups.com

_name:
"ConnectionState.waiting"
index:1
hashCode:926647089
runtimeType:Type (ConnectionState)
data:null
error:null
stackTrace:null
hasData:false
hasError:false
hashCode:94098995
requireData:Unhandled exception: Bad state: Snapshot has neither data nor error #0 AsyncSnapshot.requireData (package:flutter/src/widgets/async.dart:253:5) #1 AsyncSnapshot.Eval () #2 _ChatScreenState.build.<anonymous closure>.<anonymous closure> (package:minglewise_clone_app/pages/chat_screen.dart:39:41) #3 _FutureBuilderState.build (package:flutter/src/widgets/async.dart:773:55) #4 StatefulElement.build (package:flutter/src/widgets/framework.dart:4612:27) #5 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4495:15) #6 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4667:11) #7 Element.rebuild (package:flutter/src/widgets/framework.dart:4189:5) #8 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4474:5) #9 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4658:11) #10 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4469:5) #11 Element.inflateWidg...
runtimeType:Type (AsyncSnapshot<List<ChatWithUser>>)
hashCode:74695014
runtimeType:Type (Type)
hashCode:991938221
runtimeType:Type (Type)
hashCode:991938221
runtimeType:Type (Type)

P Sanjeevi

unread,
May 6, 2021, 8:39:08 AM5/6/21
to Suzuki Tomohiro, flutt...@googlegroups.com
This is where that bad state has occurred bro
20210506_180801.jpg

P Sanjeevi

unread,
May 6, 2021, 8:42:44 AM5/6/21
to Suzuki Tomohiro, flutt...@googlegroups.com
_delegate:DocumentSnapshotPlatform
_firestore:FirebaseFirestore (FirebaseFirestore(app: [DEFAULT]))
metadata:<not initialized>
reference:<not initialized>
exists:false
hashCode:1069331846
id:"JUu7xacaIcMIcDpelJVBt3EEoy92JUu7xacaIcMIcDpelJVBt3EEoy92"
runtimeType:Type (_JsonDocumentSnapshot)

P Sanjeevi

unread,
May 6, 2021, 8:43:21 AM5/6/21
to Suzuki Tomohiro, flutt...@googlegroups.com
This is what is there in the stack trace for bad state bro

Suzuki Tomohiro

unread,
May 6, 2021, 8:54:02 AM5/6/21
to P Sanjeevi, flutt...@googlegroups.com
One problem at a time.

the firestore photos that I sent u all the uids look the same but it needs to have different uid only

Give me the stack trace for the line that creates such bad document. (I see your screenshot was an error upon accessing non-existing document.)

P Sanjeevi

unread,
May 6, 2021, 9:00:16 AM5/6/21
to Suzuki Tomohiro, flutt...@googlegroups.com
runtimeType:Type (AppUser)
hashCode:958953013
id:"JUu7xacaIcMIcDpelJVBt3EEoy92"
hashCode:109872757
runtimeType:Type (Type)

P Sanjeevi

unread,
May 6, 2021, 9:00:44 AM5/6/21
to Suzuki Tomohiro, flutt...@googlegroups.com
runtimeType:Type (AppUser)
hashCode:336395146
id:"JUu7xacaIcMIcDpelJVBt3EEoy92"
hashCode:109872757
runtimeType:Type (Type)

P Sanjeevi

unread,
May 6, 2021, 9:01:03 AM5/6/21
to Suzuki Tomohiro, flutt...@googlegroups.com
The above are the stacktraces of each user id

P Sanjeevi

unread,
May 6, 2021, 9:07:24 AM5/6/21
to Suzuki Tomohiro, flutt...@googlegroups.com
And also I checked for all bro it shows the same as the above pictures

Suzuki Tomohiro

unread,
May 6, 2021, 9:10:24 AM5/6/21
to P Sanjeevi, flutt...@googlegroups.com
A stacktrace is stack of function calls. Not the content of objects.

P Sanjeevi

unread,
May 6, 2021, 9:13:06 AM5/6/21
to Suzuki Tomohiro, flutt...@googlegroups.com
Bro that is what it is present whatever is available I sent u bro

Suzuki Tomohiro

unread,
May 6, 2021, 9:15:03 AM5/6/21
to P Sanjeevi, flutt...@googlegroups.com
Ok, then I cannot help further. Good luck.

P Sanjeevi

unread,
May 6, 2021, 9:16:10 AM5/6/21
to Suzuki Tomohiro, flutt...@googlegroups.com
Ok so u are asking me to send the function of the uid placed bro

P Sanjeevi

unread,
May 6, 2021, 9:16:27 AM5/6/21
to Suzuki Tomohiro, flutt...@googlegroups.com
I mean the stacktrace one
Reply all
Reply to author
Forward
0 new messages