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
- Redirect from clicking team invite link ...
Hi all! Pretty new to app development in general so this might be something more generic than appwrite, but I've found (after reading the docs for the Teams API...
- Hosting Issues with Static IP not domain...
I have a machine with Static Public IP. I want to host Appwrite Site on it but I tried it but it doesn't allow IP addresses in Domain names. What should I do h...
- encrypt and decrypt buckets
I have a bucket where I switched from encryption to not encrypting files. I later realized that files already uploaded earlier stay encrypted. Now I have a buck...