Null-safety support

This commit is contained in:
Eldad Fux
2021-04-21 09:03:33 +03:00
parent aee8859e7f
commit b7d88eee5e
13 changed files with 101 additions and 88 deletions
+8
View File
@@ -1,3 +1,11 @@
## 0.5.0-dev.1
- Upgraded to Null-safety, minimum Dart SDK required 2.12.0 and minimum Flutter SDK version required 2.0.0
- Upgraded all underlying dependencies to null safe version
- All of Avatars service now return Future<Response></Response> instead of String like the Storage getFilePreview, getFileView and getFileDownload
- Upgraded to Null-safety, minimum Dart SDK required 2.12.0
- Upgraded all underlying dependencies to null safe version
## 0.4.0
- Improved code quality
+6 -4
View File
@@ -1,8 +1,10 @@
# Appwrite Flutter SDK
[![pub package](https://img.shields.io/pub/v/appwrite.svg)](https://pub.dartlang.org/packages/appwrite)
![License](https://img.shields.io/github/license/appwrite/sdk-for-flutter.svg?v=1)
![Version](https://img.shields.io/badge/api%20version-0.7.0-blue.svg?v=1)
[![pub package](https://img.shields.io/pub/v/appwrite?style=flat-square.svg)](https://pub.dartlang.org/packages/appwrite)
![License](https://img.shields.io/github/license/appwrite/sdk-for-flutter.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-0.7.0-blue.svg?style=flat-square)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite_io?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite_io)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
**This SDK is compatible with Appwrite server version 0.7.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-flutter/releases).**
@@ -20,7 +22,7 @@ Add this to your package's `pubspec.yaml` file:
```yml
dependencies:
appwrite: ^0.4.0
appwrite: ^0.5.0-dev.1
```
You can install packages from the command line:
+3
View File
@@ -0,0 +1,3 @@
name: appwrite_example
environment:
sdk: '>=2.6.0 <3.0.0'
+1 -2
View File
@@ -4,7 +4,6 @@ import 'dart:io';
import 'dart:convert';
import 'package:universal_html/html.dart' as html;
import 'package:dio/dio.dart';
import 'package:meta/meta.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_web_auth/flutter_web_auth.dart';
import 'package:dio/adapter.dart';
@@ -14,7 +13,7 @@ import 'package:path_provider/path_provider.dart';
import 'package:package_info_plus/package_info_plus.dart';
export 'package:dio/dio.dart' show Response;
export 'package:dio/dio.dart' show Response, MultipartFile;
part 'client.dart';
part 'enums.dart';
+28 -26
View File
@@ -3,14 +3,14 @@ part of appwrite;
class Client {
String endPoint;
String type = 'unknown';
Map<String, String> headers;
Map<String, String> config;
Map<String, String>? headers;
late Map<String, String> config;
bool selfSigned;
bool initialized = false;
Dio http;
PersistCookieJar cookieJar;
late PersistCookieJar cookieJar;
Client({this.endPoint = 'https://appwrite.io/v1', this.selfSigned = false, Dio http}) : this.http = http ?? Dio() {
Client({this.endPoint = 'https://appwrite.io/v1', this.selfSigned = false, Dio? http}) : this.http = http ?? Dio() {
// Platform is not supported in web so if web, set type to web automatically and skip Platform check
if(kIsWeb) {
type = 'web';
@@ -25,12 +25,13 @@ class Client {
this.headers = {
'content-type': 'application/json',
'x-sdk-version': 'appwrite:flutter:0.4.0',
'x-sdk-version': 'appwrite:flutter:0.5.0-dev.1',
};
this.config = {};
assert(endPoint.startsWith(RegExp("http://|https://")), "endPoint $endPoint must start with 'http'");
init();
}
Future<Directory> _getCookiePath() async {
@@ -66,31 +67,29 @@ class Client {
}
Client addHeader(String key, String value) {
headers[key] = value;
headers![key] = value;
return this;
}
Future init() async {
if(!initialized) {
// if web skip cookie implementation and origin header as those are automatically handled by browsers
if(!kIsWeb) {
// if web skip cookie implementation and origin header as those are automatically handled by browsers
if(!kIsWeb) {
final Directory cookieDir = await _getCookiePath();
cookieJar = new PersistCookieJar(dir:cookieDir.path);
cookieJar = new PersistCookieJar(storage: FileStorage(cookieDir.path));
this.http.interceptors.add(CookieManager(cookieJar));
PackageInfo packageInfo = await PackageInfo.fromPlatform();
addHeader('Origin', 'appwrite-$type://${packageInfo.packageName ?? packageInfo.appName}');
}else{
// if web set httpClientAdapter as BrowserHttpClientAdapter with withCredentials true to make cookies work
addHeader('Origin', 'appwrite-$type://${packageInfo.packageName}');
} else {
// if web set withCredentials true to make cookies work
this.http.options.extra['withCredentials'] = true;
}
this.http.options.baseUrl = this.endPoint;
this.http.options.validateStatus = (status) => status < 400;
}
this.http.options.baseUrl = this.endPoint;
this.http.options.validateStatus = (status) => status! < 400;
}
Future<Response> call(HttpMethod method, {String path = '', Map<String, String> headers = const {}, Map<String, dynamic> params = const {}, ResponseType responseType}) async {
Future<Response> call(HttpMethod method, {String path = '', Map<String, String> headers = const {}, Map<String, dynamic> params = const {}, ResponseType? responseType}) async {
if(selfSigned && !kIsWeb) {
// Allow self signed requests
(http.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate = (HttpClient client) {
@@ -99,18 +98,21 @@ class Client {
};
}
await this.init();
if(!initialized) {
await this.init();
}
// Origin is hardcoded for testing
Options options = Options(
headers: {...this.headers, ...headers},
headers: {...this.headers!, ...headers},
method: method.name(),
responseType: responseType
responseType: responseType,
listFormat: ListFormat.multiCompatible
);
try {
if(headers['content-type'] == 'multipart/form-data') {
return await http.request(path, data: FormData.fromMap(params), options: options);
return await http.request(path, data: FormData.fromMap(params, ListFormat.multiCompatible), options: options);
}
if (method == HttpMethod.get) {
@@ -127,16 +129,16 @@ class Client {
throw AppwriteException(e.message);
}
if(responseType == ResponseType.bytes) {
if(e.response.headers['content-type'].contains('application/json')) {
final res = json.decode(utf8.decode(e.response.data));
if(e.response!.headers['content-type']!.contains('application/json')) {
final res = json.decode(utf8.decode(e.response!.data));
throw AppwriteException(res['message'],res['code'], e.response);
} else {
throw AppwriteException(e.message);
}
}
throw AppwriteException(e.response.data['message'],e.response.data['code'], e.response.data);
throw AppwriteException(e.response!.data['message'],e.response!.data['code'], e.response!.data);
} catch(e) {
throw AppwriteException(e.message);
throw AppwriteException(e.toString());
}
}
}
+2 -2
View File
@@ -1,8 +1,8 @@
part of appwrite;
class AppwriteException implements Exception {
final String message;
final int code;
final String? message;
final int? code;
final dynamic response;
AppwriteException([this.message = "", this.code, this.response]);
+15 -15
View File
@@ -30,7 +30,7 @@ class Account extends Service {
/// login to their new account, you need to create a new [account
/// session](/docs/client/account#accountCreateSession).
///
Future<Response> create({@required String email, @required String password, String name = ''}) {
Future<Response> create({required String email, required String password, String name = ''}) {
final String path = '/account';
final Map<String, dynamic> params = {
@@ -74,7 +74,7 @@ class Account extends Service {
/// mail is sent. For security measures, user password is required to complete
/// this request.
///
Future<Response> updateEmail({@required String email, @required String password}) {
Future<Response> updateEmail({required String email, required String password}) {
final String path = '/account/email';
final Map<String, dynamic> params = {
@@ -111,7 +111,7 @@ class Account extends Service {
///
/// Update currently logged in user account name.
///
Future<Response> updateName({@required String name}) {
Future<Response> updateName({required String name}) {
final String path = '/account/name';
final Map<String, dynamic> params = {
@@ -130,7 +130,7 @@ class Account extends Service {
/// Update currently logged in user password. For validation, user is required
/// to pass the password twice.
///
Future<Response> updatePassword({@required String password, @required String oldPassword}) {
Future<Response> updatePassword({required String password, required String oldPassword}) {
final String path = '/account/password';
final Map<String, dynamic> params = {
@@ -167,7 +167,7 @@ class Account extends Service {
/// Update currently logged in user account preferences. You can pass only the
/// specific settings you wish to update.
///
Future<Response> updatePrefs({@required Map prefs}) {
Future<Response> updatePrefs({required Map prefs}) {
final String path = '/account/prefs';
final Map<String, dynamic> params = {
@@ -191,7 +191,7 @@ class Account extends Service {
/// /account/recovery](/docs/client/account#accountUpdateRecovery) endpoint to
/// complete the process.
///
Future<Response> createRecovery({@required String email, @required String url}) {
Future<Response> createRecovery({required String email, required String url}) {
final String path = '/account/recovery';
final Map<String, dynamic> params = {
@@ -218,7 +218,7 @@ class Account extends Service {
/// the only valid redirect URLs are the ones from domains you have set when
/// adding your platforms in the console interface.
///
Future<Response> updateRecovery({@required String userId, @required String secret, @required String password, @required String passwordAgain}) {
Future<Response> updateRecovery({required String userId, required String secret, required String password, required String passwordAgain}) {
final String path = '/account/recovery';
final Map<String, dynamic> params = {
@@ -258,7 +258,7 @@ class Account extends Service {
/// Allow the user to login into their account by providing a valid email and
/// password combination. This route will create a new session for the user.
///
Future<Response> createSession({@required String email, @required String password}) {
Future<Response> createSession({required String email, required String password}) {
final String path = '/account/sessions';
final Map<String, dynamic> params = {
@@ -298,7 +298,7 @@ class Account extends Service {
/// first. Use the success and failure arguments to provide a redirect URL's
/// back to your app when login is completed.
///
Future createOAuth2Session({@required String provider, String success = 'https://appwrite.io/auth/oauth2/success', String failure = 'https://appwrite.io/auth/oauth2/failure', List scopes = const []}) {
Future createOAuth2Session({required String provider, String success = 'https://appwrite.io/auth/oauth2/success', String failure = 'https://appwrite.io/auth/oauth2/failure', List scopes = const []}) {
final String path = '/account/sessions/oauth2/{provider}'.replaceAll(RegExp('{provider}'), provider);
final Map<String, dynamic> params = {
@@ -332,15 +332,15 @@ class Account extends Service {
if(kIsWeb) {
html.window.location.href = url.toString();
return null;
return Future.value();
}else{
return FlutterWebAuth.authenticate(
url: url.toString(),
callbackUrlScheme: "appwrite-callback-" + client.config['project']
callbackUrlScheme: "appwrite-callback-" + client.config['project']!
).then((value) async {
Uri url = Uri.parse(value);
Cookie cookie = new Cookie(url.queryParameters['key'], url.queryParameters['secret']);
Cookie cookie = new Cookie(url.queryParameters['key']!, url.queryParameters['secret']!);
cookie.domain = Uri.parse(client.endPoint).host;
cookie.httpOnly = true;
cookie.path = '/';
@@ -358,7 +358,7 @@ class Account extends Service {
/// account sessions across all of their different devices. When using the
/// option id argument, only the session unique ID provider will be deleted.
///
Future<Response> deleteSession({@required String sessionId}) {
Future<Response> deleteSession({required String sessionId}) {
final String path = '/account/sessions/{sessionId}'.replaceAll(RegExp('{sessionId}'), sessionId);
final Map<String, dynamic> params = {
@@ -388,7 +388,7 @@ class Account extends Service {
/// adding your platforms in the console interface.
///
///
Future<Response> createVerification({@required String url}) {
Future<Response> createVerification({required String url}) {
final String path = '/account/verification';
final Map<String, dynamic> params = {
@@ -409,7 +409,7 @@ class Account extends Service {
/// to verify the user email ownership. If confirmed this route will return a
/// 200 status code.
///
Future<Response> updateVerification({@required String userId, @required String secret}) {
Future<Response> updateVerification({required String userId, required String secret}) {
final String path = '/account/verification';
final Map<String, dynamic> params = {
+6 -6
View File
@@ -11,7 +11,7 @@ class Avatars extends Service {
/// /account/sessions endpoint. Use width, height and quality arguments to
/// change the output settings.
///
Future<Response> getBrowser({@required String code, int width = 100, int height = 100, int quality = 100}) {
Future<Response> getBrowser({required String code, int width = 100, int height = 100, int quality = 100}) {
final String path = '/avatars/browsers/{code}'.replaceAll(RegExp('{code}'), code);
final Map<String, dynamic> params = {
@@ -34,7 +34,7 @@ class Avatars extends Service {
/// provider you need. Use width, height and quality arguments to change the
/// output settings.
///
Future<Response> getCreditCard({@required String code, int width = 100, int height = 100, int quality = 100}) {
Future<Response> getCreditCard({required String code, int width = 100, int height = 100, int quality = 100}) {
final String path = '/avatars/credit-cards/{code}'.replaceAll(RegExp('{code}'), code);
final Map<String, dynamic> params = {
@@ -57,7 +57,7 @@ class Avatars extends Service {
/// website URL.
///
///
Future<Response> getFavicon({@required String url}) {
Future<Response> getFavicon({required String url}) {
final String path = '/avatars/favicon';
final Map<String, dynamic> params = {
@@ -78,7 +78,7 @@ class Avatars extends Service {
/// users. The code argument receives the 2 letter country code. Use width,
/// height and quality arguments to change the output settings.
///
Future<Response> getFlag({@required String code, int width = 100, int height = 100, int quality = 100}) {
Future<Response> getFlag({required String code, int width = 100, int height = 100, int quality = 100}) {
final String path = '/avatars/flags/{code}'.replaceAll(RegExp('{code}'), code);
final Map<String, dynamic> params = {
@@ -102,7 +102,7 @@ class Avatars extends Service {
/// remote images in your app or in case you want to make sure a 3rd party
/// image is properly served using a TLS protocol.
///
Future<Response> getImage({@required String url, int width = 400, int height = 400}) {
Future<Response> getImage({required String url, int width = 400, int height = 400}) {
final String path = '/avatars/image';
final Map<String, dynamic> params = {
@@ -156,7 +156,7 @@ class Avatars extends Service {
/// Converts a given plain text to a QR code image. You can use the query
/// parameters to change the size and style of the resulting image.
///
Future<Response> getQR({@required String text, int size = 400, int margin = 1, bool download = false}) {
Future<Response> getQR({required String text, int size = 400, int margin = 1, bool download = false}) {
final String path = '/avatars/qr';
final Map<String, dynamic> params = {
+5 -5
View File
@@ -11,7 +11,7 @@ class Database extends Service {
/// of the project's documents. [Learn more about different API
/// modes](/docs/admin).
///
Future<Response> listDocuments({@required String collectionId, List filters = const [], int limit = 25, int offset = 0, String orderField = '', OrderType orderType = OrderType.asc, String orderCast = 'string', String search = ''}) {
Future<Response> listDocuments({required String collectionId, List filters = const [], int limit = 25, int offset = 0, String orderField = '', OrderType orderType = OrderType.asc, String orderCast = 'string', String search = ''}) {
final String path = '/database/collections/{collectionId}/documents'.replaceAll(RegExp('{collectionId}'), collectionId);
final Map<String, dynamic> params = {
@@ -38,7 +38,7 @@ class Database extends Service {
/// integration](/docs/server/database#databaseCreateCollection) API or
/// directly from your database console.
///
Future<Response> createDocument({@required String collectionId, @required Map data, @required List read, @required List write, String parentDocument = '', String parentProperty = '', String parentPropertyType = 'assign'}) {
Future<Response> createDocument({required String collectionId, required Map data, required List read, required List write, String parentDocument = '', String parentProperty = '', String parentPropertyType = 'assign'}) {
final String path = '/database/collections/{collectionId}/documents'.replaceAll(RegExp('{collectionId}'), collectionId);
final Map<String, dynamic> params = {
@@ -62,7 +62,7 @@ class Database extends Service {
/// Get a document by its unique ID. This endpoint response returns a JSON
/// object with the document data.
///
Future<Response> getDocument({@required String collectionId, @required String documentId}) {
Future<Response> getDocument({required String collectionId, required String documentId}) {
final String path = '/database/collections/{collectionId}/documents/{documentId}'.replaceAll(RegExp('{collectionId}'), collectionId).replaceAll(RegExp('{documentId}'), documentId);
final Map<String, dynamic> params = {
@@ -80,7 +80,7 @@ class Database extends Service {
/// Update a document by its unique ID. Using the patch method you can pass
/// only specific fields that will get updated.
///
Future<Response> updateDocument({@required String collectionId, @required String documentId, @required Map data, @required List read, @required List write}) {
Future<Response> updateDocument({required String collectionId, required String documentId, required Map data, required List read, required List write}) {
final String path = '/database/collections/{collectionId}/documents/{documentId}'.replaceAll(RegExp('{collectionId}'), collectionId).replaceAll(RegExp('{documentId}'), documentId);
final Map<String, dynamic> params = {
@@ -102,7 +102,7 @@ class Database extends Service {
/// documents, its attributes and relations to other documents. Child documents
/// **will not** be deleted.
///
Future<Response> deleteDocument({@required String collectionId, @required String documentId}) {
Future<Response> deleteDocument({required String collectionId, required String documentId}) {
final String path = '/database/collections/{collectionId}/documents/{documentId}'.replaceAll(RegExp('{collectionId}'), collectionId).replaceAll(RegExp('{documentId}'), documentId);
final Map<String, dynamic> params = {
+3 -3
View File
@@ -11,7 +11,7 @@ class Functions extends Service {
/// return a list of all of the project's teams. [Learn more about different
/// API modes](/docs/admin).
///
Future<Response> listExecutions({@required String functionId, String search = '', int limit = 25, int offset = 0, OrderType orderType = OrderType.asc}) {
Future<Response> listExecutions({required String functionId, String search = '', int limit = 25, int offset = 0, OrderType orderType = OrderType.asc}) {
final String path = '/functions/{functionId}/executions'.replaceAll(RegExp('{functionId}'), functionId);
final Map<String, dynamic> params = {
@@ -35,7 +35,7 @@ class Functions extends Service {
/// updates on the current execution status. Once this endpoint is called, your
/// function execution process will start asynchronously.
///
Future<Response> createExecution({@required String functionId}) {
Future<Response> createExecution({required String functionId}) {
final String path = '/functions/{functionId}/executions'.replaceAll(RegExp('{functionId}'), functionId);
final Map<String, dynamic> params = {
@@ -52,7 +52,7 @@ class Functions extends Service {
///
/// Get a function execution log by its unique ID.
///
Future<Response> getExecution({@required String functionId, @required String executionId}) {
Future<Response> getExecution({required String functionId, required String executionId}) {
final String path = '/functions/{functionId}/executions/{executionId}'.replaceAll(RegExp('{functionId}'), functionId).replaceAll(RegExp('{executionId}'), executionId);
final Map<String, dynamic> params = {
+7 -7
View File
@@ -33,7 +33,7 @@ class Storage extends Service {
/// assigned to read and write access unless he has passed custom values for
/// read and write arguments.
///
Future<Response> createFile({@required MultipartFile file, @required List read, @required List write}) {
Future<Response> createFile({required MultipartFile file, required List read, required List write}) {
final String path = '/storage/files';
final Map<String, dynamic> params = {
@@ -54,7 +54,7 @@ class Storage extends Service {
/// Get a file by its unique ID. This endpoint response returns a JSON object
/// with the file metadata.
///
Future<Response> getFile({@required String fileId}) {
Future<Response> getFile({required String fileId}) {
final String path = '/storage/files/{fileId}'.replaceAll(RegExp('{fileId}'), fileId);
final Map<String, dynamic> params = {
@@ -72,7 +72,7 @@ class Storage extends Service {
/// Update a file by its unique ID. Only users with write permissions have
/// access to update this resource.
///
Future<Response> updateFile({@required String fileId, @required List read, @required List write}) {
Future<Response> updateFile({required String fileId, required List read, required List write}) {
final String path = '/storage/files/{fileId}'.replaceAll(RegExp('{fileId}'), fileId);
final Map<String, dynamic> params = {
@@ -92,7 +92,7 @@ class Storage extends Service {
/// Delete a file by its unique ID. Only users with write permissions have
/// access to delete this resource.
///
Future<Response> deleteFile({@required String fileId}) {
Future<Response> deleteFile({required String fileId}) {
final String path = '/storage/files/{fileId}'.replaceAll(RegExp('{fileId}'), fileId);
final Map<String, dynamic> params = {
@@ -111,7 +111,7 @@ class Storage extends Service {
/// 'Content-Disposition: attachment' header that tells the browser to start
/// downloading the file to user downloads directory.
///
Future<Response> getFileDownload({@required String fileId}) {
Future<Response> getFileDownload({required String fileId}) {
final String path = '/storage/files/{fileId}/download'.replaceAll(RegExp('{fileId}'), fileId);
final Map<String, dynamic> params = {
@@ -132,7 +132,7 @@ class Storage extends Service {
/// and spreadsheets, will return the file icon image. You can also pass query
/// string arguments for cutting and resizing your preview image.
///
Future<Response> getFilePreview({@required String fileId, int width = 0, int height = 0, int quality = 100, String background = '', String output = ''}) {
Future<Response> getFilePreview({required String fileId, int width = 0, int height = 0, int quality = 100, String background = '', String output = ''}) {
final String path = '/storage/files/{fileId}/preview'.replaceAll(RegExp('{fileId}'), fileId);
final Map<String, dynamic> params = {
@@ -157,7 +157,7 @@ class Storage extends Service {
/// download method but returns with no 'Content-Disposition: attachment'
/// header.
///
Future<Response> getFileView({@required String fileId}) {
Future<Response> getFileView({required String fileId}) {
final String path = '/storage/files/{fileId}/view'.replaceAll(RegExp('{fileId}'), fileId);
final Map<String, dynamic> params = {
+8 -8
View File
@@ -35,7 +35,7 @@ class Teams extends Service {
/// who will be able add new owners and update or delete the team from your
/// project.
///
Future<Response> create({@required String name, List roles = const ["owner"]}) {
Future<Response> create({required String name, List roles = const ["owner"]}) {
final String path = '/teams';
final Map<String, dynamic> params = {
@@ -55,7 +55,7 @@ class Teams extends Service {
/// Get a team by its unique ID. All team members have read access for this
/// resource.
///
Future<Response> get({@required String teamId}) {
Future<Response> get({required String teamId}) {
final String path = '/teams/{teamId}'.replaceAll(RegExp('{teamId}'), teamId);
final Map<String, dynamic> params = {
@@ -73,7 +73,7 @@ class Teams extends Service {
/// Update a team by its unique ID. Only team owners have write access for this
/// resource.
///
Future<Response> update({@required String teamId, @required String name}) {
Future<Response> update({required String teamId, required String name}) {
final String path = '/teams/{teamId}'.replaceAll(RegExp('{teamId}'), teamId);
final Map<String, dynamic> params = {
@@ -92,7 +92,7 @@ class Teams extends Service {
/// Delete a team by its unique ID. Only team owners have write access for this
/// resource.
///
Future<Response> delete({@required String teamId}) {
Future<Response> delete({required String teamId}) {
final String path = '/teams/{teamId}'.replaceAll(RegExp('{teamId}'), teamId);
final Map<String, dynamic> params = {
@@ -110,7 +110,7 @@ class Teams extends Service {
/// Get a team members by the team unique ID. All team members have read access
/// for this list of resources.
///
Future<Response> getMemberships({@required String teamId, String search = '', int limit = 25, int offset = 0, OrderType orderType = OrderType.asc}) {
Future<Response> getMemberships({required String teamId, String search = '', int limit = 25, int offset = 0, OrderType orderType = OrderType.asc}) {
final String path = '/teams/{teamId}/memberships'.replaceAll(RegExp('{teamId}'), teamId);
final Map<String, dynamic> params = {
@@ -143,7 +143,7 @@ class Teams extends Service {
/// the only valid redirect URL's are the once from domains you have set when
/// added your platforms in the console interface.
///
Future<Response> createMembership({@required String teamId, @required String email, @required List roles, @required String url, String name = ''}) {
Future<Response> createMembership({required String teamId, required String email, required List roles, required String url, String name = ''}) {
final String path = '/teams/{teamId}/memberships'.replaceAll(RegExp('{teamId}'), teamId);
final Map<String, dynamic> params = {
@@ -166,7 +166,7 @@ class Teams extends Service {
/// the membership of any other team member. You can also use this endpoint to
/// delete a user membership even if it is not accepted.
///
Future<Response> deleteMembership({@required String teamId, @required String inviteId}) {
Future<Response> deleteMembership({required String teamId, required String inviteId}) {
final String path = '/teams/{teamId}/memberships/{inviteId}'.replaceAll(RegExp('{teamId}'), teamId).replaceAll(RegExp('{inviteId}'), inviteId);
final Map<String, dynamic> params = {
@@ -185,7 +185,7 @@ class Teams extends Service {
/// after being redirected back to your app from the invitation email recieved
/// by the user.
///
Future<Response> updateMembershipStatus({@required String teamId, @required String inviteId, @required String userId, @required String secret}) {
Future<Response> updateMembershipStatus({required String teamId, required String inviteId, required String userId, required String secret}) {
final String path = '/teams/{teamId}/memberships/{inviteId}/status'.replaceAll(RegExp('{teamId}'), teamId).replaceAll(RegExp('{inviteId}'), inviteId);
final Map<String, dynamic> params = {
+9 -10
View File
@@ -1,23 +1,22 @@
name: appwrite
version: 0.4.0
version: 0.5.0-dev.1
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
issue_tracker: https://github.com/appwrite/sdk-generator/issues
documentation: https://appwrite.io/support
environment:
sdk: '>=2.6.0 <3.0.0'
sdk: '>=2.12.0 <3.0.0'
dependencies:
flutter:
sdk: flutter
cookie_jar: ^1.0.1
dio: ^3.0.10
dio_cookie_manager: ^1.0.0
flutter_web_auth: ^0.2.4
meta: ^1.1.8
package_info_plus: ^0.6.3
path_provider: ^1.6.14
universal_html: ^1.2.3
cookie_jar: ^3.0.1
dio: ^4.0.0
dio_cookie_manager: ^2.0.0
flutter_web_auth: ^0.3.0
package_info_plus: ^1.0.0
path_provider: ^2.0.1
universal_html: ^2.0.8
dev_dependencies:
flutter_test: