mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
52 lines
1.7 KiB
Dart
52 lines
1.7 KiB
Dart
import 'package:flutter/foundation.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
import 'package:fladder/providers/video_player_provider.dart';
|
|
|
|
class DebugBanner extends ConsumerWidget {
|
|
final Widget child;
|
|
const DebugBanner({required this.child, super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
final isPlaying = ref.watch(mediaPlaybackProvider.select((value) => value.playing));
|
|
if (!kDebugMode) return child;
|
|
return Directionality(
|
|
textDirection: TextDirection.ltr,
|
|
child: Stack(
|
|
fit: StackFit.expand,
|
|
children: [
|
|
child,
|
|
Align(
|
|
alignment: Alignment.bottomRight,
|
|
child: AnimatedOpacity(
|
|
opacity: isPlaying ? 0 : 1,
|
|
duration: const Duration(milliseconds: 500),
|
|
child: IgnorePointer(
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(4.0),
|
|
child: Card(
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)),
|
|
color: Colors.purpleAccent.withOpacity(0.8),
|
|
child: Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
|
|
child: Text(
|
|
"Debug",
|
|
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
|
fontWeight: FontWeight.bold,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
)
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|