Cleaned up name submission criteria (#2835)
* Cleaned up name submission criteria * chore: formatting --------- Co-authored-by: ggurdin <ggurdin@gmail.com>
This commit is contained in:
parent
48a951c1a5
commit
47ef0813a3
2 changed files with 9 additions and 6 deletions
|
|
@ -48,6 +48,8 @@ class NewGroupController extends State<NewGroup> {
|
|||
|
||||
bool requiredCodeToJoin = false;
|
||||
// bool publicGroup = false;
|
||||
|
||||
bool get canSubmit => nameController.text.trim().isNotEmpty;
|
||||
// Pangea#
|
||||
bool groupCanBeFound = false;
|
||||
|
||||
|
|
@ -250,10 +252,11 @@ class NewGroupController extends State<NewGroup> {
|
|||
focusNode.requestFocus();
|
||||
return;
|
||||
}
|
||||
// Pangea#
|
||||
|
||||
if (nameController.text.trim().isEmpty &&
|
||||
createGroupType == CreateGroupType.space) {
|
||||
// if (nameController.text.trim().isEmpty &&
|
||||
// createGroupType == CreateGroupType.space) {
|
||||
if (!canSubmit) {
|
||||
// Pangea#
|
||||
setState(() => error = L10n.of(context).pleaseFillOut);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,9 +131,9 @@ class NewGroupView extends StatelessWidget {
|
|||
onFieldSubmitted: (value) {
|
||||
controller.loading ? null : controller.submitAction();
|
||||
},
|
||||
validator: (value) => value == null || value.isEmpty
|
||||
? L10n.of(context).pleaseFillOut
|
||||
: null,
|
||||
validator: (value) => controller.canSubmit
|
||||
? null
|
||||
: L10n.of(context).pleaseFillOut,
|
||||
focusNode: controller.focusNode,
|
||||
// Pangea#
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue