jonathangomz / notion_api Goto Github PK
View Code? Open in Web Editor NEWNotion API client for dart
Home Page: https://pub.dev/packages/notion_api
License: Apache License 2.0
Notion API client for dart
Home Page: https://pub.dev/packages/notion_api
License: Apache License 2.0
I just started using your package and see that I have to import every file separately for your notion package. There are 2 conventions you need to follow which is used by all packages.
Future<void> createPage({required String pageId}) {
Page page = Page(
parent: Parent.page(id: 'YOUR_PAGE_ID'), // <- page
title: Text('NotionClient (v1): Page test'),
);
}
I have to import all of this
import 'package:notion_api/notion.dart';
import 'package:notion_api/notion/general/rich_text.dart';
import 'package:notion_api/notion/objects/pages.dart';
import 'package:notion_api/notion/objects/parent.dart';
It should only be
import 'package:notion_api/notion.dart';
To achieve this all you have to do is declare an export in your notion.dart file.
export 'notion/general/rich_text.dart';
export 'notion/objects/pages.dart';
export 'notion/objects/parent.dart';
src
. At the moment it's all accessible and when you do improve your code it will break all projects that use this. It's better to do it early.Thanks for the api, I'm eager to use it!
Databases attached to workspaces returns following part for parent mapping. Since id is set by using type
property, json[json["type"]]
returns true
and fail to cast string.
Here is sample from response:
"parent": {
"type": "workspace",
"workspace": true
}
Hello! I don't know if this was planned due to it being a beta version and whatnot, but using notion_api: ^2.0.0-beta2 in the dependencies and using the example, there is an error due to a class name change from NotionClient to Client.
I'm not familiar with issues or commenting on other people's packages, just wanted to let you know that the example is outdated with the most recent version ๐
It seems there is already a PR for this with #7
https://developers.notion.com/changelog/unversioned-requests-no-longer-accepted
With this lib is it possible for users to dynamically access information from 1 page itself? It can only be texts.
Example: User A accesses - Page A, User B accesses - Page B.
Hi, please explain how you design work with typed Block (e.g. Paragraph) after retrieve Page?
NotionResponse resBlocks =
await notion.blocks.list(block_id: 'YYYYYYYYY');
Pagination paging = resBlocks.content;
for (Block block in paging.blocks) {
if (block.isParagraph) {
//<-- HOW TO GET Paragraph Object ?
}
}
`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.