Remove unused imports and code for play/pause button and popup menus in PrimaryControls widget.
This commit is contained in:
parent
4a8c14ad09
commit
306b85f163
|
|
@ -27,7 +27,15 @@ class StudioDetails extends StatefulWidget {
|
|||
class _StudioDetailsState extends State<StudioDetails> {
|
||||
int _currentlyPlayingId = 0;
|
||||
late VideoPlayerController _videoPlayerController;
|
||||
|
||||
late final ChewieController _chewieController = ChewieController(
|
||||
videoPlayerController: _videoPlayerController,
|
||||
customControls: const PrimaryControls(),
|
||||
autoPlay: true,
|
||||
looping: true,
|
||||
aspectRatio: 16 / 9,
|
||||
materialProgressColors: ChewieProgressColors(
|
||||
playedColor: Theme.of(context).colorScheme.title,
|
||||
handleColor: Theme.of(context).colorScheme.title));
|
||||
@override
|
||||
void initState() {
|
||||
final state = context.read<StudioDetailsState>();
|
||||
|
|
@ -60,15 +68,6 @@ class _StudioDetailsState extends State<StudioDetails> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
late final ChewieController _chewieController = ChewieController(
|
||||
videoPlayerController: _videoPlayerController,
|
||||
customControls: const PrimaryControls(),
|
||||
autoPlay: true,
|
||||
looping: true,
|
||||
aspectRatio: 16 / 9,
|
||||
materialProgressColors: ChewieProgressColors(
|
||||
playedColor: Theme.of(context).colorScheme.title,
|
||||
handleColor: Theme.of(context).colorScheme.title));
|
||||
final d = MediaQuery.of(context);
|
||||
return Consumer<StudioDetailsState>(
|
||||
builder: (context, state, child) => StateHandler<StudioDetailsState>(
|
||||
|
|
@ -154,7 +153,7 @@ class _StudioDetailsState extends State<StudioDetails> {
|
|||
void dispose() {
|
||||
_videoPlayerController.pause();
|
||||
_videoPlayerController.dispose();
|
||||
// _chewieController.dispose();
|
||||
_chewieController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import 'dart:async';
|
|||
import 'package:animated_custom_dropdown/custom_dropdown.dart';
|
||||
import 'package:chewie/chewie.dart';
|
||||
import 'package:didvan/config/design_config.dart';
|
||||
import 'package:didvan/constants/app_icons.dart';
|
||||
import 'package:didvan/utils/date_time.dart';
|
||||
import 'package:didvan/views/widgets/didvan/divider.dart';
|
||||
import 'package:didvan/views/widgets/didvan/text.dart';
|
||||
|
|
@ -26,8 +25,6 @@ class _PrimaryControlsState extends State<PrimaryControls> {
|
|||
double opacity = 1;
|
||||
Timer? _hideControlsTimer;
|
||||
ValueNotifier<Duration> position = ValueNotifier(Duration.zero);
|
||||
final GlobalKey<PopupMenuButtonState> _popupMenuKey = GlobalKey();
|
||||
final GlobalKey<PopupMenuButtonState> _popupMenuSpeedKey = GlobalKey();
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
|
|
@ -251,29 +248,6 @@ class _PrimaryControlsState extends State<PrimaryControls> {
|
|||
);
|
||||
}
|
||||
|
||||
Widget _buildPlayPause() {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: InkWell(
|
||||
onTap: _handlePlay,
|
||||
child: PlayBtnAnimation(
|
||||
alwaysAnimate: true,
|
||||
isAnimating: isAnimating,
|
||||
onEnd: () => setState(
|
||||
() => isAnimating = false,
|
||||
),
|
||||
child: Icon(
|
||||
chewieController.isPlaying
|
||||
? CupertinoIcons.pause_fill
|
||||
: CupertinoIcons.play_fill,
|
||||
color: Colors.white,
|
||||
size: 24,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildProgressIndicator() {
|
||||
return Expanded(
|
||||
child: ValueListenableBuilder<Duration>(
|
||||
|
|
|
|||
Loading…
Reference in New Issue