mirror of
https://github.com/darkmoonight/Rain.git
synced 2025-06-28 20:19:58 +00:00
21 lines
498 B
Dart
21 lines
498 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,
|
||
|
),
|
||
|
);
|
||
|
}
|