From 513c2edaa9d7a49c9642ff836693953a9cd27dd3 Mon Sep 17 00:00:00 2001 From: pavanpodila Date: Sat, 6 Apr 2024 07:17:02 +0530 Subject: [PATCH] chore: updated readme --- .../flutter_sanity_portable_text/README.md | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/packages/sanity/flutter_sanity_portable_text/README.md b/packages/sanity/flutter_sanity_portable_text/README.md index 4cef0c1..12f5452 100644 --- a/packages/sanity/flutter_sanity_portable_text/README.md +++ b/packages/sanity/flutter_sanity_portable_text/README.md @@ -5,19 +5,33 @@ Renders the [Portable Text format](https://github.com/portabletext/portabletext) in Flutter. -Screenshot of the rendered Portable Text + ## Features - [x] Renders all standard styles and marks - [x] Renders multiple blocks of text -- [x] Includes supports for custom blocks -- [x] Supports custom styles and marks including gestures +- [x] Includes support for custom blocks and block containers +- [x] Supports custom styles and marks including complex annotations +- [x] Ability to customize all the default styles, blocks and containers +- [x] Shows inline errors for unregistered blocks, marks and styles. This is + useful during debugging and development. ## Usage The below samples show the various ways of using the `PortableText` widget. +- [With a simple TextBlockItem](#with-a-simple-textblockitem) +- [Rendered directly from JSON](#rendered-directly-from-json) +- [With multiple blocks and different styles](#with-multiple-blocks-and-different-styles) +- [With a custom block](#with-a-custom-block) +- [Using an unregistered block shows an error](#using-an-unregistered-block-shows-an-error) +- [With a custom mark](#with-a-custom-mark) +- [When a custom mark is not registered, an error will be shown](#when-a-custom-mark-is-not-registered-an-error-will-be-shown) + ### With a simple TextBlockItem ```dart @@ -308,7 +322,7 @@ class MyApp extends StatelessWidget { style: 'h1', ), - // this will show an error on the PortableWidget + // this will show an error on the PortableText Widget UnregisteredBlockItem(), ], ), @@ -460,7 +474,7 @@ class MyApp extends StatelessWidget { children: [ Span( text: - ' and report when a custom mark is not registered, such as:'), + ' and report when a custom mark is not registered, such as:'), Span(text: ' this.', marks: ['missing-key']), ], markDefs: [