diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d7b702..ddb2de6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.0.2 + +* Added more default loginOptions for login, forgot password and register. + ## 6.0.1 * Added default loginOptions for email and password fields. diff --git a/lib/src/config/login_options.dart b/lib/src/config/login_options.dart index d61f245..60ecd72 100644 --- a/lib/src/config/login_options.dart +++ b/lib/src/config/login_options.dart @@ -35,14 +35,131 @@ class LoginOptions { this.forgotPasswordSpacerOptions = const ForgotPasswordSpacerOptions(), }); - factory LoginOptions.defaults() => const LoginOptions( - emailDecoration: InputDecoration( - labelText: 'Email', - hintText: 'Enter your email', + factory LoginOptions.defaults() => LoginOptions( + spacers: const LoginSpacerOptions( + spacerBeforeTitle: 8, + spacerAfterTitle: 2, + formFlexValue: 2, ), - passwordDecoration: InputDecoration( + title: const Text( + 'Log in', + style: TextStyle( + color: Color(0xff71C6D1), + fontWeight: FontWeight.w800, + fontSize: 24, + ), + ), + emailDecoration: const InputDecoration( + contentPadding: EdgeInsets.symmetric(horizontal: 8), + labelText: 'Email address', + border: OutlineInputBorder(), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Color(0xff71C6D1), + ), + ), + labelStyle: TextStyle( + color: Colors.black, + fontWeight: FontWeight.w400, + fontSize: 16, + ), + ), + passwordDecoration: const InputDecoration( + contentPadding: EdgeInsets.symmetric(horizontal: 8), labelText: 'Password', - hintText: 'Enter your password', + border: OutlineInputBorder(), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Color(0xff71C6D1), + ), + ), + labelStyle: TextStyle( + color: Colors.black, + fontWeight: FontWeight.w400, + fontSize: 16, + ), + ), + loginButtonBuilder: + (context, onPressed, isDisabled, onDisabledPress, options) => + InkWell( + onTap: () async => onPressed.call(), + child: Container( + height: 44, + width: 254, + decoration: const BoxDecoration( + color: Color(0xff71C6D1), + borderRadius: BorderRadius.all(Radius.circular(20)), + ), + child: const Center( + child: Text( + 'Log in', + style: TextStyle( + fontWeight: FontWeight.w800, + fontSize: 20, + color: Colors.white, + ), + ), + ), + ), + ), + registrationButtonBuilder: + (context, onPressed, isDisabled, onDisabledPress, options) => + TextButton( + onPressed: () async { + await onPressed.call(); + }, + child: const Text( + 'Create account', + style: TextStyle( + decoration: TextDecoration.underline, + decorationColor: Color(0xff71C6D1), + color: Color(0xff71C6D1), + fontSize: 18, + fontWeight: FontWeight.w800, + ), + ), + ), + forgotPasswordButtonBuilder: + (context, onPressed, isDisabled, onDisabledPress, options) => + TextButton( + onPressed: () async { + await onPressed.call(); + }, + child: const Text( + 'Forgot password?', + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w500, + color: Color(0xff8D8D8D), + ), + ), + ), + forgotPasswordSpacerOptions: const ForgotPasswordSpacerOptions( + spacerAfterButton: 3, + spacerBeforeTitle: 1, + ), + requestForgotPasswordButtonBuilder: + (context, onPressed, isDisabled, onDisabledPress, options) => + InkWell( + onTap: onPressed, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + color: const Color(0xff71C6D1), + ), + height: 44, + width: 254, + child: const Center( + child: Text( + 'Send link', + style: TextStyle( + fontWeight: FontWeight.w800, + fontSize: 20, + color: Colors.white, + ), + ), + ), + ), ), ); diff --git a/lib/src/widgets/email_password_login.dart b/lib/src/widgets/email_password_login.dart index a2fea9e..c66f560 100644 --- a/lib/src/widgets/email_password_login.dart +++ b/lib/src/widgets/email_password_login.dart @@ -204,6 +204,8 @@ class _EmailPasswordLoginFormState extends State { options, ), ), + ] else ...[ + const SizedBox(height: 16), ], if (options.spacers.spacerAfterForm != null) ...[ Spacer(flex: options.spacers.spacerAfterForm!), diff --git a/pubspec.yaml b/pubspec.yaml index 33bf03c..3048845 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_login description: Flutter Login Component -version: 6.0.1 +version: 6.0.2 environment: sdk: ">=2.18.1 <3.0.0"