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> {
|
class _StudioDetailsState extends State<StudioDetails> {
|
||||||
int _currentlyPlayingId = 0;
|
int _currentlyPlayingId = 0;
|
||||||
late VideoPlayerController _videoPlayerController;
|
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
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
final state = context.read<StudioDetailsState>();
|
final state = context.read<StudioDetailsState>();
|
||||||
|
|
@ -60,15 +68,6 @@ class _StudioDetailsState extends State<StudioDetails> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
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);
|
final d = MediaQuery.of(context);
|
||||||
return Consumer<StudioDetailsState>(
|
return Consumer<StudioDetailsState>(
|
||||||
builder: (context, state, child) => StateHandler<StudioDetailsState>(
|
builder: (context, state, child) => StateHandler<StudioDetailsState>(
|
||||||
|
|
@ -154,7 +153,7 @@ class _StudioDetailsState extends State<StudioDetails> {
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_videoPlayerController.pause();
|
_videoPlayerController.pause();
|
||||||
_videoPlayerController.dispose();
|
_videoPlayerController.dispose();
|
||||||
// _chewieController.dispose();
|
_chewieController.dispose();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import 'dart:async';
|
||||||
import 'package:animated_custom_dropdown/custom_dropdown.dart';
|
import 'package:animated_custom_dropdown/custom_dropdown.dart';
|
||||||
import 'package:chewie/chewie.dart';
|
import 'package:chewie/chewie.dart';
|
||||||
import 'package:didvan/config/design_config.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/utils/date_time.dart';
|
||||||
import 'package:didvan/views/widgets/didvan/divider.dart';
|
import 'package:didvan/views/widgets/didvan/divider.dart';
|
||||||
import 'package:didvan/views/widgets/didvan/text.dart';
|
import 'package:didvan/views/widgets/didvan/text.dart';
|
||||||
|
|
@ -26,8 +25,6 @@ class _PrimaryControlsState extends State<PrimaryControls> {
|
||||||
double opacity = 1;
|
double opacity = 1;
|
||||||
Timer? _hideControlsTimer;
|
Timer? _hideControlsTimer;
|
||||||
ValueNotifier<Duration> position = ValueNotifier(Duration.zero);
|
ValueNotifier<Duration> position = ValueNotifier(Duration.zero);
|
||||||
final GlobalKey<PopupMenuButtonState> _popupMenuKey = GlobalKey();
|
|
||||||
final GlobalKey<PopupMenuButtonState> _popupMenuSpeedKey = GlobalKey();
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void didChangeDependencies() {
|
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() {
|
Widget _buildProgressIndicator() {
|
||||||
return Expanded(
|
return Expanded(
|
||||||
child: ValueListenableBuilder<Duration>(
|
child: ValueListenableBuilder<Duration>(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue