mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 00:28:18 +08:00
31
lib/common/widgets/extra_hit_test_widget.dart
Normal file
31
lib/common/widgets/extra_hit_test_widget.dart
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
import 'package:flutter/rendering.dart';
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
|
class ExtraHitTestWidget extends SingleChildRenderObjectWidget {
|
||||||
|
const ExtraHitTestWidget({
|
||||||
|
super.key,
|
||||||
|
required this.width,
|
||||||
|
required Widget super.child,
|
||||||
|
});
|
||||||
|
|
||||||
|
final double width;
|
||||||
|
|
||||||
|
@override
|
||||||
|
RenderObject createRenderObject(BuildContext context) {
|
||||||
|
return RenderExtraHitTestWidget(width: width);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class RenderExtraHitTestWidget extends RenderProxyBox {
|
||||||
|
RenderExtraHitTestWidget({
|
||||||
|
required double width,
|
||||||
|
}) : _width = width;
|
||||||
|
|
||||||
|
final double _width;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool hitTestChildren(BoxHitTestResult result, {required Offset position}) {
|
||||||
|
return super.hitTestChildren(result, position: position) ||
|
||||||
|
position.dx <= _width;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -53,7 +53,7 @@ class SuperChatItem {
|
|||||||
'ts': 0,
|
'ts': 0,
|
||||||
'uinfo': {
|
'uinfo': {
|
||||||
'medal': {
|
'medal': {
|
||||||
"name": "MedalName",
|
"name": "Medal",
|
||||||
"level": Utils.random.nextInt(40),
|
"level": Utils.random.nextInt(40),
|
||||||
"id": 123,
|
"id": 123,
|
||||||
"ruid": 456,
|
"ruid": 456,
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'dart:math';
|
|||||||
import 'package:PiliPlus/common/assets.dart';
|
import 'package:PiliPlus/common/assets.dart';
|
||||||
import 'package:PiliPlus/common/style.dart';
|
import 'package:PiliPlus/common/style.dart';
|
||||||
import 'package:PiliPlus/common/widgets/dialog/report.dart';
|
import 'package:PiliPlus/common/widgets/dialog/report.dart';
|
||||||
|
import 'package:PiliPlus/common/widgets/extra_hit_test_widget.dart';
|
||||||
import 'package:PiliPlus/common/widgets/pendant_avatar.dart';
|
import 'package:PiliPlus/common/widgets/pendant_avatar.dart';
|
||||||
import 'package:PiliPlus/http/constants.dart';
|
import 'package:PiliPlus/http/constants.dart';
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
@@ -98,6 +99,8 @@ class AuthorPanel extends StatelessWidget {
|
|||||||
Get.toNamed('/member?mid=${moduleAuthor.mid}');
|
Get.toNamed('/member?mid=${moduleAuthor.mid}');
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
|
child: ExtraHitTestWidget(
|
||||||
|
width: 50,
|
||||||
child: Row(
|
child: Row(
|
||||||
spacing: 10,
|
spacing: 10,
|
||||||
children: [
|
children: [
|
||||||
@@ -130,6 +133,7 @@ class AuthorPanel extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
Widget? moreBtn = isSave
|
Widget? moreBtn = isSave
|
||||||
? null
|
? null
|
||||||
|
|||||||
@@ -153,11 +153,11 @@ class _SuperChatCardState extends State<SuperChatCard> {
|
|||||||
name = Row(
|
name = Row(
|
||||||
spacing: 5,
|
spacing: 5,
|
||||||
children: [
|
children: [
|
||||||
Flexible(child: name),
|
|
||||||
MedalWidget.fromMedalInfo(
|
MedalWidget.fromMedalInfo(
|
||||||
medal: medal,
|
medal: medal,
|
||||||
padding: MedalWidget.mediumPadding,
|
padding: MedalWidget.mediumPadding,
|
||||||
),
|
),
|
||||||
|
Flexible(child: name),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import 'package:PiliPlus/common/constants.dart';
|
|||||||
import 'package:PiliPlus/common/style.dart';
|
import 'package:PiliPlus/common/style.dart';
|
||||||
import 'package:PiliPlus/common/widgets/badge.dart';
|
import 'package:PiliPlus/common/widgets/badge.dart';
|
||||||
import 'package:PiliPlus/common/widgets/dialog/report.dart';
|
import 'package:PiliPlus/common/widgets/dialog/report.dart';
|
||||||
|
import 'package:PiliPlus/common/widgets/extra_hit_test_widget.dart';
|
||||||
import 'package:PiliPlus/common/widgets/flutter/text/text.dart' as custom_text;
|
import 'package:PiliPlus/common/widgets/flutter/text/text.dart' as custom_text;
|
||||||
import 'package:PiliPlus/common/widgets/gesture/tap_gesture_recognizer.dart';
|
import 'package:PiliPlus/common/widgets/gesture/tap_gesture_recognizer.dart';
|
||||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||||
@@ -139,6 +140,8 @@ class ReplyItemGrpc extends StatelessWidget {
|
|||||||
feedBack();
|
feedBack();
|
||||||
Get.toNamed('/member?mid=${replyItem.mid}');
|
Get.toNamed('/member?mid=${replyItem.mid}');
|
||||||
},
|
},
|
||||||
|
child: ExtraHitTestWidget(
|
||||||
|
width: 46,
|
||||||
child: Row(
|
child: Row(
|
||||||
crossAxisAlignment: .center,
|
crossAxisAlignment: .center,
|
||||||
spacing: 12,
|
spacing: 12,
|
||||||
@@ -200,7 +203,10 @@ class ReplyItemGrpc extends StatelessWidget {
|
|||||||
nameColor: DmUtils.decimalToColor(
|
nameColor: DmUtils.decimalToColor(
|
||||||
member.fansMedalColorName.toInt(),
|
member.fansMedalColorName.toInt(),
|
||||||
),
|
),
|
||||||
padding: const .symmetric(horizontal: 6, vertical: 1.5),
|
padding: const .symmetric(
|
||||||
|
horizontal: 6,
|
||||||
|
vertical: 1.5,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -213,7 +219,9 @@ class ReplyItemGrpc extends StatelessWidget {
|
|||||||
replyItem.ctime.toInt(),
|
replyItem.ctime.toInt(),
|
||||||
format: DateFormatUtils.longFormatDs,
|
format: DateFormatUtils.longFormatDs,
|
||||||
)
|
)
|
||||||
: DateFormatUtils.dateFormat(replyItem.ctime.toInt()),
|
: DateFormatUtils.dateFormat(
|
||||||
|
replyItem.ctime.toInt(),
|
||||||
|
),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: theme.textTheme.labelSmall!.fontSize,
|
fontSize: theme.textTheme.labelSmall!.fontSize,
|
||||||
color: theme.colorScheme.outline,
|
color: theme.colorScheme.outline,
|
||||||
@@ -234,6 +242,7 @@ class ReplyItemGrpc extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
if (PendantAvatar.showDecorate) {
|
if (PendantAvatar.showDecorate) {
|
||||||
final garb = replyItem.memberV2.garb;
|
final garb = replyItem.memberV2.garb;
|
||||||
|
|||||||
Reference in New Issue
Block a user