chore: Switch from bottoast to flushbar
This commit is contained in:
parent
4cc4800035
commit
e621a83406
15 changed files with 79 additions and 44 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import 'package:bot_toast/bot_toast.dart';
|
||||
import 'package:flushbar/flushbar_helper.dart';
|
||||
import 'package:famedlysdk/famedlysdk.dart';
|
||||
import 'package:famedlysdk/matrix_api.dart';
|
||||
|
||||
|
|
@ -48,7 +48,9 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
widget.room.setName(displayname),
|
||||
);
|
||||
if (success != false) {
|
||||
BotToast.showText(text: L10n.of(context).displaynameHasBeenChanged);
|
||||
await FlushbarHelper.createSuccess(
|
||||
message: L10n.of(context).displaynameHasBeenChanged)
|
||||
.show(context);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -101,7 +103,9 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
widget.room.setDescription(displayname),
|
||||
);
|
||||
if (success != false) {
|
||||
BotToast.showText(text: L10n.of(context).groupDescriptionHasBeenChanged);
|
||||
await FlushbarHelper.createSuccess(
|
||||
message: L10n.of(context).groupDescriptionHasBeenChanged)
|
||||
.show(context);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -133,7 +137,9 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
widget.room.setAvatar(file),
|
||||
);
|
||||
if (success != false) {
|
||||
BotToast.showText(text: L10n.of(context).avatarHasBeenChanged);
|
||||
await FlushbarHelper.createSuccess(
|
||||
message: L10n.of(context).avatarHasBeenChanged)
|
||||
.show(context);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -184,8 +190,9 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
Clipboard.setData(
|
||||
ClipboardData(text: widget.room.canonicalAlias),
|
||||
);
|
||||
BotToast.showText(
|
||||
text: L10n.of(context).copiedToClipboard);
|
||||
FlushbarHelper.createSuccess(
|
||||
message: L10n.of(context).copiedToClipboard)
|
||||
.show(context);
|
||||
},
|
||||
),
|
||||
ChatSettingsPopupMenu(widget.room, false)
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import 'package:fluffychat/components/avatar.dart';
|
|||
import 'package:fluffychat/components/matrix.dart';
|
||||
import 'package:fluffychat/utils/beautify_string_extension.dart';
|
||||
import 'package:fluffychat/views/chat_list.dart';
|
||||
import 'package:flushbar/flushbar_helper.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
|
||||
|
|
@ -102,6 +103,16 @@ class _ChatEncryptionSettingsState extends State<ChatEncryptionSettings> {
|
|||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addPostFrameCallback(
|
||||
(_) => FlushbarHelper.createInformation(
|
||||
message: L10n.of(context).warningEncryptionInBeta)
|
||||
.show(context),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final room = Matrix.of(context).client.getRoomById(widget.id);
|
||||
|
|
|
|||
|
|
@ -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:famedlysdk/matrix_api.dart';
|
||||
import 'package:fluffychat/components/adaptive_page_layout.dart';
|
||||
|
|
@ -60,7 +60,9 @@ class _InvitationSelectionState extends State<InvitationSelection> {
|
|||
widget.room.invite(id),
|
||||
);
|
||||
if (success != false) {
|
||||
BotToast.showText(text: L10n.of(context).contactHasBeenInvitedToTheGroup);
|
||||
await FlushbarHelper.createSuccess(
|
||||
message: L10n.of(context).contactHasBeenInvitedToTheGroup)
|
||||
.show(context);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:bot_toast/bot_toast.dart';
|
||||
import 'package:flushbar/flushbar_helper.dart';
|
||||
import 'package:famedlysdk/famedlysdk.dart';
|
||||
import 'package:file_picker_cross/file_picker_cross.dart';
|
||||
|
||||
|
|
@ -76,7 +76,9 @@ class _SettingsState extends State<Settings> {
|
|||
.client
|
||||
.changePassword(newPassword, oldPassword: oldPassword),
|
||||
);
|
||||
BotToast.showText(text: L10n.of(context).passwordHasBeenChanged);
|
||||
await FlushbarHelper.createSuccess(
|
||||
message: L10n.of(context).passwordHasBeenChanged)
|
||||
.show(context);
|
||||
}
|
||||
|
||||
void _deleteAccountAction(BuildContext context) async {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import 'package:bot_toast/bot_toast.dart';
|
||||
import 'package:flushbar/flushbar_helper.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:famedlysdk/famedlysdk.dart';
|
||||
import 'package:file_picker_cross/file_picker_cross.dart';
|
||||
|
|
@ -449,7 +449,9 @@ class _EmoteImagePickerState extends State<_EmoteImagePicker> {
|
|||
),
|
||||
onPressed: () async {
|
||||
if (kIsWeb) {
|
||||
BotToast.showText(text: L10n.of(context).notSupportedInWeb);
|
||||
await FlushbarHelper.createError(
|
||||
message: L10n.of(context).notSupportedInWeb)
|
||||
.show(context);
|
||||
return;
|
||||
}
|
||||
MatrixFile file;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import 'dart:math';
|
||||
|
||||
import 'package:bot_toast/bot_toast.dart';
|
||||
import 'package:flushbar/flushbar_helper.dart';
|
||||
import 'package:famedlysdk/famedlysdk.dart';
|
||||
|
||||
import 'package:fluffychat/components/matrix.dart';
|
||||
|
|
@ -95,13 +95,17 @@ class _SignUpPasswordState extends State<SignUpPassword> {
|
|||
await matrix.client
|
||||
.setDisplayname(matrix.client.userID, widget.displayname);
|
||||
} catch (exception) {
|
||||
BotToast.showText(text: L10n.of(context).couldNotSetDisplayname);
|
||||
await FlushbarHelper.createError(
|
||||
message: L10n.of(context).couldNotSetDisplayname)
|
||||
.show(context);
|
||||
}
|
||||
if (widget.avatar != null) {
|
||||
try {
|
||||
await matrix.client.setAvatar(widget.avatar);
|
||||
} catch (exception) {
|
||||
BotToast.showText(text: L10n.of(context).couldNotSetAvatar);
|
||||
await FlushbarHelper.createError(
|
||||
message: L10n.of(context).couldNotSetAvatar)
|
||||
.show(context);
|
||||
}
|
||||
}
|
||||
await Navigator.of(context).pushAndRemoveUntil(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue