checkpoint

This commit is contained in:
2025-11-26 17:41:37 -05:00
parent ef5c0c1a95
commit 2ecd1c5b4e
15 changed files with 794 additions and 152 deletions
+13 -12
View File
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../l10n/app_localizations.dart';
import '../providers/providers.dart';
import '../utils/toast_helper.dart';
@@ -78,7 +79,7 @@ class _LoginPageState extends ConsumerState<LoginPage> {
),
const SizedBox(height: 24),
Text(
'Plan B Logistics',
AppLocalizations.of(context)!.appTitle,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.displayMedium?.copyWith(
color: Theme.of(context).colorScheme.primary,
@@ -87,7 +88,7 @@ class _LoginPageState extends ConsumerState<LoginPage> {
),
const SizedBox(height: 8),
Text(
'Delivery Management System',
AppLocalizations.of(context)!.appDescription,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
color: Theme.of(context).colorScheme.onSurfaceVariant,
@@ -96,17 +97,17 @@ class _LoginPageState extends ConsumerState<LoginPage> {
const SizedBox(height: 48),
TextFormField(
controller: _usernameController,
decoration: const InputDecoration(
labelText: 'Username',
hintText: 'Enter your username',
prefixIcon: Icon(Icons.person),
border: OutlineInputBorder(),
decoration: InputDecoration(
labelText: AppLocalizations.of(context)!.username,
hintText: AppLocalizations.of(context)!.usernameHint,
prefixIcon: const Icon(Icons.person),
border: const OutlineInputBorder(),
),
textInputAction: TextInputAction.next,
enabled: !_isLoading,
validator: (value) {
if (value == null || value.trim().isEmpty) {
return 'Please enter your username';
return AppLocalizations.of(context)!.usernameRequired;
}
return null;
},
@@ -115,8 +116,8 @@ class _LoginPageState extends ConsumerState<LoginPage> {
TextFormField(
controller: _passwordController,
decoration: InputDecoration(
labelText: 'Password',
hintText: 'Enter your password',
labelText: AppLocalizations.of(context)!.password,
hintText: AppLocalizations.of(context)!.passwordHint,
prefixIcon: const Icon(Icons.lock),
border: const OutlineInputBorder(),
suffixIcon: IconButton(
@@ -136,7 +137,7 @@ class _LoginPageState extends ConsumerState<LoginPage> {
onFieldSubmitted: (_) => _handleLogin(),
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter your password';
return AppLocalizations.of(context)!.passwordRequired;
}
return null;
},
@@ -158,7 +159,7 @@ class _LoginPageState extends ConsumerState<LoginPage> {
),
),
)
: const Text('Login'),
: Text(AppLocalizations.of(context)!.loginButton),
),
],
),