opt: member page

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2024-11-20 15:58:11 +08:00
parent 5b02ca44f8
commit 67fc1b7d08
5 changed files with 432 additions and 358 deletions

View File

@@ -95,6 +95,7 @@ class _DynamicSliverAppBarState extends State<DynamicSliverAppBar> {
// As long as the height is 0 instead of the sliver app bar a sliver to box adapter will be used
// to calculate dynamically the size for the sliver app bar
double _height = 0;
Orientation? _orientation;
@override
void initState() {
@@ -105,6 +106,7 @@ class _DynamicSliverAppBarState extends State<DynamicSliverAppBar> {
@override
void didUpdateWidget(covariant DynamicSliverAppBar oldWidget) {
super.didUpdateWidget(oldWidget);
_updateHeight();
}
@@ -124,6 +126,11 @@ class _DynamicSliverAppBarState extends State<DynamicSliverAppBar> {
@override
Widget build(BuildContext context) {
//Needed to lay out the flexibleSpace the first time, so we can calculate its intrinsic height
Orientation orientation = MediaQuery.orientationOf(context);
if (_orientation != orientation) {
_orientation = orientation;
_height = 0;
}
if (_height == 0) {
return SliverToBoxAdapter(
child: Stack(

View File

@@ -50,7 +50,8 @@ class VideoCardH extends StatelessWidget {
excludeSemantics: true,
customSemanticsActions: <CustomSemanticsAction, void Function()>{
for (var item in actions)
CustomSemanticsAction(label: item.title): item.onTap!,
CustomSemanticsAction(
label: item.title.isEmpty ? 'label' : item.title): item.onTap!,
},
child: InkWell(
borderRadius: BorderRadius.circular(12),

View File

@@ -24,19 +24,20 @@ class VideoCustomActions {
late List<VideoCustomAction> actions;
VideoCustomActions(this.videoItem, this.context) {
actions = [
VideoCustomAction(
videoItem.bvid,
'copy',
Stack(
children: [
Icon(MdiIcons.identifier, size: 16),
Icon(MdiIcons.circleOutline, size: 16),
],
if ((videoItem.bvid as String?)?.isNotEmpty == true)
VideoCustomAction(
videoItem.bvid,
'copy',
Stack(
children: [
Icon(MdiIcons.identifier, size: 16),
Icon(MdiIcons.circleOutline, size: 16),
],
),
() {
Utils.copyText(videoItem.bvid);
},
),
() {
Utils.copyText(videoItem.bvid);
},
),
VideoCustomAction(
'稍后再看',
'pause',