Skip to content

🚀 Feature: Improve API syntax #94

@superakabo

Description

@superakabo

🔖 Feature description

The APIs for Appwrite can be improved, made less verbose and more Dart/Flutter friendly by adopting a declarative approach in many scenarios. Also, since majority of Appwriters might have experience with Firebase, I think it will be best to create similar APIs or better. I think the experience will be better if developers for example, do not have to create instances of Client, Users, Database, Storage etc. objects first.

🎤 Pitch

Instead of

Client client = Client();
client
    .setEndpoint('https://localhost/v1') // Your Appwrite Endpoint
    .setProject('5e8cf4f46b5e8') // Your project ID
    .setSelfSigned(); // Use only on dev mode with a self-signed SSL cert

It can be

Appwrite.instance.initialize(
   endpoint: 'https://localhost/v1',
   propjectId:'5e8cf4f46b5e8',
   selfSigned: true,
);

Instead of

Users users = Users(client);
Future result = users.create(
    userId: '[USER_ID]',
    email: 'me@appwrite.io',
    password: 'password',
    name: 'My Name'
 );

It can be

Appwrite.instance.createUser(
    userId: '[USER_ID]',
    email: 'me@appwrite.io',
    password: 'password',
    name: 'My Name'
);

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions