Skip to content

Commit 9b46e42

Browse files
committed
feat: fix flutter templates
1 parent e9e991a commit 9b46e42

File tree

6 files changed

+46
-185
lines changed

6 files changed

+46
-185
lines changed

lib/services/account.dart

Lines changed: 13 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@ class Account extends Service {
3030
/// login to their new account, you need to create a new [account
3131
/// session](/docs/client/account#accountCreateSession).
3232
///
33-
Future<Response> create({required String email
34-
, required String password
35-
, String? name
36-
}) {
33+
Future<Response> create({required String email, required String password, String? name}) {
3734
final String path = '/account';
3835

3936
final Map<String, dynamic> params = {
@@ -79,9 +76,7 @@ class Account extends Service {
7976
/// This endpoint can also be used to convert an anonymous account to a normal
8077
/// one, by passing an email address and a new password.
8178
///
82-
Future<Response> updateEmail({required String email
83-
, required String password
84-
}) {
79+
Future<Response> updateEmail({required String email, required String password}) {
8580
final String path = '/account/email';
8681

8782
final Map<String, dynamic> params = {
@@ -139,8 +134,7 @@ class Account extends Service {
139134
///
140135
/// Update currently logged in user account name.
141136
///
142-
Future<Response> updateName({required String name
143-
}) {
137+
Future<Response> updateName({required String name}) {
144138
final String path = '/account/name';
145139

146140
final Map<String, dynamic> params = {
@@ -160,9 +154,7 @@ class Account extends Service {
160154
/// to pass in the new password, and the old password. For users created with
161155
/// OAuth and Team Invites, oldPassword is optional.
162156
///
163-
Future<Response> updatePassword({required String password
164-
, String? oldPassword
165-
}) {
157+
Future<Response> updatePassword({required String password, String? oldPassword}) {
166158
final String path = '/account/password';
167159

168160
final Map<String, dynamic> params = {
@@ -199,8 +191,7 @@ class Account extends Service {
199191
/// Update currently logged in user account preferences. You can pass only the
200192
/// specific settings you wish to update.
201193
///
202-
Future<Response> updatePrefs({required Map prefs
203-
}) {
194+
Future<Response> updatePrefs({required Map prefs}) {
204195
final String path = '/account/prefs';
205196

206197
final Map<String, dynamic> params = {
@@ -225,9 +216,7 @@ class Account extends Service {
225216
/// complete the process. The verification link sent to the user's email
226217
/// address is valid for 1 hour.
227218
///
228-
Future<Response> createRecovery({required String email
229-
, required String url
230-
}) {
219+
Future<Response> createRecovery({required String email, required String url}) {
231220
final String path = '/account/recovery';
232221

233222
final Map<String, dynamic> params = {
@@ -254,11 +243,7 @@ class Account extends Service {
254243
/// the only valid redirect URLs are the ones from domains you have set when
255244
/// adding your platforms in the console interface.
256245
///
257-
Future<Response> updateRecovery({required String userId
258-
, required String secret
259-
, required String password
260-
, required String passwordAgain
261-
}) {
246+
Future<Response> updateRecovery({required String userId, required String secret, required String password, required String passwordAgain}) {
262247
final String path = '/account/recovery';
263248

264249
final Map<String, dynamic> params = {
@@ -298,9 +283,7 @@ class Account extends Service {
298283
/// Allow the user to login into their account by providing a valid email and
299284
/// password combination. This route will create a new session for the user.
300285
///
301-
Future<Response> createSession({required String email
302-
, required String password
303-
}) {
286+
Future<Response> createSession({required String email, required String password}) {
304287
final String path = '/account/sessions';
305288

306289
final Map<String, dynamic> params = {
@@ -362,11 +345,7 @@ class Account extends Service {
362345
/// first. Use the success and failure arguments to provide a redirect URL's
363346
/// back to your app when login is completed.
364347
///
365-
Future createOAuth2Session({required String provider
366-
, String? success
367-
, String? failure
368-
, List? scopes
369-
}) {
348+
Future createOAuth2Session({required String provider, String? success, String? failure, List? scopes}) {
370349
final String path = '/account/sessions/oauth2/{provider}'.replaceAll(RegExp('{provider}'), provider);
371350

372351
final Map<String, dynamic> params = {
@@ -424,8 +403,7 @@ class Account extends Service {
424403
/// Use this endpoint to get a logged in user's session using a Session ID.
425404
/// Inputting 'current' will return the current session being used.
426405
///
427-
Future<Response> getSession({required String sessionId
428-
}) {
406+
Future<Response> getSession({required String sessionId}) {
429407
final String path = '/account/sessions/{sessionId}'.replaceAll(RegExp('{sessionId}'), sessionId);
430408

431409
final Map<String, dynamic> params = {
@@ -444,8 +422,7 @@ class Account extends Service {
444422
/// account sessions across all of their different devices. When using the
445423
/// option id argument, only the session unique ID provider will be deleted.
446424
///
447-
Future<Response> deleteSession({required String sessionId
448-
}) {
425+
Future<Response> deleteSession({required String sessionId}) {
449426
final String path = '/account/sessions/{sessionId}'.replaceAll(RegExp('{sessionId}'), sessionId);
450427

451428
final Map<String, dynamic> params = {
@@ -476,8 +453,7 @@ class Account extends Service {
476453
/// adding your platforms in the console interface.
477454
///
478455
///
479-
Future<Response> createVerification({required String url
480-
}) {
456+
Future<Response> createVerification({required String url}) {
481457
final String path = '/account/verification';
482458

483459
final Map<String, dynamic> params = {
@@ -498,9 +474,7 @@ class Account extends Service {
498474
/// to verify the user email ownership. If confirmed this route will return a
499475
/// 200 status code.
500476
///
501-
Future<Response> updateVerification({required String userId
502-
, required String secret
503-
}) {
477+
Future<Response> updateVerification({required String userId, required String secret}) {
504478
final String path = '/account/verification';
505479

506480
final Map<String, dynamic> params = {

lib/services/avatars.dart

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ class Avatars extends Service {
1111
/// /account/sessions endpoint. Use width, height and quality arguments to
1212
/// change the output settings.
1313
///
14-
Future<Response> getBrowser({required String code
15-
, int? width
16-
, int? height
17-
, int? quality
18-
}) {
14+
Future<Response> getBrowser({required String code, int? width, int? height, int? quality}) {
1915
final String path = '/avatars/browsers/{code}'.replaceAll(RegExp('{code}'), code);
2016

2117
final Map<String, dynamic> params = {
@@ -38,11 +34,7 @@ class Avatars extends Service {
3834
/// provider you need. Use width, height and quality arguments to change the
3935
/// output settings.
4036
///
41-
Future<Response> getCreditCard({required String code
42-
, int? width
43-
, int? height
44-
, int? quality
45-
}) {
37+
Future<Response> getCreditCard({required String code, int? width, int? height, int? quality}) {
4638
final String path = '/avatars/credit-cards/{code}'.replaceAll(RegExp('{code}'), code);
4739

4840
final Map<String, dynamic> params = {
@@ -65,8 +57,7 @@ class Avatars extends Service {
6557
/// website URL.
6658
///
6759
///
68-
Future<Response> getFavicon({required String url
69-
}) {
60+
Future<Response> getFavicon({required String url}) {
7061
final String path = '/avatars/favicon';
7162

7263
final Map<String, dynamic> params = {
@@ -87,11 +78,7 @@ class Avatars extends Service {
8778
/// users. The code argument receives the 2 letter country code. Use width,
8879
/// height and quality arguments to change the output settings.
8980
///
90-
Future<Response> getFlag({required String code
91-
, int? width
92-
, int? height
93-
, int? quality
94-
}) {
81+
Future<Response> getFlag({required String code, int? width, int? height, int? quality}) {
9582
final String path = '/avatars/flags/{code}'.replaceAll(RegExp('{code}'), code);
9683

9784
final Map<String, dynamic> params = {
@@ -115,10 +102,7 @@ class Avatars extends Service {
115102
/// remote images in your app or in case you want to make sure a 3rd party
116103
/// image is properly served using a TLS protocol.
117104
///
118-
Future<Response> getImage({required String url
119-
, int? width
120-
, int? height
121-
}) {
105+
Future<Response> getImage({required String url, int? width, int? height}) {
122106
final String path = '/avatars/image';
123107

124108
final Map<String, dynamic> params = {
@@ -148,12 +132,7 @@ class Avatars extends Service {
148132
/// the user's initials when reloading the same theme will always return for
149133
/// the same initials.
150134
///
151-
Future<Response> getInitials({String? name
152-
, int? width
153-
, int? height
154-
, String? color
155-
, String? background
156-
}) {
135+
Future<Response> getInitials({String? name, int? width, int? height, String? color, String? background}) {
157136
final String path = '/avatars/initials';
158137

159138
final Map<String, dynamic> params = {
@@ -177,11 +156,7 @@ class Avatars extends Service {
177156
/// Converts a given plain text to a QR code image. You can use the query
178157
/// parameters to change the size and style of the resulting image.
179158
///
180-
Future<Response> getQR({required String text
181-
, int? size
182-
, int? margin
183-
, bool? download
184-
}) {
159+
Future<Response> getQR({required String text, int? size, int? margin, bool? download}) {
185160
final String path = '/avatars/qr';
186161

187162
final Map<String, dynamic> params = {

lib/services/database.dart

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,7 @@ class Database extends Service {
1111
/// of the project's documents. [Learn more about different API
1212
/// modes](/docs/admin).
1313
///
14-
Future<Response> listDocuments({required String collectionId
15-
, List? filters
16-
, int? limit
17-
, int? offset
18-
, String? orderField
19-
, String? orderType
20-
, String? orderCast
21-
, String? search
22-
}) {
14+
Future<Response> listDocuments({required String collectionId, List? filters, int? limit, int? offset, String? orderField, String? orderType, String? orderCast, String? search}) {
2315
final String path = '/database/collections/{collectionId}/documents'.replaceAll(RegExp('{collectionId}'), collectionId);
2416

2517
final Map<String, dynamic> params = {
@@ -46,14 +38,7 @@ class Database extends Service {
4638
/// integration](/docs/server/database#databaseCreateCollection) API or
4739
/// directly from your database console.
4840
///
49-
Future<Response> createDocument({required String collectionId
50-
, required Map data
51-
, List? read
52-
, List? write
53-
, String? parentDocument
54-
, String? parentProperty
55-
, String? parentPropertyType
56-
}) {
41+
Future<Response> createDocument({required String collectionId, required Map data, List? read, List? write, String? parentDocument, String? parentProperty, String? parentPropertyType}) {
5742
final String path = '/database/collections/{collectionId}/documents'.replaceAll(RegExp('{collectionId}'), collectionId);
5843

5944
final Map<String, dynamic> params = {
@@ -77,9 +62,7 @@ class Database extends Service {
7762
/// Get a document by its unique ID. This endpoint response returns a JSON
7863
/// object with the document data.
7964
///
80-
Future<Response> getDocument({required String collectionId
81-
, required String documentId
82-
}) {
65+
Future<Response> getDocument({required String collectionId, required String documentId}) {
8366
final String path = '/database/collections/{collectionId}/documents/{documentId}'.replaceAll(RegExp('{collectionId}'), collectionId).replaceAll(RegExp('{documentId}'), documentId);
8467

8568
final Map<String, dynamic> params = {
@@ -97,12 +80,7 @@ class Database extends Service {
9780
/// Update a document by its unique ID. Using the patch method you can pass
9881
/// only specific fields that will get updated.
9982
///
100-
Future<Response> updateDocument({required String collectionId
101-
, required String documentId
102-
, required Map data
103-
, List? read
104-
, List? write
105-
}) {
83+
Future<Response> updateDocument({required String collectionId, required String documentId, required Map data, List? read, List? write}) {
10684
final String path = '/database/collections/{collectionId}/documents/{documentId}'.replaceAll(RegExp('{collectionId}'), collectionId).replaceAll(RegExp('{documentId}'), documentId);
10785

10886
final Map<String, dynamic> params = {
@@ -124,9 +102,7 @@ class Database extends Service {
124102
/// documents, its attributes and relations to other documents. Child documents
125103
/// **will not** be deleted.
126104
///
127-
Future<Response> deleteDocument({required String collectionId
128-
, required String documentId
129-
}) {
105+
Future<Response> deleteDocument({required String collectionId, required String documentId}) {
130106
final String path = '/database/collections/{collectionId}/documents/{documentId}'.replaceAll(RegExp('{collectionId}'), collectionId).replaceAll(RegExp('{documentId}'), documentId);
131107

132108
final Map<String, dynamic> params = {

lib/services/functions.dart

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,7 @@ class Functions extends Service {
1111
/// return a list of all of the project's executions. [Learn more about
1212
/// different API modes](/docs/admin).
1313
///
14-
Future<Response> listExecutions({required String functionId
15-
, String? search
16-
, int? limit
17-
, int? offset
18-
, String? orderType
19-
}) {
14+
Future<Response> listExecutions({required String functionId, String? search, int? limit, int? offset, String? orderType}) {
2015
final String path = '/functions/{functionId}/executions'.replaceAll(RegExp('{functionId}'), functionId);
2116

2217
final Map<String, dynamic> params = {
@@ -40,9 +35,7 @@ class Functions extends Service {
4035
/// updates on the current execution status. Once this endpoint is called, your
4136
/// function execution process will start asynchronously.
4237
///
43-
Future<Response> createExecution({required String functionId
44-
, String? data
45-
}) {
38+
Future<Response> createExecution({required String functionId, String? data}) {
4639
final String path = '/functions/{functionId}/executions'.replaceAll(RegExp('{functionId}'), functionId);
4740

4841
final Map<String, dynamic> params = {
@@ -60,9 +53,7 @@ class Functions extends Service {
6053
///
6154
/// Get a function execution log by its unique ID.
6255
///
63-
Future<Response> getExecution({required String functionId
64-
, required String executionId
65-
}) {
56+
Future<Response> getExecution({required String functionId, required String executionId}) {
6657
final String path = '/functions/{functionId}/executions/{executionId}'.replaceAll(RegExp('{functionId}'), functionId).replaceAll(RegExp('{executionId}'), executionId);
6758

6859
final Map<String, dynamic> params = {

0 commit comments

Comments
 (0)