mirror of
https://github.com/darkmoonight/Rain.git
synced 2025-06-28 12:09:57 +00:00
21 lines
526 B
Dart
21 lines
526 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
final globalKey = GlobalKey<ScaffoldMessengerState>();
|
|
|
|
void showSnackBar({required String content, Function? onPressed}) {
|
|
globalKey.currentState?.showSnackBar(
|
|
SnackBar(
|
|
content: Text(content),
|
|
action:
|
|
onPressed != null
|
|
? SnackBarAction(
|
|
label: 'settings'.tr,
|
|
onPressed: () {
|
|
onPressed();
|
|
},
|
|
)
|
|
: null,
|
|
),
|
|
);
|
|
}
|