【问题标题】:flutter : data to go over the curve parts when I scroll颤振:当我滚动时要遍历曲线部分的数据
【发布时间】:2022-01-08 22:26:12
【问题描述】:

我发布了两张图片,第一张看起来不错,但是当我滚动数据时,我的用户界面变得一团糟(第二张图片)

我希望它在滚动时位于曲线部分下方。

怎么做

这是我的代码

return Scaffold(
      backgroundColor: appGreenColor,
      appBar: new AppBar(
        centerTitle: false,
        backgroundColor: appGreenColor,
        elevation: 0,
        title: Padding(
          padding: const EdgeInsets.only(left: 16.0),
          child: Image.asset(
            "lib/Assets/bellazIcon.png",
            fit: BoxFit.fill,
            height: 40,
            width: 78,
          ),
        ),
        actions: [
          Padding(
            padding: const EdgeInsets.only(right: 8.0),
            child: IconButton(
                icon: Image.asset(
                  "lib/Assets/notification1.png",
                  height: 22,
                  width: 22,
                ),
                onPressed: () {
                  Navigator.push(
                      context,
                      MaterialPageRoute(
                          builder: (context) => NotificationList()));
                }),
          )
        ],
      ),
      body: Container(
        height: MediaQuery.of(context).size.height - 70,
        decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.only(
                topLeft: Radius.circular(30), topRight: Radius.circular(30))),
        child: SingleChildScrollView(
          child: Column(
            children: [
              Padding(
                padding: const EdgeInsets.symmetric(horizontal: 3),
                child: Column(
                  children: [
                    locationView(),
                    imageSlider(),
                    genderView(),
                    categories(),
                    isMan == true
                        ? maleTopBranches.length == 0
                            ? Container()
                            : topRatedSalons(maleTopBranches)
                        : topRatedSalons(femaleTopBranches),
                  ],
                ),
              ),
              offerImage(),
              Padding(
                padding: const EdgeInsets.symmetric(horizontal: 2.0),
                child: Column(
                  children: [
                    services(),
                    nearByAppointment(),
                  ],
                ),
              ),
              infoImage()
            ],
          ),
        ),
      ),
    );

在我不滚动之前,这张图片看起来很好

但是当我滚动图像时,我的数据会出现在该曲线上

这个答案对我有用 添加:clipBehavior:Clip.hardEdge

Container(
   clipBehavior: Clip.hardEdge,
   height: MediaQuery.of(context).size.height - 70,
   decoration: const BoxDecoration(
   color: Colors.white,
   borderRadius: BorderRadius.only(topLeft: Radius.circular(30), 
                     topRight: Radius.circular(30))),
           child: ...,
         ),)

【问题讨论】:

    标签: flutter flutter-layout flutter-dependencies flutter-web flutter-animation


    【解决方案1】:

    尝试添加:clipBehavior: Clip.hardEdge

    Container(
       clipBehavior: Clip.hardEdge,
       height: MediaQuery.of(context).size.height - 70,
       decoration: const BoxDecoration(
       color: Colors.white,
       borderRadius: BorderRadius.only(topLeft: Radius.circular(30), 
                         topRight: Radius.circular(30))),
               child: ...,
             ),)
    

    【讨论】:

      猜你喜欢
      • 2021-10-13
      • 2019-11-05
      • 1970-01-01
      • 2019-05-23
      • 2019-11-11
      • 2020-02-19
      • 2018-08-14
      • 2021-12-22
      • 1970-01-01
      相关资源
      最近更新 更多