簡體   English   中英

顫振中的彎曲半徑按鈕

[英]Curved radius button in flutter

我試圖在顫動中創建一個彎曲的按鈕。 但是對我而言,borderRadius標簽不起作用。 這是我的代碼

    //Login Button
    final loginButton = Padding(
      padding: EdgeInsets.symmetric(vertical: 16.0),
      child: Material(
        borderRadius: BorderRadius.circular(30.0),
        shadowColor: Colors.lightBlueAccent.shade100,
        elevation: 5.0,
        child: MaterialButton(
          minWidth: 200.0,
          height: 42.0,
          onPressed: () {
//            Navigator.of(context).pushNamed(HomePage.tag);
          },
          color: Colors.lightBlueAccent,
          child: Text('Log In', style: TextStyle(color: Colors.white)),
        ),
      ),
    );

我不會在這方面犯錯。

    //Login Button
    final loginButton = Padding(
      padding: EdgeInsets.symmetric(vertical: 16.0),
      child: Material(
        borderRadius: BorderRadius.circular(30.0),
        shadowColor: Colors.lightBlueAccent.shade100,
        elevation: 5.0,
        Colors.lightBlueAccent,
        child: MaterialButton(
          minWidth: 200.0,
          height: 42.0,
          onPressed: () {
//            Navigator.of(context).pushNamed(HomePage.tag);
          },

          child: Text('Log In', style: TextStyle(color: Colors.white)),
        ),
      ),
    );

嘗試上面的代碼,我將顏色標簽從MaterialButton上移到了Material小部件中。 我已經對其進行了測試,並且可以在Flutter dev v0.7.1中正常運行。 除非您解釋一下它不起作用以及期望它如何工作的意思,否則我將無濟於事。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM