Skip to content

Commit

Permalink
The fix: let the input field remove all spaces
Browse files Browse the repository at this point in the history
Using Flutter built-in facilities
instead of handcrafting code to trim spaces when the field changes.
  • Loading branch information
CarlosNihelton committed Aug 20, 2024
1 parent e7e773a commit a87eac5
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:dart_either/dart_either.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:yaru/yaru.dart';
import '../../core/either_value_notifier.dart';
Expand Down Expand Up @@ -78,6 +79,10 @@ class _ProTokenInputFieldState extends State<ProTokenInputField> {
children: [
Expanded(
child: TextField(
inputFormatters: [
// This ignores all sorts of (Unicode) whitespaces (not only at the ends).
FilteringTextInputFormatter.deny(RegExp(r'\s')),
],
autofocus: false,
controller: _controller,
decoration: InputDecoration(
Expand Down

0 comments on commit a87eac5

Please sign in to comment.