rich_text_view 0.0.1 copy "rich_text_view: ^0.0.1" to clipboard
rich_text_view: ^0.0.1 copied to clipboard

outdated

A simple yet powerful rich text view that supports mention, hashtag, emial, url and see more.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:rich_text_view/rich_text_view.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: Text('Flutter Rich Text View'),
        ),
        body: SingleChildScrollView(
          child: Column(
            children: [
              Text('As a Text View Widget'),
              SizedBox(
                height: 16,
              ),
              Container(
                width: 300,
                child: RichTextView(
                  text:
                      "Who else thinks it's thinks it's just cool to mention @jane when #JaneMustLive is trending without even trying to send an email to janedoe@gmail.com and verify the facts talkmore of visiting www.janedoe.com",
                  maxLines: 3,
                  align: TextAlign.center,
                  onEmailClicked: (email) => print('$email clicked'),
                  onHashTagClicked: (hashtag) => print('is $hashtag trending?'),
                  onMentionClicked: (mention) => print('$mention clicked'),
                  onUrlClicked: (url) => print('visting $url?'),
                  supportedTypes: [
                    ParsedType.EMAIL,
                    ParsedType.HASH,
                    ParsedType.MENTION
                  ],
                ),
              ),
              SizedBox(
                height: 24,
              ),
              Text('As a Text Editor Widget'),
              SizedBox(
                height: 16,
              ),
              Container(
                width: 300,
                child: RichTextView(
                  editable: true,
                  suggestionPosition: SuggestionPosition.bottom,
                  onSearchPeople: (term) async {
                    return [
                      Suggestion(
                          imageURL: 'imageURL',
                          subtitle: 'I am the little guy from Coal city',
                          title: 'Nelly Gane')
                    ];
                  },
                  onSearchTags: (term) async {
                    return [
                      HashTag(hashtag: 'Dart', counts: 29, trending: true)
                    ];
                  },
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
62
likes
0
pub points
89%
popularity

Publisher

verified publishernelsoneze.com

A simple yet powerful rich text view that supports mention, hashtag, emial, url and see more.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

bloc, flutter, flutter_bloc

More

Packages that depend on rich_text_view