如何在Flutter中删除堆栈中的小部件的内部边框?

时间:2020-08-22 07:39:24

标签: flutter flutter-layout

Goal

Example

我不会在堆栈中获得两个容器的轮廓边框,一个容器的位置如图所示。我的目标是删除“红色”部分。

如何在Flutter中完成此操作?

def function(selector,name ,driver) :
df = pd.DataFrame()
try:
    data = {}

    result = WebDriverWait(driver, 1).until(EC.visibility_of_element_located((By.CSS_SELECTOR, selector))).text
    print(name , result)
    data.update( {name : result} )


except Exception as e:
    data.update( {name : " "} )
finally :
    df = df.append(data,ignore_index= True)
return df

df=function(".home span" , "team1_name",driver )
df=function(".away span" , "team2_name",driver )
df=function(".home strong+ strong" , "team1_position",driver )
df=function(".away strong+ strong" , "team2_position",driver )

1 个答案:

答案 0 :(得分:1)

如果我正确理解了您的问题,那么这对您有用!

Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Stack Example'),
      ),
      body: Center(
        child: Stack(
          overflow: Overflow.visible,
          children: [
            Container(
              width: 200,
              height: 200,
              decoration: BoxDecoration(
                color: Colors.grey.withOpacity(0.2),
                border: Border.all(),
              ),
              child: const Center(child: Text("BLABLABLA")),
            ),
            Positioned(
              top: -10,
              left: 10,
              child: Container(
                width: 150,
                height: 25,
                decoration: BoxDecoration(
                  color: Colors.white,
                ),
                child: Stack(children: [
                  Container(
                      width: double.infinity,
                      decoration: BoxDecoration(
                        border: Border(
                          top: BorderSide(color: Colors.black),
                          left: BorderSide(color: Colors.black),
                          right: BorderSide(color: Colors.black),
                        ),
                      ),
                      height: 11),
                  Center(
                    child: Text("BLABLABL2"),
                  ),
                ],
               ),
              ),
            ),
          ],
        ),
      ),
    );
  }

输出将类似于

enter image description here