简体   繁体   English

我正在尝试使用 Flutter 制作计算器应用程序的副本 UI,但我遇到了一些问题

[英]I am trying to make a replica UI of a calculator app using Flutter and I am stuck in a few things

I have been able to make a major part of the UI but few elements are still creating a problem for me.我已经能够制作 UI 的主要部分,但仍然很少有元素对我造成问题。

This is the screenshot of the original UI of the app.这是应用程序原始 UI 的屏幕截图。

Original Screenshot原始截图

And this is the screenshot of the UI that I have been able to make up till now using Flutter这是我到目前为止使用 Flutter 制作的 UI 截图

Screenshot of UI made with the help of flutter借助 flutter 制作的 UI 截图

Now can you please help me regarding how can I make that '=' container go to the extreme right just like in the original screenshot.现在你能帮我看看我怎样才能把那个“=”容器 go 放在最右边,就像在原始屏幕截图中一样。 And as well how should I align the first row on the same level as in the original UI.以及我应该如何将第一行对齐到与原始 UI 相同的级别。

This is the code that I have made for the container having all the digits.这是我为包含所有数字的容器制作的代码。

Expanded(
            child: Container(
              decoration: BoxDecoration(
                color: Color(0xFF212121),
                borderRadius: BorderRadius.only(topRight: Radius.circular(10.0), topLeft: Radius.circular(10.0)),
              ),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  Icon(Icons.remove, color: Colors.grey, size: 40.0,),
                  Buttons(
                    widget1: Text('AC', style: kNumber2TextStyle,),
                    widget2: Icon(Icons.backspace_outlined, size: 25.0, color: Colors.white,),
                    widget3: Text('%', style: kNumberTextStyle,),
                    widget4: Text('÷', style: kButton2TextStyle,),
                  ),
                  Buttons(
                    widget1: Text('7', style: kNumberTextStyle,),
                    widget2: Text('8', style: kNumberTextStyle,),
                    widget3: Text('9', style: kNumberTextStyle,),
                    widget4: Text('x', style: kButtonTextStyle,),
                  ),
                  Buttons(
                    widget1: Text('4', style: kNumberTextStyle,),
                    widget2: Text('5', style: kNumberTextStyle,),
                    widget3: Text('6', style: kNumberTextStyle,),
                    widget4: Text('-', style: kButton2TextStyle,),
                  ),
                  Buttons(
                    widget1: Text('1', style: kNumberTextStyle,),
                    widget2: Text('2', style: kNumberTextStyle,),
                    widget3: Text('3', style: kNumberTextStyle,),
                    widget4: Text('+', style: kButtonTextStyle,),
                  ),
                  Buttons(
                    widget1: Text('.', style: kNumberTextStyle,),
                    widget2: Text('0', style: kNumberTextStyle,),
                    widget3: Text('( )', style: kNumberTextStyle,),
                    widget4: Container(
                      padding: EdgeInsets.all(30.0),
                      color: Color(0xFFFFBE00),
                      child: Text('=', style: kNumberTextStyle,),
                    ),
                  ),
                ],
              ),
            ),
          )

Please help!请帮忙!

there are several ways to achieve this, as learning curve, I recommend you read how flexible / expanded works有几种方法可以实现这一点,作为学习曲线,我建议您阅读灵活/扩展的工作原理

Colum and inside it, rows, each row will contain the buttons, use flexible or expanded in order to occupy the entire row not matter the display.列和它里面的行,每一行都会包含按钮,使用灵活或展开以占据整行不管显示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我正在制作一个壁纸应用程序。 我被困在某个地方 - I am making an wallpaper app. And I am stuck somewhere 我正在尝试运行我的 flutter 应用程序,但出现这些错误? - I am trying to run my flutter app and I am getting these errors? 我是 flutter 的新手,我正在尝试创建此布局 - I am new to flutter and i am trying to create this layout 我正在尝试制作读取短信的android应用 - I am trying to make android app that read sms 我是编程新手。我正在尝试制作 android app soundrecoder - i am new in programming .i am trying to make android app soundrecoder 我正在尝试在 flutter 中使用地图功能 - i am trying to use map function in flutter 我无法在 android 上运行我的计算器应用程序 - I am having trouble with running my calculator app on android 我正在尝试使用phonegap在adt中运行一个Android应用程序 - I am trying to run an android app in adt using phonegap 我正在学习使用 android studio 制作应用程序,所以我正在制作一个简单的计算器,但是我遇到了一个问题,无法获得正确的答案 - I am learning to use android studio to make an app, so I am making a simple calculator, but I have run into a problem getting the correct answer 我正在尝试将数据从我的 flutter 应用程序保存到谷歌表格,但我收到格式异常 - i am trying to save data from my flutter app to google sheets ,but i get a format exception
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM