2024-05-18 09:37:50 +08:00

33 lines
931 B
Dart
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';
import 'video_player_control.dart';
class ControllerWidget extends InheritedWidget {
final String title;
final GlobalKey<VideoPlayerControlState> controlKey;
final Widget child;
final VideoPlayerController controller;
final bool videoInit;
ControllerWidget(
{Key? key,
required this.controlKey,
required this.child,
required this.controller,
required this.videoInit,
required this.title
}) : super(key: key, child: child);
//定义一个便捷方法方便子树中的widget获取共享数据
static ControllerWidget? of(BuildContext context) {
return context.dependOnInheritedWidgetOfExactType<ControllerWidget>();
}
@override
bool updateShouldNotify(InheritedWidget oldWidget) {
// TODO: implement updateShouldNotify
return false;
}
}