Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## 21.0.0

* Add array-based enum parameters (e.g., `permissions: List<BrowserPermission>`).
* Breaking change: `Output` enum has been removed; use `ImageFormat` instead.
* Add `Channel` helpers for Realtime.

## 20.3.3

* Fix boolean parameter not handled correctly in Client requests
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-flutter/releases).**
**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-flutter/releases).**

Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Flutter SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)

Expand All @@ -19,7 +19,7 @@ Add this to your package's `pubspec.yaml` file:

```yml
dependencies:
appwrite: ^20.3.3
appwrite: ^21.0.0
```

You can install packages from the command line:
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/create-mfa-authenticator.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Client client = Client()
Account account = Account(client);

MfaType result = await account.createMFAAuthenticator(
type: AuthenticatorType.totp,
type: enums.AuthenticatorType.totp,
);
2 changes: 1 addition & 1 deletion docs/examples/account/create-mfa-challenge.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Client client = Client()
Account account = Account(client);

MfaChallenge result = await account.createMFAChallenge(
factor: AuthenticationFactor.email,
factor: enums.AuthenticationFactor.email,
);
2 changes: 1 addition & 1 deletion docs/examples/account/create-o-auth-2-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Client client = Client()
Account account = Account(client);

await account.createOAuth2Session(
provider: OAuthProvider.amazon,
provider: enums.OAuthProvider.amazon,
success: 'https://example.com', // optional
failure: 'https://example.com', // optional
scopes: [], // optional
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/create-o-auth-2-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Client client = Client()
Account account = Account(client);

await account.createOAuth2Token(
provider: OAuthProvider.amazon,
provider: enums.OAuthProvider.amazon,
success: 'https://example.com', // optional
failure: 'https://example.com', // optional
scopes: [], // optional
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/delete-mfa-authenticator.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Client client = Client()
Account account = Account(client);

await account.deleteMFAAuthenticator(
type: AuthenticatorType.totp,
type: enums.AuthenticatorType.totp,
);
2 changes: 1 addition & 1 deletion docs/examples/account/update-mfa-authenticator.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ Client client = Client()
Account account = Account(client);

User result = await account.updateMFAAuthenticator(
type: AuthenticatorType.totp,
type: enums.AuthenticatorType.totp,
otp: '<OTP>',
);
4 changes: 2 additions & 2 deletions docs/examples/avatars/get-browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Avatars avatars = Avatars(client);

// Downloading file
Uint8List bytes = await avatars.getBrowser(
code: Browser.avantBrowser,
code: enums.Browser.avantBrowser,
width: 0, // optional
height: 0, // optional
quality: -1, // optional
Expand All @@ -20,7 +20,7 @@ file.writeAsBytesSync(bytes);
// Displaying image preview
FutureBuilder(
future: avatars.getBrowser(
code: Browser.avantBrowser,
code: enums.Browser.avantBrowser,
width:0 , // optional
height:0 , // optional
quality:-1 , // optional
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/avatars/get-credit-card.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Avatars avatars = Avatars(client);

// Downloading file
Uint8List bytes = await avatars.getCreditCard(
code: CreditCard.americanExpress,
code: enums.CreditCard.americanExpress,
width: 0, // optional
height: 0, // optional
quality: -1, // optional
Expand All @@ -20,7 +20,7 @@ file.writeAsBytesSync(bytes);
// Displaying image preview
FutureBuilder(
future: avatars.getCreditCard(
code: CreditCard.americanExpress,
code: enums.CreditCard.americanExpress,
width:0 , // optional
height:0 , // optional
quality:-1 , // optional
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/avatars/get-flag.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Avatars avatars = Avatars(client);

// Downloading file
Uint8List bytes = await avatars.getFlag(
code: Flag.afghanistan,
code: enums.Flag.afghanistan,
width: 0, // optional
height: 0, // optional
quality: -1, // optional
Expand All @@ -20,7 +20,7 @@ file.writeAsBytesSync(bytes);
// Displaying image preview
FutureBuilder(
future: avatars.getFlag(
code: Flag.afghanistan,
code: enums.Flag.afghanistan,
width:0 , // optional
height:0 , // optional
quality:-1 , // optional
Expand Down
16 changes: 8 additions & 8 deletions docs/examples/avatars/get-screenshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ Uint8List bytes = await avatars.getScreenshot(
viewportWidth: 1920, // optional
viewportHeight: 1080, // optional
scale: 2, // optional
theme: Theme.light, // optional
theme: enums.Theme.dark, // optional
userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional
fullpage: true, // optional
locale: 'en-US', // optional
timezone: Timezone.africaAbidjan, // optional
timezone: enums.Timezone.americaNewYork, // optional
latitude: 37.7749, // optional
longitude: -122.4194, // optional
accuracy: 100, // optional
touch: true, // optional
permissions: ["geolocation","notifications"], // optional
permissions: [enums.BrowserPermission.geolocation, enums.BrowserPermission.notifications], // optional
sleep: 3, // optional
width: 800, // optional
height: 600, // optional
quality: 85, // optional
output: ImageFormat.jpg, // optional
output: enums.ImageFormat.jpeg, // optional
Comment on lines +19 to +33
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add the missing enums import for the updated snippet.

The example now uses enums.* but doesn’t import the alias, so it won’t compile as shown.

💡 Suggested fix
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite/appwrite.dart';
+import 'package:appwrite/enums.dart' as enums;

Also applies to: 50-64

🤖 Prompt for AI Agents
In `@docs/examples/avatars/get-screenshot.md` around lines 19 - 33, The example
uses the enums alias (e.g., enums.Theme, enums.Timezone,
enums.BrowserPermission, enums.ImageFormat) but never imports it; add an import
for the enums alias from the SDK/module used in this project (so the example
compiles), then reference enums throughout the snippet; update the top of the
snippet to import the enums symbol (so get-screenshot.md examples 19-33 and
similarly 50-64 compile).

)

final file = File('path_to_file/filename.ext');
Expand All @@ -47,21 +47,21 @@ FutureBuilder(
viewportWidth:1920 , // optional
viewportHeight:1080 , // optional
scale:2 , // optional
theme: Theme.light, // optional
theme: enums.Theme.dark, // optional
userAgent:'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15' , // optional
fullpage:true , // optional
locale:'en-US' , // optional
timezone: Timezone.africaAbidjan, // optional
timezone: enums.Timezone.americaNewYork, // optional
latitude:37.7749 , // optional
longitude:-122.4194 , // optional
accuracy:100 , // optional
touch:true , // optional
permissions:["geolocation","notifications"] , // optional
permissions: [enums.BrowserPermission.geolocation, enums.BrowserPermission.notifications], // optional
sleep:3 , // optional
width:800 , // optional
height:600 , // optional
quality:85 , // optional
output: ImageFormat.jpg, // optional
output: enums.ImageFormat.jpeg, // optional
), // Works for both public file and private file, for private files you need to be logged in
builder: (context, snapshot) {
return snapshot.hasData && snapshot.data != null
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/functions/create-execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Execution result = await functions.createExecution(
body: '<BODY>', // optional
xasync: false, // optional
path: '<PATH>', // optional
method: ExecutionMethod.gET, // optional
method: enums.ExecutionMethod.gET, // optional
headers: {}, // optional
scheduledAt: '<SCHEDULED_AT>', // optional
);
8 changes: 4 additions & 4 deletions docs/examples/storage/get-file-preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ Uint8List bytes = await storage.getFilePreview(
fileId: '<FILE_ID>',
width: 0, // optional
height: 0, // optional
gravity: ImageGravity.center, // optional
gravity: enums.ImageGravity.center, // optional
quality: -1, // optional
borderWidth: 0, // optional
borderColor: '', // optional
borderRadius: 0, // optional
opacity: 0, // optional
rotation: -360, // optional
background: '', // optional
output: ImageFormat.jpg, // optional
output: enums.ImageFormat.jpg, // optional
token: '<TOKEN>', // optional
)

Expand All @@ -34,15 +34,15 @@ FutureBuilder(
fileId:'<FILE_ID>' ,
width:0 , // optional
height:0 , // optional
gravity: ImageGravity.center, // optional
gravity: enums.ImageGravity.center, // optional
quality:-1 , // optional
borderWidth:0 , // optional
borderColor:'' , // optional
borderRadius:0 , // optional
opacity:0 , // optional
rotation:-360 , // optional
background:'' , // optional
output: ImageFormat.jpg, // optional
output: enums.ImageFormat.jpg, // optional
token:'<TOKEN>' , // optional
), // Works for both public file and private file, for private files you need to be logged in
builder: (context, snapshot) {
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/teams/create-membership.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Teams teams = Teams(client);

Membership result = await teams.createMembership(
teamId: '<TEAM_ID>',
roles: [],
roles: [enums.Roles.admin],
email: 'email@example.com', // optional
userId: '<USER_ID>', // optional
phone: '+12065550100', // optional
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/teams/update-membership.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ Teams teams = Teams(client);
Membership result = await teams.updateMembership(
teamId: '<TEAM_ID>',
membershipId: '<MEMBERSHIP_ID>',
roles: [],
roles: [enums.Roles.admin],
);
1 change: 1 addition & 0 deletions lib/appwrite.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ part 'query.dart';
part 'permission.dart';
part 'role.dart';
part 'id.dart';
part 'channel.dart';
part 'operator.dart';
part 'services/account.dart';
part 'services/avatars.dart';
Expand Down
Loading