contentful_rich_text 2.1.0 copy "contentful_rich_text: ^2.1.0" to clipboard
contentful_rich_text: ^2.1.0 copied to clipboard

Rich Text renderer that parses Contentful Rich Text JSON object and returns a renderable Flutter widget tree

example/lib/main.dart

import 'package:contentful_rich_text/contentful_rich_text.dart';
import 'package:example/contentful_data.dart';
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Contentful Rich Text Parser Demo',
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Contentful Rich Text Parser Demo'),
        ),
        body: Padding(
          padding: const EdgeInsets.symmetric(horizontal: 8),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: <Widget>[
              SingleChildScrollView(
                child: ContentfulRichText(ContentfulData.jsonData).documentToWidgetTree,
              ),
              const Padding(
                padding: EdgeInsets.all(8.0),
                child: Divider(height: 4),
              ),
              const Text('JSON Data:'),
              const Expanded(
                child: SingleChildScrollView(
                  child: Text(ContentfulData.stringData),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
23
likes
120
pub points
91%
popularity

Publisher

verified publisherkumanu.com

Rich Text renderer that parses Contentful Rich Text JSON object and returns a renderable Flutter widget tree

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

collection, flutter, html_unescape, url_launcher

More

Packages that depend on contentful_rich_text