can i use UniqueKey to generate UID?

217 views
Skip to first unread message

che.ca...@gmail.com

unread,
Jul 23, 2020, 8:59:15 AM7/23/20
to Flutter Development (flutter-dev)
I want to generate unique user id, so can i use UniqueKey().toString() to be UID?

Suzuki Tomohiro

unread,
Jul 23, 2020, 9:34:40 AM7/23/20
to che.ca...@gmail.com, Flutter Development (flutter-dev)
I don’t think you want to use UniqueKey for user id generation because it’s not unique among multiple devices.

If you use Firestore, just creating a document gives a unique ID.


On Thu, Jul 23, 2020 at 08:59 che.ca...@gmail.com <che.ca...@gmail.com> wrote:
I want to generate unique user id, so can i use UniqueKey().toString() to be UID?

--
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/3bdc4bca-d031-4086-ae2e-22a572482fe6n%40googlegroups.com.

wa...@clinicianfirst.com

unread,
Jul 23, 2020, 8:04:09 PM7/23/20
to Flutter Development (flutter-dev)
If you're looking to generate UIDs, check out:  https://pub.dev/packages/uuid  

che.ca...@gmail.com

unread,
Jul 23, 2020, 8:50:36 PM7/23/20
to Flutter Development (flutter-dev)
yeah, i know the UUID package, but it is too long, what i need is only a 8 characters maxinum UID.
Reply all
Reply to author
Forward
0 new messages