account settings

This commit is contained in:
wgh19
2024-05-14 22:43:45 +08:00
parent a8b0495fc6
commit f8c3514956
3 changed files with 114 additions and 3 deletions

View File

@@ -7,9 +7,11 @@ void showToast(BuildContext context, {required String message, IconData? icon})
var newEntry = OverlayEntry(
builder: (context) => ToastOverlay(message: message, icon: icon));
OverlayWidget.of(context)?.addOverlay(newEntry);
var overlay = OverlayWidget.of(context);
Timer(const Duration(seconds: 2), () => OverlayWidget.of(context)?.remove(newEntry));
overlay?.addOverlay(newEntry);
Timer(const Duration(seconds: 2), () => overlay?.remove(newEntry));
}
class ToastOverlay extends StatelessWidget {