My flutter data model uses UniqueKey to generate unique keys for firebase documents:
final String uKey = UniqueKey().toString();
DocumentReference documentReferencer =
_mainCollection.doc(userUid).collection('teams').doc(uKey);
Typically this generates a key e.g. [#81215]
This has been working for a number of years now.
I rebuilt the app with flutter 3.22.1 and now on IOS the same code is generating a single key, literally: Instance of ‘UniqueKey’.
This is not occurring on Android where my test device is generating unique keys as before.
I’m using Xcode 15.4 on an iMac running Sonoma 14.5
Pretty much every collection I have in the app uses this method to create a unique key so the option to replace UniqueKey with an alternative is not so simple.
As far as my googling goes I can’t see any other reports of this issue. Therefore creating this question to check whether anyone has hit the same problem and hopefully solved it.
Martin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.