Skip to content

fix(ui_auth): make maxWidth configurable on all screens #178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ class EmailLinkSignInScreen extends ProviderScreen<EmailLinkAuthProvider> {
/// {@macro ui.auth.screens.responsive_page.breakpoint}
final double breakpoint;

/// {@macro ui.auth.screens.responsive_page.max_width}
final double? maxWidth;

const EmailLinkSignInScreen({
super.key,
super.auth,
Expand All @@ -53,6 +56,7 @@ class EmailLinkSignInScreen extends ProviderScreen<EmailLinkAuthProvider> {
this.sideBuilder,
this.desktopLayoutDirection,
this.breakpoint = 500,
this.maxWidth = 1200,
});

@override
Expand All @@ -62,7 +66,7 @@ class EmailLinkSignInScreen extends ProviderScreen<EmailLinkAuthProvider> {
breakpoint: breakpoint,
headerBuilder: headerBuilder,
headerMaxExtent: headerMaxExtent,
maxWidth: 1200,
maxWidth: maxWidth,
sideBuilder: sideBuilder,
desktopLayoutDirection: desktopLayoutDirection,
child: Padding(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ class EmailVerificationScreen extends StatelessWidget {
/// A configuration object used to construct a dynamic link.
final fba.ActionCodeSettings? actionCodeSettings;

/// {@macro ui.auth.screens.responsive_page.max_width}
final double? maxWidth;

/// {@macro ui.auth.screens.email_verification_screen}
const EmailVerificationScreen({
super.key,
Expand All @@ -76,6 +79,7 @@ class EmailVerificationScreen extends StatelessWidget {
this.desktopLayoutDirection,
this.breakpoint = 500,
this.actionCodeSettings,
this.maxWidth = 1200,
});

@override
Expand All @@ -89,7 +93,7 @@ class EmailVerificationScreen extends StatelessWidget {
headerBuilder: headerBuilder,
headerMaxExtent: headerMaxExtent,
sideBuilder: sideBuilder,
maxWidth: 1200,
maxWidth: maxWidth,
contentFlex: 2,
child: Padding(
padding: const EdgeInsets.all(32),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ class ForgotPasswordScreen extends StatelessWidget {
/// {@macro ui.auth.screens.responsive_page.breakpoint}
final double breakpoint;

/// {@macro ui.auth.screens.responsive_page.max_width}
final double? maxWidth;

const ForgotPasswordScreen({
super.key,
this.auth,
Expand All @@ -53,6 +56,7 @@ class ForgotPasswordScreen extends StatelessWidget {
this.desktopLayoutDirection,
this.resizeToAvoidBottomInset,
this.breakpoint = 600,
this.maxWidth = 1200,
});

@override
Expand All @@ -72,7 +76,7 @@ class ForgotPasswordScreen extends StatelessWidget {
headerMaxExtent: headerMaxExtent,
sideBuilder: sideBuilder,
breakpoint: breakpoint,
maxWidth: 1200,
maxWidth: maxWidth,
contentFlex: 1,
child: Padding(
padding: const EdgeInsets.all(32),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ class LoginScreen extends StatelessWidget {
/// {@macro ui.auth.widgets.email_form.showPasswordVisibilityToggle}
final bool showPasswordVisibilityToggle;

/// {@macro ui.auth.screens.responsive_page.max_width}
final double? maxWidth;

const LoginScreen({
super.key,
required this.action,
Expand All @@ -73,6 +76,7 @@ class LoginScreen extends StatelessWidget {
this.breakpoint = 800,
this.styles,
this.showPasswordVisibilityToggle = false,
this.maxWidth,
});

@override
Expand Down Expand Up @@ -102,6 +106,7 @@ class LoginScreen extends StatelessWidget {
headerBuilder: headerBuilder,
headerMaxExtent: headerMaxExtent,
sideBuilder: sideBuilder,
maxWidth: maxWidth,
child: loginContent,
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ class PhoneInputScreen extends StatelessWidget {
/// {@macro ui.auth.providers.phone_auth_provider.mfa_hint}
final fba.PhoneMultiFactorInfo? mfaHint;

/// {@macro ui.auth.screens.responsive_page.max_width}
final double? maxWidth;

const PhoneInputScreen({
super.key,
this.action,
Expand All @@ -83,6 +86,7 @@ class PhoneInputScreen extends StatelessWidget {
this.breakpoint = 500,
this.multiFactorSession,
this.mfaHint,
this.maxWidth,
});

void _next(BuildContext context, AuthAction? action, Object flowKey, _) {
Expand Down Expand Up @@ -114,6 +118,7 @@ class PhoneInputScreen extends StatelessWidget {
headerBuilder: headerBuilder,
headerMaxExtent: headerMaxExtent,
breakpoint: breakpoint,
maxWidth: maxWidth,
child: Padding(
padding: const EdgeInsets.all(20),
child: Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ class RegisterScreen extends MultiProviderScreen {
/// * [EmailFormStyle]
final Set<FirebaseUIStyle>? styles;

/// {@macro ui.auth.screens.responsive_page.max_width}
final double? maxWidth;

const RegisterScreen({
super.key,
super.auth,
Expand All @@ -104,6 +107,7 @@ class RegisterScreen extends MultiProviderScreen {
this.footerBuilder,
this.breakpoint = 800,
this.styles,
this.maxWidth,
});

@override
Expand All @@ -126,6 +130,7 @@ class RegisterScreen extends MultiProviderScreen {
subtitleBuilder: subtitleBuilder,
footerBuilder: footerBuilder,
breakpoint: breakpoint,
maxWidth: maxWidth,
),
);
}
Expand Down
5 changes: 5 additions & 0 deletions packages/firebase_ui_auth/lib/src/screens/sign_in_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ class SignInScreen extends MultiProviderScreen {
/// {@macro ui.auth.widgets.email_form.showPasswordVisibilityToggle}
final bool showPasswordVisibilityToggle;

/// {@macro ui.auth.screens.responsive_page.max_width}
final double? maxWidth;

/// {@macro ui.auth.screens.sign_in_screen}
const SignInScreen({
super.key,
Expand All @@ -118,6 +121,7 @@ class SignInScreen extends MultiProviderScreen {
this.breakpoint = 800,
this.styles,
this.showPasswordVisibilityToggle = false,
this.maxWidth,
});

Future<void> _signInWithDifferentProvider(
Expand Down Expand Up @@ -170,6 +174,7 @@ class SignInScreen extends MultiProviderScreen {
footerBuilder: footerBuilder,
breakpoint: breakpoint,
showPasswordVisibilityToggle: showPasswordVisibilityToggle,
maxWidth: maxWidth,
),
);
}
Expand Down