mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-28 05:26:47 +00:00
Specify default "details" text for snackbar
This commit is contained in:
parent
87e5499d09
commit
0773b2e70d
@ -12,6 +12,7 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:one_context/one_context.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
void showSnackIcon(String text, {IconData icon, Function onAction, bool success, String actionText}) {
|
||||
|
||||
@ -29,7 +30,13 @@ void showSnackIcon(String text, {IconData icon, Function onAction, bool success,
|
||||
|
||||
SnackBarAction action;
|
||||
|
||||
if (onAction != null && actionText != null) {
|
||||
if (onAction != null) {
|
||||
|
||||
if (actionText == null) {
|
||||
// Default action text
|
||||
actionText = I18N.of(OneContext().context).details;
|
||||
}
|
||||
|
||||
action = SnackBarAction(
|
||||
label: actionText,
|
||||
onPressed: onAction,
|
||||
|
Loading…
x
Reference in New Issue
Block a user