diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f26f34..40f7039 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 20.3.2 + +* Fix OAuth2 browser infinite redirect issue + ## 20.3.1 * Fix passing of `null` values and stripping only non-nullable optional parameters from the request body diff --git a/README.md b/README.md index 7c6aab4..a94911b 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Add this to your package's `pubspec.yaml` file: ```yml dependencies: - appwrite: ^20.3.1 + appwrite: ^20.3.2 ``` You can install packages from the command line: diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index e97d24a..50c28ff 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -7,7 +7,7 @@ Client client = Client() Avatars avatars = Avatars(client); // Downloading file -UInt8List bytes = await avatars.getBrowser( +Uint8List bytes = await avatars.getBrowser( code: Browser.avantBrowser, width: 0, // optional height: 0, // optional diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index 9ec4258..c3471fc 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -7,7 +7,7 @@ Client client = Client() Avatars avatars = Avatars(client); // Downloading file -UInt8List bytes = await avatars.getCreditCard( +Uint8List bytes = await avatars.getCreditCard( code: CreditCard.americanExpress, width: 0, // optional height: 0, // optional diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index 0df5ed0..abd61a0 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -7,7 +7,7 @@ Client client = Client() Avatars avatars = Avatars(client); // Downloading file -UInt8List bytes = await avatars.getFavicon( +Uint8List bytes = await avatars.getFavicon( url: 'https://example.com', ) diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 99d4340..e5a4c60 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -7,7 +7,7 @@ Client client = Client() Avatars avatars = Avatars(client); // Downloading file -UInt8List bytes = await avatars.getFlag( +Uint8List bytes = await avatars.getFlag( code: Flag.afghanistan, width: 0, // optional height: 0, // optional diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index 5b9d1b5..bbfcc03 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -7,7 +7,7 @@ Client client = Client() Avatars avatars = Avatars(client); // Downloading file -UInt8List bytes = await avatars.getImage( +Uint8List bytes = await avatars.getImage( url: 'https://example.com', width: 0, // optional height: 0, // optional diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index 0c5b62a..29940c1 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -7,7 +7,7 @@ Client client = Client() Avatars avatars = Avatars(client); // Downloading file -UInt8List bytes = await avatars.getInitials( +Uint8List bytes = await avatars.getInitials( name: '', // optional width: 0, // optional height: 0, // optional diff --git a/docs/examples/avatars/get-qr.md b/docs/examples/avatars/get-qr.md index d9a533c..0a75a66 100644 --- a/docs/examples/avatars/get-qr.md +++ b/docs/examples/avatars/get-qr.md @@ -7,7 +7,7 @@ Client client = Client() Avatars avatars = Avatars(client); // Downloading file -UInt8List bytes = await avatars.getQR( +Uint8List bytes = await avatars.getQR( text: '', size: 1, // optional margin: 0, // optional diff --git a/docs/examples/avatars/get-screenshot.md b/docs/examples/avatars/get-screenshot.md index 768cb8f..42a5ca7 100644 --- a/docs/examples/avatars/get-screenshot.md +++ b/docs/examples/avatars/get-screenshot.md @@ -7,17 +7,17 @@ Client client = Client() Avatars avatars = Avatars(client); // Downloading file -UInt8List bytes = await avatars.getScreenshot( +Uint8List bytes = await avatars.getScreenshot( url: 'https://example.com', headers: {}, // optional viewportWidth: 1, // optional viewportHeight: 1, // optional scale: 0.1, // optional - theme: .light, // optional + theme: Theme.light, // optional userAgent: '', // optional fullpage: false, // optional locale: '', // optional - timezone: .africaAbidjan, // optional + timezone: Timezone.africaAbidjan, // optional latitude: -90, // optional longitude: -180, // optional accuracy: 0, // optional @@ -27,7 +27,7 @@ UInt8List bytes = await avatars.getScreenshot( width: 0, // optional height: 0, // optional quality: -1, // optional - output: .jpg, // optional + output: Output.jpg, // optional ) final file = File('path_to_file/filename.ext'); @@ -41,11 +41,11 @@ FutureBuilder( viewportWidth:1 , // optional viewportHeight:1 , // optional scale:0.1 , // optional - theme: .light, // optional + theme: Theme.light, // optional userAgent:'' , // optional fullpage:false , // optional locale:'' , // optional - timezone: .africaAbidjan, // optional + timezone: Timezone.africaAbidjan, // optional latitude:-90 , // optional longitude:-180 , // optional accuracy:0 , // optional @@ -55,7 +55,7 @@ FutureBuilder( width:0 , // optional height:0 , // optional quality:-1 , // optional - output: .jpg, // optional + output: Output.jpg, // 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 diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index 5bef06e..2cdba9b 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -7,7 +7,7 @@ Client client = Client() Storage storage = Storage(client); // Downloading file -UInt8List bytes = await storage.getFileDownload( +Uint8List bytes = await storage.getFileDownload( bucketId: '', fileId: '', token: '', // optional diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 96338bd..6fd148e 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -7,7 +7,7 @@ Client client = Client() Storage storage = Storage(client); // Downloading file -UInt8List bytes = await storage.getFilePreview( +Uint8List bytes = await storage.getFilePreview( bucketId: '', fileId: '', width: 0, // optional diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index 6587f08..bcf5902 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -7,7 +7,7 @@ Client client = Client() Storage storage = Storage(client); // Downloading file -UInt8List bytes = await storage.getFileView( +Uint8List bytes = await storage.getFileView( bucketId: '', fileId: '', token: '', // optional diff --git a/lib/services/databases.dart b/lib/services/databases.dart index e3e83c5..4063c0b 100644 --- a/lib/services/databases.dart +++ b/lib/services/databases.dart @@ -165,8 +165,8 @@ class Databases extends Service { final Map apiParams = { 'documentId': documentId, 'data': data, - if (permissions != null) 'permissions': permissions, - if (transactionId != null) 'transactionId': transactionId, + 'permissions': permissions, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -229,8 +229,8 @@ class Databases extends Service { final Map apiParams = { 'data': data, - if (permissions != null) 'permissions': permissions, - if (transactionId != null) 'transactionId': transactionId, + 'permissions': permissions, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -262,8 +262,8 @@ class Databases extends Service { final Map apiParams = { if (data != null) 'data': data, - if (permissions != null) 'permissions': permissions, - if (transactionId != null) 'transactionId': transactionId, + 'permissions': permissions, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -291,7 +291,7 @@ class Databases extends Service { .replaceAll('{documentId}', documentId); final Map apiParams = { - if (transactionId != null) 'transactionId': transactionId, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -324,8 +324,8 @@ class Databases extends Service { final Map apiParams = { if (value != null) 'value': value, - if (min != null) 'min': min, - if (transactionId != null) 'transactionId': transactionId, + 'min': min, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -358,8 +358,8 @@ class Databases extends Service { final Map apiParams = { if (value != null) 'value': value, - if (max != null) 'max': max, - if (transactionId != null) 'transactionId': transactionId, + 'max': max, + 'transactionId': transactionId, }; final Map apiHeaders = { diff --git a/lib/services/functions.dart b/lib/services/functions.dart index 7aa458e..c2cdb97 100644 --- a/lib/services/functions.dart +++ b/lib/services/functions.dart @@ -47,7 +47,7 @@ class Functions extends Service { if (path != null) 'path': path, if (method != null) 'method': method!.value, if (headers != null) 'headers': headers, - if (scheduledAt != null) 'scheduledAt': scheduledAt, + 'scheduledAt': scheduledAt, }; final Map apiHeaders = { diff --git a/lib/services/storage.dart b/lib/services/storage.dart index 8cc371a..0aca3f7 100644 --- a/lib/services/storage.dart +++ b/lib/services/storage.dart @@ -111,8 +111,8 @@ class Storage extends Service { .replaceAll('{fileId}', fileId); final Map apiParams = { - if (name != null) 'name': name, - if (permissions != null) 'permissions': permissions, + 'name': name, + 'permissions': permissions, }; final Map apiHeaders = { diff --git a/lib/services/tables_db.dart b/lib/services/tables_db.dart index 12a61f0..1d9c398 100644 --- a/lib/services/tables_db.dart +++ b/lib/services/tables_db.dart @@ -157,8 +157,8 @@ class TablesDB extends Service { final Map apiParams = { 'rowId': rowId, 'data': data, - if (permissions != null) 'permissions': permissions, - if (transactionId != null) 'transactionId': transactionId, + 'permissions': permissions, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -217,8 +217,8 @@ class TablesDB extends Service { final Map apiParams = { if (data != null) 'data': data, - if (permissions != null) 'permissions': permissions, - if (transactionId != null) 'transactionId': transactionId, + 'permissions': permissions, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -248,8 +248,8 @@ class TablesDB extends Service { final Map apiParams = { if (data != null) 'data': data, - if (permissions != null) 'permissions': permissions, - if (transactionId != null) 'transactionId': transactionId, + 'permissions': permissions, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -275,7 +275,7 @@ class TablesDB extends Service { .replaceAll('{rowId}', rowId); final Map apiParams = { - if (transactionId != null) 'transactionId': transactionId, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -306,8 +306,8 @@ class TablesDB extends Service { final Map apiParams = { if (value != null) 'value': value, - if (min != null) 'min': min, - if (transactionId != null) 'transactionId': transactionId, + 'min': min, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -338,8 +338,8 @@ class TablesDB extends Service { final Map apiParams = { if (value != null) 'value': value, - if (max != null) 'max': max, - if (transactionId != null) 'transactionId': transactionId, + 'max': max, + 'transactionId': transactionId, }; final Map apiHeaders = { diff --git a/lib/src/client_browser.dart b/lib/src/client_browser.dart index 26810cc..36d791a 100644 --- a/lib/src/client_browser.dart +++ b/lib/src/client_browser.dart @@ -40,7 +40,7 @@ class ClientBrowser extends ClientBase with ClientMixin { 'x-sdk-name': 'Flutter', 'x-sdk-platform': 'client', 'x-sdk-language': 'flutter', - 'x-sdk-version': '20.3.1', + 'x-sdk-version': '20.3.2', 'X-Appwrite-Response-Format': '1.8.0', }; diff --git a/lib/src/client_io.dart b/lib/src/client_io.dart index 961481c..91d47a7 100644 --- a/lib/src/client_io.dart +++ b/lib/src/client_io.dart @@ -58,7 +58,7 @@ class ClientIO extends ClientBase with ClientMixin { 'x-sdk-name': 'Flutter', 'x-sdk-platform': 'client', 'x-sdk-language': 'flutter', - 'x-sdk-version': '20.3.1', + 'x-sdk-version': '20.3.2', 'X-Appwrite-Response-Format': '1.8.0', }; diff --git a/pubspec.yaml b/pubspec.yaml index 848a2e6..8cb133b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: appwrite -version: 20.3.1 +version: 20.3.2 description: Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API homepage: https://appwrite.io repository: https://github.com/appwrite/sdk-for-flutter @@ -20,7 +20,7 @@ dependencies: sdk: flutter cookie_jar: ^4.0.8 device_info_plus: '>=11.5.0 <13.0.0' - flutter_web_auth_2: ^4.1.0 + flutter_web_auth_2: ^5.0.0-alpha.3 http: '>=0.13.6 <2.0.0' package_info_plus: '>=8.0.2 <10.0.0' path_provider: ^2.1.4