mirror of
https://github.com/dstark5/Openlib.git
synced 2025-06-01 07:36:41 +08:00
22 lines
654 B
Dart
22 lines
654 B
Dart
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,
|
|
));
|
|
}
|