Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mikezamayias committed Jan 23, 2022
1 parent 5f62c57 commit 01b7604
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/pages/sign_in/view/sign_in_page_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class SignInPageView extends StatelessWidget {
? const EdgeInsets.symmetric(horizontal: 90)
: const EdgeInsets.symmetric(horizontal: 30),
child: Form(
key: locator<FormService>().logInFormKey,
key: locator<FormService>().signInFormKey,
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
Expand Down
16 changes: 6 additions & 10 deletions lib/services/form_service.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import 'package:flutter/material.dart';

class FormService {
// form key
GlobalKey<FormState> get formKey => GlobalKey<FormState>();
static final GlobalKey<FormState> _signUpFormFormKey = GlobalKey<FormState>();
static final GlobalKey<FormState> _signInFormFormKey = GlobalKey<FormState>();
static final GlobalKey<FormState> _addPhoneFormKey = GlobalKey<FormState>();

// get sign up form key
GlobalKey<FormState> get signUpFormKey => GlobalKey<FormState>();

// get sign in form key
GlobalKey<FormState> get logInFormKey => GlobalKey<FormState>();

// get add phone form key
GlobalKey<FormState> get phoneFormKey => GlobalKey<FormState>();
GlobalKey<FormState> get signUpFormKey => _signUpFormFormKey;
GlobalKey<FormState> get signInFormKey => _signInFormFormKey;
GlobalKey<FormState> get addPhoneFormKey => _addPhoneFormKey;
}

0 comments on commit 01b7604

Please sign in to comment.