Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradient color #8

Open
matheusrmribeiro opened this issue Jun 18, 2020 · 3 comments
Open

Gradient color #8

matheusrmribeiro opened this issue Jun 18, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@matheusrmribeiro
Copy link

Would be nice if the LineStyle have a gradient color option, like the Container widget.

@JHBitencourt JHBitencourt added the enhancement New feature or request label Jun 18, 2020
@JHBitencourt
Copy link
Owner

I agree, each TimelineTile could have its own gradient line.

But it would be hard (can't think an easy way right now) to keep the same gradient through all the tiles, which I assume that would be the most common desired use case. Any ideias?

@matheusrmribeiro
Copy link
Author

I did not explain so well, but the gradient option it's like you said, each TimelineTile will have your own gradient LineStyle.

What I needed was that each TimelineTile had your own gradient, not all the same. I think it's better in that way than have one that repeat on each tile or even one to all TimelineTile tree.

Some problems:

  1. If you have one gradient to all TimelineTile tree.
    • Maybe the user can't notice the effect on large lists

  2. If need to repeat the gradient on all tiles
    • You can create a gradient const and put it on all tiles manually

@bartcone-fulfilld
Copy link

Old thread, but you can use a ShaderMask (https://api.flutter.dev/flutter/widgets/ShaderMask-class.html) to achieve all different kinds of variations. Example below creates the gradient along the entire timeline.

ShaderMask(
              blendMode: BlendMode.srcIn,
              shaderCallback: (bounds) {
                return LinearGradient(colors: [
                  Colors.yellow,
                  Colors.deepOrange
                ], tileMode: TileMode.mirror)
                    .createShader(bounds);
              },
              child: WidgetEncapsulatingTime()),

Screen Shot 2022-07-28 at 5 19 11 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants