From 5bc84efff2a8b34553ae4b6d8d27b7419970d017 Mon Sep 17 00:00:00 2001 From: wuqifeng <540416539@qq.com> Date: Thu, 8 Oct 2026 22:51:45 +0800 Subject: [PATCH] Revert "feat: 优化视频专区列表布局与沉浸体验" --- lib/pages/video/zone/video_zone_page.dart | 57 +++++++++------------------------------------------------ 1 file changed, 9 insertions(+), 48 deletions(-) diff --git a/lib/pages/video/zone/video_zone_page.dart b/lib/pages/video/zone/video_zone_page.dart index d802dae..68a07f2 100644 --- a/lib/pages/video/zone/video_zone_page.dart +++ b/lib/pages/video/zone/video_zone_page.dart @@ -1,8 +1,5 @@ -import 'dart:async'; - import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:wow_english/common/dialogs/show_dialog.dart'; import 'package:wow_english/common/request/dao/video_dao.dart'; @@ -24,20 +21,9 @@ class _VideoZonePageState extends State { @override void initState() { super.initState(); - unawaited( - SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky), - ); _itemsFuture = VideoDao.list(); } - @override - void dispose() { - unawaited( - SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky), - ); - super.dispose(); - } - void _reload() { setState(() { _itemsFuture = VideoDao.list(); @@ -46,10 +32,7 @@ class _VideoZonePageState extends State { @override Widget build(BuildContext context) { - return MediaQuery.removePadding( - context: context, - removeTop: true, - child: Scaffold( + return Scaffold( backgroundColor: Colors.white, appBar: const WEAppBar( titleText: '视频专区', @@ -81,34 +64,20 @@ class _VideoZonePageState extends State { }, child: LayoutBuilder( builder: (context, constraints) { - final horizontalPadding = 30.w; - final crossAxisSpacing = 12.w; final titleStyle = _VideoCard.createTitleStyle(context); - final titlePainter = TextPainter( - text: TextSpan(text: '视频标题', style: titleStyle), - maxLines: 1, - textDirection: Directionality.of(context), - textScaler: MediaQuery.textScalerOf(context), - )..layout(); - final cardWidth = (constraints.maxWidth - - horizontalPadding * 2 - - crossAxisSpacing * 2) / - 3; - final cardHeight = - cardWidth * 9 / 16 + 5.h + titlePainter.height; return GridView.builder( physics: const AlwaysScrollableScrollPhysics(), padding: EdgeInsets.fromLTRB( - horizontalPadding, + 14.w, 10.h, - horizontalPadding, + 14.w, 16.h, ), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 3, + crossAxisCount: 4, mainAxisSpacing: 14.h, - crossAxisSpacing: crossAxisSpacing, - mainAxisExtent: cardHeight, + crossAxisSpacing: 12.w, + childAspectRatio: 1.55, ), itemCount: items.length, itemBuilder: (context, index) => _VideoCard( @@ -122,8 +91,7 @@ class _VideoZonePageState extends State { ); }, ), - ), - ); + ); } void _openVideo(List items, int index) { @@ -144,13 +112,7 @@ class _VideoZonePageState extends State { .toList(), 'initialVideoId': item.id, }, - ).then((_) { - if (!mounted) return; - unawaited( - SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky), - ); - _reload(); - }); + ).then((_) => _reload()); } } @@ -203,8 +165,7 @@ class _VideoCard extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - AspectRatio( - aspectRatio: 16 / 9, + Expanded( child: ClipRRect( borderRadius: BorderRadius.circular(12.r), child: CachedNetworkImage( -- libgit2 0.22.2