flutter_show_more

Flutter widget for limiting the amount of text to show.

pub package

Installation

Add this to your package's pubspec.yaml file

dependencies:
  ...
  flutter_show_more: ^latest.version.here

Usage

First import show_more.dart

import 'package:flutter_show_more/flutter_show_more.dart';

ShowMoreText with all attributes

ShowMoreText(
  veryLongText,
  maxLength: 100,
  style: TextStyle(fontSize: 12, color: Colors.grey),
  showMoreText: 'show more',
  showMoreStyle: TextStyle(
  fontSize: 12,
    fontWeight: FontWeight.bold,
    color: Theme.of(context).accentColor,
  ),
  shouldShowLessText: true,
  showLessText: 'show less',
),

Screenshots

License

MIT License

Libraries

flutter_show_more