Compare commits
No commits in common. "a75083d916dd246ccc691142bb2408d66cf9ad1b" and "00863b94e82462cd57853dc6d012285e4a7ea95d" have entirely different histories.
a75083d916
...
00863b94e8
@ -171,18 +171,7 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
}
|
||||
|
||||
void _onTapChannel(SnChannel channel) {
|
||||
setState(() {
|
||||
_unreadCounts?[channel.id] = 0;
|
||||
if (channel.realmId != null) {
|
||||
_unreadCountsGrouped?[channel.realmId!] =
|
||||
(_unreadCountsGrouped?[channel.realmId!] ?? 0) -
|
||||
(_unreadCounts?[channel.id] ?? 0);
|
||||
}
|
||||
if (channel.type == 1) {
|
||||
_unreadCountsGrouped?[0] =
|
||||
(_unreadCountsGrouped?[0] ?? 0) - (_unreadCounts?[channel.id] ?? 0);
|
||||
}
|
||||
});
|
||||
setState(() => _unreadCounts?[channel.id] = 0);
|
||||
if (ResponsiveScaffold.getIsExpand(context)) {
|
||||
GoRouter.of(context).pushReplacementNamed(
|
||||
'chatRoom',
|
||||
@ -191,8 +180,9 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
'alias': channel.alias,
|
||||
},
|
||||
).then((value) {
|
||||
if (mounted && value == true) {
|
||||
_refreshChannels();
|
||||
if (mounted) {
|
||||
setState(() => _unreadCounts?[channel.id] = 0);
|
||||
_refreshChannels(noRemote: true);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@ -203,8 +193,9 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
'alias': channel.alias,
|
||||
},
|
||||
).then((value) {
|
||||
if (mounted && value == true) {
|
||||
_refreshChannels();
|
||||
if (mounted) {
|
||||
setState(() => _unreadCounts?[channel.id] = 0);
|
||||
_refreshChannels(noRemote: true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ class AccountPopoverCard extends StatelessWidget {
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
GoRouter.of(context).pushReplacementNamed(
|
||||
GoRouter.of(context).pushNamed(
|
||||
'accountProfilePage',
|
||||
pathParameters: {'name': data.name},
|
||||
);
|
||||
|
@ -25,7 +25,6 @@ class AttachmentItem extends StatelessWidget {
|
||||
final String? heroTag;
|
||||
final BoxFit fit;
|
||||
final FilterQuality? filterQuality;
|
||||
final Function? onZoom;
|
||||
|
||||
const AttachmentItem({
|
||||
super.key,
|
||||
@ -33,7 +32,6 @@ class AttachmentItem extends StatelessWidget {
|
||||
required this.data,
|
||||
required this.heroTag,
|
||||
this.filterQuality,
|
||||
this.onZoom,
|
||||
});
|
||||
|
||||
Widget _buildContent(BuildContext context) {
|
||||
@ -96,14 +94,7 @@ class AttachmentItem extends StatelessWidget {
|
||||
});
|
||||
}
|
||||
|
||||
return GestureDetector(
|
||||
child: _buildContent(context),
|
||||
onTap: () {
|
||||
if (data?.mimetype.startsWith('image') ?? false) {
|
||||
onZoom?.call();
|
||||
}
|
||||
},
|
||||
);
|
||||
return _buildContent(context);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,6 +74,7 @@ class _AttachmentListState extends State<AttachmentList> {
|
||||
return Container(
|
||||
padding: widget.padding ?? EdgeInsets.zero,
|
||||
constraints: constraints,
|
||||
child: GestureDetector(
|
||||
child: AspectRatio(
|
||||
aspectRatio: singleAspectRatio,
|
||||
child: Container(
|
||||
@ -89,7 +90,14 @@ class _AttachmentListState extends State<AttachmentList> {
|
||||
heroTag: heroTags[0],
|
||||
fit: widget.fit,
|
||||
filterQuality: widget.filterQuality,
|
||||
onZoom: () {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
if (widget.data.firstOrNull?.mediaType != SnMediaType.image) {
|
||||
return;
|
||||
}
|
||||
context.pushTransparentRoute(
|
||||
AttachmentZoomView(
|
||||
data: widget.data.where((ele) => ele != null).cast(),
|
||||
@ -101,9 +109,6 @@ class _AttachmentListState extends State<AttachmentList> {
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@ -128,14 +133,21 @@ class _AttachmentListState extends State<AttachmentList> {
|
||||
mainAxisSpacing: 4,
|
||||
children: widget.data
|
||||
.mapIndexed(
|
||||
(idx, ele) => Container(
|
||||
(idx, ele) => GestureDetector(
|
||||
child: Container(
|
||||
constraints: constraints,
|
||||
child: AttachmentItem(
|
||||
data: ele,
|
||||
heroTag: heroTags[idx],
|
||||
fit: BoxFit.cover,
|
||||
filterQuality: widget.filterQuality,
|
||||
onZoom: () {
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
if (widget.data[idx]!.mediaType !=
|
||||
SnMediaType.image) {
|
||||
return;
|
||||
}
|
||||
context.pushTransparentRoute(
|
||||
AttachmentZoomView(
|
||||
data: widget.data
|
||||
@ -149,7 +161,6 @@ class _AttachmentListState extends State<AttachmentList> {
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
|
Loading…
x
Reference in New Issue
Block a user