File tree 7 files changed +19
-4
lines changed
7 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -4,5 +4,6 @@ export 'src/chewie_player.dart';
4
4
export 'src/chewie_progress_colors.dart' ;
5
5
export 'src/cupertino/cupertino_controls.dart' ;
6
6
export 'src/material/material_controls.dart' ;
7
+ export 'src/material/material_progress_bar.dart' ;
7
8
export 'src/material/material_desktop_controls.dart' ;
8
9
export 'src/models/index.dart' ;
Original file line number Diff line number Diff line change @@ -722,6 +722,7 @@ class _CupertinoControlsState extends State<CupertinoControls>
722
722
255 ,
723
723
),
724
724
),
725
+ draggableProgressBar: chewieController.draggableProgressBar,
725
726
),
726
727
),
727
728
);
Original file line number Diff line number Diff line change @@ -12,13 +12,15 @@ class CupertinoVideoProgressBar extends StatelessWidget {
12
12
this .onDragStart,
13
13
this .onDragUpdate,
14
14
super .key,
15
+ this .draggableProgressBar = true ,
15
16
}) : colors = colors ?? ChewieProgressColors ();
16
17
17
18
final VideoPlayerController controller;
18
19
final ChewieProgressColors colors;
19
20
final Function ()? onDragStart;
20
21
final Function ()? onDragEnd;
21
22
final Function ()? onDragUpdate;
23
+ final bool draggableProgressBar;
22
24
23
25
@override
24
26
Widget build (BuildContext context) {
@@ -31,6 +33,7 @@ class CupertinoVideoProgressBar extends StatelessWidget {
31
33
onDragEnd: onDragEnd,
32
34
onDragStart: onDragStart,
33
35
onDragUpdate: onDragUpdate,
36
+ draggableProgressBar: draggableProgressBar,
34
37
);
35
38
}
36
39
}
Original file line number Diff line number Diff line change @@ -618,6 +618,7 @@ class _MaterialControlsState extends State<MaterialControls>
618
618
Theme .of (context).colorScheme.surface.withOpacity (0.5 ),
619
619
backgroundColor: Theme .of (context).disabledColor.withOpacity (.5 ),
620
620
),
621
+ draggableProgressBar: chewieController.draggableProgressBar,
621
622
),
622
623
);
623
624
}
Original file line number Diff line number Diff line change @@ -594,6 +594,7 @@ class _MaterialDesktopControlsState extends State<MaterialDesktopControls>
594
594
Theme .of (context).colorScheme.surface.withOpacity (0.5 ),
595
595
backgroundColor: Theme .of (context).disabledColor.withOpacity (.5 ),
596
596
),
597
+ draggableProgressBar: chewieController.draggableProgressBar,
597
598
),
598
599
);
599
600
}
Original file line number Diff line number Diff line change @@ -7,31 +7,38 @@ class MaterialVideoProgressBar extends StatelessWidget {
7
7
MaterialVideoProgressBar (
8
8
this .controller, {
9
9
this .height = kToolbarHeight,
10
+ this .barHeight = 10 ,
11
+ this .handleHeight = 6 ,
10
12
ChewieProgressColors ? colors,
11
13
this .onDragEnd,
12
14
this .onDragStart,
13
15
this .onDragUpdate,
14
16
super .key,
17
+ this .draggableProgressBar = true ,
15
18
}) : colors = colors ?? ChewieProgressColors ();
16
19
17
20
final double height;
21
+ final double barHeight;
22
+ final double handleHeight;
18
23
final VideoPlayerController controller;
19
24
final ChewieProgressColors colors;
20
25
final Function ()? onDragStart;
21
26
final Function ()? onDragEnd;
22
27
final Function ()? onDragUpdate;
28
+ final bool draggableProgressBar;
23
29
24
30
@override
25
31
Widget build (BuildContext context) {
26
32
return VideoProgressBar (
27
33
controller,
28
- barHeight: 10 ,
29
- handleHeight: 6 ,
34
+ barHeight: barHeight ,
35
+ handleHeight: handleHeight ,
30
36
drawShadow: true ,
31
37
colors: colors,
32
38
onDragEnd: onDragEnd,
33
39
onDragStart: onDragStart,
34
40
onDragUpdate: onDragUpdate,
41
+ draggableProgressBar: draggableProgressBar,
35
42
);
36
43
}
37
44
}
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ class VideoProgressBar extends StatefulWidget {
9
9
this .onDragEnd,
10
10
this .onDragStart,
11
11
this .onDragUpdate,
12
+ this .draggableProgressBar = true ,
12
13
super .key,
13
14
required this .barHeight,
14
15
required this .handleHeight,
@@ -24,6 +25,7 @@ class VideoProgressBar extends StatefulWidget {
24
25
final double barHeight;
25
26
final double handleHeight;
26
27
final bool drawShadow;
28
+ final bool draggableProgressBar;
27
29
28
30
@override
29
31
// ignore: library_private_types_in_public_api
@@ -65,7 +67,6 @@ class _VideoProgressBarState extends State<VideoProgressBar> {
65
67
66
68
@override
67
69
Widget build (BuildContext context) {
68
- final ChewieController chewieController = ChewieController .of (context);
69
70
final child = Center (
70
71
child: StaticProgressBar (
71
72
value: controller.value,
@@ -77,7 +78,7 @@ class _VideoProgressBarState extends State<VideoProgressBar> {
77
78
),
78
79
);
79
80
80
- return chewieController .draggableProgressBar
81
+ return widget .draggableProgressBar
81
82
? GestureDetector (
82
83
onHorizontalDragStart: (DragStartDetails details) {
83
84
if (! controller.value.isInitialized) {
You can’t perform that action at this time.
0 commit comments