【问题标题】:I have created two 'raised buttons' but only one is showing. What is the problem here?我创建了两个“凸起的按钮”,但只有一个显示。这里有什么问题?
【发布时间】:2020-12-20 11:00:08
【问题描述】:

我在应用程序中总共制作了 14 个屏幕,您可以在下面我提供的链接的代码中看到。我创建了两个凸起的按钮,一个名为“Wonders of World”的按钮在按下时会将其带到第二个屏幕,另一个名为“Wonders of India”的按钮会将其带到第十一个屏幕。不幸的是,世界的第一个按钮奇迹是不可见的。为什么不显示? This is the image on running the app, you can see only one raised button visible.

The link of the code

【问题讨论】:

  • 我已经阅读了它,但我不知道我应该把定位的小部件放在哪里,在文本或凸起的按钮中?

标签: android-studio flutter flutter-layout flutter-design


【解决方案1】:

只需将两个按钮都包裹在 Row Like 中

Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                RaisedButton(
                  child: Text("Wonders of World"),
                  onPressed: (){
                    Navigator.push(context, MaterialPageRoute(builder: (context) => SplashUI()));
                  },
                  color: Colors.red,
                  textColor: Colors.yellow,
                  padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
                  splashColor: Colors.grey,
                ),
                RaisedButton(
                  child: Text("Wonders of India"),
                  onPressed: (){
                    Navigator.push(context, MaterialPageRoute(builder: (context) => EleventhScreen()));
                  },
                  color: Colors.red,
                  textColor: Colors.yellow,
                  padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
                  splashColor: Colors.grey,
                )
              ],
            ),

【讨论】:

  • 它的表现感谢您的反馈!声望低于 15 人的投票将被记录,但不会更改公开显示的帖子得分。
  • Vasav Chaturvedi 如果@Deepak Ror 回答对您有帮助,那么您应该投票或接受它
  • 当我点击点赞图标时,它会被点赞,但点赞又变为零,并出现一条消息“感谢您的反馈!声望低于 15 人的投票将被记录,但不会更改公开显示的帖子得分。'
  • 别担心@VasavChaturvedi,你已经尽力了。
猜你喜欢
  • 1970-01-01
  • 2019-01-21
  • 1970-01-01
  • 2018-08-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-09-30
  • 1970-01-01
相关资源
最近更新 更多