Skip to content

Commit

Permalink
imp: revert messages.userHint if provided
Browse files Browse the repository at this point in the history
  • Loading branch information
juliansteenbakker committed Mar 15, 2022
1 parent feecdf0 commit fc1b98f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
11 changes: 9 additions & 2 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ packages:
path: ".."
relative: true
source: path
version: "3.0.0"
version: "3.1.0"
flutter_signin_button:
dependency: "direct main"
description:
Expand Down Expand Up @@ -142,6 +142,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.11"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
meta:
dependency: transitive
description:
Expand Down Expand Up @@ -230,7 +237,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.3"
version: "0.4.8"
typed_data:
dependency: transitive
description:
Expand Down
7 changes: 3 additions & 4 deletions lib/src/providers/login_messages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/material.dart';

class LoginMessages with ChangeNotifier {
LoginMessages({
this.userHint = defaultUserHint,
this.userHint,
this.passwordHint = defaultPasswordHint,
this.confirmPasswordHint = defaultConfirmPasswordHint,
this.forgotPasswordButton = defaultForgotPasswordButton,
Expand Down Expand Up @@ -38,7 +38,6 @@ class LoginMessages with ChangeNotifier {
this.recoverCodePasswordDescription = defaultRecoverCodePasswordDescription,
});

static const defaultUserHint = 'Email';
static const defaultPasswordHint = 'Password';
static const defaultConfirmPasswordHint = 'Confirm Password';
static const defaultForgotPasswordButton = 'Forgot Password?';
Expand Down Expand Up @@ -80,8 +79,8 @@ class LoginMessages with ChangeNotifier {
static const defaultConfirmSignupSuccess = 'Account confirmed.';

/// Hint text of the userHint [TextField]
/// By default is Email
final String userHint;
/// Default will be selected based on userType
final String? userHint;

/// Additional signup form button's label
final String additionalSignUpSubmitButton;
Expand Down
3 changes: 2 additions & 1 deletion lib/src/widgets/cards/login_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,8 @@ class _LoginCardState extends State<_LoginCard> with TickerProviderStateMixin {
width: width,
loadingController: widget.loadingController,
interval: _nameTextFieldLoadingAnimationInterval,
labelText: TextFieldUtils.getLabelText(widget.userType),
labelText:
messages.userHint ?? TextFieldUtils.getLabelText(widget.userType),
autofillHints: _isSubmitting
? null
: [TextFieldUtils.getAutofillHints(widget.userType)],
Expand Down

0 comments on commit fc1b98f

Please sign in to comment.