change: Switch to ScaffoldMessenger
This commit is contained in:
parent
af02b8a43a
commit
af2176b1c5
16 changed files with 73 additions and 84 deletions
|
|
@ -1,9 +1,10 @@
|
|||
import 'dart:async';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:adaptive_page_layout/adaptive_page_layout.dart';
|
||||
import 'package:famedlysdk/famedlysdk.dart';
|
||||
import 'package:fluffychat/components/message_download_content.dart';
|
||||
import 'package:flushbar/flushbar_helper.dart';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_sound_lite/flutter_sound.dart';
|
||||
|
|
@ -81,8 +82,11 @@ class _AudioPlayerState extends State<AudioPlayer> {
|
|||
_playAction();
|
||||
} catch (e, s) {
|
||||
Logs().v('Could not download audio file', e, s);
|
||||
await FlushbarHelper.createError(message: e.toLocalizedString(context))
|
||||
.show(context);
|
||||
AdaptivePageLayout.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(e.toLocalizedString(context)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import 'package:fluffychat/config/themes.dart';
|
|||
import 'package:fluffychat/utils/event_extension.dart';
|
||||
import 'package:fluffychat/utils/matrix_locals.dart';
|
||||
import 'package:fluffychat/utils/room_status_extension.dart';
|
||||
import 'package:flushbar/flushbar_helper.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:pedantic/pedantic.dart';
|
||||
|
|
@ -47,9 +47,11 @@ class ChatListItem extends StatelessWidget {
|
|||
}
|
||||
|
||||
if (room.membership == Membership.ban) {
|
||||
await FlushbarHelper.createError(
|
||||
message: L10n.of(context).youHaveBeenBannedFromThisChat)
|
||||
.show(context);
|
||||
AdaptivePageLayout.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(L10n.of(context).youHaveBeenBannedFromThisChat),
|
||||
),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:adaptive_page_layout/adaptive_page_layout.dart';
|
||||
import 'package:famedlysdk/encryption/utils/key_verification.dart';
|
||||
import 'package:famedlysdk/famedlysdk.dart';
|
||||
import 'package:fluffychat/components/audio_player.dart';
|
||||
|
|
@ -6,7 +7,7 @@ import 'package:fluffychat/components/image_bubble.dart';
|
|||
import 'package:fluffychat/utils/event_extension.dart';
|
||||
import 'package:fluffychat/utils/matrix_locals.dart';
|
||||
import 'package:fluffychat/components/dialogs/key_verification_dialog.dart';
|
||||
import 'package:flushbar/flushbar_helper.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:matrix_link_text/link_text.dart';
|
||||
|
|
@ -26,13 +27,14 @@ class MessageContent extends StatelessWidget {
|
|||
|
||||
void _verifyOrRequestKey(BuildContext context) async {
|
||||
if (event.content['can_request_session'] != true) {
|
||||
FlushbarHelper.createError(
|
||||
message: event.type == EventTypes.Encrypted
|
||||
AdaptivePageLayout.of(context).showSnackBar(SnackBar(
|
||||
content: Text(
|
||||
event.type == EventTypes.Encrypted
|
||||
? L10n.of(context).needPantalaimonWarning
|
||||
: event.getLocalizedBody(
|
||||
MatrixLocals(L10n.of(context)),
|
||||
),
|
||||
);
|
||||
)));
|
||||
return;
|
||||
}
|
||||
final client = Matrix.of(context).client;
|
||||
|
|
@ -59,11 +61,8 @@ class MessageContent extends StatelessWidget {
|
|||
future: () => event.requestKey(),
|
||||
);
|
||||
if (success.error == null) {
|
||||
await FlushbarHelper.createLoading(
|
||||
title: L10n.of(context).loadingPleaseWait,
|
||||
message: L10n.of(context).requestToReadOlderMessages,
|
||||
linearProgressIndicator: LinearProgressIndicator(),
|
||||
).show(context);
|
||||
AdaptivePageLayout.of(context).showSnackBar(SnackBar(
|
||||
content: Text(L10n.of(context).requestToReadOlderMessages)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue