html_parsed_read_more 0.0.3 copy "html_parsed_read_more: ^0.0.3" to clipboard
html_parsed_read_more: ^0.0.3 copied to clipboard

A Flutter package which allows the user to enter html contents which can be collapsed and expanded based on user defined trimming conditions

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: ThemeData.light(),
      home: const HomeView(),
    );
  }
}

class HomeView extends StatelessWidget {
  const HomeView({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Example'),
      ),
      body: const Column(
        children: [
          HtmlParsedReadMore(
            readLessText: 'Read less',
            readMoreText: 'Read more',
            maxLinesReadLess: 3,
            maxLinesReadMore: 1000,
            textOverflow: TextOverflow.ellipsis,
            fontFamily: 'poppins',
            textButtonFontSize: 14.0,
            text:
                '<strong>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum</strong>',
          )
        ],
      ),
    );
  }
}
2
likes
150
points
81
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package which allows the user to enter html contents which can be collapsed and expanded based on user defined trimming conditions

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_html, html

More

Packages that depend on html_parsed_read_more