flutter_percent_indicator icon indicating copy to clipboard operation
flutter_percent_indicator copied to clipboard

Feature Request: Multiple overlapping percent strokes.

Open vedantrathore opened this issue 4 years ago • 7 comments

Hello @diegoveloper , Thanks for this amazing package. I was wondering if there is any support for multiple percent strokes, preferably overlapping. Something like this image

If not, then I'd like to work on this feature and send out a PR. Just want to know your thoughts on how should we proceed in implementing this.

vedantrathore avatar Jul 23 '20 07:07 vedantrathore

Hello, this is not supported right now. If you want to implement this feature, go ahead you are welcome! Just don't forget to do it on LinearPercentIndicator too and add a couple of samples.

Thanks

On Thu, Jul 23, 2020, 2:44 AM Vedant Rathore [email protected] wrote:

Hello @diegoveloper https://github.com/diegoveloper , Thanks for this amazing package. I was wondering if there is any support for multiple percent strokes, preferably overlapping. Something like this [image: image] https://user-images.githubusercontent.com/14354315/88257907-7968bc80-ccdc-11ea-90eb-c6bf54034b3f.png

If not, then I'd like to work on this feature and send out a PR. Just want to know your thoughts on how should we proceed in implementing this.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/diegoveloper/flutter_percent_indicator/issues/68, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFL3UE6AMDXA36RXMR3ABDR47S7PANCNFSM4PFOQVPA .

diegoveloper avatar Jul 23 '20 14:07 diegoveloper

@vedantrathore did you end up developing this feature? I'm currently searching for the same feature but for the LinearPercentIndicator...

Lorenzohidalgo avatar Jul 12 '21 15:07 Lorenzohidalgo

Hey @diegoveloper and @vedantrathore , is this feature supported?

om-ha avatar Sep 12 '21 10:09 om-ha

Hey @Lorenzohidalgo and @om-ha Unfortunately I did not end up working on this as the design requirements for this feature changed and this was not needed anymore.

Feel free to pick this up if needed.

vedantrathore avatar Sep 14 '21 08:09 vedantrathore

Hey @vedantrathore and @diegoveloper

I just tested this, it's easily achievable with a Stack widget!

Enjoy:

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

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

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.symmetric(horizontal: 20),
      child: Column(
        children: const [
          SizedBox(height: 36),
          _MultiLevelPercentIndicatorWidget(),
          Spacer(),
        ],
      ),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    // Background
    return Container(
      height: 8,
      padding: const EdgeInsets.all(2),
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(4.0),
        color: Colors.redAccent.shade100,
      ),
      child: Stack(
        children: [
          // low-intensity color (bottom)
          LinearPercentIndicator(
            padding: const EdgeInsets.symmetric(horizontal: 2), // for some reason we need to re-apply padding for horizontal
            percent: 0.8,
            backgroundColor: Colors.transparent,
            progressColor: Colors.redAccent.shade100,
          ),
          // high-intensity color (top)
          LinearPercentIndicator(
            padding: const EdgeInsets.symmetric(horizontal: 2), // for some reason we need to re-apply padding for horizontal
            percent: 0.4,
            backgroundColor: Colors.transparent,
            progressColor: Colors.redAccent.shade400,
          ),
        ],
      ),
    );
  }
}

om-ha avatar Oct 21 '21 07:10 om-ha

This Worked for me, but this only works if one has fixed amount of metrics

 Stack(
                      children: [
                        new CircularPercentIndicator(
                          radius: 130.0,
                          animation: true,
                          animationDuration: 1200,
                          lineWidth: 15.0,
                          percent: 0.60,
                          center: new Text(
                            "60 %",
                            style: new TextStyle(
                                fontWeight: FontWeight.bold, fontSize: 20.0),
                          ),
                          circularStrokeCap: CircularStrokeCap.round,
                          backgroundColor: Colors.orange,
                          progressColor: colorPrimary,
                        ),
                        new CircularPercentIndicator(
                          radius: 130.0,
                          animation: true,
                          animationDuration: 1200,
                          lineWidth: 15.0,
                          percent: 0.45,
                          center: new Text(
                 
           "60 %",
                            style: new TextStyle(
                                fontWeight: FontWeight.bold, fontSize: 20.0),
                          ),
                          circularStrokeCap: CircularStrokeCap.round,
                          backgroundColor: colorTransparent,
                          progressColor: colorRed,
                        ),
                      ],
                    ),

Screen Shot 2021-11-17 at 6 18 40 PM

DhrumilShah11 avatar Nov 17 '21 12:11 DhrumilShah11

Will this be picked up?

ymerdrengene avatar Jul 11 '22 13:07 ymerdrengene