mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: some widgets
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -24,125 +24,138 @@ void autoWrapReportDialog(
|
|||||||
actionsPadding: const EdgeInsets.only(left: 16, right: 16, bottom: 10),
|
actionsPadding: const EdgeInsets.only(left: 16, right: 16, bottom: 10),
|
||||||
content: Builder(
|
content: Builder(
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return SingleChildScrollView(
|
return Column(
|
||||||
child: AnimatedSize(
|
mainAxisSize: MainAxisSize.min,
|
||||||
duration: const Duration(milliseconds: 200),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
child: Column(
|
children: [
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
Flexible(
|
||||||
children: [
|
child: Material(
|
||||||
Padding(
|
child: SingleChildScrollView(
|
||||||
padding: const EdgeInsets.only(
|
child: AnimatedSize(
|
||||||
left: 22,
|
duration: const Duration(milliseconds: 200),
|
||||||
right: 22,
|
child: Column(
|
||||||
bottom: 5,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
),
|
children: [
|
||||||
child: const Text('请选择举报的理由:'),
|
|
||||||
),
|
|
||||||
...options.entries.map<Widget>((title) {
|
|
||||||
return Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
if (title.key.isNotEmpty)
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 22),
|
padding: const EdgeInsets.only(
|
||||||
child: Text(
|
left: 22,
|
||||||
title.key,
|
right: 22,
|
||||||
style: TextStyle(
|
bottom: 5,
|
||||||
color:
|
|
||||||
Theme.of(context).colorScheme.outline),
|
|
||||||
),
|
),
|
||||||
|
child: const Text('请选择举报的理由:'),
|
||||||
),
|
),
|
||||||
Padding(
|
...options.entries.map<Widget>((title) {
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
return Column(
|
||||||
child: Wrap(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: title.value.entries.map((opt) {
|
children: [
|
||||||
return IntrinsicWidth(
|
if (title.key.isNotEmpty)
|
||||||
child: radioWidget<int>(
|
Padding(
|
||||||
value: opt.key,
|
padding: const EdgeInsets.only(left: 22),
|
||||||
groupValue: reasonType,
|
child: Text(
|
||||||
title: opt.value,
|
title.key,
|
||||||
padding: const EdgeInsets.only(right: 10),
|
style: TextStyle(
|
||||||
onChanged: (value) {
|
color: Theme.of(context)
|
||||||
reasonType = value;
|
.colorScheme
|
||||||
if (context.mounted) {
|
.outline),
|
||||||
(context as Element?)?.markNeedsBuild();
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 12),
|
||||||
|
child: Wrap(
|
||||||
|
children: title.value.entries.map((opt) {
|
||||||
|
return IntrinsicWidth(
|
||||||
|
child: radioWidget<int>(
|
||||||
|
value: opt.key,
|
||||||
|
groupValue: reasonType,
|
||||||
|
title: opt.value,
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
right: 10),
|
||||||
|
onChanged: (value) {
|
||||||
|
reasonType = value;
|
||||||
|
if (context.mounted) {
|
||||||
|
(context as Element?)
|
||||||
|
?.markNeedsBuild();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
if (reasonType == 0)
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
left: 22,
|
||||||
|
top: 5,
|
||||||
|
right: 22,
|
||||||
|
),
|
||||||
|
child: Form(
|
||||||
|
key: key,
|
||||||
|
child: TextFormField(
|
||||||
|
autofocus: true,
|
||||||
|
minLines: 4,
|
||||||
|
maxLines: 4,
|
||||||
|
initialValue: reasonDesc,
|
||||||
|
inputFormatters: [
|
||||||
|
LengthLimitingTextInputFormatter(60),
|
||||||
|
],
|
||||||
|
decoration: const InputDecoration(
|
||||||
|
labelText:
|
||||||
|
'为帮助审核人员更快处理,请补充问题类型和出现位置等详细信息',
|
||||||
|
border: OutlineInputBorder(),
|
||||||
|
contentPadding: EdgeInsets.all(10),
|
||||||
|
),
|
||||||
|
onChanged: (value) => reasonDesc = value,
|
||||||
|
validator: (value) {
|
||||||
|
if (value.isNullOrEmpty) {
|
||||||
|
return '理由不能为空';
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
),
|
||||||
}).toList(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
if (reasonType == 0)
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(
|
|
||||||
left: 22,
|
|
||||||
top: 5,
|
|
||||||
right: 22,
|
|
||||||
),
|
|
||||||
child: Form(
|
|
||||||
key: key,
|
|
||||||
child: TextFormField(
|
|
||||||
autofocus: true,
|
|
||||||
minLines: 4,
|
|
||||||
maxLines: 4,
|
|
||||||
initialValue: reasonDesc,
|
|
||||||
inputFormatters: [
|
|
||||||
LengthLimitingTextInputFormatter(60),
|
|
||||||
],
|
|
||||||
decoration: const InputDecoration(
|
|
||||||
labelText: '为帮助审核人员更快处理,请补充问题类型和出现位置等详细信息',
|
|
||||||
border: OutlineInputBorder(),
|
|
||||||
contentPadding: EdgeInsets.all(10),
|
|
||||||
),
|
|
||||||
onChanged: (value) => reasonDesc = value,
|
|
||||||
validator: (value) {
|
|
||||||
if (value.isNullOrEmpty) {
|
|
||||||
return '理由不能为空';
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
banUid = !banUid;
|
|
||||||
(context as Element?)?.markNeedsBuild();
|
|
||||||
},
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 18, top: 10),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Icon(
|
|
||||||
size: 22,
|
|
||||||
banUid
|
|
||||||
? Icons.check_box_outlined
|
|
||||||
: Icons.check_box_outline_blank,
|
|
||||||
color: banUid
|
|
||||||
? Theme.of(context).colorScheme.primary
|
|
||||||
: Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.onSurfaceVariant,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
' 拉黑该用户',
|
|
||||||
style: TextStyle(
|
|
||||||
color: banUid
|
|
||||||
? Theme.of(context).colorScheme.primary
|
|
||||||
: null,
|
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
banUid = !banUid;
|
||||||
|
(context as Element?)?.markNeedsBuild();
|
||||||
|
},
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 18, top: 10),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
size: 22,
|
||||||
|
banUid
|
||||||
|
? Icons.check_box_outlined
|
||||||
|
: Icons.check_box_outline_blank,
|
||||||
|
color: banUid
|
||||||
|
? Theme.of(context).colorScheme.primary
|
||||||
|
: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
' 拉黑该用户',
|
||||||
|
style: TextStyle(
|
||||||
|
color: banUid
|
||||||
|
? Theme.of(context).colorScheme.primary
|
||||||
|
: null,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -99,7 +99,6 @@ class HomeController extends GetxController with GetTickerProviderStateMixin {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
tabController.animation?.removeListener(() {});
|
|
||||||
tabController.dispose();
|
tabController.dispose();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -299,6 +299,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
|||||||
child: videoItem['staff'] == null
|
child: videoItem['staff'] == null
|
||||||
? GestureDetector(
|
? GestureDetector(
|
||||||
onTap: onPushMember,
|
onTap: onPushMember,
|
||||||
|
behavior: HitTestBehavior.opaque,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
|||||||
@@ -377,6 +377,21 @@ class _SendDanmakuPanelState extends CommonPublishPageState<SendDanmakuPanel> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Obx(
|
||||||
|
() => enablePublish.value
|
||||||
|
? iconButton(
|
||||||
|
context: context,
|
||||||
|
bgColor: Colors.transparent,
|
||||||
|
iconSize: 22,
|
||||||
|
iconColor: themeData.colorScheme.onSurfaceVariant,
|
||||||
|
onPressed: () {
|
||||||
|
editController.clear();
|
||||||
|
enablePublish.value = false;
|
||||||
|
},
|
||||||
|
icon: Icons.clear,
|
||||||
|
)
|
||||||
|
: const SizedBox.shrink(),
|
||||||
|
),
|
||||||
const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
Obx(
|
Obx(
|
||||||
() => iconButton(
|
() => iconButton(
|
||||||
|
|||||||
Reference in New Issue
Block a user