Skip to content

Commit bfafe19

Browse files
committed
refactor(authentication): localize and simplify AuthenticationPage
Refactored the `AuthenticationPage` to use localization keys directly from `l10n` for its headline and subheadline. This removes the need to pass these strings as parameters, making the widget more self-contained and easier to maintain. The `showAnonymousButton` parameter has also been removed, as anonymous sign-in is not a feature of the secure dashboard. BREAKING CHANGE: The constructor for `AuthenticationPage` no longer accepts `headline`, `subHeadline`, or `showAnonymousButton` parameters. Calls to this widget must be updated to remove these arguments.
1 parent 96dd0d2 commit bfafe19

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

lib/authentication/view/authentication_page.dart

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,14 @@ import 'package:ht_dashboard/router/routes.dart';
1010
import 'package:ht_dashboard/shared/constants/app_spacing.dart';
1111

1212
/// {@template authentication_page}
13-
/// Displays authentication options (Google, Email, Anonymous) based on context.
13+
/// Displays authentication options for the dashboard.
1414
///
15-
/// This page can be used for both initial sign-in and for connecting an
16-
/// existing anonymous account.
15+
/// This page provides a secure sign-in method for administrators and
16+
/// publishers via email.
1717
/// {@endtemplate}
1818
class AuthenticationPage extends StatelessWidget {
1919
/// {@macro authentication_page}
20-
const AuthenticationPage({
21-
required this.headline,
22-
required this.subHeadline,
23-
required this.showAnonymousButton,
24-
super.key,
25-
});
26-
27-
/// The main title displayed on the page.
28-
final String headline;
29-
30-
/// The descriptive text displayed below the headline.
31-
final String subHeadline;
32-
33-
/// Whether to show the "Continue Anonymously" button.
34-
final bool showAnonymousButton;
20+
const AuthenticationPage({super.key});
3521

3622
@override
3723
Widget build(BuildContext context) {
@@ -88,15 +74,15 @@ class AuthenticationPage extends StatelessWidget {
8874
// const SizedBox(height: AppSpacing.lg),
8975
// --- Headline and Subheadline ---
9076
Text(
91-
headline,
77+
l10n.authenticationPageHeadline,
9278
style: textTheme.headlineMedium?.copyWith(
9379
fontWeight: FontWeight.bold,
9480
),
9581
textAlign: TextAlign.center,
9682
),
9783
const SizedBox(height: AppSpacing.md),
9884
Text(
99-
subHeadline,
85+
l10n.authenticationPageSubheadline,
10086
style: textTheme.bodyLarge?.copyWith(
10187
color: colorScheme.onSurfaceVariant,
10288
),

0 commit comments

Comments
 (0)