35 lines
1011 B
Dart
35 lines
1011 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class CustomDownloadSnackbar {
|
|
static void show(
|
|
BuildContext context, {
|
|
required String message,
|
|
Duration duration = const Duration(seconds: 2),
|
|
}) {
|
|
final messenger = ScaffoldMessenger.of(context);
|
|
messenger
|
|
..hideCurrentSnackBar()
|
|
..showSnackBar(
|
|
SnackBar(
|
|
content: Text(
|
|
message,
|
|
style: const TextStyle(
|
|
color: Colors.white,
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.w500,
|
|
),
|
|
),
|
|
behavior: SnackBarBehavior.floating,
|
|
margin: const EdgeInsets.fromLTRB(16, 0, 16, 24),
|
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
|
duration: duration,
|
|
backgroundColor: const Color(0xFF1F1F1F),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(14),
|
|
),
|
|
dismissDirection: DismissDirection.down,
|
|
),
|
|
);
|
|
}
|
|
}
|