在颤振中溢出一排凸起的丁香

时间:2019-08-09 10:23:25

标签: flutter

您好,我只尝试为一周中的每一天创建圆形按钮。为此,我使用了Raisedbutton和CircleBorder形状,但是当我有4个以上的凸起按钮时,我就溢出了,好像在升高按钮中隐藏了填充...

 new Row (

        children: <Widget>[
      RaisedButton(
                  hoverElevation:5,
                  textColor: Colors.black,
                  color: Colors.white,
                  child:   Text(("Lu"), style: TextStyle(color: Colors.black, fontWeight: FontWeight.w600, fontSize: 15.0)),
                  onPressed: ()
                  {

                  },
                  shape: new CircleBorder(
                  )
              ),

 RaisedButton(),

 RaisedButton(),

 RaisedButton(),

 RaisedButton....
]
)

2 个答案:

答案 0 :(得分:1)

对于一行,您可以使用SingleChildScrollView小部件进行滚动

Intent intent = new Intent(this, appstartreceiver.class);
PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 99, intent, PendingIntent.FLAG_UPDATE_CURRENT);
    AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);

    Calendar calendar = Calendar.getInstance();
    calendar.set(Calendar.HOUR_OF_DAY, 8);
    calendar.set(Calendar.MINUTE, 0);
    calendar.set(Calendar.SECOND, 0);

    long startUpTime = calendar.getTimeInMillis();

    // To avoid firing the alarm if the time is passed while setting
    if (System.currentTimeMillis() > startUpTime) {
        startUpTime = startUpTime + 24 * 60 * 60 * 1000;
    }

    alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, startUpTime, 24 * 60 * 60 * 1000, pendingIntent);

或者您只需将Wrap小部件用于多行

SingleChildScrollView(
            scrollDirection: Axis.horizontal,
            child: Row(children: <Widget>[
              RaisedButton(
                  hoverElevation: 5,
                  textColor: Colors.black,
                  color: Colors.white,
                  child: Text(("Lu"),
                      style: TextStyle(
                          color: Colors.black,
                          fontWeight: FontWeight.w600,
                          fontSize: 15.0)),
                  onPressed: () {},
                  shape: new CircleBorder()),
              RaisedButton(
                  hoverElevation: 5,
                  textColor: Colors.black,
                  color: Colors.white,
                  child: Text(("Lu"),
                      style: TextStyle(
                          color: Colors.black,
                          fontWeight: FontWeight.w600,
                          fontSize: 15.0)),
                  onPressed: () {},
                  shape: new CircleBorder()),
              RaisedButton(),
              RaisedButton(),
              RaisedButton(),
              RaisedButton(),
            ]),
          )

答案 1 :(得分:0)

我找到了这个解决方案

我可以使用此解决方案自定义填充

{
"timestamp" : "",
"fruit" : {
    "name" : "orange",
    "translations" : [
        { 
            "en-GB" : "orange" 
        },
        {
            "sv-SE" : "apelsin"
        },
        ....
    ]
}

....