小编B.G*_*ost的帖子

Equatable 的子类传递给 super(Equatable 类) 的是什么?

嗨,我是 flutter 中的 bloc 新手,我正在尝试了解块计时器在 flutter_bloc 的文档中,我知道这个构造函数类是什么意思


@immutable
abstract class TimerState extends Equatable {
  final int duration;

//and this list props ??
  TimerState(this.duration, [List props = const []])
      : super([duration]..addAll(props));
}
Run Code Online (Sandbox Code Playgroud)

dart equatable flutter bloc

3
推荐指数
1
解决办法
6358
查看次数

允许我的用户使用带有 PHP 的 Google Calendar API 在我的日历中添加会议,无需身份验证

我正在开发一个应用程序,该应用程序允许我的用户使用我的 Google 日历之一安排/重新安排日历事件,我不需要用户向 Google 进行身份验证。我需要使用的是带有服务帐户的 Google Calendar API。

我试图用 api v2 写一些东西,但我遇到了问题,所以我想知道你是否可以指导我阅读教程或示例,或者只是插入的示例

<?php

require_once './google-api-php-client-2.2.2/vendor/autoload.php';


session_start();
/************************************************   */

$client_id = '751416246659ae431430560098c25ba433c3e483';
$Email_address = ' testecalendar@spartan-grail-241202.iam.gserviceaccount.com';
$key_file_location = './credentials.json';

$client = new Google_Client();
$client->setApplicationName("Client_Library_Examples");
$key = file_get_contents($key_file_location);

// separate additional scopes with a comma   
$scopes = "https://www.googleapis.com/auth/calendar.readonly";
$client->setAuthConfig('./credentials.json');


$service = new Google_Service_Calendar($client);

?>

<html>

<body>

    <?php
    $calendarList  = $service->calendarList->listCalendarList();

    while (true) {
        foreach ($calendarList->getItems() as $calendarListEntry) {

            echo $calendarListEntry->getSummary() . "<br>\n";


            // get events 
            $events = $service->events->listEvents($calendarListEntry->id);


            foreach ($events->getItems() as $event) …
Run Code Online (Sandbox Code Playgroud)

php google-calendar-api google-api google-oauth

1
推荐指数
1
解决办法
2181
查看次数