mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: 更多横屏适配
This commit is contained in:
@@ -4,8 +4,11 @@ import 'package:get/get.dart';
|
||||
import 'package:PiliPalaX/pages/member_dynamics/index.dart';
|
||||
import 'package:PiliPalaX/utils/utils.dart';
|
||||
|
||||
import '../../common/constants.dart';
|
||||
import '../../common/widgets/http_error.dart';
|
||||
import '../../utils/grid.dart';
|
||||
import '../dynamics/widgets/dynamic_panel.dart';
|
||||
import 'package:waterfall_flow/waterfall_flow.dart';
|
||||
|
||||
class MemberDynamicsPage extends StatefulWidget {
|
||||
const MemberDynamicsPage({super.key});
|
||||
@@ -70,14 +73,28 @@ class _MemberDynamicsPageState extends State<MemberDynamicsPage> {
|
||||
if (data['status']) {
|
||||
return Obx(
|
||||
() => list.isNotEmpty
|
||||
? SliverList(
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(context, index) {
|
||||
return DynamicPanel(item: list[index]);
|
||||
},
|
||||
childCount: list.length,
|
||||
),
|
||||
)
|
||||
? SliverWaterfallFlow.extent(
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
//cacheExtent: 0.0,
|
||||
crossAxisSpacing: StyleString.safeSpace,
|
||||
mainAxisSpacing: StyleString.safeSpace,
|
||||
|
||||
/// follow max child trailing layout offset and layout with full cross axis extend
|
||||
/// last child as loadmore item/no more item in [GridView] and [WaterfallFlow]
|
||||
/// with full cross axis extend
|
||||
// LastChildLayoutType.fullCrossAxisExtend,
|
||||
|
||||
/// as foot at trailing and layout with full cross axis extend
|
||||
/// show no more item at trailing when children are not full of viewport
|
||||
/// if children is full of viewport, it's the same as fullCrossAxisExtend
|
||||
// LastChildLayoutType.foot,
|
||||
lastChildLayoutTypeBuilder: (index) =>
|
||||
index == list.length
|
||||
? LastChildLayoutType.foot
|
||||
: LastChildLayoutType.none,
|
||||
children: [
|
||||
for (var i in list) DynamicPanel(item: i),
|
||||
])
|
||||
: const SliverToBoxAdapter(),
|
||||
);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user