mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-18 12:49:54 +02:00
feat: Implement IPTV player screen with Xtream API integration for web playback.
This commit is contained in:
1 parent
43f1ebbbbf
commit
3cf848c526
4 files changed
+298
-174
No files matched your search
@@ -0,0 +1,55 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class ClockWidget extends StatefulWidget {
|
||||
final TextStyle? style;
|
||||
|
||||
const ClockWidget({super.key, this.style});
|
||||
|
||||
@override
|
||||
State<ClockWidget> createState() => _ClockWidgetState();
|
||||
}
|
||||
|
||||
class _ClockWidgetState extends State<ClockWidget> {
|
||||
late DateTime _now;
|
||||
Timer? _timer;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_now = DateTime.now();
|
||||
_startTimer();
|
||||
}
|
||||
|
||||
void _startTimer() {
|
||||
_timer = Timer.periodic(const Duration(seconds: 1), (timer) {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_now = DateTime.now();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_timer?.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// Format: HH:mm
|
||||
final timeString = DateFormat('HH:mm').format(_now);
|
||||
return Text(
|
||||
timeString,
|
||||
style: widget.style ?? const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
shadows: [Shadow(color: Colors.black, blurRadius: 4)],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user