Skip to content

Commit 6dbffe0

Browse files
committed
🔥 Code cleanup.
1 parent 4d7f9ff commit 6dbffe0

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed

example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class _MyHomePageState extends State<MyHomePage> {
4545
);
4646
},
4747
tooltip: 'Increment',
48-
child: Icon(Icons.camera_enhance),
48+
child: const Icon(Icons.camera_enhance),
4949
),
5050
);
5151
}

lib/src/widget/camera_picker.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -531,8 +531,8 @@ class CameraPickerState extends State<CameraPicker> {
531531
Widget get switchCamerasButton {
532532
return InkWell(
533533
onTap: switchCameras,
534-
child: Padding(
535-
padding: const EdgeInsets.all(8.0),
534+
child: const Padding(
535+
padding: EdgeInsets.all(8.0),
536536
child: Icon(
537537
Icons.switch_camera,
538538
color: Colors.white,
@@ -596,7 +596,7 @@ class CameraPickerState extends State<CameraPicker> {
596596
color: Colors.white,
597597
shape: BoxShape.circle,
598598
),
599-
child: Center(
599+
child: const Center(
600600
child: Icon(
601601
Icons.keyboard_arrow_down,
602602
color: Colors.black,
@@ -634,7 +634,7 @@ class CameraPickerState extends State<CameraPicker> {
634634
padding: EdgeInsets.all(
635635
Screens.width / (isShootingButtonAnimate ? 10 : 35),
636636
),
637-
decoration: BoxDecoration(
637+
decoration: const BoxDecoration(
638638
color: Colors.white30,
639639
shape: BoxShape.circle,
640640
),

lib/src/widget/camera_picker_viewer.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ class _CameraPickerViewerState extends State<CameraPickerViewer> {
254254
color: Colors.white,
255255
shape: BoxShape.circle,
256256
),
257-
child: Center(
257+
child: const Center(
258258
child: Icon(
259259
Icons.close,
260260
color: Colors.black,
@@ -302,7 +302,7 @@ class _CameraPickerViewerState extends State<CameraPickerViewer> {
302302
child: GestureDetector(
303303
onTap: playButtonCallback,
304304
child: DecoratedBox(
305-
decoration: BoxDecoration(
305+
decoration: const BoxDecoration(
306306
boxShadow: <BoxShadow>[BoxShadow(color: Colors.black12)],
307307
shape: BoxShape.circle,
308308
),

lib/src/widget/circular_progress_bar.dart

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,7 @@ class ProgressPainter extends CustomPainter {
120120
final double outerRadius = center;
121121
final double innerRadius = center - ringsWidth * 2;
122122

123-
// if (progress > 0.0) {
124123
final double progressWidth = outerRadius - innerRadius;
125-
// if (radians > 0.0) {
126124
canvas.save();
127125
canvas.translate(0.0, size.width);
128126
canvas.rotate(-90.0.toRad);
@@ -137,8 +135,6 @@ class ProgressPainter extends CustomPainter {
137135
canvas
138136
..drawArc(arcRect, 0, radians, false, progressPaint)
139137
..restore();
140-
// }
141-
// }
142138
}
143139

144140
@override
@@ -147,6 +143,4 @@ class ProgressPainter extends CustomPainter {
147143

148144
extension _MathExtension on double {
149145
double get toRad => this * (math.pi / 180.0);
150-
151-
double get toDeg => this * (180.0 / math.pi);
152146
}

0 commit comments

Comments
 (0)