Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chewie after update #687

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 45 additions & 4 deletions lib/src/chewie_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ class Chewie extends StatefulWidget {
const Chewie({
Key? key,
required this.controller,
required this.user
}) : super(key: key);

/// The [ChewieController]
final ChewieController controller;
final UserProfileModel user;

@override
ChewieState createState() {
Expand All @@ -44,6 +46,11 @@ class ChewieState extends State<Chewie> {
bool get isControllerFullScreen => widget.controller.isFullScreen;
late PlayerNotifier notifier;


bool waterMark = false;
late Timer _timer;
int _start = 0;

@override
void initState() {
super.initState();
Expand Down Expand Up @@ -99,10 +106,44 @@ class ChewieState extends State<Chewie> {
) {
return Scaffold(
resizeToAvoidBottomInset: false,
body: Container(
alignment: Alignment.center,
color: Colors.black,
child: controllerProvider,
body: Stack(
children:[
Container(
alignment: Alignment.center,
color: Colors.black,
child: controllerProvider,
),
StatefulBuilder(builder: (innerContext,update){
_timer = Timer.periodic(
Duration(seconds: 30),
(Timer timer) {
if (_start == 0) {
//timer.cancel();
waterMark = !waterMark;
_start = 60;
} else {
_start--;
//if(_start == 15) waterMark = !waterMark;
}
},
);
return Positioned(
child: Center(
child: Container(
alignment: waterMark ? Alignment.topRight:Alignment.bottomLeft,
margin: EdgeInsets.symmetric(vertical: 50,horizontal: 10),
child: Text(
"${user.email}",
style: TextStyle(
color: Colors.black
.withOpacity(0.1),
fontSize: 18,
fontWeight: FontWeight.w700),
),
),
)) ;
}),
],
),
);
}
Expand Down