notion_dart_kit library

A comprehensive, type-safe Dart toolkit for the Notion API.

To use this library, import it:

import 'package:notion_dart_kit/notion_dart_kit.dart';

Classes

AndFilter
Annotations
Annotations for styling rich text.
ApiVersion
API version management utilities for Notion API.
ArrayRollupValue
BatchHelper
Helper functions for batch operations on pages.
Block
Base block object representing a piece of content within Notion
BlockBuilder
Main entry point for building block objects
BlockChildren
Block children response with pagination.
BlockChildrenCache
Cache for block children lookups.
BlockContent
Standard block content (paragraph, headings, lists, etc.)
BlockParent
BlockPosition
Position used when appending children in API version 2026-03-11 or newer.
BlocksService
Service for interacting with Notion Blocks API
BookmarkBlockBuilder
Builder for bookmark blocks
BooleanFormulaValue
BotInfo
Bot-specific properties
BotOwner
Bot owner information
BotUser
Builder for breadcrumb blocks
CalloutBlockBuilder
Builder for callout blocks
CheckboxEqualsFilter
CheckboxFilterBuilder
チェックボックスフィルタビルダー
CheckboxProperty
CheckboxPropertySchema
CodeBlockBuilder
Builder for code blocks
CodeContent
Code block content with language
Comment
Comment object
CommentAttachment
Comment attachment entry
CommentDisplayName
Comment display name shown for a comment
CommentsService
Service for interacting with Notion Comments API
CreatedByProperty
CreatedByPropertySchema
CreatedTimeProperty
CreatedTimePropertySchema
CustomDisplayName
CustomEmoji
Custom emoji object in a Notion workspace.
CustomEmojiPageIcon
CustomEmojisService
Service for Notion custom emoji endpoints.
Database
Represents a Notion database - a container for one or more data sources
DatabaseMention
DatabaseParent
DatabasesService
Service for interacting with Notion Databases API
DataSource
Represents a Notion data source
DataSourceParent
DataSourceRef
Reference to a data source (minimal info returned with database object)
DataSourcesService
Service for interacting with Notion Data Sources API
DateAfterFilter
DateBeforeFilter
DateEqualsFilter
DateFilterBuilder
日付フィルタビルダー
DateFormulaValue
DateIsEmptyFilter
DateIsNotEmptyFilter
DateMention
DateNextMonthFilter
DateNextWeekFilter
DateNextYearFilter
DateOnOrAfterFilter
DateOnOrBeforeFilter
DatePastMonthFilter
DatePastWeekFilter
DatePastYearFilter
DateProperty
DatePropertyBuilder
Builder for date properties
DatePropertySchema
DateRollupValue
DateValue
Date value for date properties.
DividerBlockBuilder
Builder for divider blocks
EmailProperty
EmailPropertySchema
EmbedBlockBuilder
Builder for embed blocks
EmojiIcon
Represents an emoji icon
EmojiPageIcon
EquationBlockBuilder
Builder for equation blocks
EquationContent
Equation expression.
EquationRichText
EquationRichTextBuilder
Builder for equation rich text
ExternalFile
Failure<T, E>
FilePageIcon
FilesFilterBuilder
Filesフィルタビルダー
FilesIsEmptyFilter
FilesIsNotEmptyFilter
FilesProperty
FilesPropertySchema
FileUpload
Represents a File Upload object in Notion
FileUploadsService
Service for interacting with Notion File Uploads API
Filter
Type-safe filter DSL for Notion database queries.
FormulaProperty
FormulaPropertySchema
FormulaValue
Formula result value (union type)
HeadingBlockBuilder
Builder for heading blocks (1, 2, 3)
InMemoryRetryQueueStorage
In-memory storage (default). Provides no persistence across process restarts.
IntegrationDisplayName
LastEditedByProperty
LastEditedByPropertySchema
LastEditedTimeProperty
LastEditedTimePropertySchema
LegacyPropertyValue
Legacy property value wrapper - will be replaced by typed PropertyValue This is a simplified version - properties are stored as raw JSON for now
LinkPreviewMention
ListItemBlockBuilder
Builder for list item blocks (bulleted and numbered)
MarkdownContentUpdate
A search-and-replace operation for the update_content markdown command.
MarkdownUpdateCommand
Request command for PATCH /v1/pages/:page_id/markdown.
MediaBlockBuilder
Builder for media blocks (image, video, file, pdf)
MentionContent
Mention types
MentionRichText
MentionRichTextBuilder
Builder for mention rich text
MultiSelectContainsAnyFilter
MultiSelectContainsFilter
MultiSelectDoesNotContainAnyFilter
MultiSelectDoesNotContainFilter
MultiSelectFilterBuilder
MultiSelectフィルタビルダー
MultiSelectIsEmptyFilter
MultiSelectIsNotEmptyFilter
MultiSelectProperty
MultiSelectPropertySchema
NotionClient
Main client for interacting with the Notion API.
NotionFile
Represents a file in Notion (either external URL or uploaded file)
NotionLogger
Singleton logger for Notion API operations.
NotionNativePageIcon
NumberDoesNotEqualFilter
NumberEqualsFilter
NumberFilterBuilder
数値系フィルタビルダー
NumberFormulaValue
NumberGreaterThanFilter
NumberGreaterThanOrEqualFilter
NumberIsEmptyFilter
NumberIsNotEmptyFilter
NumberLessThanFilter
NumberLessThanOrEqualFilter
NumberProperty
NumberPropertySchema
NumberRollupValue
OrFilter
Page
Represents a Notion page
PageHelper
Helper functions for extracting data from pages.
PageIcon
Represents a page icon (either emoji or file)
PageMarkdown
Response object returned by Notion page markdown endpoints.
PageMention
PageParent
PagesService
Service for interacting with Notion Pages API
PageTemplateApply
Template application body for create/update page template support.
PaginatedComments
Paginated list for comments
PaginatedList<T>
Represents a paginated list response from the Notion API.
ParagraphBlockBuilder
Builder for paragraph blocks
Parent
Parent object representing the location of a page, database, or block
PeopleContainsFilter
PeopleDoesNotContainFilter
PeopleFilterBuilder
Peopleフィルタビルダー
PeopleIsEmptyFilter
PeopleIsNotEmptyFilter
PeopleProperty
PeoplePropertySchema
PersonInfo
Person-specific properties
PersonUser
PhoneNumberProperty
PhoneNumberPropertySchema
PropertyBuilder
Main entry point for building property values
PropertyFilter
Type-safe property filter conditions for different property types.
PropertyFilterBuilder
プロパティフィルタビルダー
PropertyFilterCondition
PropertyHelper
Helper functions for extracting typed values from properties.
PropertyItem
Represents a Notion page property item
PropertyItemList
Represents a paginated list of property items
PropertySchema
Represents a property schema definition in a data source
PropertySort
PropertyValue
Represents a Notion page property value
QuoteBlockBuilder
Builder for quote blocks
RateLimiter
Rate limiter that enforces request rate limits with exponential backoff.
RelationContainsFilter
RelationDoesNotContainFilter
RelationFilterBuilder
Relationフィルタビルダー
RelationIsEmptyFilter
RelationIsNotEmptyFilter
RelationItem
Relation item - reference to another page
RelationProperty
RelationPropertySchema
Result<T, E>
A type representing either success or failure.
RetryQueue
Retry queue with priority scheduling and exponential backoff.
RetryQueueEntry
Internal queue entry with scheduling metadata.
RetryQueueStorage
Abstract persistence layer for the retry queue.
RichText
Rich text object with support for text, mentions, and equations
RichTextBuilder
Main entry point for building rich text objects
RichTextHelper
Helper functions for working with rich text.
RichTextProperty
RichTextPropertyBuilder
Builder for rich text properties with formatting
RichTextPropertySchema
RollupProperty
RollupPropertySchema
RollupValue
Rollup calculation result (union type)
SearchResult
Union type for search results (Page or Database).
SearchResults
Search results containing pages and/or databases.
SearchService
Service for interacting with Notion Search API
SelectDoesNotEqualAnyFilter
SelectDoesNotEqualFilter
SelectEqualsAnyFilter
SelectEqualsFilter
SelectFilterBuilder
Selectフィルタビルダー
SelectIsEmptyFilter
SelectIsNotEmptyFilter
SelectOption
Select option for select and multi-select properties.
SelectProperty
SelectPropertySchema
Sort
Type-safe sort DSL for Notion database queries.
SortBuilder
Builder for creating sort conditions with convenient static methods.
StatusDoesNotEqualAnyFilter
StatusDoesNotEqualFilter
StatusEqualsAnyFilter
StatusEqualsFilter
StatusFilterBuilder
Statusフィルタビルダー
StatusIsEmptyFilter
StatusIsNotEmptyFilter
StatusOption
Status option for status properties.
StatusProperty
StatusPropertySchema
StringFormulaValue
Success<T, E>
TabBlockBuilder
Builder for tab blocks.
TableBlockBuilder
Builder for table blocks
TableOfContentsBlockBuilder
Builder for table of contents blocks
Template
Template object representing a template in a Notion data source
TemplateMentionDate
TemplateMentionUser
TemplatesService
Service for interacting with Notion Templates API
TextContainsFilter
TextContent
Text content with optional link.
TextDoesNotContainFilter
TextDoesNotEqualFilter
TextEndsWithFilter
TextEqualsFilter
TextFilterBuilder
テキスト系フィルタビルダー
TextIsEmptyFilter
TextIsNotEmptyFilter
Link object for text.
TextRichText
TextRichTextBuilder
Builder for text rich text with formatting
TextStartsWithFilter
TimestampSort
TitleProperty
TitlePropertyBuilder
Builder for title properties with rich text formatting
TitlePropertySchema
ToDoBlockBuilder
Builder for to-do blocks
ToDoContent
To-do block content with checked state
ToggleBlockBuilder
Builder for toggle blocks
UniqueId
Unique ID value
UniqueIdProperty
UniqueIdPropertySchema
UnsupportedRollupValue
UploadedFile
UrlProperty
UrlPropertySchema
User
User object representing a user in a Notion workspace
UserDisplayName
UserMention
UserOwner
UsersService
Service for interacting with Notion Users API
VerificationProperty
VerificationPropertySchema
VerificationValue
Verification state value
View
A Notion database view.
ViewQuery
Response from creating a cached view query.
ViewsService
Service for Notion Views API.
WorkspaceOwner
WorkspaceParent

