堆栈中的颤振位置行

时间:2020-10-04 08:02:53

标签: flutter dart

我想创建一个带有一堆定位行的堆栈,它适用于第二行。 我可以通过定位的小部件来定位行。但这不适用于第三个。我无法控制位置。它只是停留在堆栈中。在堆栈中可以使用的位置限制的小部件是否有限制。

我该如何解决? 谢谢您的帮助

                        Stack(
                            children: [
                              Positioned(
                                top: 0,
                                right: 8,
                                child: Row(
                                  children: [
                                    SizedBox(width: 18),
                                    Text(
                                      "0:00",
                                      style: TextStyle(color: Colors.white),
                                    ),
                                    SizedBox(
                                      width: 15,
                                    ),
                                    SizedBox(
                                      height: 6,
                                      width: 300,
                                      child: RaisedButton(
                                          elevation: 0,
                                          color: Colors.grey,
                                          splashColor: Colors.grey,
                                          highlightColor: Colors.grey,
                                          highlightElevation: 0,
                                          onPressed: () {
                                            //hh
                                          },
                                          shape: RoundedRectangleBorder(
                                            borderRadius:
                                                BorderRadius.circular(0.5),
                                          )),
                                    ),
                                  ],
                                ),
                              ),
                              SizedBox(height: 43),
                              Positioned(
                                top: 30,
                                right: 8,
                                child: Row( 
                                  children: [
                                    SizedBox(width: 18),
                                    Text(
                                      "1:00",
                                      style: TextStyle(color: Colors.white),
                                    ),
                                    SizedBox(
                                      width: 15,
                                    ),
                                    SizedBox(
                                      height: 6,
                                      width: 300,
                                      child: RaisedButton(
                                          elevation: 0,
                                          color: Colors.grey,
                                          splashColor: Colors.grey,
                                          highlightColor: Colors.grey,
                                          highlightElevation: 0,
                                          onLongPress: () {
                                            print("f");
                                          },
                                          onPressed: () {
                                            //hh
                                          },
                                          shape: RoundedRectangleBorder(
                                            borderRadius:
                                                BorderRadius.circular(0.5),
                                          )),
                                    )
                                  ],
                                ),
                              ),
                              SizedBox(height: 60),
                                 Positioned(top: 60,right: 8,
                                   child:
                                 Row(
                                  children: [
                                    SizedBox(width: 18),
                                    Text(
                                      "2:00",
                                      style: TextStyle(color: Colors.white),
                                    ),
                                    SizedBox(
                                      width: 15,
                                    ),
                                    SizedBox(
                                      height: 6,
                                      width: 300,
                                      child: RaisedButton(
                                          elevation: 0,
                                          color: Colors.grey,
                                          splashColor: Colors.grey,
                                          highlightColor: Colors.grey,
                                          highlightElevation: 0,
                                          onPressed: () {
                                            //hh
                                          },
                                          shape: RoundedRectangleBorder(
                                            borderRadius:
                                                BorderRadius.circular(0.5),
                                          )),
                                    )
                                  ],
                                ),),

0 个答案:

没有答案