appwrite/docs/examples/1.5.x/server-dart/examples/databases/create-string-attribute.md

20 lines
592 B
Markdown
Raw Normal View History

2024-02-05 12:40:51 +00:00
import 'package:dart_appwrite/dart_appwrite.dart';
2024-02-21 11:31:50 +00:00
Client client = Client()
2025-04-22 13:02:33 +00:00
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
2024-02-05 12:40:51 +00:00
2024-02-21 11:31:50 +00:00
Databases databases = Databases(client);
2024-02-05 12:40:51 +00:00
2024-02-27 08:12:00 +00:00
AttributeString result = await databases.createStringAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
size: 1,
xrequired: false,
xdefault: '<DEFAULT>', // (optional)
array: false, // (optional)
encrypt: false, // (optional)
2024-02-21 11:31:50 +00:00
);