Skip to content

Commit 460d517

Browse files
authored
feat: SignInWithEmailDialog allow customization of copy. (serverpod#2391)
1 parent cf14157 commit 460d517

File tree

4 files changed

+237
-37
lines changed

4 files changed

+237
-37
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export 'src/signin_button.dart';
22
export 'src/auth.dart';
3+
export 'src/signin_labels.dart';

modules/serverpod_auth/serverpod_auth_email_flutter/lib/src/signin_button.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'package:flutter/material.dart';
22
import 'package:serverpod_auth_client/serverpod_auth_client.dart';
33
import 'package:serverpod_auth_email_flutter/src/signin_dialog.dart';
4+
import 'package:serverpod_auth_email_flutter/src/signin_labels.dart';
45

56
/// Sign in with Email button. When pressed, a pop-up window appears with fields for entering login, email and password.
67
class SignInWithEmailButton extends StatefulWidget {
@@ -29,6 +30,10 @@ class SignInWithEmailButton extends StatefulWidget {
2930
/// If this value is modified, the server must be updated to match.
3031
final int? minPasswordLength;
3132

33+
/// Labels for the sign in dialog.
34+
/// If [null], the default/english labels will be used.
35+
final SignInWithEmailDialogLabels? localization;
36+
3237
/// Creates a new Sign in with Email button.
3338
const SignInWithEmailButton({
3439
required this.caller,
@@ -38,6 +43,7 @@ class SignInWithEmailButton extends StatefulWidget {
3843
this.icon,
3944
this.maxPasswordLength,
4045
this.minPasswordLength,
46+
this.localization,
4147
super.key,
4248
});
4349

@@ -63,6 +69,7 @@ class SignInWithEmailButtonState extends State<SignInWithEmailButton> {
6369
caller: widget.caller,
6470
maxPasswordLength: widget.maxPasswordLength,
6571
minPasswordLength: widget.minPasswordLength,
72+
localization: widget.localization,
6673
onSignedIn: () {
6774
if (widget.onSignedIn != null) {
6875
widget.onSignedIn!();

0 commit comments

Comments
 (0)