Code Monkey home page Code Monkey logo

expandable_text's Introduction

Hi there! 👋

My name is Florian and I'm a software engineer. Some technologies I enjoy working with include Flutter, React, Xamarin and ASP.NET Core. Furthermore, I'm interested in Domain Driven Design, UX, Usability and Clean Code.

📫 You can reach me on Twitter
🌍 Find me on the web at florianweinaug.de
💡 Learn more on LinkedIn and XING

expandable_text's People

Contributors

fweinaug avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

expandable_text's Issues

Add multiple textspans/styles within text

At the moment it is currently only possible to pick one TextStyle for the entire text.

It would be great if that could be changed.

The requirements for the project that I am working on right now require that part of the text have a different style from the rest of the text.

It would be great if I were able to use this package to implement their design.

See screenshot.
image

Default dots

Wouldn't it be better to make the dots plain text rather than clickable?

Null Safety Migration

Thanks for the great package! It's been exactly what we need.

Has this package been migrated for null safety? When building an app with the master version of Flutter (to check for future compatibility issues with the app), the build fails with this error:

/[...]/flutter/master/x64/.pub-cache/hosted/pub.dartlang.org/expandable_text-1.2.0/lib/expandable_text.dart:117:56: Error: No named parameter with the name 'nullOk'.
        final locale = Localizations.localeOf(context, nullOk: true);
                                                       ^^^^^^

I'm not super familiar with what is needed for migration, but I could attempt a PR, if needed.
https://dart.dev/null-safety/migration-guide
https://medium.com/flutter/announcing-dart-null-safety-beta-4491da22077a

Support Hashtags

Any plans on supporting hashtags (# and @)?
So, marking them on handling tabs?

Expand on text tap

It would be a nice addition if you add a bool expandOnTextTap, and when you tap on the text it will expand.
It's good when the text is plain text and you don't want to specifically tap the ... show more text.

Maybe even add an option shrinkOnTextTap so it will be more complete, but it is not necessary for me really.

Thanks :)

IsExpanded getter

First of all, thank you for this amazing plugin.
Secondly, can we have a controller or getter or something which gives the current status of widget (isExpanded or not). We can use _expanded variable you used to get this.

Add custom regexes

Idea for future feature. Let the user pass his own regex for hashtags, user mentions and urls. (Or even let him pass as many regexes and corresponding styles as he wants)

I am developing an app where we have our own definition for hashtags and user mentions and this feature would be very helpful

onUrlTap doesn't work on real device but only on emulator

Hi, @fweinaug

I have tried everything and after that i am logging this issue.

Device: Iphone XR
OS: iOS 16.6 (same behavior in iOS 16.5.1 on same device before)
Flutter: 3.10.6 (also tested in 3.10.1)
Xcode 15.3 Beta. (also tested in xcode 14.3)
MAC OS Ventura.

My issue is that i am unable to trigger the event onUrlTap at all. The only thing that fires is onLinkTap if I add that. Other than that neither onPrefixTap, nor onHash/onMention nothing works.

Importnat Point: When i put a breakpoint inside expandable_text.dart if(element.isUrl && widget.onUrlTap!=null) ... and then tap multiple times, and resume the program, surprisingly onUrlTap fires as many times as i have tapped it.

Can anyone point what is the issue? BTW it works fine on Iphone X OS 16.3 and also on all android real devices. The issue is with Iphone XR OS 16.5.1 - 16.6.

bought playlist returns AUTHENTICATION_FORBIDDEN response

من یک پلی لیست با این آیدی را خریده ام:
9981728f-646c-4da0-8434-658167def033
و اولین ویدیوی آن را با این اکسس هش میخواهم نگاه کنم:
44Bf8CibkfjP05xYk25JEWYpXbSOeKt5
و وقتی به این api درخواست میدهم تا hls ویدیو را دریافت کنم:

/vod/{access_hash}/

این پاسخ را دریافت می کنم:
response:
{ok: false, data: {error: user does not have permission.}, status: 403, error_type: [AUTHENTICATION_FORBIDDEN]}

access token:
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoiNWZlZWEzOGQtZjJlOC00Yzc5LTlkZDEtNjRlM2YyM2ZkMzk4IiwiY3JlYXRlZF9hdCI6IjIwMjMtMDctMDYgMTc6MjQ6MjIiLCJ0eXBlIjoiYWNjZXNzIn0.6fXSmj7I7HHHo-PdfZCf3ziOCt3gmom9t6kdU67fhdnSOi9fNxbeHY1KlYW3mlBsZJwxKGedKVh7z_3ZyO8u9Q

Bug in detection urls

There is currently a bug in detection urls.
A text like "test..." is detected as a url.

Collapse animation not working

The animation only works when expanding the text, not collapsing it. Using version 2.3.0.

Tested and verified with a minimal demo:

import 'package:expandable_text/expandable_text.dart';
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final String text =
      'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras venenatis nibh eu vestibulum ullamcorper. Suspendisse potenti. Praesent pulvinar a mauris nec efficitur. Integer ut luctus mi. Donec ut tristique sapien, et facilisis libero. In faucibus placerat erat, at cursus purus euismod vitae. Mauris tempor aliquam urna ac pretium. Pellentesque sapien libero, fringilla vel augue vitae, bibendum ultrices massa. Etiam maximus consectetur nulla sit amet eleifend.';

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Padding(
        padding: const EdgeInsets.all(16.0),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.start,
          children: <Widget>[
            ExpandableText(
              text,
              expandText: 'Show more',
              collapseText: 'Show less',
              animation: true,
              animationDuration: const Duration(seconds: 2),
            )
          ],
        ),
      ),
    );
  }
}
Flutter doctor

$ flutter doctor -v
[✓] Flutter (Channel stable, 3.0.5, on macOS 12.1 21C52 darwin-x64, locale en-SE)
    • Flutter version 3.0.5 at /usr/local/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f1875d570e (13 days ago), 2022-07-13 11:24:16 -0700
    • Engine revision e85ea0e79c
    • Dart version 2.17.6
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/mattias/Library/Android/sdk
    • Platform android-32, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] VS Code (version 1.69.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.44.0

[✓] Connected device (3 available)
    • iPhone 13 (mobile) • DF62181D-AB04-4849-964A-65357B8EC7F9 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-5 (simulator)
    • macOS (desktop)    • macos                                • darwin-x64     • macOS 12.1 21C52 darwin-x64
    • Chrome (web)       • chrome                               • web-javascript • Google Chrome 103.0.5060.134

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

Animation on expand and shrink

Hey nice package!
It will be great if you could add an animation (change height and fade?) when expanding and shrinking the text.
That will make the UX better and smoother on the eyes.

Thanks :)

Url Preview

Hi, thanks for building this package. Does it support url preview?

Error

Error: No named parameter with the name 'nullOk'.
final locale = Localizations.localeOf(context, nullOk: true);
^^^^^^

Support styling of 'expandText/collapseText'

It is currently possible to change the color of the expandText/collapseText but not to change the style.

I am working on an app at the moment and one of the requirements is for the "see more"/"see less" to have a different style.
See screenshot

image

It would be great if that were possible with this package. :)

Support for mentions with spaces

Hi, it would be nice if you could create mentions that contain spaces like: @FirstName LastName. It seems that updating parser to accept at least non breaking spaces (\u00A0) would be good enough.

Text style formatting

Hello, right now I unable to use your widget because there is no way I can style the longText inside of it (it is always black), please add the necessary parameters so we can add custom styling to all text.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.