fix: Create chat dialog crashes sometimes and power level textfield does not validate input
This commit is contained in:
parent
c29f9bd44a
commit
5665cac15c
3 changed files with 16 additions and 5 deletions
|
|
@ -61,6 +61,16 @@ Future<int?> showPermissionChooser(
|
|||
initialText: currentLevel.toString(),
|
||||
keyboardType: TextInputType.number,
|
||||
autocorrect: false,
|
||||
validator: (text) {
|
||||
if (text == null) {
|
||||
return L10n.of(context)!.pleaseEnterANumber;
|
||||
}
|
||||
final level = int.tryParse(text);
|
||||
if (level == null || level < 0) {
|
||||
return L10n.of(context)!.pleaseEnterANumber;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue