我想集成outlook日历API,从outlook日程表中获取事件,并将它们添加到我的flutter应用程序中,但我找不到任何合适的指南,所以我的问题是如何将outlook历表API集成到我的flutter应用程序。
首先,添加o auth2客户端发布包
https://pub.dev/packages/oauth2_client
class Something{
Future fetchOutlookCalender(
{BlockCreateCustomTaskBucket provider}) async {
var client = OAuth2Client(
authorizeUrl:
'https://login.microsoftonline.com/common/oauth2/v2.0/authorize',
tokenUrl: 'https://login.microsoftonline.com/common/oauth2/v2.0/token',
redirectUri: 'com.example.upticker://oauth2redirect',
customUriScheme: 'com.example.upticker');
var token = await client.getTokenWithAuthCodeFlow(
clientId: '32502b36-55b3-44b7-88ab-cf8d0ce273dc',
scopes: ['openid profile offline_access user.read calendars.read']);
print('accesstoken: '${token.accessToken}',')
}