Compare commits
No commits in common. "21a1d4a2ad649b4fc47b74ae19bcc7ed4839eb55" and "4209a13c840a44fe9225b4edc5c7ecb93ff953bd" have entirely different histories.
21a1d4a2ad
...
4209a13c84
@ -113,20 +113,21 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer> {
|
|||||||
? Theme.of(context)
|
? Theme.of(context)
|
||||||
.colorScheme
|
.colorScheme
|
||||||
.primaryContainer
|
.primaryContainer
|
||||||
: Colors.transparent,
|
: Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.surfaceContainerLow,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
GoRouter.of(context).goNamed(ele.screen);
|
GoRouter.of(context).goNamed(ele.screen);
|
||||||
Scaffold.of(context).closeDrawer();
|
Scaffold.of(context).closeDrawer();
|
||||||
nav.setIndex(idx);
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
).toList(),
|
).toList(),
|
||||||
).padding(horizontal: 16, bottom: 8),
|
).padding(horizontal: 16),
|
||||||
Align(
|
Align(
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
@ -172,7 +173,7 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Gap(MediaQuery.of(context).padding.bottom + 8),
|
Gap(MediaQuery.of(context).padding.bottom),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -281,7 +282,7 @@ class _DrawerContentList extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
title: Text(nav.focusedRealm!.name),
|
title: Text(nav.focusedRealm!.name),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
GoRouter.of(context).goNamed(
|
GoRouter.of(context).pushNamed(
|
||||||
'realmDetail',
|
'realmDetail',
|
||||||
pathParameters: {
|
pathParameters: {
|
||||||
'alias': nav.focusedRealm!.alias,
|
'alias': nav.focusedRealm!.alias,
|
||||||
@ -299,7 +300,7 @@ class _DrawerContentList extends StatelessWidget {
|
|||||||
leading: const Icon(Symbols.globe),
|
leading: const Icon(Symbols.globe),
|
||||||
title: Text('community').tr(),
|
title: Text('community').tr(),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
GoRouter.of(context).goNamed(
|
GoRouter.of(context).pushNamed(
|
||||||
'realmCommunity',
|
'realmCommunity',
|
||||||
pathParameters: {
|
pathParameters: {
|
||||||
'alias': nav.focusedRealm!.alias,
|
'alias': nav.focusedRealm!.alias,
|
||||||
@ -324,7 +325,7 @@ class _DrawerContentList extends StatelessWidget {
|
|||||||
leading: const Icon(Symbols.tag),
|
leading: const Icon(Symbols.tag),
|
||||||
title: Text(ele.name),
|
title: Text(ele.name),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
GoRouter.of(context).goNamed(
|
GoRouter.of(context).pushNamed(
|
||||||
'chatRoom',
|
'chatRoom',
|
||||||
pathParameters: {
|
pathParameters: {
|
||||||
'scope': ele.realm?.alias ?? 'global',
|
'scope': ele.realm?.alias ?? 'global',
|
||||||
|
@ -103,7 +103,7 @@ class PostCommentSliverListState extends State<PostCommentSliverList> {
|
|||||||
final sn = context.read<SnNetworkProvider>();
|
final sn = context.read<SnNetworkProvider>();
|
||||||
await sn.client
|
await sn.client
|
||||||
.put('/cgi/co/questions/${widget.parentPost.id}/answer', data: {
|
.put('/cgi/co/questions/${widget.parentPost.id}/answer', data: {
|
||||||
'publisher': widget.parentPost.publisherId,
|
'publisher': answer.publisherId,
|
||||||
'answer_id': answer.id,
|
'answer_id': answer.id,
|
||||||
});
|
});
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
|
@ -279,8 +279,6 @@ class _PostItemState extends State<PostItem> {
|
|||||||
final ua = context.read<UserProvider>();
|
final ua = context.read<UserProvider>();
|
||||||
final isAuthor =
|
final isAuthor =
|
||||||
ua.isAuthorized && widget.data.publisher.accountId == ua.user?.id;
|
ua.isAuthorized && widget.data.publisher.accountId == ua.user?.id;
|
||||||
final isParentAuthor = ua.isAuthorized &&
|
|
||||||
widget.data.replyTo?.publisher.accountId == ua.user?.id;
|
|
||||||
|
|
||||||
final displayableAttachments = widget.data.preload?.attachments
|
final displayableAttachments = widget.data.preload?.attachments
|
||||||
?.where((ele) =>
|
?.where((ele) =>
|
||||||
@ -335,7 +333,6 @@ class _PostItemState extends State<PostItem> {
|
|||||||
_PostActionPopup(
|
_PostActionPopup(
|
||||||
data: widget.data,
|
data: widget.data,
|
||||||
isAuthor: isAuthor,
|
isAuthor: isAuthor,
|
||||||
isParentAuthor: isParentAuthor,
|
|
||||||
onShare: () => _doShare(context),
|
onShare: () => _doShare(context),
|
||||||
onShareImage: () => _doShareViaPicture(context),
|
onShareImage: () => _doShareViaPicture(context),
|
||||||
onSelectAnswer: widget.onSelectAnswer,
|
onSelectAnswer: widget.onSelectAnswer,
|
||||||
@ -580,7 +577,6 @@ class _PostItemState extends State<PostItem> {
|
|||||||
_PostActionPopup(
|
_PostActionPopup(
|
||||||
data: widget.data,
|
data: widget.data,
|
||||||
isAuthor: isAuthor,
|
isAuthor: isAuthor,
|
||||||
isParentAuthor: isParentAuthor,
|
|
||||||
onShare: () => _doShare(context),
|
onShare: () => _doShare(context),
|
||||||
onShareImage: () => _doShareViaPicture(context),
|
onShareImage: () => _doShareViaPicture(context),
|
||||||
onSelectAnswer: widget.onSelectAnswer,
|
onSelectAnswer: widget.onSelectAnswer,
|
||||||
@ -1321,7 +1317,6 @@ class _PostAvatar extends StatelessWidget {
|
|||||||
class _PostActionPopup extends StatelessWidget {
|
class _PostActionPopup extends StatelessWidget {
|
||||||
final SnPost data;
|
final SnPost data;
|
||||||
final bool isAuthor;
|
final bool isAuthor;
|
||||||
final bool isParentAuthor;
|
|
||||||
final Function onDeleted;
|
final Function onDeleted;
|
||||||
final Function() onShare, onShareImage;
|
final Function() onShare, onShareImage;
|
||||||
final Function()? onSelectAnswer;
|
final Function()? onSelectAnswer;
|
||||||
@ -1329,7 +1324,6 @@ class _PostActionPopup extends StatelessWidget {
|
|||||||
const _PostActionPopup({
|
const _PostActionPopup({
|
||||||
required this.data,
|
required this.data,
|
||||||
required this.isAuthor,
|
required this.isAuthor,
|
||||||
required this.isParentAuthor,
|
|
||||||
required this.onDeleted,
|
required this.onDeleted,
|
||||||
required this.onShare,
|
required this.onShare,
|
||||||
required this.onShareImage,
|
required this.onShareImage,
|
||||||
@ -1403,7 +1397,7 @@ class _PostActionPopup extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
if (onTranslate != null) PopupMenuDivider(),
|
if (onTranslate != null) PopupMenuDivider(),
|
||||||
if (isParentAuthor && onSelectAnswer != null)
|
if (isAuthor && onSelectAnswer != null)
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
@ -1416,7 +1410,7 @@ class _PostActionPopup extends StatelessWidget {
|
|||||||
onSelectAnswer?.call();
|
onSelectAnswer?.call();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
if (isParentAuthor && onSelectAnswer != null) PopupMenuDivider(),
|
if (isAuthor && onSelectAnswer != null) PopupMenuDivider(),
|
||||||
if (isAuthor)
|
if (isAuthor)
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
child: Row(
|
child: Row(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user