Merge pull request #727 from pangeachat/default-overlay-blur
Default overlay blur
This commit is contained in:
commit
cc285232fe
4 changed files with 22 additions and 9 deletions
|
|
@ -1680,6 +1680,7 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
MatrixState.pangeaController.subscriptionController.isSubscribed,
|
||||
position: OverlayPositionEnum.centered,
|
||||
onDismiss: clearSelectedEvents,
|
||||
blurBackground: true,
|
||||
);
|
||||
|
||||
// select the message
|
||||
|
|
|
|||
|
|
@ -46,11 +46,16 @@ class ChatEventList extends StatelessWidget {
|
|||
// after the chat event list mounts, if the user hasn't yet seen this instruction
|
||||
// card, attach it on top of the first shown message
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (events.isEmpty) return;
|
||||
final msgEvents = events
|
||||
.where(
|
||||
(event) => event.type == EventTypes.Message,
|
||||
)
|
||||
.toList();
|
||||
if (msgEvents.isEmpty) return;
|
||||
controller.pangeaController.instructions.showInstructionsPopup(
|
||||
context,
|
||||
InstructionsEnum.clickMessage,
|
||||
events[0].eventId,
|
||||
msgEvents[0].eventId,
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -69,6 +69,12 @@ class InstructionsController {
|
|||
String transformTargetKey, [
|
||||
bool showToggle = true,
|
||||
]) async {
|
||||
final bool userLangsSet =
|
||||
await _pangeaController.userController.areUserLanguagesSet;
|
||||
if (!userLangsSet) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (_instructionsShown[key.toString()] ?? false) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -85,12 +91,6 @@ class InstructionsController {
|
|||
return;
|
||||
}
|
||||
|
||||
final bool userLangsSet =
|
||||
await _pangeaController.userController.areUserLanguagesSet;
|
||||
if (!userLangsSet) {
|
||||
return;
|
||||
}
|
||||
|
||||
final botStyle = BotStyle.text(context);
|
||||
Future.delayed(
|
||||
const Duration(seconds: 1),
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ class OverlayUtil {
|
|||
double? height,
|
||||
Offset? offset,
|
||||
backDropToDismiss = true,
|
||||
blurBackground = false,
|
||||
Color? borderColor,
|
||||
Color? backgroundColor,
|
||||
Alignment? targetAnchor,
|
||||
|
|
@ -50,6 +51,7 @@ class OverlayUtil {
|
|||
TransparentBackdrop(
|
||||
backgroundColor: backgroundColor,
|
||||
onDismiss: onDismiss,
|
||||
blurBackground: blurBackground,
|
||||
),
|
||||
Positioned(
|
||||
top: (position == OverlayPositionEnum.centered) ? 0 : null,
|
||||
|
|
@ -207,10 +209,13 @@ class OverlayUtil {
|
|||
class TransparentBackdrop extends StatelessWidget {
|
||||
final Color? backgroundColor;
|
||||
final Function? onDismiss;
|
||||
final bool blurBackground;
|
||||
|
||||
const TransparentBackdrop({
|
||||
super.key,
|
||||
this.onDismiss,
|
||||
this.backgroundColor,
|
||||
this.blurBackground = false,
|
||||
});
|
||||
|
||||
@override
|
||||
|
|
@ -231,7 +236,9 @@ class TransparentBackdrop extends StatelessWidget {
|
|||
MatrixState.pAnyState.closeOverlay();
|
||||
},
|
||||
child: BackdropFilter(
|
||||
filter: ImageFilter.blur(sigmaX: 2.5, sigmaY: 2.5),
|
||||
filter: blurBackground
|
||||
? ImageFilter.blur(sigmaX: 2.5, sigmaY: 2.5)
|
||||
: ImageFilter.blur(sigmaX: 0, sigmaY: 0),
|
||||
child: Container(
|
||||
height: double.infinity,
|
||||
width: double.infinity,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue