HEy there! i used ID.unique() quite a lot. but suddenly, Flutter doesnt correctly recognize it.
Instead of saving a unique ID, i get te literal ID "unique()"
Why could that be?
flutter: Signature ID: unique()
Print ID
Future<void> uploadSignature(
String name, String fileName, int isCustomer, String documentID) async {
try {
log('Uploading Signature...');
String signatureID = ID.unique();
print('Signature ID: $signatureID');
final fullPath = await _getFullImagePath(fileName);
final file = File(fullPath);
if (await file.exists()) {
await appwriteDatabaseHelper.database.createDocument(
documentId: signatureID,
databaseId: appwriteDatabaseID,
collectionId: appwriteSignatureCollection,
data: {
'signatureID': signatureID,
'name': name,
'isCustomer': isCustomer,
'servicescheincollection': documentID,
},
);
log('Uploaded Signature $signatureID successfully');
log('Uploading Signature to storage...');
try {
await uploadImage(fullPath, signatureID);
} catch (e) {
log('Uploading Signature failed: $e');
}
} else {
log('File not found: $fullPath');
}
} catch (e) {
log('Uploading Signature failed: $e');
}
}
Function
When pressing on the unique Function, it makes sense cause it only says this
``part of appwrite;
/// Helper class to generate ID strings for resources. class ID { ID._();
/// Have Appwrite generate a unique ID for you. static String unique() { return 'unique()'; }
/// Uses [id] as the ID for the resource. static String custom(String id) { return id; } } `` and literally returns unique()...
I looked into a different branch and its working as intended with the same Version of appwrite. WHat could i have made it not work here?
i´ll gladly provide more code...
Recommended threads
- SELF HOSTING ISSUE, DATA NOT MIGRATING T...
Hey, devs, I recently tried to migrate my cloud instance to a self hosted version but my data is not transferred fully only the table structure is transferred ...
- No Document ID?
Hi I have a self hosted appwrite. My documents get a document ID but are not visible in the console. I don't know why this happens and how to fix this
- How to determine if a user is anonymous?
This is probably a silly question, but I have not yet found a good answer. Is there a method to determine if the current session is anonymous aside from seein...