how to create multiple radial bar inside each other? - flutter

I need to make a multiple radial bar inside each other. I searched but only syncfusion_flutter_charts package had some thing like that but I it needs licenses .There is no limitation on using other flutter packages.
the chart is some thing like this multiple radial bar

The best way to do this is to use a Stack widget together with Positioned Widgets. Examples with guides are found in the added links by the Flutter team itself.
What You can do is, use Stack widget to stack the Widgets and use to Wrap those widgets in Positioned widget to Passioned them the way you want inside the Stack.
Although I should mention heavy use of stack widget will have some performance impact.

using this way you can achieve it ( this is only a example , how to do it , it is not a implementation code ) ,
write code according to the use case , that is add alignment ,positioned ,etc...
stack(children: [
CircularPercentIndicator(
radius: 50.0,
circularStrokeCap: CircularStrokeCap.round,
progressColor: Colors.purple,
.....
.....
),
CircularPercentIndicator(
radius: 100.0,
circularStrokeCap: CircularStrokeCap.round,
progressColor: Colors.red,
.....
.....
),
CircularPercentIndicator(
radius: 150.0,
circularStrokeCap: CircularStrokeCap.round,
progressColor: Colors.blue,
.....
.....
),
])

actually I found the best way.CircularPercentIndicator has a center property which takes a widget. I gave it an another CircularPercentIndicator .this way worked perfect

Related

what will do after icon broke suddenly in appbar?

I am developing a flutter app where appbar icon broke suddenly without any reason. Try to fix but nothing has been found yet.
enter image description here
AppBar(
actions: [
GestureDetector(
onTap: () {},
child: SvgPicture.asset(
iconSearch,
color: VisuColors.white,
),
),
]
)
According to the image and code that you provide, things that come to my mind are:
1- Try to give width and height to SvgPicture.asset like this:
SvgPicture.asset(
iconSearch,
color: VisuColors.white,
width: 15,
height: 15,
),
2- Check the color that you gave to SvgPicture.asset, maybe it has something related to the color.
3- If these 2 solutions didn't solve your problem, check your SVG file and try to use another SVG file to see if the problem is with the file that you use. Because sometimes, the SVG files may be broken (size, color, formatting etc.).

How can I edit a text and add photo on illustrator image in flutter?

cv template and I want to edit it with flutter
Everything in Flutter is widgets, this image would be an Image widget in your Flutter app.
You can use Stack widget to put things over each other. so You can put image over an image by using Stack widget.
Unfortunately you can't edit text of an image in Flutter, Instead I would rather to edit this image (for putting image and editing text) by Photoshop for example and then implementing it as one piece widget in my Flutter app.
What I assess from your question is you want to have a layout like the one given in your link, right? For a circular image, you could use CircleAvatar. As for the text you could use the Text widget. Now put these widgets inside a Column or Row. You seem to be new to Flutter and I'd suggest you to get a good grip on the basics first. Anyhow, here's a little dummy code snippet you could extend to achieve what you're looking for
Column(
crossAxisAlignment: CrossAxisAlignment
.start, //if you want your widgets to align on left in your col
children: [
CircleAvatar(
radius: 70,
foregroundImage: AssetImage("pathToYourAssetImg"),
),
SizedBox(
height: 20, //set this to your intended value
),
Text( //you could also create a custom text widget and pass the arguments if you don't want to hardcode text widgets over & over again for all of your text
"yourText",
style: TextStyle(
color: Colors.black87,
fontSize: 20, //set this to your value
fontWeight: FontWeight.bold //if you want to have a bold text
),
),
],
);

How do I make a child widget expand to fill a parent container inside of a stack when the child has no parameters to alter its layout?

I'm building a card game and using flame to pull the cards from a sprite sheet. The problem is that I set the width and height of the Container that holds the SpriteWidget, but the SpriteWidget expands to either the width or the height of the container, but not both. I want it to expand/stretch to be the same size as the parent container. Unfortunately, the SpriteWidget really has no parameters that could be used to change its size.
I've spent several hours scouring the internet for a solution and tried a number of widgets including FittedBox, Flex, Positioned.fill, etc., but I'm unable to achieve the desired effect. How can I make the SpriteWidget stretch to fill its parent when it has no parameters to do so?
class _PlayerHandPortraitLayout
extends WidgetView<PlayerHand, _PlayerHandController> {
#override
final state;
const _PlayerHandPortraitLayout(this.state) : super(state);
#override
Widget build(BuildContext build) {
return Stack(
children: state.displayHand().asMap().entries.map((cardItem) {
var index = cardItem.key;
var card = cardItem.value;
return Positioned(
left: index * CARD_OVERLAP_OFFSET,
child: Draggable<Container>(
childWhenDragging: Container(),
child: Container(
color: Colors.purple,
width: state.cardWidth,
height: state.cardHeight,
child: SpriteWidget(
sprite: state.spriteImages[card.suite.index][card.value.index],
),
),
feedback: Container(
color: Colors.yellow,
width: state.cardWidth,
height: state.cardHeight,
child: SpriteWidget(
sprite: state.spriteImages[card.suite.index][card.value.index],
),
),
),
);
}).toList(),
);
}
}
actually this will be not possible, SpriteWidget is designed to expand as long as it fits on the smallest dimension available on its parent, you can check on it source code here.
This is done so the Sprite will not get distorted when its parent has a different aspect ratio than the ratio of the Sprite.
If you have an use case where you would want the Sprite to get intentionally distorted, please open an issue on the Flame repository explaining the case, and we can try to take a look on it.

Flutter: adding a gradient to my progress bar

Let me first say I started with flutter last week so I apologise in advance for my lack of knowledge.
I'm using a progress bar in my application:
FAProgressBar(
size: 50,
currentValue: dailyProgress,
direction: Axis.vertical,
verticalDirection: VerticalDirection.up,
progressColor: Colors.amber,
backgroundColor: Colors.grey[300],
animatedDuration: const Duration(milliseconds: 2000),
),
In reality it looks like this: https://imgur.com/NZUoZtW
I want it to look like this: https://imgur.com/gFCqfzR
How would you recommend me to proceed? It seems impossible to replace the progressColor property with a gradient. Is there another package I can use? Any suggestion is appreciated.
I suggest you try Gradient Widgets package for Flutter.
It has GradientProgressIndicator which should fit your needs.

flutter circular progress Widget

Am looking to implement a circular progress widget in flutter similar to the Jquery circular progress. The idea is when a button is clicked, as an activity happens in the background, the circular progress fills in color while a counter incrementally goes from 0-100%. I am able to do the circular fill using custom paint but am unable to display the actual % count as the color fills the circular progress. How would i do this in flutter?
Use precent_indicator library: https://pub.dev/packages/percent_indicator/install
It has good features, such as showing progress around a picture:
CircularPercentIndicator(
radius: 100.0,
lineWidth: 15.0,
progressColor: Colors.blue,
percent: 0.4,
center: const CircleAvatar(
backgroundImage: NetworkImage('https://tr.web.img4.acsta.net/c_310_420/pictures/bzp/01/61282.jpg'),
radius: 85,
),
),
),
you can use this plugin: https://pub.dartlang.org/packages/flutter_circular_chart
they have the component you need