Giter Club home page Giter Club logo

super_rich_text's Introduction

Whats up πŸ‘‹

Basic Info

Bestfastfire

Here are some ideas to get you started:

  • πŸ”­ I’m currently working with Flutter
  • 🌱 I’m currently learning Swift

Public Projects

  PlayStore / App Store

  PlayStore / App Store

  PlayStore / App Store

  PlayStore / App Store

  PlayStore / App Store

Help Maintenance

I've been maintaining quite many repos these days and burning out slowly. If you could help me cheer up, buying me a cup of coffee will make my life really happy and get much energy out of it.

Contact

woton-sampaio-a66302166 woton-sampaio-a66302166 woton-sampaio-a66302166

super_rich_text's People

Contributors

ali1ammar avatar bestfastfire avatar unger1984 avatar

Stargazers

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

super_rich_text's Issues

Custom markers being shifted

return SuperRichText(
      text: text,
      style: style,
      useGlobalMarkers: false,
      othersMarkers: [
        MarkerText(
          marker: '//',
          style: const TextStyle(
            fontStyle: FontStyle.italic,
          ),
        ),
        MarkerText(
          marker: '>',
          style: TextStyle(
            fontSize: style.fontSize! * 0.8,
          ),
        ),
        MarkerText(
          marker: '^',
          style: const TextStyle(
            fontWeight: FontWeight.bold,
          ),
        ),
      ],
    );

Using the text
regular text //italic text 1// regular text //italic text 2// regular text
outputs the following
regular text regular text italic text 1 regular text_italic text 2_
the strings to be replaced are being shifted to the next position of the next one,
but using
regular text ^bold text 1^ regular text ^bold text 2^ regular text works as expected

How to justify text?

I need text to justify, this would work in a normal Text object but doesnt seem to work in this lib textAlign: TextAlign.justify, ideas?

Text styling gets lost on scrolling

When scrolling up and down the Styling gets lost and the input Text is displayed:

big

Here you can see the used Code:

return Center(
              child: ListView.builder(
                itemCount: 10,
                scrollDirection: Axis.vertical,
                cacheExtent: 100.0,
                padding: EdgeInsets.symmetric(vertical: 10.0),
                itemBuilder: (BuildContext context, int index) {

                  String material = '*β€”*';

                  return GestureDetector(
                      child: Container(
                        decoration: BoxDecoration(
                            border: Border.all(),
                            borderRadius: BorderRadius.circular(12)),
                        margin: EdgeInsets.symmetric(
                            vertical: 10.0, horizontal: 10.0),
                        padding: EdgeInsets.symmetric(
                            vertical: 10.0, horizontal: 10.0),
                        child: Column(
                          children: <Widget>[
                            Row(
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: <Widget>[
                                Flexible(
                                  child: Column(
                                    children: <Widget>[
                                      SuperRichText(
                                        text:
                                            'Item',
                                        style: Theme.of(context)
                                            .textTheme
                                            .headline5,
                                      ),
                                    ],
                                  ),
                                )
                              ],
                            ),
                            Divider(),
                            Row(
                              crossAxisAlignment: CrossAxisAlignment.center,
                              children: <Widget>[
                                Tooltip(
                                  message: 'Spieldauer',
                                  height: 24,
                                  child: Icon(Icons.timer),
                                ),
                                Padding(
                                  padding: const EdgeInsets.only(right: 7.0),
                                ),
                                Text('5 -20 Min.',
                                  style: Theme.of(context).textTheme.bodyText1,
                                ),
                                Spacer(
                                  flex: 1,
                                ),
                                Divider(),
                                Spacer(
                                  flex: 1,
                                ),
                                Tooltip(
                                  message: 'Gruppengrâße',
                                  height: 24,
                                  child: Icon(Icons.group),
                                ),
                                Padding(
                                  padding: const EdgeInsets.only(right: 7.0),
                                ),
                                Text('1 - 3',
                                  style: Theme.of(context).textTheme.bodyText1,
                                ),
                              ],
                            ),
                            Divider(),
                            Row(
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: <Widget>[
                                Tooltip(
                                  message: 'Material',
                                  height: 24,
                                  child: Icon(Icons.build),
                                ),
                                Padding(
                                  padding: const EdgeInsets.only(right: 7.0),
                                ),
                                new Flexible(
                                  child: Column(
                                    children: <Widget>[
                                      SuperRichText(
                                        text: '$material',
                                        style: Theme.of(context)
                                            .textTheme
                                            .bodyText1,
                                      ),
                                    ],
                                  ),
                                ),
                              ],
                            ),
                          ],
                        ),
                      ),
                      onTap: () {
                      });
                },
              ),
            );
          ```

String with no attributes causes exception

If I have a text with no attributes at all, I get an exception:

════════ Exception caught by widgets library ════════
The following FormatException was thrown building SuperRichText(dirty):
Nothing to repeat*.?

The relevant error-causing widget was:
SuperRichText file:///Users/.../lib/helper/RichTextWidget.dart:66:12
When the exception was thrown, this was the stack:
#0 new _RegExp (dart:core-patch/regexp_patch.dart:219:51)
#1 new RegExp (dart:core-patch/regexp_patch.dart:29:15)
#2 SuperRichText.build. (package:super_rich_text/super_rich_text.dart:172:17)
#3 List.forEach (dart:core-patch/growable_array.dart:285:8)
#4 SuperRichText.build (package:super_rich_text/super_rich_text.dart:163:16)
...
══════════════

The use case is that the Widget first displays a loading text without attributes and then later some text with attributes like * or / is displayed.

One function for marker

Good day, first of all want to say that this extension is beautiful. I'd like it alot.
I faced a problem in my project. I have Marker with function

  MarkerText.withFunction(
        marker: '/19/',
        functions: [() => print("test")],
        style: styleMarker),

and my text String looks like this
var textString = "The main part of /19/this/19/ is identical with /19/Rule/19/ of the ";

So print is only work on first word in string. But it doesnt work on second word. Its works fine if i write second function in list of functions

    MarkerText.withFunction(
        marker: '/19/',
        functions: [() => print("test"), () => print("test")],
        style: styleMarker),

but it is not very convenient way to solve the problem because in my text could be a lot of specific part with same marker tag, and for each of them i should past the same function. Thanks in advance

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.