1

[example] 1As far as i can understand the issue, strings outgrow the Text widget when increasing zoom on browser. The issue comes in all browsers except Google Chrome. In case of Google Chrome page just ignores zoom. What would be the workaround if there is any?

class TextField extends AuthField {
  TextField(
      {super.key,
      required super.apiKey,
      required super.title,
      required super.description,
      required this.controller,
      required super.isRequired})
      : super(type: "textfield");

  final TextEditingController controller;

  @override
  Map<String, dynamic> commit() {
    data = controller.text;
    return {"type": type, "title": title, "api_name": apiKey, "value": data};
  }
  @override
  State<TextField> createState() => TextFieldState();
}

class TextFieldState extends State<TextField> {
  @override
  Widget build(BuildContext context) {
    return TextFormField(
      style: textStyleLittle,
      validator: (widget.isRequired)
          ? (value) {
              if (value == null || value.isEmpty) {
                return "This field can not be empty";
              }
              return null;
            }
          : null,
      textInputAction: TextInputAction.next,
      onEditingComplete: () => FocusScope.of(context).nextFocus(),
      controller: widget.controller,
      keyboardType: TextInputType.text,
      decoration: InputDecoration(
          labelStyle: textStyleLittle,
          hintStyle: textStyleLittle,
          hintText: widget.description,
          label: AutoSizeText(
            widget.title,
            style: textStyleLittle,
            wrapWords: false,
          ),
        ),
    );
  }
}

I tried using auto_size_text package, i tried dynamically changing the font size by inverse proportion, but it seems font size does not scale linearly.

0 Answers0