@@ -28,7 +28,11 @@ class ProgressExampleState extends State<ProgressExample> {
28
28
SizedBox (
29
29
height: 20 ,
30
30
),
31
- Wrapper (stepsCompleted: 0 , type: ZetaProgressBarType .standard, isThin: false , stateChangeable: true ),
31
+ Wrapper (
32
+ stepsCompleted: 0 ,
33
+ type: ZetaProgressBarType .standard,
34
+ isThin: false ,
35
+ stateChangeable: true ),
32
36
SizedBox (
33
37
height: 20 ,
34
38
),
@@ -38,6 +42,12 @@ class ProgressExampleState extends State<ProgressExample> {
38
42
isThin: false ,
39
43
label: "UPLOADING ..." ,
40
44
),
45
+ Wrapper (
46
+ stepsCompleted: 0 ,
47
+ circleSize: ZetaCircleSizes .xl,
48
+ rounded: false ,
49
+ isCircle: true ,
50
+ ),
41
51
]),
42
52
),
43
53
),
@@ -47,21 +57,26 @@ class ProgressExampleState extends State<ProgressExample> {
47
57
}
48
58
49
59
class Wrapper extends StatefulWidget {
50
- const Wrapper (
51
- {super .key,
52
- required this .stepsCompleted,
53
- this .type = ZetaProgressBarType .standard,
54
- this .isThin = false ,
55
- this .rounded = true ,
56
- this .stateChangeable = false ,
57
- this .label});
60
+ const Wrapper ({
61
+ super .key,
62
+ required this .stepsCompleted,
63
+ this .type = ZetaProgressBarType .standard,
64
+ this .isThin = false ,
65
+ this .rounded = true ,
66
+ this .stateChangeable = false ,
67
+ this .label,
68
+ this .isCircle = false ,
69
+ this .circleSize,
70
+ });
58
71
59
72
final int stepsCompleted;
60
- final bool rounded;
61
- final ZetaProgressBarType type;
62
- final bool isThin;
73
+ final bool ? rounded;
74
+ final ZetaProgressBarType ? type;
75
+ final bool ? isThin;
63
76
final String ? label;
64
- final bool stateChangeable;
77
+ final bool ? stateChangeable;
78
+ final bool isCircle;
79
+ final ZetaCircleSizes ? circleSize;
65
80
66
81
@override
67
82
State <Wrapper > createState () => _WrapperState ();
@@ -75,7 +90,7 @@ class _WrapperState extends State<Wrapper> {
75
90
@override
76
91
void initState () {
77
92
super .initState ();
78
- type = widget.type;
93
+ type = widget.type! ;
79
94
stepsCompleted = widget.stepsCompleted;
80
95
progress = stepsCompleted / 10 ;
81
96
}
@@ -90,7 +105,9 @@ class _WrapperState extends State<Wrapper> {
90
105
91
106
void setLoading () {
92
107
setState (() {
93
- type = type == ZetaProgressBarType .buffering ? ZetaProgressBarType .standard : ZetaProgressBarType .buffering;
108
+ type = type == ZetaProgressBarType .buffering
109
+ ? ZetaProgressBarType .standard
110
+ : ZetaProgressBarType .buffering;
94
111
});
95
112
}
96
113
@@ -99,20 +116,35 @@ class _WrapperState extends State<Wrapper> {
99
116
return Column (
100
117
// Replace with a Column for vertical
101
118
children: [
102
- SizedBox (
103
- width: 400 ,
104
- child: ZetaProgressBar (
105
- progress: progress, rounded: widget.rounded, type: type, isThin: widget.isThin, label: widget.label),
106
- ),
119
+ widget.isCircle
120
+ ? Center (
121
+ child: ZetaProgressCircle (
122
+ progress: progress,
123
+ size: widget.circleSize! ,
124
+ ),
125
+ )
126
+ : SizedBox (
127
+ width: 400 ,
128
+ child: ZetaProgressBar (
129
+ progress: progress,
130
+ rounded: widget.rounded! ,
131
+ type: type,
132
+ isThin: widget.isThin! ,
133
+ label: widget.label),
134
+ ),
107
135
const SizedBox (width: 40 ),
108
136
Row (
109
137
mainAxisAlignment: MainAxisAlignment .center,
110
138
children: [
111
139
widget.type != ZetaProgressBarType .indeterminate
112
- ? FilledButton (onPressed: increasePercentage, child: Text ("Increase" ))
140
+ ? FilledButton (
141
+ onPressed: increasePercentage, child: Text ("Increase" ))
113
142
: Container (),
114
143
const SizedBox (width: 40 ),
115
- widget.stateChangeable ? FilledButton (onPressed: setLoading, child: Text ("Start Buffering" )) : Container ()
144
+ widget.stateChangeable!
145
+ ? FilledButton (
146
+ onPressed: setLoading, child: Text ("Start Buffering" ))
147
+ : SizedBox .shrink ()
116
148
],
117
149
)
118
150
],
0 commit comments