expandable_text 0.1.0

Flutter Android iOS web

Widget that only shows the first lines of a text and adds a link to expand the full text.

expandable_text #

pub package

This Flutter package includes the widget ExpandableText which you can use to initially only show a defined number of lines of a probably long text. The widget appends a configurable text link which let's the user expand the full text, or collapse it again.

Example with maxLines=1

Getting Started #

Add this to your package's pubspec.yaml file:

dependencies:
  expandable_text: 0.1.0

Next, import the package into your dart code:

import 'package:expandable_text/expandable_text.dart';

Usage #

Example which shows an expandable text if longText exceeds one line:

Widget build(BuildContext context) {
    return ExpandableText(
        longText,
        expandText: 'show more',
        collapseText: 'show less',
        maxLines: 1,
        linkColor: Colors.blue,
    );
}
8
likes
100
pub points
81%
popularity

Widget that only shows the first lines of a text and adds a link to expand the full text.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

florian.weinaug@gmail.com

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on expandable_text