浏览代码

[new]调整首页抽屉显示问题

zk 6 月之前
父节点
当前提交
b6cbf0c2c4
共有 1 个文件被更改,包括 17 次插入8 次删除
  1. 17 8
      lib/module/main/main_page.dart

+ 17 - 8
lib/module/main/main_page.dart

@@ -68,15 +68,26 @@ class MainPage extends BasePage<MainController> {
       shadowColor: Colors.black.withOpacity(0.1),
       cornerRadius: 18.w,
       snapSpec: SnapSpec(
-        initialSnap: 1,
+        initialSnap: SnapSpec.headerFooterSnap,
         // Enable snapping. This is true by default.
         snap: true,
         // Set custom snapping points.
-        snappings: [SnapSpec.headerFooterSnap, 1.0],
+        snappings: [SnapSpec.headerFooterSnap, SnapSpec.expanded],
         // Define to what the snappings relate to. In this case,
         // the total available space that the sheet can expand to.
         positioning: SnapPositioning.relativeToAvailableSpace,
       ),
+      // headerBuilder: (context, state) {
+      //   return Container(
+      //     height: 56,
+      //     width: double.infinity,
+      //     color: Colors.green,
+      //     alignment: Alignment.center,
+      //     child: Text(
+      //       'This is the header',
+      //     ),
+      //   );
+      // },
       footerBuilder: buildFooterBuilder,
       headerBuilder: buildHeaderBuilder,
       builder: buildTrackEntranceBuilder,
@@ -225,7 +236,9 @@ class MainPage extends BasePage<MainController> {
     return Obx(() {
       UserInfo? userInfo = controller.selectedFriend;
       if (userInfo == null) {
-        return SizedBox.shrink();
+        return SizedBox(
+          height: 86.w,
+        );
       }
       return mainSelectedFriendItem(
           userInfo,
@@ -277,11 +290,7 @@ class MainPage extends BasePage<MainController> {
           ),
           SizedBox(height: 12.w),
           buildSelectFriendInfoView(),
-          Obx(() {
-            return Visibility(
-                visible: controller.selectedFriend != null,
-                child: SizedBox(height: 13.w));
-          }),
+          SizedBox(height: 13.w)
         ],
       ),
     );