Enums

BlockColor
Block colors
FileUploadMode
Upload mode
FileUploadStatus
Status of a File Upload
RetryPriority
Priority levels for retry tasks.
RichTextColor
Rich text color options
SearchFilter
Filter for search results.
SortDirection
Sort direction for database queries.
TimestampType
Timestamp type for sorting.

Extensions

BlockContentExtension on BlockContent
Extensions for toJson methods
CodeContentExtension on CodeContent
FilterStringExtension on String
String拡張(フィルタ用)
PropertyMapExt on Map<String, dynamic>
Extension on Map<String, dynamic> to convert to typed PropertyValue.
ResultFutureExtension on Future<Result<T, E>>
Extension methods for Future<Result<T, E>>
SortStringExtension on String
Extension on String to create sort conditions.
ToDoContentExtension on ToDoContent

Functions

recursivelyLoadBlocks(NotionClient client, String blockId, {int? maxDepth, int concurrency = 4, BlockChildrenCache? cache}) Future<List<Block>>
Recursively load all descendant blocks for the given blockId.
recursivelyLoadBlocksFromService(BlocksService blocksService, String blockId, {int? maxDepth, int concurrency = 4, BlockChildrenCache? cache}) Future<List<Block>>
Variant that accepts a BlocksService directly (useful for testing).

Typedefs

GetRetryAfter = Duration? Function(Object error)
Optional extractor for Retry-After duration from an error.
IsRetryable = bool Function(Object error)
A function that decides whether an error is retryable for this task.
RetryExecutor<T> = Future<T> Function()
A function that executes the task.

Exceptions / Errors

AuthenticationException
Exception thrown when authentication fails.
InvalidTemplateException
Exception thrown when a template is invalid or cannot be used.
NotFoundException
Exception thrown when a requested resource is not found.
NotionException
Base exception for all Notion API errors.
RateLimitException
Exception thrown when the API rate limit is exceeded.
TemplateNotFoundException
Exception thrown when a template is not found.
ValidationException
Exception thrown when the request is invalid.