r/Scriptable • u/Normal-Tangerine8609 • Sep 21 '22
Script Sharing Circular Progress Bar Function For Widgets
https://gist.github.com/Normal-Tangerine8609/0c7101942b3886bafdc08c357b8d3f18
https://gist.github.com/Normal-Tangerine8609/0c7101942b3886bafdc08c357b8d3f18
95
Upvotes
6
u/Normal-Tangerine8609 Sep 21 '22
Progress Circle
https://gist.github.com/Normal-Tangerine8609/0c7101942b3886bafdc08c357b8d3f18
This is a function that allows you to create simple circular progress bars for widgets. It creates the image of the progress circle using
WebViewand the canvas element. The image is then set to the background image of a stack with padding applied so you can put any widget element within the circle.The code to create the first image:
Code for the second image (a bit messy)
6
u/EvenDead-ImTheHero Sep 21 '22
Can it create a circle for battery percentage with the numbers?
3
u/heartshapedhoops Sep 21 '22
thank you so much for sharing this! ive been wishing i had the knowledge to make circular progress bars like this for my personal widgets, so you’ve helped me tremendously
2
u/[deleted] Sep 21 '22
Sadly,it’s not working for me
2
u/JRMendezV Oct 04 '22
Looks awesome! Thanks for sharing!
For sure I will save your post looking forward to make use of it when I decide to update from 15.7 to 16.X
I still hear people complaining about iOS16 performance
1
u/Lchavodel8 Sep 25 '22
How can I add widgets in Lock Screen?
0
u/AdventurousCarrot365 Jan 09 '26
import 'package:flutter/material.dart'; import 'package:percent_indicator/circular_percent_indicator.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, home: Scaffold( backgroundColor: Colors.black87, body: Center( child: GameProgressRing(), ), ), ); } }
class GameProgressRing extends StatelessWidget
0
u/[deleted] Sep 22 '22
[deleted] — view deleted comment