appwrite/app/sdks/client-flutter/docs/examples/teams/create.md

22 lines
440 B
Markdown
Raw Normal View History

2020-04-10 08:31:49 +00:00
import 'package:appwrite/appwrite.dart';
2020-05-28 04:41:25 +00:00
void main() { // Init SDK
Client client = Client();
Teams teams = Teams(client);
2020-04-10 08:31:49 +00:00
2020-05-28 04:41:25 +00:00
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
2020-04-10 08:31:49 +00:00
.setProject('5df5acd0d48c2') // Your project ID
2020-05-28 04:41:25 +00:00
;
2020-04-10 08:31:49 +00:00
2020-05-28 04:41:25 +00:00
Future result = teams.create(
2020-04-10 08:31:49 +00:00
name: '[NAME]',
2020-05-28 04:41:25 +00:00
);
2020-04-10 08:31:49 +00:00
2020-05-28 04:41:25 +00:00
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}