@@ -2,8 +2,7 @@ import 'package:algorithm_visualizer/core/helpers/current_device.dart';
22import 'package:algorithm_visualizer/core/resources/theme_manager.dart' ;
33import 'package:flutter/cupertino.dart' ;
44import 'package:flutter/material.dart' ;
5- import 'package:flutter/foundation.dart'
6- show TargetPlatform, defaultTargetPlatform;
5+ import 'package:flutter/foundation.dart' show TargetPlatform, defaultTargetPlatform;
76import 'package:flutter_screenutil/flutter_screenutil.dart' ;
87
98class CustomCircularProgress extends StatelessWidget {
@@ -14,8 +13,7 @@ class CustomCircularProgress extends StatelessWidget {
1413 Widget build (BuildContext context) {
1514 bool isThatAndroid = defaultTargetPlatform == TargetPlatform .android;
1615 final color = this .color;
17- final tColor =
18- color == null ? Theme .of (context).focusColor : context.getColor (color);
16+ final tColor = color == null ? Theme .of (context).focusColor : context.getColor (color);
1917
2018 return isThatAndroid
2119 ? Column (
@@ -27,14 +25,12 @@ class CustomCircularProgress extends StatelessWidget {
2725 child: SizedBox (
2826 width: 20. r,
2927 height: 20. r,
30- child: CircularProgressIndicator (
31- strokeWidth: 3. r, color: tColor),
28+ child: CircularProgressIndicator (strokeWidth: 3. r, color: tColor),
3229 ),
3330 ),
3431 ],
3532 )
36- : CupertinoActivityIndicator (
37- color: tColor, radius: 9. r, animating: true );
33+ : CupertinoActivityIndicator (color: tColor, radius: 9. r, animating: true );
3834 }
3935}
4036
@@ -46,43 +42,37 @@ class SmallCircularProgress extends StatelessWidget {
4642 Widget build (BuildContext context) {
4743 bool isThatAndroid = defaultTargetPlatform == TargetPlatform .android;
4844 final color = this .color;
49- final tColor =
50- color == null ? Theme .of (context).focusColor : context.getColor (color);
45+ final tColor = color == null ? Theme .of (context).focusColor : context.getColor (color);
5146
5247 return isThatAndroid
5348 ? SizedBox (
5449 width: 15. r,
5550 height: 15. r,
5651 child: ClipOval (
57- child:
58- CircularProgressIndicator (strokeWidth: 3.5 .r, color: tColor),
52+ child: CircularProgressIndicator (strokeWidth: 3.5 .r, color: tColor),
5953 ),
6054 )
61- : CupertinoActivityIndicator (
62- color: tColor, radius: 9. r, animating: true );
55+ : CupertinoActivityIndicator (color: tColor, radius: 9. r, animating: true );
6356 }
6457}
6558
6659class ThineCircularProgress extends StatelessWidget {
6760 final ThemeEnum ? color;
6861 final ThemeEnum ? backgroundColor;
6962 final double strokeWidth;
70- const ThineCircularProgress (
71- {super .key, this .color, this .backgroundColor, this .strokeWidth = 2 });
63+ const ThineCircularProgress ({super .key, this .color, this .backgroundColor, this .strokeWidth = 2 });
7264
7365 @override
7466 Widget build (BuildContext context) {
7567 final color = this .color;
76- final tColor =
77- color == null ? Theme .of (context).focusColor : context.getColor (color);
68+ final tColor = color == null ? Theme .of (context).focusColor : context.getColor (color);
7869 final backgroundColor = this .backgroundColor;
7970
8071 return Center (
8172 child: CircularProgressIndicator .adaptive (
8273 strokeWidth: strokeWidth.r,
8374 valueColor: AlwaysStoppedAnimation <Color >(tColor),
84- backgroundColor:
85- backgroundColor != null ? context.getColor (backgroundColor) : null ,
75+ backgroundColor: backgroundColor != null ? context.getColor (backgroundColor) : null ,
8676 ),
8777 );
8878 }
@@ -104,16 +94,14 @@ class ThineCircularProgressWithValue extends StatelessWidget {
10494 @override
10595 Widget build (BuildContext context) {
10696 final color = this .color;
107- final tColor =
108- color == null ? Theme .of (context).focusColor : context.getColor (color);
97+ final tColor = color == null ? Theme .of (context).focusColor : context.getColor (color);
10998 final backgroundColor = this .backgroundColor;
11099
111100 return Center (
112101 child: CircularProgressIndicator .adaptive (
113102 strokeWidth: strokeWidth.r,
114103 valueColor: AlwaysStoppedAnimation <Color >(tColor),
115- backgroundColor:
116- backgroundColor != null ? context.getColor (backgroundColor) : null ,
104+ backgroundColor: backgroundColor != null ? context.getColor (backgroundColor) : null ,
117105 value: value,
118106 ),
119107 );
@@ -147,27 +135,22 @@ class CustomThineCircularProgress extends StatelessWidget {
147135 final ThemeEnum ? color;
148136 final ThemeEnum ? backgroundColor;
149137 final double strokeWidth;
150- const CustomThineCircularProgress (
151- {super .key, this .color, this .backgroundColor, this .strokeWidth = 2 });
138+ const CustomThineCircularProgress ({super .key, this .color, this .backgroundColor, this .strokeWidth = 2 });
152139
153140 @override
154141 Widget build (BuildContext context) {
155142 final color = this .color;
156- final tColor =
157- color == null ? Theme .of (context).focusColor : context.getColor (color);
143+ final tColor = color == null ? Theme .of (context).focusColor : context.getColor (color);
158144 final backgroundColor = this .backgroundColor;
159145
160146 return Center (
161147 child: context.isAndroid
162148 ? CircularProgressIndicator (
163149 strokeWidth: strokeWidth.r,
164150 valueColor: AlwaysStoppedAnimation <Color >(tColor),
165- backgroundColor: backgroundColor != null
166- ? context.getColor (backgroundColor)
167- : null ,
151+ backgroundColor: backgroundColor != null ? context.getColor (backgroundColor) : null ,
168152 )
169- : CupertinoActivityIndicator (
170- color: tColor, radius: strokeWidth.r, animating: true ),
153+ : CupertinoActivityIndicator (color: tColor, radius: strokeWidth.r, animating: true ),
171154 );
172155 }
173156}
@@ -188,22 +171,18 @@ class CustomThineCircularProgressWithValue extends StatelessWidget {
188171 @override
189172 Widget build (BuildContext context) {
190173 final color = this .color;
191- final tColor =
192- color == null ? Theme .of (context).focusColor : context.getColor (color);
174+ final tColor = color == null ? Theme .of (context).focusColor : context.getColor (color);
193175 final backgroundColor = this .backgroundColor;
194176
195177 return Center (
196178 child: context.isAndroid
197179 ? CircularProgressIndicator (
198180 strokeWidth: strokeWidth.r,
199181 valueColor: AlwaysStoppedAnimation <Color >(tColor),
200- backgroundColor: backgroundColor != null
201- ? context.getColor (backgroundColor)
202- : null ,
182+ backgroundColor: backgroundColor != null ? context.getColor (backgroundColor) : null ,
203183 value: value,
204184 )
205- : CupertinoActivityIndicator (
206- color: tColor, radius: strokeWidth.r, animating: false ),
185+ : CupertinoActivityIndicator (color: tColor, radius: strokeWidth.r, animating: false ),
207186 );
208187 }
209188}
@@ -222,16 +201,14 @@ class BaseCircularProgress extends StatelessWidget {
222201 @override
223202 Widget build (BuildContext context) {
224203 final color = this .color;
225- final tColor =
226- color == null ? Theme .of (context).focusColor : context.getColor (color);
204+ final tColor = color == null ? Theme .of (context).focusColor : context.getColor (color);
227205 final backgroundColor = this .backgroundColor;
228206
229207 return Center (
230208 child: CircularProgressIndicator (
231209 strokeWidth: strokeWidth.r,
232210 valueColor: AlwaysStoppedAnimation <Color >(tColor),
233- backgroundColor:
234- backgroundColor != null ? context.getColor (backgroundColor) : null ,
211+ backgroundColor: backgroundColor != null ? context.getColor (backgroundColor) : null ,
235212 ),
236213 );
237214 }
0 commit comments