How to add cursor For PinFieldAutoFill flutter

912

Please enable cursor option in "sms_autofill" package, class constructer "PinInputTextField".

Sharing reference code

return PinInputTextField(
  pinLength: widget.codeLength,
  decoration: widget.decoration,
  cursor: Cursor(
    width: 2,
    height: 40,
    color: Colors.red,
    radius: Radius.circular(1),
    enabled: true,
  ),
Share:
912
Muzammil Dafedar
Author by

Muzammil Dafedar

Experienced Full Stack Engineer with a demonstrated history of working in the information technology and services industry. Skilled in Search Engine Optimization (SEO), PHP, CodeIgniter, Web Services API, Payment gateways, Front end technologies and Flutter. Strong engineering professional with a Bachelor of Engineering - BE focused in Computer Science from University Vishweshwaraya Technological University

Updated on December 27, 2022

Comments

  • Muzammil Dafedar
    Muzammil Dafedar over 1 year

    There is no cursor while entering OTP, How can add Cursor in pinFieldAutoFill. I am using the sms_autofill: ^1.2.5 package.

                                     PinFieldAutoFill(
                                            autofocus: true,
                                            keyboardType: TextInputType.number,
                                            decoration: UnderlineDecoration(
                                              textStyle: TextStyle(
                                                  fontSize: 44.sp,
                                                  fontWeight: FontWeight.bold,
                                                  color: kDarkBlue),
                                              colorBuilder: FixedColorBuilder(
                                                  Colors.grey),
                                            ),
                                            currentCode: authService
                                                .loginMobileOTP, // prefill with a code
                                            onCodeSubmitted: (_) async {
                                              authService.login(
                                                  context, _scaffoldKey);
                                            },
                                            onCodeChanged: (value) {
                                              authService.loginMobileOTP =
                                                  value;
                                            },
                                            codeLength:
                                                6 //code length, default 6
                                            ),
    
    • Rajesh M P
      Rajesh M P about 3 years
      Is this issue get resolved? looking for a similar solution.