chore: Switch from bottoast to flushbar

This commit is contained in:
Christian Pauly 2020-11-14 08:54:26 +01:00
commit e621a83406
15 changed files with 79 additions and 44 deletions

View file

@ -1,4 +1,4 @@
import 'package:bot_toast/bot_toast.dart';
import 'package:flushbar/flushbar_helper.dart';
import 'package:famedlysdk/famedlysdk.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
@ -169,10 +169,12 @@ class SimpleDialogs {
onAdditionalAuth != null) {
return await tryRequestWithErrorToast(onAdditionalAuth(exception));
} else {
BotToast.showText(text: exception.errorMessage);
await FlushbarHelper.createError(message: exception.errorMessage)
.show(context);
}
} catch (exception) {
BotToast.showText(text: exception.toString());
await FlushbarHelper.createError(message: exception.toString())
.show(context);
return false;
}
}

View file

@ -1,6 +1,6 @@
import 'dart:async';
import 'package:bot_toast/bot_toast.dart';
import 'package:flushbar/flushbar_helper.dart';
import 'package:famedlysdk/famedlysdk.dart';
import 'package:fluffychat/utils/app_route.dart';
import 'package:fluffychat/views/chat_encryption_settings.dart';
@ -22,7 +22,6 @@ class _EncryptionButtonState extends State<EncryptionButton> {
void _enableEncryptionAction() async {
if (widget.room.encrypted) {
BotToast.showText(text: L10n.of(context).warningEncryptionInBeta);
await Navigator.of(context).push(
AppRoute.defaultRoute(
context,
@ -32,7 +31,9 @@ class _EncryptionButtonState extends State<EncryptionButton> {
return;
}
if (!widget.room.client.encryptionEnabled) {
BotToast.showText(text: L10n.of(context).needPantalaimonWarning);
await FlushbarHelper.createInformation(
message: L10n.of(context).needPantalaimonWarning)
.show(context);
return;
}
if (await SimpleDialogs(context).askConfirmation(

View file

@ -1,4 +1,4 @@
import 'package:bot_toast/bot_toast.dart';
import 'package:flushbar/flushbar_helper.dart';
import 'package:circular_check_box/circular_check_box.dart';
import 'package:famedlysdk/famedlysdk.dart';
import 'package:fluffychat/utils/matrix_locals.dart';
@ -43,7 +43,9 @@ class ChatListItem extends StatelessWidget {
}
if (room.membership == Membership.ban) {
BotToast.showText(text: L10n.of(context).youHaveBeenBannedFromThisChat);
await FlushbarHelper.createError(
message: L10n.of(context).youHaveBeenBannedFromThisChat)
.show(context);
return;
}