Skip to content

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

@ricbermo

Description

@ricbermo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions