Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed assertion: line 69 pos 15: 'color != null': is not true. #1

Closed
isaacdarcilla opened this issue Aug 20, 2020 · 2 comments
Closed

Comments

@isaacdarcilla
Copy link

import 'package:flutter/material.dart';
import 'package:flutter_otp_text_field/flutter_otp_text_field.dart';

class OtpScreen extends StatefulWidget {
@OverRide
_OtpState createState() => _OtpState();
}

class _OtpState extends State {
@OverRide
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
// leading: IconButton(
// icon: Icon(
// Icons.keyboard_backspace,
// ),
// onPressed: ()=>Navigator.pop(context),
// ),
centerTitle: true,
title: Text(
"OTP",
),
elevation: 0.0,
),

  body: Container(
    child: Padding(
      padding: EdgeInsets.all(8.0),
      child: OtpTextField(
        numberOfFields: 5,
        borderColor: Color(0xFF512DA8),
        showFieldAsBox: true,
        onCodeChanged: (String value) {

        },
        onSubmit: (String verificationCode){
          //navigate to different screen code goes here
          showDialog(
              context: context,
              builder: (context){
                return AlertDialog(
                  title: Text("Verification Code"),
                  content: Text('Code entered is $verificationCode'),
                );
              }
          );
        }, // end onSubmit
      ), // end PinEntryTextField()
    ), // end Padding()
  ), 
);

}
}

My code

@Hasilt
Copy link

Hasilt commented Aug 28, 2020

In my case giving enabledBorderColor a color value solved the issue.

@david-legend
Copy link
Owner

looks like I should provide a default value for enabledBorderColor - will do that and update the package. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants