feat(flutter): 修复登录输入并升级登录页
This commit is contained in:
1 parent
f72cb41670
commit
81bb1543bb
5 files changed
+233
-141
No files matched your search
@@ -22,11 +22,11 @@ class _AuthFields extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_fieldLabel(state.l10n.authEmailLabel),
|
||||
const SizedBox(height: 8),
|
||||
const SizedBox(height: 6),
|
||||
_emailField(context, hasError: emailError),
|
||||
const SizedBox(height: 16),
|
||||
const SizedBox(height: 14),
|
||||
_fieldLabel(state.l10n.authPasswordLabel),
|
||||
const SizedBox(height: 8),
|
||||
const SizedBox(height: 6),
|
||||
_passwordField(context, hasError: passwordError),
|
||||
if (state.status.signUpMode) ...[
|
||||
const SizedBox(height: 8),
|
||||
@@ -60,7 +60,8 @@ class _AuthFields extends StatelessWidget {
|
||||
autofillHints: const [AutofillHints.email],
|
||||
onChanged: callbacks.onEmailChanged,
|
||||
onSubmitted: (_) => state.fields.passwordFocus.requestFocus(),
|
||||
style: const TextStyle(color: AppColors.onPrimary, fontSize: 15),
|
||||
style: const TextStyle(color: AppColors.onSurface, fontSize: 15),
|
||||
cursorColor: AppColors.blue,
|
||||
decoration: _decoration(
|
||||
context: context,
|
||||
hint: 'name@example.com',
|
||||
@@ -91,7 +92,8 @@ class _AuthFields extends StatelessWidget {
|
||||
autofillHints: const [AutofillHints.password],
|
||||
onChanged: callbacks.onPasswordChanged,
|
||||
onSubmitted: (_) => callbacks.onSubmit(),
|
||||
style: const TextStyle(color: AppColors.onPrimary, fontSize: 15),
|
||||
style: const TextStyle(color: AppColors.onSurface, fontSize: 15),
|
||||
cursorColor: AppColors.blue,
|
||||
decoration: _decoration(
|
||||
context: context,
|
||||
hint: l10n.authPasswordHint,
|
||||
@@ -125,8 +127,8 @@ class _AuthFields extends StatelessWidget {
|
||||
label,
|
||||
style: const TextStyle(
|
||||
color: AppColors.muted,
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -140,7 +142,10 @@ class _AuthFields extends StatelessWidget {
|
||||
}) {
|
||||
final border = OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(_fieldRadius),
|
||||
borderSide: BorderSide.none,
|
||||
borderSide: const BorderSide(
|
||||
color: AppColors.border,
|
||||
width: _fieldBorderWidth,
|
||||
),
|
||||
);
|
||||
final errorColor = Theme.of(context).colorScheme.error;
|
||||
final errorBorder = OutlineInputBorder(
|
||||
@@ -149,11 +154,11 @@ class _AuthFields extends StatelessWidget {
|
||||
);
|
||||
return InputDecoration(
|
||||
hintText: hint,
|
||||
hintStyle: const TextStyle(color: AppColors.muted, fontSize: 14),
|
||||
hintStyle: const TextStyle(color: AppColors.subtle, fontSize: 14),
|
||||
prefixIcon: Icon(
|
||||
icon,
|
||||
size: 21,
|
||||
color: focused ? AppColors.blueSoft : AppColors.muted,
|
||||
color: focused ? AppColors.blue : AppColors.muted,
|
||||
),
|
||||
prefixIconConstraints: const BoxConstraints(
|
||||
minWidth: _minTapTarget,
|
||||
@@ -161,7 +166,7 @@ class _AuthFields extends StatelessWidget {
|
||||
),
|
||||
suffixIcon: suffix,
|
||||
filled: true,
|
||||
fillColor: AppColors.bar,
|
||||
fillColor: AppColors.card,
|
||||
isDense: true,
|
||||
contentPadding: const EdgeInsets.only(right: 16),
|
||||
border: border,
|
||||
@@ -229,8 +234,8 @@ class _AuthSubmitButton extends StatelessWidget {
|
||||
: Text(
|
||||
status.signUpMode ? l10n.signUp : l10n.signIn,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w800,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -273,7 +278,7 @@ class _ModeSegment extends StatelessWidget {
|
||||
child: Text(
|
||||
label,
|
||||
style: TextStyle(
|
||||
color: selected ? AppColors.onPrimary : AppColors.muted,
|
||||
color: selected ? AppColors.onPrimary : AppColors.onSurface,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
@@ -327,29 +332,11 @@ class _AuthBrand extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _brandMark() => Container(
|
||||
Widget _brandMark() => _brandMarkWidget(
|
||||
key: const Key('auth-brand-mark'),
|
||||
width: _brandMarkSize,
|
||||
height: _brandMarkSize,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColors.blue.withValues(alpha: 0.32),
|
||||
blurRadius: 24,
|
||||
offset: const Offset(0, 10),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
child: Image.asset(
|
||||
'assets/icon/splash_mark.png',
|
||||
width: _brandMarkSize,
|
||||
height: _brandMarkSize,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
size: compact ? _compactBrandMarkSize : _brandMarkSize,
|
||||
radius: compact ? _compactBrandMarkRadius : _brandMarkRadius,
|
||||
iconSize: compact ? _compactBrandIconSize : _brandIconSize,
|
||||
);
|
||||
|
||||
Widget _brandCopy(BuildContext context, {required bool centered}) => Column(
|
||||
@@ -361,9 +348,9 @@ class _AuthBrand extends StatelessWidget {
|
||||
AppLocalizations.of(context)!.appName,
|
||||
textAlign: centered ? TextAlign.center : TextAlign.start,
|
||||
style: const TextStyle(
|
||||
color: AppColors.onPrimary,
|
||||
fontSize: 26,
|
||||
fontWeight: FontWeight.w800,
|
||||
color: AppColors.onSurface,
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.w900,
|
||||
height: 1.1,
|
||||
),
|
||||
),
|
||||
@@ -372,8 +359,8 @@ class _AuthBrand extends StatelessWidget {
|
||||
tagline,
|
||||
textAlign: centered ? TextAlign.center : TextAlign.start,
|
||||
style: const TextStyle(
|
||||
color: AppColors.blueSoft,
|
||||
fontSize: 14,
|
||||
color: AppColors.muted,
|
||||
fontSize: 13,
|
||||
height: 1.35,
|
||||
),
|
||||
),
|
||||
@@ -406,7 +393,7 @@ class _AuthError extends StatelessWidget {
|
||||
child: Text(
|
||||
message,
|
||||
key: const Key('auth-error'),
|
||||
style: TextStyle(color: color, fontSize: 13, height: 1.35),
|
||||
style: TextStyle(color: color, fontSize: 12, height: 1.35),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user