From 34ba6cffa2cd3c5eecac6db35eaf0cba09c6a49c Mon Sep 17 00:00:00 2001 From: Freek van de Ven Date: Tue, 8 Nov 2022 09:56:05 +0100 Subject: [PATCH] fix: change to options instead of translations --- CHANGELOG.md | 4 ++-- example/pubspec.lock | 2 +- lib/src/config/login_options.dart | 18 +++++++++--------- lib/src/widgets/email_password_login.dart | 6 +++--- lib/src/widgets/forgot_password_form.dart | 2 +- pubspec.yaml | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d87e4bf..b8df519 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ -## 2.0.2 -* Added more translatable options +## 3.0.0 +* Added login options to loginbuilders for more customization ## 2.0.1 diff --git a/example/pubspec.lock b/example/pubspec.lock index d2a7089..546025a 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -61,7 +61,7 @@ packages: path: ".." relative: true source: path - version: "2.0.2" + version: "3.0.0" flutter_test: dependency: "direct dev" description: flutter diff --git a/lib/src/config/login_options.dart b/lib/src/config/login_options.dart index b4917fd..47541b9 100644 --- a/lib/src/config/login_options.dart +++ b/lib/src/config/login_options.dart @@ -84,13 +84,13 @@ Widget _createLoginButton( OptionalAsyncCallback onPressed, bool disabled, OptionalAsyncCallback onDisabledPress, - LoginTranslations translations, + LoginOptions options, ) { return Opacity( opacity: disabled ? 0.5 : 1.0, child: ElevatedButton( onPressed: !disabled ? onPressed : onDisabledPress, - child: Text(translations.loginButton), + child: Text(options.translations.loginButton), ), ); } @@ -100,13 +100,13 @@ Widget _createForgotPasswordButton( OptionalAsyncCallback onPressed, bool disabled, OptionalAsyncCallback onDisabledPress, - LoginTranslations translations, + LoginOptions options, ) { return Opacity( opacity: disabled ? 0.5 : 1.0, child: ElevatedButton( onPressed: !disabled ? onPressed : onDisabledPress, - child: Text(translations.forgotPasswordButton), + child: Text(options.translations.forgotPasswordButton), ), ); } @@ -116,13 +116,13 @@ Widget _createRequestForgotPasswordButton( OptionalAsyncCallback onPressed, bool disabled, OptionalAsyncCallback onDisabledPress, - LoginTranslations translations, + LoginOptions options, ) { return Opacity( opacity: disabled ? 0.5 : 1.0, child: ElevatedButton( onPressed: !disabled ? onPressed : onDisabledPress, - child: Text(translations.requestForgotPasswordButton), + child: Text(options.translations.requestForgotPasswordButton), ), ); } @@ -132,13 +132,13 @@ Widget _createRegisterButton( OptionalAsyncCallback onPressed, bool disabled, OptionalAsyncCallback onDisabledPress, - LoginTranslations translations, + LoginOptions options, ) { return Opacity( opacity: disabled ? 0.5 : 1.0, child: ElevatedButton( onPressed: !disabled ? onPressed : onDisabledPress, - child: Text(translations.registrationButton), + child: Text(options.translations.registrationButton), ), ); } @@ -148,7 +148,7 @@ typedef ButtonBuilder = Widget Function( OptionalAsyncCallback onPressed, bool isDisabled, OptionalAsyncCallback onDisabledPress, - LoginTranslations options, + LoginOptions options, ); typedef InputContainerBuilder = Widget Function( diff --git a/lib/src/widgets/email_password_login.dart b/lib/src/widgets/email_password_login.dart index df527db..a044818 100644 --- a/lib/src/widgets/email_password_login.dart +++ b/lib/src/widgets/email_password_login.dart @@ -162,7 +162,7 @@ class _EmailPasswordLoginFormState extends State { }, false, () {}, - options.translations, + options, ), ), ], @@ -177,7 +177,7 @@ class _EmailPasswordLoginFormState extends State { () { _formKey.currentState?.validate(); }, - options.translations, + options, ); }, ), @@ -192,7 +192,7 @@ class _EmailPasswordLoginFormState extends State { }, false, () {}, - options.translations, + options, ), ] ], diff --git a/lib/src/widgets/forgot_password_form.dart b/lib/src/widgets/forgot_password_form.dart index 8355aff..2cc59f8 100644 --- a/lib/src/widgets/forgot_password_form.dart +++ b/lib/src/widgets/forgot_password_form.dart @@ -133,7 +133,7 @@ class _ForgotPasswordFormState extends State { () { _formKey.currentState?.validate(); }, - options.translations, + options, ), ); }, diff --git a/pubspec.yaml b/pubspec.yaml index 3e54b8e..c082806 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_login description: A new Flutter package project. -version: 2.0.2 +version: 3.0.0 environment: sdk: ">=2.18.1 <3.0.0"