An expandable text package for flutter.

Overview

Flutter Expandable Text

A customisable flutter package that allows the expanding and collapsing of long text.

pub.dev


Getting Started

Add package to your pubspec.yaml file

dependencies:
    flutter_expandable_text: ^1.0.0

then import:

import 'package:flutter_expandable_text/expandable_text.dart';

Usage snippet

Trim based on number of character in text

ExpandableText(
    _text,
    trimType: TrimType.characters,
    trim: 20, // trims if text exceeds 20 characters
);

Trim based on number of lines

ExpandableText(
    _text,
    trimType: TrimType.lines,
    trim: 2, // trims if text exceeds more than 2 lines
    onLinkPressed: (expanded) {

    },
);

Demo Image


Parameters

Name Description Is It Required Default Value
text Input text that is displayed Yes -
readMoreText Clickable text to display that expands text. No read more
readLessText Clickable text to display that collapses text No read less
linkTextStyle TextStyle for both readMoreText and readLessText No TextStyle(color:Colors.blue)
style TextStyle for text No TextStyle(color:Colors.black)
trim For TrimType.lines this represents the maximum amount of lines allowable before the text is collapsed. For TrimType.characters this represents the number of characters allowable before the text is collapsed No 2
trimType Whether to trim text by lines or characters in text No TrimType.lines
onLinkPressed Callback function when a link is pressed. Returns a boolean true is expanded and false is collapsed No null


Contributions

Feel free to contribute to this project.

If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue.

If you fixed a bug or implemented a new feature, please send a pull request.

You might also like...

A simple Quran package for flutter with arabic text, english translation, bangla language and pronunciation

A simple Quran package for flutter with arabic text, english translation, bangla language and pronunciation. Also available audio link, revelation type and other information.

Oct 10, 2022

Flutter plugin for selecting images from the Android and iOS image library, taking new pictures with the camera, and edit them before using such as rotation, cropping, adding sticker/text/filters.

Flutter plugin for selecting images from the Android and iOS image library, taking new pictures with the camera, and edit them before using such as rotation, cropping, adding sticker/text/filters.

advance_image_picker Flutter plugin for selecting multiple images from the Android and iOS image library, taking new pictures with the camera, and edi

Dec 19, 2022

This is a Flutter app which shows how to use the Selectable Text in your app

selectable_text A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Oct 25, 2021

Flutter circular text widget

Flutter circular text widget

Circular Text Widget Installation Add dependency in pubspec.yaml: dependencies: flutter_circular_text: "^0.3.1" Import in your project: import 'pack

Dec 28, 2022

Easy to use text widget for Flutter apps, which converts inlined urls into working, clickable links

Easy to use text widget for Flutter apps, which converts inlined urls into working, clickable links

LinkText Easy to use text widget for Flutter apps, which converts inlined URLs into clickable links. Allows custom styling. Usage LinkText widget does

Nov 4, 2022

Be together, whenever. A simple way to text chat and plan things all in one place for flutter developers.

Be together, whenever. A simple way to text chat and plan things all in one place for flutter developers.

Flutterdevconnect Be together, whenever. A simple way to text chat and plan things all in one place for flutter developers. Android IOS Web PWA Androi

Aug 27, 2022

flutter grpc video app && microsoft text to speech

flutter grpc video app && microsoft text to speech

flutter_video_app Getting Started Install dart protoc_plugin pub global activate protoc_plugin Clone WarpDriveProtocol git clone [email protected]

Sep 1, 2022

A Flutter plugin than allow expand and collapse text dynamically

A Flutter plugin than allow expand and collapse text dynamically

readmore A Flutter plugin than allow expand and collapse text. usage: add to your pubspec readmore: ^1.0.2 and import: import 'package:readmore/readm

Dec 28, 2022

Rich text editor for Flutter

Rich text editor for Flutter

A rich text editor for Flutter FlutterQuill is a rich text editor and a Quill component for Flutter. This library is a WYSIWYG editor built for the mo

Jan 4, 2023
Comments
  • respect text scale factor

    respect text scale factor

    this change introduces an accessibility feature called text scaling

    When a visually impaired person uses their phone, they usually increase text size on the device so they can read more easily. This PR makes so that ExpandableText increases the text size accordingly to system settings, just like flutter's Text widget.

    opened by eEQK 4
Owner
Chappie74
Just a guy that likes programming.
Chappie74
Text analyzer that extracts tokens from text for use in full-text search queries and indexes.

Tokenize text, compute document readbility and compare terms in Natural Language Processing. THIS PACKAGE IS PRE-RELEASE, and SUBJECT TO DAILY BREAKIN

GM Consult Pty Ltd 5 Dec 12, 2022
Flutter Tutorial : Expandable List - ExpansionTile & ListTile

Flutter Tutorial - Expandable List - ExpansionTile & ListTile With Flutter ExpansionTile, you can expand and shrink your widgets and also create an ex

Qaiser farooq 1 Dec 3, 2021
Expandable bottom app bar widget for Flutter SDK

Expandable bottom app bar widget for Flutter SDK

melvspace 106 Dec 28, 2022
Grad text package - A Flutter Widget to draw gradients into text

grad_text A Flutter Widget to draw gradients into text.(Null safe) Demo Install

Karthik Sunil K 3 Jan 31, 2022
An Instagram like text editor Flutter widget that helps you to change your text style.

TextEditor An instagram like text editor widget for flutter Show some ❤️ and star the repo to support the project Features Edit TextStyle object font

Mehdi Zarepour 68 Dec 16, 2022
Detectable text field - Flutter Text widgets with detection features

detectable_text_field Text widgets with detection features. You can detect hasht

null 0 Feb 2, 2022
A text field that displays text on different languages based on your selection.

translatable_text_field A text field that displays text on different languages based on your selection. Its basic idea is that you place this fields i

null 0 Mar 13, 2022
Dynamic Text Highlighting (DTH) package for Dart & Flutter.

Dynamic Text Highlighting (DTH) This package is used to highlight, in a completely dynamic way, keywords, or phrases, wherever they are present in a s

null 34 Oct 3, 2022
🔥🚀 Flutter package to create Pin code input text field with every pixel customization possibility 🎨 with beautiful animations

Flutter PinPut From Tornike ?? ?? Flutter package to create Pin code input (OTP) text field with every pixel customization possibility ?? and beautifu

Tornike 451 Jan 2, 2023
A Flutter package to make your text selectable for web and non-selectable for native builds.

PlatformText A Flutter package to make your text selectable for web and non-selectable for native builds. Features PlatformText returns Text or Select

Piotr Rozpończyk 1 Jun 9, 2022