Skip to content

Commit 6ae4808

Browse files
committed
🎨 Bind circular progress color with theme
1 parent 8de205a commit 6ae4808

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

lib/src/widgets/camera_picker.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ class CameraPickerState extends State<CameraPicker>
414414
late final ThemeData _theme =
415415
widget.theme ?? CameraPicker.themeData(C.themeColor);
416416

417-
/// Get [ThemeData] of the [AssetPicker] through [Constants.pickerKey].
417+
/// Get [ThemeData] of the [CameraPicker] through [Constants.pickerKey].
418418
/// 通过常量全局 Key 获取当前选择器的主题
419419
ThemeData get theme => _theme;
420420

@@ -1120,9 +1120,10 @@ class CameraPickerState extends State<CameraPicker>
11201120
_initializeWrapper(
11211121
isInitialized: () =>
11221122
controller.value.isRecordingVideo && isRecordingRestricted,
1123-
builder: (_, __) => CircleProgressBar(
1123+
builder: (_, __) => CircularProgressBar(
11241124
duration: maximumRecordingDuration!,
11251125
outerRadius: outerSize.width,
1126+
ringsColor: theme.indicatorColor,
11261127
ringsWidth: 2.0,
11271128
),
11281129
),

lib/src/widgets/circular_progress_bar.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import 'package:flutter/scheduler.dart';
99

1010
import '../constants/styles.dart';
1111

12-
class CircleProgressBar extends StatefulWidget {
13-
const CircleProgressBar({
12+
class CircularProgressBar extends StatefulWidget {
13+
const CircularProgressBar({
1414
Key? key,
1515
required this.outerRadius,
1616
required this.ringsWidth,
@@ -26,10 +26,10 @@ class CircleProgressBar extends StatefulWidget {
2626
final Duration duration;
2727

2828
@override
29-
State<StatefulWidget> createState() => CircleProgressState();
29+
_CircleProgressState createState() => _CircleProgressState();
3030
}
3131

32-
class CircleProgressState extends State<CircleProgressBar>
32+
class _CircleProgressState extends State<CircularProgressBar>
3333
with SingleTickerProviderStateMixin {
3434
final GlobalKey paintKey = GlobalKey();
3535

0 commit comments

Comments
 (0)