blur background during IT
This commit is contained in:
parent
b7eaab52da
commit
ca3cd03664
2 changed files with 64 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ import 'package:fluffychat/pangea/choreographer/widgets/start_igc_button.dart';
|
|||
import 'package:fluffychat/pangea/extensions/pangea_room_extension/pangea_room_extension.dart';
|
||||
import 'package:fluffychat/pangea/widgets/animations/gain_points.dart';
|
||||
import 'package:fluffychat/pangea/widgets/chat/chat_floating_action_button.dart';
|
||||
import 'package:fluffychat/pangea/widgets/chat/chat_view_background.dart';
|
||||
import 'package:fluffychat/pangea/widgets/chat/input_bar_wrapper.dart';
|
||||
import 'package:fluffychat/utils/account_config.dart';
|
||||
import 'package:fluffychat/widgets/chat_settings_popup_menu.dart';
|
||||
|
|
@ -419,6 +420,9 @@ class ChatView extends StatelessWidget {
|
|||
],
|
||||
),
|
||||
// #Pangea
|
||||
ChatViewBackground(
|
||||
choreographer: controller.choreographer,
|
||||
),
|
||||
Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
|
|
|
|||
60
lib/pangea/widgets/chat/chat_view_background.dart
Normal file
60
lib/pangea/widgets/chat/chat_view_background.dart
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
import 'dart:async';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:fluffychat/pangea/choreographer/controllers/choreographer.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ChatViewBackground extends StatefulWidget {
|
||||
final Choreographer choreographer;
|
||||
const ChatViewBackground({
|
||||
super.key,
|
||||
required this.choreographer,
|
||||
});
|
||||
|
||||
@override
|
||||
ChatViewBackgroundState createState() => ChatViewBackgroundState();
|
||||
}
|
||||
|
||||
class ChatViewBackgroundState extends State<ChatViewBackground> {
|
||||
StreamSubscription? _choreoSub;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// Rebuild the widget each time there's an update from choreo
|
||||
_choreoSub = widget.choreographer.stateListener.stream.listen((_) {
|
||||
setState(() {});
|
||||
});
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_choreoSub?.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return widget.choreographer.itController.willOpen
|
||||
? Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
child: Material(
|
||||
borderOnForeground: false,
|
||||
color: const Color.fromRGBO(0, 0, 0, 1).withAlpha(150),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: BackdropFilter(
|
||||
filter: ImageFilter.blur(sigmaX: 2.5, sigmaY: 2.5),
|
||||
child: Container(
|
||||
height: double.infinity,
|
||||
width: double.infinity,
|
||||
color: Colors.transparent,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SizedBox.shrink();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue