RomanBase / code_field

Widget providing input code field to insert pin, sms and other auth codes.
https://pub.dev/packages/code_field
MIT License
5 stars 8 forks source link

Unable to delete 1st item of the list. #4

Open ricbermo opened 3 years ago

ricbermo commented 3 years ago

Given the following code

class CodeInput extends StatelessWidget {
  final codeControl = InputCodeControl(
    inputRegex: '^[0-9]',
  );

  final Function onDone;
  CodeInput({this.onDone}) {
    codeControl.done(_executeDone);
  }

  void _executeDone() {
    onDone(codeControl.value);
  }

  @override
  Widget build(BuildContext context) {
    final h5 = Theme.of(context).textTheme.headline5;
    final textTheme = h5.copyWith(
      color: kTextColor,
    );

    return InputCodeField(
      autofocus: true,
      control: codeControl,
      count: 4,
      spacing: 16,
      decoration: InputCodeDecoration(
        width: 74,
        height: 48,
        box: BoxDecoration(
          color: Colors.black.withOpacity(0.04),
          border: const Border(
            bottom: BorderSide(color: Colors.grey),
          ),
        ),
        focusedBox: BoxDecoration(
          color: Colors.black.withOpacity(0.04),
          border: const Border(
            bottom: BorderSide(color: kPrimaryColor),
          ),
        ),
        textStyle: textTheme,
      ),
    );
  }
}

Generating the following UI (part of it) image

I'm not able to delete the 1st entered digit, the number 1 as seen in the screenshot.

Expected: I should be able to delete all of the entered digits by either pressing backspace or manually selecting the input.

RomanBase commented 3 years ago

Hey, sorry for pretty late answer.. There was a lot Flutter SDK changes and we drop support for this library for a while, but we are looking forward and working on new more general and customizable Input (based on flutter_control library).