appwrite 23.0.0 copy "appwrite: ^23.0.0" to clipboard
appwrite: ^23.0.0 copied to clipboard

Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API

example/README.md

Examples #

Init your Appwrite client:

Client client = Client();

client
    .setEndpoint('https://localhost/v1') // Your Appwrite Endpoint
    .setProject('5e8cf4f46b5e8') // Your project ID
    .setSelfSigned() // Remove in production
;

Create a new user and session:

Account account = Account(client);

final user = await account.create(userId: ID.unique(), email: "email@example.com", password: "password", name: "Walter O'Brien");
 
final session = await account.createEmailSession(email: 'me@appwrite.io', password: 'password');

Fetch user profile:

Account account = Account(client);

final profile = await account.get();

Upload File:

Storage storage = Storage(client);

late InputFile file;

if(kIsWeb) {
    file = InputFile(bytes: pickedFile.bytes, filename: 'image.jpg');
} else {
    file = InputFile(path: './path-to-file/image.jpg', filename: 'image.jpg');
}

storage.createFile(
    bucketId: '[BUCKET_ID]',
    fileId: '[FILE_ID]', // use 'unique()' to automatically generate a unique ID
    file: file,
    permissions: [
      Permission.read(Role.any()),
    ],
)
.then((response) {
    print(response); // File uploaded!
})
.catchError((error) {
    print(error.response);
});

All examples and API features are available at the official Appwrite docs

578
likes
140
points
10.4k
downloads

Documentation

Documentation
API reference

Publisher

verified publisherappwrite.io

Weekly Downloads

Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API

Homepage
Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

cookie_jar, device_info_plus, flutter, flutter_web_auth_2, http, package_info_plus, path_provider, web, web_socket_channel

More

Packages that depend on appwrite