mirror of
https://github.com/ente-io/ente.git
synced 2025-08-07 23:18:10 +00:00
fix(auth): toast on desktop
This commit is contained in:
parent
54f6f8656d
commit
aa5c41b59d
@ -4,8 +4,8 @@ import 'package:ente_auth/services/update_service.dart';
|
||||
import 'package:ente_auth/ui/common/gradient_button.dart';
|
||||
import 'package:ente_auth/ui/linear_progress_widget.dart';
|
||||
import 'package:ente_auth/ui/settings/app_update_dialog.dart';
|
||||
import 'package:ente_auth/utils/toast_util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
|
||||
class CodeErrorWidget extends StatelessWidget {
|
||||
const CodeErrorWidget({super.key});
|
||||
@ -97,8 +97,9 @@ class CodeErrorWidget extends StatelessWidget {
|
||||
barrierColor: Colors.black.withOpacity(0.85),
|
||||
);
|
||||
} catch (e) {
|
||||
await Fluttertoast.showToast(
|
||||
msg: context.l10n.updateNotAvailable,
|
||||
showToast(
|
||||
context,
|
||||
context.l10n.updateNotAvailable,
|
||||
);
|
||||
}
|
||||
},
|
||||
|
@ -22,7 +22,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_context_menu/flutter_context_menu.dart';
|
||||
import 'package:flutter_slidable/flutter_slidable.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:move_to_background/move_to_background.dart';
|
||||
|
||||
@ -104,13 +103,11 @@ class _CodeWidgetState extends State<CodeWidget> {
|
||||
onSelected: () => _onShowQrPressed(null),
|
||||
),
|
||||
MenuItem(
|
||||
label: widget.code.isPinned
|
||||
? l10n.unpinText
|
||||
: l10n.pinText,
|
||||
label: widget.code.isPinned ? l10n.unpinText : l10n.pinText,
|
||||
icon: widget.code.isPinned
|
||||
? Icons.push_pin
|
||||
: Icons.push_pin_outlined,
|
||||
onSelected: () => _onShowQrPressed(null),
|
||||
onSelected: () => _onPinPressed(null),
|
||||
),
|
||||
MenuItem(
|
||||
label: l10n.edit,
|
||||
@ -181,9 +178,7 @@ class _CodeWidgetState extends State<CodeWidget> {
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
widget.code.isPinned
|
||||
? l10n.unpinText
|
||||
: l10n.pinText,
|
||||
widget.code.isPinned ? l10n.unpinText : l10n.pinText,
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -224,8 +219,6 @@ class _CodeWidgetState extends State<CodeWidget> {
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
@ -562,8 +555,9 @@ class _CodeWidgetState extends State<CodeWidget> {
|
||||
);
|
||||
unawaited(
|
||||
CodeStore.instance.addCode(code).then(
|
||||
(value) => Fluttertoast.showToast(
|
||||
msg: !currentlyPinned
|
||||
(value) => showToast(
|
||||
context,
|
||||
!currentlyPinned
|
||||
? context.l10n.pinnedCodeMessage(widget.code.issuer)
|
||||
: context.l10n.unpinnedCodeMessage(widget.code.issuer),
|
||||
),
|
||||
|
Loading…
x
Reference in New Issue
Block a user