expanded_text_custom

Last updated:

0 purchases

expanded_text_custom Image
expanded_text_custom Images
Add to Cart

Description:

expanded text custom

Expanded Text Custom Library #
A custom Flutter widget to display expandable text with a "read more/read less" toggle, customizable icons, and shader effects.
Features #
Expandable text with customizable "read more/read less" functionality.
Option to display an optional title above the text content.
Customizable appearance, including text styles, colors, icons, and shader effects.
Support for animated text size changes and smooth transitions.
Optional custom icons for expand/collapse functionality.
Installation #
Add the following line to your pubspec.yaml file:
yaml
dependencies:
expanded_text_custom:
git: https://github.com/your-github-repo/expanded_text_custom.git
copied to clipboard
Usage #
Import the library in your Flutter project:
import 'package:expanded_text_custom/expanded_text_custom.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:expanded_text_custom/expanded_text_custom.dart';

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

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text("Expandable Text Custom Example")),
body: Center(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: ExpandableTextCustom(
title: "Expandable Text Example",
content:
"This is an example of expandable text. The full content can be viewed by clicking 'read more'. This feature is useful for displaying long text with a compact view.",
maxLines: 3,
showMore: true,
textMore: "Read More",
textLess: "Read Less"),
),
),
),
);
}
}
copied to clipboard
Key Properties #

title: An optional title for the expandable text.
content: The main content to display (required).
maxLines: The maximum number of lines to show before truncating. Default is 3.
showMore: Whether to show the "read more/read less" toggle. Default is false.
showIcon: Whether to display an icon next to the "read more/read less" text. Default is true.
textExpandStyle: The style for the "read more/read less" text.
titleColor: The color of the title text.
textStyleTitle: Custom text style for the title.
textStyleContent: Custom text style for the main content.
shaderMask: Whether to apply a shader mask effect for truncation. Default is false.
iconColor: Color filter for the expand/collapse icons.
textMore: Custom text for "read more".
textLess: Custom text for "read less".
assetsIconLess: Path to the SVG asset for the collapse icon.
assetsIconMore: Path to the SVG asset for the expand icon.

Additional Notes #

This widget uses AnimatedSize for smooth transitions when expanding/collapsing text.
The ShaderMask is used to create a fade-out effect at the bottom of truncated text.
Make sure to provide valid SVG asset paths if you use custom icons for "read more/read less".
You can customize the widget to meet your specific needs by adjusting the various properties.

For more information or support, please visit [repository link] and open an issue or contribute to the codebase.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.