Giter Site home page Giter Site logo

notion_api's People

Contributors

bgwastu avatar jonathangomz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

notion_api's Issues

Follow proper package guidelines

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.

  1. Could you please update your package to export all required files properly so that we don't have too many dependencies on file imports in our classes. Currently for this small bit of code.
  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';
  1. Move private code into a folder called 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.

Parent mapping throws exception

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
 }

NotionClient class was renamed to Client

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 ๐Ÿ˜

How to work with typed blocks by design?

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 ?
    }
  }
`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.