Files
Openlib/lib/ui/components/snack_bar_widget.dart
2024-08-23 23:35:09 +02:00

23 lines
674 B
Dart

// Flutter imports:
import 'package:flutter/material.dart';
void showSnackBar({required BuildContext context, required String message}) {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text(
message,
style: const TextStyle(
fontSize: 11,
fontWeight: FontWeight.bold,
color: Colors.white,
),
textAlign: TextAlign.center,
),
// ignore: use_build_context_synchronously
backgroundColor: Theme.of(context).colorScheme.secondary,
width: 300,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(50))),
behavior: SnackBarBehavior.floating,
));
}