mirror of
https://github.com/Iconica-Development/flutter_login_widget.git
synced 2025-05-19 05:33:45 +02:00
Merge pull request #32 from Iconica-Development/feature/default_configuration
feat: add default loginOptions
This commit is contained in:
commit
e93e2b01cc
4 changed files with 130 additions and 7 deletions
|
@ -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.
|
||||
|
|
|
@ -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,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
|
|
|
@ -204,6 +204,8 @@ class _EmailPasswordLoginFormState extends State<EmailPasswordLoginForm> {
|
|||
options,
|
||||
),
|
||||
),
|
||||
] else ...[
|
||||
const SizedBox(height: 16),
|
||||
],
|
||||
if (options.spacers.spacerAfterForm != null) ...[
|
||||
Spacer(flex: options.spacers.spacerAfterForm!),
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue