小编roe*_*ias的帖子

Flutter 在换行小部件内垂直对齐文本

我正在编写一个颤振应用程序,该应用程序应该有一行包含图标和文本的行,但由于某种原因,我无法将文本与图标垂直放在同一行。我的意思是我想要一个图标,而不是在同一行中有一个文本,但文本比图标高一点。有人知道我该如何解决它吗?(我需要有一行,因为我想在行中放入更多的东西)。

我的代码:

              Column(
                children: [
                  Container(
                    height: size.height * .04,
                    color: NotificationColor,
                    child: Row(
                      children: [
                        Wrap(
                          spacing: size.width * .040,
                          children: [
                            const Icon(CupertinoIcons.bell),
                            Text(
                              "Notification", // this is the text that is higher then the icon
                              style: TextStyle(
                                fontSize: size.width * .035,
                              ),
                            ),
                          ],
                        ),
                      ],
                    ),
                  ),
                  SizedBox(height: size.height * .01),
                  Container(),
                  SizedBox(height: size.height * .01),
                  Container(),
                ],
              ),
Run Code Online (Sandbox Code Playgroud)

dart flutter

2
推荐指数
1
解决办法
2713
查看次数

使用 firebase 和 flutter 进行电话身份验证

我正在编写一个使用电话身份验证的 flutter 应用程序。我目前正在 iPhone 12 模拟器上运行该应用程序,当我测试该应用程序并实现电话号码时,我没有按计划从 firebase 收到 6 位数代码。我认为是因为其中提到的一个引起了共鸣。

    1. Firebase 无法使用假号码将代码发送到模拟器。
    1. 我需要更改 firebase/flutter 项目的一些设置,以便它能够按预期工作。
    1. 我还需要发送带有区号的电话号码。
    1. 我的代码是错误的或者没有做我想要它做的事情。

(我还没有苹果开发者帐户,所以我给了 firebase 一个测试号码和代码,这样当我输入假号码时,我仍然可以将代码发送到应用程序(不是作为推送通知))。

该应用程序的一些要点:

如果需要的话,我可以在真实设备上测试该应用程序。
我现在不需要获取推送通知,我只需将验证码打印到控制台,这样我就会看到代码是否有效。
我想在将电话号码发送到此页面(验证页面)后立即开始验证过程,
现在我使用的是不带区号的完整号码。

我可以为模拟器使用假号码吗?或者我需要一个真正的?

谢谢您,希望您能帮助解决我的问题。

这是我的代码(仅验证部分):

// imports are here

enum Status { waiting, error }

class VerificationCode extends StatefulWidget {
  const VerificationCode({Key? key, this.number}) : super(key: key);
  final number;
  @override
  _VerificationCodeState createState() => _VerificationCodeState(number);
}

class _VerificationCodeState extends State<VerificationCode> {
  late final phoneNumber;
  final _verKey = GlobalKey<FormState>();
  late String _verCode;
  late double _formHeight;
  final FirebaseAuth _auth = …
Run Code Online (Sandbox Code Playgroud)

ios-simulator dart firebase firebase-authentication flutter

1
推荐指数
1
解决办法
4184
查看次数