Skip to content

Commit 4d6d7c9

Browse files
committed
优化示例页
1 parent 9817a3b commit 4d6d7c9

File tree

2 files changed

+9
-30
lines changed

2 files changed

+9
-30
lines changed

tdesign-component/example/lib/page/td_progress_page.dart

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class _TDProgressPageState extends State<TDProgressPage> {
2323
Timer? _timer;
2424
bool isProgressing = false;
2525
bool isPlaying = false;
26-
double microProgressValue = 0.0;
26+
double microProgressValue = 0.3;
2727
Timer? _microTimer;
2828

2929
@override
@@ -129,25 +129,12 @@ class _TDProgressPageState extends State<TDProgressPage> {
129129

130130
@Demo(group: 'progress')
131131
Widget _buildMicroButton(BuildContext context) {
132-
return Row(
133-
mainAxisAlignment: MainAxisAlignment.start,
134-
children: [
135-
TDProgress(
136-
type: TDProgressType.micro,
137-
value: microProgressValue,
138-
onTap: _toggleMicroProgress,
139-
label: TDIconLabel(isPlaying ? Icons.pause : Icons.play_arrow,
140-
color: TDTheme.of(context).brandNormalColor),
141-
),
142-
const SizedBox(width: 10),
143-
TDProgress(
144-
type: TDProgressType.micro,
145-
value: microProgressValue,
146-
onTap: _resetMicroProgress,
147-
label: TDIconLabel(Icons.stop,
148-
color: TDTheme.of(context).brandNormalColor),
149-
),
150-
],
132+
return TDProgress(
133+
type: TDProgressType.micro,
134+
value: microProgressValue,
135+
onTap: _toggleMicroProgress,
136+
label: TDIconLabel(isPlaying ? Icons.pause : Icons.play_arrow,
137+
color: TDTheme.of(context).brandNormalColor),
151138
);
152139
}
153140

@@ -281,12 +268,4 @@ class _TDProgressPageState extends State<TDProgressPage> {
281268
_microTimer?.cancel();
282269
}
283270
}
284-
285-
void _resetMicroProgress() {
286-
_microTimer?.cancel();
287-
setState(() {
288-
isPlaying = false;
289-
microProgressValue = 0.0;
290-
});
291-
}
292271
}

tdesign-component/lib/src/components/progress/td_progress.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class TDProgress extends StatelessWidget {
134134
strokeWidth: 5.0,
135135
backgroundColor: TDTheme.of(context).grayColor2,
136136
borderRadius: BorderRadius.circular(20),
137-
circleRadius: 80.0,
137+
circleRadius: 100.0,
138138
);
139139
case TDProgressType.micro:
140140
return _DefaultValues(
@@ -480,7 +480,7 @@ class _ProgressIndicatorState extends State<ProgressIndicator>
480480
break;
481481
case TDProgressType.circular:
482482
iconSize = widget.circleRadius * 0.4;
483-
fontSize = widget.circleRadius * 0.2;
483+
fontSize = widget.circleRadius * 0.15;
484484
fontWeight = FontWeight.bold;
485485
break;
486486
case TDProgressType.micro:

0 commit comments

Comments
 (0)