How to change the colour of CircularProgressIndicator – You must have encountered the time to load data before displaying it on the screen when building in Flutter during API calls or other activities. In such a situation, the circular progress indicator comes into play. In such situations, you may have included the circular progress indicator in your app.However, you may wish to occasionally modify the circular progress indicator’s colour. So, in this article, we’ll look at how to modify the colour of the circular progress indicator as a leading Flutter app development company.
What is the circular progress indicator in Flutter?
The circular Progress Indicator is a flutter material widget. The screen displays a tiny animated round icon; a circular progress indicator widget notifies the user that the application is busy.When the app is busy, it prevents the user from engaging with it. It’s utilized for things like downloading and uploading material, retrieving data from an API and processing data.
Why do you need to change the colour of the circular progress indicator?
The animated circular icon on your screen will reflect the default colour. This situation occurs as it uses the primarySwatchcolour specified already in the theme after adding the Circular Progress Indicator to your website.For instance, it will appear blue if the circular progress indicator is blue-themed. Most of the time, you will need to modify or customize the default colour, which is pre-existing as decided by your theme designer.
How to change the colour in the circular progress indicator in Flutter?
In Flutter, you can change the colour of the circular progress indicator by modifying the valueColor property of the CircularProgressIndicator widget to the desired colour.
The steps to change the colour of the little icon in the Circular progress indicator in Flutter are mentioned below:
Step 1: The first step is to locate the CircularProgressIndicator in your program, of which you want to change the colour.
Step 2: The next step is to add the valueColor property to the circular progress indicator widget of Flutter.
Step 3: Now, assign the AlwaysStoppedAnimation() to the widget class.
Step 4: Inside the AlwaysStoppedAnimation() class, you will find the option to add the colour of your preference.
Step 5: You can also modify the background theme and colour of the CircularProgressIndicator widget by adding the backgroundColor parameter in the class and modifying it to the desired colour.CircularProgressIndicator may be used to track both determinate and indeterminate progress.When you need to represent the progress of an ongoing activity, such as the percentage of conversion that occurred when saving a file, a determined progress bar plays an important role. You must enter a number between 0.0 and 1.0 to demonstrate progress.An indeterminate progress indicator might be useful when you don’t know what proportion of a task you’re working on. Therefore, CircularProgressIndicator is set to act as an indeterminate toolbar by default.
An illustration of a determinate Circular Progress indicator
According to the code, the progress is initially set to 0.2 (20 per cent progress), then changed to 0.6 after a 1000ms (1sec) delay (60 per cent).When you use a definite circular progress indicator widget in your application, you usually obtain the progress from the background job you’re working on. Once you’ve reached 100%, or 1.0, you can hide the tiny circular indicator and continue using the programme normally.import’package:flutter/material.dart’;
voidmain() {
runApp(MaterialApp(
home: MyApp(),
));
}
classMyApp extends StatefulWidget {
@override
_MyAppStatecreateState() => _MyAppState();
}
class_MyAppState extends State<MyApp> {
Icon fab = Icon(
Icons.refresh,
);
boolshowProgress = false;
doubleprogress = 0.2;
voidtoggleSubmitState() {
setState(() {
showProgress = !showProgress;
});
}
@override
Widget build(BuildContext context) {
returnScaffold(
appBar: AppBar(
title: newText(“Flutter – tutorialkart.com”),
),
body: Center(
child: showProgress
? CircularProgressIndicator(value:progress)
: Text(‘Click on Refreseh button below’, style: TextStyle(fontSize: 20),)),
floatingActionButton: FloatingActionButton(
child: fab,
onPressed: () =>setState(() {
showProgress = !showProgress;
if(showProgress) {
Future.delayed(constDuration(milliseconds: 1000), () {
setState(() {
progress = 0.6;
});
});
fab = Icon(
Icons.stop,
);
} else{
fab = Icon(Icons.refresh);
}
}),
),
);
}
}
An illustration of anindeterminate Circular Progress indicator
We’re using CircularProgressIndicator in an indeterminate mode in this example. It does not display any progress but instead circles incessantly, signalling to the viewer that something is working in the background and that he may need to wait.You should not supply any value to the function Object() { [native code] } CircularProgressIndicator if you want to utiliseCircularProgressIndicator in indeterminate mode ().
import’package:flutter/material.dart’;
voidmain() {
runApp(MaterialApp(
home: MyApp(),
));
}
classMyApp extends StatefulWidget {
@override
_MyAppStatecreateState() => _MyAppState();
}
class_MyAppState extends State<MyApp> {
Icon fab = Icon(
Icons.refresh,
);
boolshowProgress = true;
voidtoggleSubmitState() {
setState(() {
showProgress = !showProgress;
});
}
@override
Widget build(BuildContext context) {
returnScaffold(
appBar: AppBar(
title: newText(“Flutter – tutorialkart.com”),
),
body: Center(
child: showProgress
? CircularProgressIndicator()
: Text(‘Click on Refreseh button below’, style: TextStyle(fontSize: 20),)),
floatingActionButton: FloatingActionButton(
child: fab,
onPressed: () =>setState(() {
showProgress = !showProgress;
if(showProgress) {
fab = Icon(
Icons.stop,
);
} else{
fab = Icon(Icons.refresh);
}
}),
),
);
}
}
Apart from changing the icon’s colour, we can also customize & style the widget with different properties in the flutter application. These different properties are –
Value
Value property is used to show the percentage of a job that is presently executing that has been completed. It accepts any numeric value between 0 and 1, with 0 indicating the initial stage of the task and 1 indicating the final stage
valueColor
valueColor parameter is used to colour the value indication. It accepts any given colour as a value.
backgroundColor
This attribute will adjust the background colour of the circular progress indication. It uses any given colour as a value.
strokeWidth
This attribute will be used to modify the width of the progress indicator’s stroke. It is worth twice as much the value.
Conclusion
BOSC Tech Labs is a leading Flutter service provider company with years of experience in custom mobile app solution for various industries. Customizing colours, styles, and themes is always an attraction to the users’ eye. Flutter enables all such options for you in its applications. Moreover, the colour modification feature provided in Flutter to change the icon colour of the circular progress indicator is very simple and smooth.
Nice
http://withoutprescription.guru/# best non prescription ed pills
where can i buy generic clomid: cost of generic clomid tablets – clomid buy
http://indiapharm.guru/# best india pharmacy
100mg viagra without a doctor prescription: buy prescription drugs online legally – prescription drugs online
viagra without doctor prescription: best non prescription ed pills – buy prescription drugs online legally
http://edpills.icu/# best ed treatment
order amoxicillin uk: amoxicillin 825 mg – buying amoxicillin in mexico
п»їlegitimate online pharmacies india: indian pharmacies safe – india online pharmacy
http://mexicopharm.shop/# п»їbest mexican online pharmacies
reputable indian pharmacies: top online pharmacy india – top 10 online pharmacy in india
https://kamagra.team/# Kamagra 100mg
https://edpills.monster/# cure ed
Kamagra Oral Jelly: buy Kamagra – buy kamagra online usa
canadian pharmacy tadalafil 20mg tadalafil 20mg price in india tadalafil 20mg pills
online ed medications: erectile dysfunction drug – top ed drugs
http://sildenafil.win/# can you buy sildenafil
tadalafil cost india tadalafil free shipping buy tadalafil 20mg price
tadalafil tablets price in india: tadalafil 20 mg over the counter – buy tadalafil 5mg online
http://levitra.icu/# Buy generic Levitra online
http://levitra.icu/# Levitra generic best price
Levitra 20 mg for sale: Vardenafil buy online – Levitra 10 mg best price
Kamagra 100mg buy Kamagra cheap kamagra
tadalafil 20mg online canada: tadalafil 20mg uk – generic tadalafil canada
http://sildenafil.win/# sildenafil 100mg price canada
sildenafil rx coupon order sildenafil 50 mg sildenafil online united states
cheap kamagra: п»їkamagra – Kamagra 100mg
https://tadalafil.trade/# tadalafil capsules 21 mg
https://sildenafil.win/# price generic sildenafil
cheap sildenafil tablets 100mg: sildenafil rx drugstore online – sildenafil canada over the counter
male ed drugs buy ed pills what is the best ed pill
discount doxycycline: buy doxycycline over the counter – buy 40 mg doxycycline
buy cheap zithromax online how much is zithromax 250 mg zithromax for sale online
zithromax buy online no prescription: zithromax antibiotic without prescription – order zithromax without prescription
https://doxycycline.forum/# doxycycline 100g tablets
amoxicillin medicine amoxil for sale amoxicillin pills 500 mg
doxycycline pills buy: Doxycycline 100mg buy online – doxycycline prescription australia
https://ciprofloxacin.men/# buy cipro online usa
buy cipro cheap: Get cheapest Ciprofloxacin online – buy ciprofloxacin over the counter
zithromax purchase online buy zithromax generic zithromax online paypal
zithromax 500mg over the counter: buy zithromax – buy zithromax online cheap
https://amoxicillin.best/# buy amoxicillin online no prescription
doxycycline australia buy doxycycline over the counter doxycycline price
cipro ciprofloxacin: ciprofloxacin 500mg buy online – ciprofloxacin order online
doxycycline medicine in india: doxyciclin – cheap doxycycline online
https://doxycycline.forum/# cheapest doxycycline tablets
buy ciprofloxacin tablets antibiotics cipro ciprofloxacin 500mg buy online
ciprofloxacin over the counter: Ciprofloxacin online prescription – ciprofloxacin mail online
http://ciprofloxacin.men/# buy ciprofloxacin
zithromax 500mg price: zithromax online no prescription – zithromax over the counter canada
where can i buy cipro online: buy ciprofloxacin online – buy cipro online canada
generic doxycycline 3626 Buy doxycycline for chlamydia price of doxycycline in india
http://amoxicillin.best/# order amoxicillin no prescription
canada pharmaceuticals online cheap drugs online mexican pharmacy
canadian family pharmacy: online meds – legitimate canadian mail order pharmacy
canadian drugs online viagra: online pharmacy usa – true canadian pharmacy
http://buydrugsonline.top/# best online canadian pharcharmy
internet pharmacies: online meds – canadian prescription drugstore
best india pharmacy: pharmacy website india – top 10 pharmacies in india
http://mexicopharmacy.store/# п»їbest mexican online pharmacies
canadian prescription prices Mail order pharmacy cheapest canadian online pharmacy
trusted canadian online pharmacy: cheap drugs online – no perscription pharmacy
online prescription drugs: buy drugs online – compare prescription drug prices
https://buydrugsonline.top/# canada pharmacies without script
wellbutrin 151: Buy Wellbutrin XL 300 mg online – buy wellbutrin cheap
https://clomid.club/# where can i buy generic clomid without dr prescription
get generic clomid now: Buy Clomid Shipped From Canada – can you get clomid without insurance
https://paxlovid.club/# paxlovid pharmacy
prescription drug neurontin: generic gabapentin – generic neurontin cost
https://claritin.icu/# no prescription ventolin
paxlovid generic http://paxlovid.club/# paxlovid pill
Paxlovid over the counter: Paxlovid over the counter – paxlovid cost without insurance
https://claritin.icu/# ventolin order online without prescription
http://gabapentin.life/# neurontin 100 mg capsule
ventolin buy: buy Ventolin inhaler – order ventolin online
https://clomid.club/# can you get clomid no prescription
can you buy ventolin over the counter: Ventolin inhaler – ventolin price in usa
http://paxlovid.club/# paxlovid covid
migliori farmacie online 2023: Tadalafil prezzo – top farmacia online
farmacia online senza ricetta: farmacia online – п»їfarmacia online migliore
viagra prezzo farmacia 2023: sildenafil prezzo – pillole per erezione immediata
farmacie online affidabili Farmacie a milano che vendono cialis senza ricetta comprare farmaci online con ricetta
farmacie on line spedizione gratuita: cialis generico – farmacia online migliore
farmacie online sicure: cialis generico – farmacia online senza ricetta
farmacia online migliore: kamagra gold – farmacie on line spedizione gratuita
farmacie online sicure: dove acquistare cialis online sicuro – farmaci senza ricetta elenco
comprare farmaci online all’estero: avanafil generico prezzo – farmacia online migliore
farmacia online migliore kamagra gold farmaci senza ricetta elenco
viagra originale in 24 ore contrassegno: sildenafil prezzo – gel per erezione in farmacia
https://avanafilit.icu/# farmacia online
comprare farmaci online con ricetta: farmacie on line spedizione gratuita – farmacia online
farmacia online senza ricetta: kamagra – farmaci senza ricetta elenco
viagra subito: dove acquistare viagra in modo sicuro – viagra generico sandoz
comprare farmaci online all’estero: Avanafil farmaco – comprare farmaci online all’estero
farmacia online piГ№ conveniente kamagra comprare farmaci online con ricetta
kamagra senza ricetta in farmacia: viagra online siti sicuri – pillole per erezione immediata
http://sildenafilit.bid/# pillole per erezioni fortissime
farmacia online più conveniente: kamagra oral jelly consegna 24 ore – farmacia online migliore
top farmacia online: dove acquistare cialis online sicuro – farmaci senza ricetta elenco
farmaci senza ricetta elenco: kamagra gold – farmacie on line spedizione gratuita
farmaci senza ricetta elenco: kamagra oral jelly – farmacia online migliore
farmacia online: farmacia online senza ricetta – farmaci senza ricetta elenco
farmaci senza ricetta elenco kamagra oral jelly consegna 24 ore farmacia online miglior prezzo
farmacia online migliore: farmacia online miglior prezzo – farmacia online miglior prezzo
farmaci senza ricetta elenco: avanafil prezzo – farmacie online sicure
https://sildenafilit.bid/# viagra generico recensioni
farmacia online senza ricetta: avanafil prezzo – comprare farmaci online all’estero
farmacia online senza ricetta: dove acquistare cialis online sicuro – farmaci senza ricetta elenco
farmaci senza ricetta elenco farmacia online acquistare farmaci senza ricetta
alternativa al viagra senza ricetta in farmacia: viagra consegna in 24 ore pagamento alla consegna – viagra originale in 24 ore contrassegno
comprare farmaci online con ricetta: cialis generico consegna 48 ore – farmacia online migliore
farmacie on line spedizione gratuita: kamagra oral jelly consegna 24 ore – farmacia online migliore
viagra prezzo farmacia 2023: viagra online spedizione gratuita – farmacia senza ricetta recensioni
http://tadalafilit.store/# farmacia online senza ricetta
farmaci senza ricetta elenco: kamagra oral jelly consegna 24 ore – migliori farmacie online 2023
farmacia online migliore: acquisto farmaci con ricetta – comprare farmaci online all’estero
farmacia online senza ricetta Farmacie a roma che vendono cialis senza ricetta farmaci senza ricetta elenco
farmacie online autorizzate elenco: cialis generico – farmacia online migliore
farmaci senza ricetta elenco: avanafil prezzo – farmacie online autorizzate elenco
farmacia online: farmacia online spedizione gratuita – farmacia online piГ№ conveniente
acquistare farmaci senza ricetta: top farmacia online – top farmacia online
farmaci senza ricetta elenco: Tadalafil generico – farmacie online autorizzate elenco
http://sildenafilo.store/# comprar sildenafilo cinfa 100 mg españa
farmacias online seguras comprar kamagra farmacia envГos internacionales
http://farmacia.best/# farmacias online seguras en españa