Build Android (FCM) / build-android-fcm (push) Canceled after 0s
Build Android / build-android (push) Canceled after 0s
Build iOS / build-ios (push) Canceled after 0s
Build Linux / build-linux (push) Canceled after 0s
Build macOS / build-macos (push) Canceled after 0s
Build Windows / build-windows (push) Canceled after 0s
Release (main) / android (oneme) (push) Canceled after 0s
Release (main) / android (qlyra) (push) Canceled after 0s
Release (main) / windows (push) Canceled after 0s
Release (main) / linux (push) Canceled after 0s
Release (main) / macos (push) Canceled after 0s
Release (main) / ios (push) Canceled after 0s
Release (main) / release (push) Canceled after 0s
128 lines
2.9 KiB
Dart
128 lines
2.9 KiB
Dart
part of '../chat_screen.dart';
|
|
|
|
class _DateSeparatorItem {
|
|
final DateTime date;
|
|
final GlobalKey key;
|
|
_DateSeparatorItem(this.date, this.key);
|
|
}
|
|
|
|
class _MessageItem {
|
|
final CachedMessage message;
|
|
final int index;
|
|
const _MessageItem(this.message, this.index);
|
|
}
|
|
|
|
class _UnreadSeparatorItem {
|
|
const _UnreadSeparatorItem();
|
|
}
|
|
|
|
class _FrostedPanel extends StatelessWidget {
|
|
final Color tint;
|
|
final Border? border;
|
|
final double sigma;
|
|
final BackdropKey? backdropKey;
|
|
final Widget child;
|
|
|
|
const _FrostedPanel({
|
|
required this.tint,
|
|
this.border,
|
|
this.sigma = AppFrost.panelSigma,
|
|
this.backdropKey,
|
|
required this.child,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Stack(
|
|
fit: StackFit.passthrough,
|
|
clipBehavior: Clip.none,
|
|
children: [
|
|
Positioned.fill(
|
|
child: GlassSurface(
|
|
frostTint: tint,
|
|
frostSigma: sigma,
|
|
border: border,
|
|
backdropKey: backdropKey,
|
|
child: const SizedBox.expand(),
|
|
),
|
|
),
|
|
child,
|
|
],
|
|
);
|
|
}
|
|
}
|
|
|
|
class _MeasureSize extends StatefulWidget {
|
|
final Widget child;
|
|
final ValueChanged<double> onHeight;
|
|
|
|
const _MeasureSize({required this.onHeight, required this.child});
|
|
|
|
@override
|
|
State<_MeasureSize> createState() => _MeasureSizeState();
|
|
}
|
|
|
|
class _MeasureSizeState extends State<_MeasureSize> {
|
|
final GlobalKey _key = GlobalKey();
|
|
double _last = -1;
|
|
|
|
void _report() {
|
|
if (!mounted) return;
|
|
final height = _key.currentContext?.size?.height;
|
|
if (height == null) return;
|
|
if ((height - _last).abs() > 0.5) {
|
|
_last = height;
|
|
widget.onHeight(height);
|
|
}
|
|
}
|
|
|
|
void _scheduleReport() {
|
|
WidgetsBinding.instance.addPostFrameCallback((_) => _report());
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
_scheduleReport();
|
|
return NotificationListener<SizeChangedLayoutNotification>(
|
|
onNotification: (_) {
|
|
_scheduleReport();
|
|
return true;
|
|
},
|
|
child: SizeChangedLayoutNotifier(
|
|
child: SizedBox(key: _key, child: widget.child),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class ForwardRequest {
|
|
final int sourceChatId;
|
|
final String sourceChatName;
|
|
final String sourceChatIconUrl;
|
|
final String sourceChatType;
|
|
final List<CachedMessage> messages;
|
|
|
|
ForwardRequest({
|
|
required this.sourceChatId,
|
|
required this.sourceChatName,
|
|
required this.sourceChatIconUrl,
|
|
required this.sourceChatType,
|
|
required List<CachedMessage> messages,
|
|
}) : messages = List.unmodifiable(messages);
|
|
|
|
ForwardRequest withMessages(List<CachedMessage> value) => ForwardRequest(
|
|
sourceChatId: sourceChatId,
|
|
sourceChatName: sourceChatName,
|
|
sourceChatIconUrl: sourceChatIconUrl,
|
|
sourceChatType: sourceChatType,
|
|
messages: value,
|
|
);
|
|
}
|
|
|
|
class ReplyRequest {
|
|
final int sourceChatId;
|
|
final CachedMessage message;
|
|
|
|
const ReplyRequest({required this.sourceChatId, required this.message});
|
|
}
|