mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-25 03:26:22 +08:00
feat: set top dyn
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -25,6 +25,7 @@ class AuthorPanel extends StatelessWidget {
|
||||
final String? source;
|
||||
final Function? onRemove;
|
||||
final bool isSave;
|
||||
final Function(bool isTop, dynamic dynId)? onSetTop;
|
||||
|
||||
const AuthorPanel({
|
||||
super.key,
|
||||
@@ -33,6 +34,7 @@ class AuthorPanel extends StatelessWidget {
|
||||
this.source,
|
||||
this.onRemove,
|
||||
this.isSave = false,
|
||||
this.onSetTop,
|
||||
});
|
||||
|
||||
Widget _buildAvatar(double size) => NetworkImgLayer(
|
||||
@@ -354,6 +356,18 @@ class AuthorPanel extends StatelessWidget {
|
||||
title:
|
||||
Text('检查动态', style: Theme.of(context).textTheme.titleSmall!),
|
||||
),
|
||||
if (onSetTop != null)
|
||||
ListTile(
|
||||
onTap: () {
|
||||
Get.back();
|
||||
onSetTop!(item.modules?.moduleTag?.text != null, item.idStr);
|
||||
},
|
||||
minLeadingWidth: 0,
|
||||
leading: const Icon(Icons.vertical_align_top, size: 19),
|
||||
title: Text(
|
||||
'${item.modules?.moduleTag?.text != null ? '取消' : ''}置顶',
|
||||
style: Theme.of(context).textTheme.titleSmall!),
|
||||
),
|
||||
if (onRemove != null)
|
||||
ListTile(
|
||||
onTap: () {
|
||||
|
||||
@@ -15,14 +15,16 @@ class DynamicPanel extends StatelessWidget {
|
||||
final Function? onRemove;
|
||||
final Function(List<String>, int)? callback;
|
||||
final bool isSave;
|
||||
final Function(bool isTop, dynamic dynId)? onSetTop;
|
||||
|
||||
const DynamicPanel({
|
||||
super.key,
|
||||
required this.item,
|
||||
this.source,
|
||||
this.onRemove,
|
||||
this.callback,
|
||||
this.isSave = false,
|
||||
super.key,
|
||||
this.onSetTop,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -134,6 +136,7 @@ class DynamicPanel extends StatelessWidget {
|
||||
source: source,
|
||||
onRemove: onRemove,
|
||||
isSave: isSave,
|
||||
onSetTop: onSetTop,
|
||||
),
|
||||
),
|
||||
if (item!.modules!.moduleDynamic!.desc != null ||
|
||||
|
||||
Reference in New Issue
Block a user