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

outdated

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:flutter/material.dart';

import './contentful_data.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Contentful Rich Text Parser Demo',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Contentful Rich Text Parser Demo'),
        ),
        body: SingleChildScrollView(
          child: DefaultTextStyle(
            style: TextStyle(
              color: Colors.black,
            ),
            child: Center(
              child: Padding(
                padding: EdgeInsets.all(20.0),
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.start,
                  children: <Widget>[
                    ContentfulRichText(ContentfulData.jsonData)
                        .documentToWidgetTree,
                    Padding(
                      padding: EdgeInsets.symmetric(vertical: 20.0),
                      child: Divider(
                        color: Colors.black54,
                      ),
                    ),
                    Text.rich(
                      TextSpan(children: [
                        TextSpan(
                          text: 'JSON Data:',
                        )
                      ]),
                    ),
                    Text(ContentfulData.stringData),
                  ],
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
28
likes
0
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

License

unknown (license)

Dependencies

flutter, html_unescape, url_launcher

More

Packages that depend on contentful_rich_text