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