showOfflineModeNotification static method
- BuildContext context, {
- required bool isEnabled,
Shows offline mode notification.
Implementation
static void showOfflineModeNotification(
BuildContext context, {
required bool isEnabled,
}) {
final message = isEnabled
? 'Offline Mode enabled - browse movies without internet'
: 'Offline Mode disabled - network access restored';
final backgroundColor = isEnabled ? Colors.orange : Colors.blue;
final icon = isEnabled ? Icons.offline_pin : Icons.wifi;
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Row(
children: [
Icon(icon, color: Colors.white, size: 16),
const SizedBox(width: 8),
Expanded(
child: Text(message, style: const TextStyle(color: Colors.white)),
),
],
),
backgroundColor: backgroundColor,
duration: const Duration(seconds: 3),
behavior: SnackBarBehavior.floating,
margin: const EdgeInsets.all(16),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
),
);
}