패키지, 저장소 및 앱 카테고리 검색

패키지 상세v3.1.1

add_2_calendar

각 플랫폼의 기본 캘린더에 이벤트를 추가하기 위한 정말 간단한 Flutter 플러그인입니다.

AndroidiOS
30일 다운로드
15.9만
좋아요
364
Pub 점수
160

패키지 설치

flutter pub add add_2_calendar

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Android 및 iOS의 기본 캘린더에 캘린더 이벤트를 추가할 수 있는 가벼운 플러터 플러그인입니다. 최소한의 설정으로 이벤트 생성 및 예약을 위한 간단한 API를 제공하여 캘린더 통합이 필요한 앱에 이상적입니다. 플러그인은 플랫폼별 차이점을 자동으로 처리하여 장치 간 일관된 동작을 보장합니다. 제목, 날짜, 시간, 설명과 같은 기본 이벤트 세부 정보를 지원합니다.

사용 사례

  • 예약 일정 조정
  • 캘린더에 알림 추가하기
  • 생산성 앱에서 이벤트 생성 통합
  • 앱 내에서 이벤트 공유 활성화
  • 회의 초대 지원

주요 기능

  • 크로스 플랫폼 호환성
  • 간단한 이벤트 생성 API
  • 자동 플랫폼 처리
  • 이벤트 제목, 날짜, 시간 및 설명을 지원합니다
  • 필수 구성 최소화

적합한 대상

  • 캘린더 통합 앱을 개발하는 개발자
  • 빠른 이벤트 추가가 필요한 앱
  • Android 및 iOS를 대상으로 하는 프로젝트
  • 간편한 캘린더 접근을 원하는 팀

고려 사항

  • 캘린더에 액세스하려면 사용자 권한이 필요합니다
  • 기본 이벤트 속성에 한정
  • 반복 이벤트에 대한 지원 없음
  • 기기의 기본 캘린더 앱에 따라 다릅니다
  • 안드로이드에서 추가 권한이 필요할 수 있습니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

add_2_calendar

A really simple Flutter plugin to add events to each platform's default calendar.

Installation

In your pubspec.yaml file within your Flutter Project:

dependencies:
  add_2_calendar: ^2.1.2
Android integration

The plugin doesn't need any special permissions by default to add events to the calendar. However, events can also be added without launching the calendar application, for this it is needed to add calendar permissions to your AndroidManifest.xml

<uses-permission android:name="android.permission.WRITE_CALENDAR" />
<uses-permission android:name="android.permission.READ_CALENDAR" />

Starting from API 30 Android requires package visibility configuration in your AndroidManifest.xml. A element must be added to your manifest as a child of the root element. See the Android documentation for examples of other queries.

<queries>
  <intent>
    <action android:name="android.intent.action.INSERT" />
    <data android:mimeType="vnd.android.cursor.item/event" />
  </intent>
</queries>
iOS integration

In order to make this plugin work on iOS 10+, be sure to add this to your info.plist file:

<key>NSCalendarsUsageDescription</key>
<string>INSERT_REASON_HERE</string>

NSContactsUsageDescription is required for the location autocomplete once Apple's UI is opened, so it is highly recommended that you also add the key, the app might crash otherwise.

<key>NSContactsUsageDescription</key>
<string>INSERT_REASON_HERE</string>

Use it

import 'package:add_2_calendar/add_2_calendar.dart';

final Event event = Event(
      title: 'Event title',
      description: 'Event description',
      location: 'Event location',
      startDate: DateTime(/* Some date here */),
      endDate: DateTime(/* Some date here */),
      iosParams: IOSParams( 
        reminder: Duration(/* Ex. hours:1 */), // on iOS, you can set alarm notification after your event.
        url: 'https://www.example.com', // on iOS, you can set url to your event.
      ),
      androidParams: AndroidParams( 
        emailInvites: [], // on Android, you can add invite emails to your event.
      ),
    );
...
Add2Calendar.addEvent2Cal(event);
...

This will launch the default calendar application to confirm the event and add it to your calendar.

Recurring events

You can add recurrency to your events by specifying a frequency. Optional parameters such as interval, ocurrances and endDate can also be added.

 Event(
   ...
  recurrence: Recurrence(
        frequency: Frequency.monthly,
        interval: 2,
        ocurrences: 6,
      ),
    );

iOS language support

By default the ios screen that appears to save the event will be displayed in English, to support diffrent languages, add to your info.plist the languages you are supporting.

<key>CFBundleLocalizations</key>
	<array>
		<string>en</string>
		<string>es</string>
		<string>ja</string>
	</array>

Note: See DateTime docs to know what valid date could be correct in above piece of code.

Example

Please run the app in the example/ folder to start playing!

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트