flutter_show_more 1.0.2 copy "flutter_show_more: ^1.0.2" to clipboard
flutter_show_more: ^1.0.2 copied to clipboard

Flutter widget for limiting the amount of text to show.

flutter_show_more #

A modern Flutter widget for limiting the amount of text to show, with "show more" and "show less" functionality. Fully compatible with Dart 3, Flutter 3, and strict null safety.

pub package

Features #

  • Limits text visibility up to a specific character length, using grapheme-aware (characters API) truncation so emojis aren't split.
  • Optionally handles "show less" logic.
  • Fully customizable styles for text and toggles.

Installation #

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

dependencies:
  flutter_show_more: ^1.0.2

Usage #

First, import flutter_show_more:

import 'package:flutter_show_more/flutter_show_more.dart';

Then, use ShowMoreText:

ShowMoreText(
  'A very long text string that you want to truncate and allow the user to expand or collapse.',
  maxLength: 100,
  style: const TextStyle(fontSize: 14, color: Colors.black87),
  showMoreText: 'show more',
  showMoreStyle: TextStyle(
    fontSize: 14,
    fontWeight: FontWeight.bold,
    color: Theme.of(context).colorScheme.primary,
  ),
  shouldShowLessText: true,
  showLessText: 'show less',
)

Screenshots #

flutter_show_more example

License #

MIT License

7
likes
150
points
122
downloads

Documentation

API reference

Publisher

verified publisherjoshuamatta.dev

Weekly Downloads

Flutter widget for limiting the amount of text to show.

Homepage
Repository (GitHub)
View/report issues

Topics

#flutter #text #show-more #widget

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_show_more