OTP页面颤动

OTP page in flutter

如何在 flutter 中制作这样的 otp 页面,请帮助我并分享特定照片的完整代码谢谢

在pubspec.yaml

中添加以下包
otp_text_field:
  git:
    url: https://github.com/AkashMore7427/OTPTextField

在您的 dart 文件中添加以下导入行

import 'package:otp_text_field/otp_field.dart';
import 'package:otp_text_field/otp_field_style.dart';
import 'package:otp_text_field/style.dart';

将以下代码添加到您的正文中

Column(children: [
    // Image.network("Add Image Link"),
    Text(
      "Enter verification Code",
    ),
    Text(
      "Code sent to info@gmail.com",
    ),
    OTPTextField(
        length: 4,
        width: MediaQuery.of(context).size.width,
        fieldWidth: 50,
        style: TextStyle(fontSize: 17),
        textFieldAlignment: MainAxisAlignment.spaceAround,
        onCompleted: (pin) {
          print("Completed: " + pin);
        },
        otpFieldStyle: OtpFieldStyle(
          borderColor: Colors.black,
        )),

    Text("Resend in 0:45"),
    //Add Button Widget Here
  ]),