Merge pull request #9 from Iconica-Development/feature/expand_translations

fix: change to options instead of translations
This commit is contained in:
FlutterJoey 2022-11-08 09:58:51 +01:00 committed by GitHub
commit 92a1af6d72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 17 deletions

View file

@ -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

View file

@ -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

View file

@ -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(

View file

@ -162,7 +162,7 @@ class _EmailPasswordLoginFormState extends State<EmailPasswordLoginForm> {
},
false,
() {},
options.translations,
options,
),
),
],
@ -177,7 +177,7 @@ class _EmailPasswordLoginFormState extends State<EmailPasswordLoginForm> {
() {
_formKey.currentState?.validate();
},
options.translations,
options,
);
},
),
@ -192,7 +192,7 @@ class _EmailPasswordLoginFormState extends State<EmailPasswordLoginForm> {
},
false,
() {},
options.translations,
options,
),
]
],

View file

@ -133,7 +133,7 @@ class _ForgotPasswordFormState extends State<ForgotPasswordForm> {
() {
_formKey.currentState?.validate();
},
options.translations,
options,
),
);
},

View file

@ -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"