feat(ui): 登录页重设计并统一弹框主题渐变外壳

This commit is contained in:
Vicky authored and trae-solo-agent committed 2026-10-28 16:36:43 +08:00
1 parent c027acc91f
commit de7da64886
25 files changed
+905 -317

No files matched your search

+37 -55
View File
@@ -61,7 +61,7 @@ class _AuthFields extends StatelessWidget {
onChanged: callbacks.onEmailChanged,
onSubmitted: (_) => state.fields.passwordFocus.requestFocus(),
style: const TextStyle(color: AppColors.onSurface, fontSize: 15),
cursorColor: AppColors.blue,
cursorColor: AppColors.brandRed,
decoration: _decoration(
context: context,
hint: 'name@example.com',
@@ -93,7 +93,7 @@ class _AuthFields extends StatelessWidget {
onChanged: callbacks.onPasswordChanged,
onSubmitted: (_) => callbacks.onSubmit(),
style: const TextStyle(color: AppColors.onSurface, fontSize: 15),
cursorColor: AppColors.blue,
cursorColor: AppColors.brandRed,
decoration: _decoration(
context: context,
hint: l10n.authPasswordHint,
@@ -128,7 +128,7 @@ class _AuthFields extends StatelessWidget {
style: const TextStyle(
color: AppColors.muted,
fontSize: 12,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w400,
),
);
@@ -142,10 +142,7 @@ class _AuthFields extends StatelessWidget {
}) {
final border = OutlineInputBorder(
borderRadius: BorderRadius.circular(_fieldRadius),
borderSide: const BorderSide(
color: AppColors.border,
width: _fieldBorderWidth,
),
borderSide: BorderSide.none,
);
final errorColor = Theme.of(context).colorScheme.error;
final errorBorder = OutlineInputBorder(
@@ -158,7 +155,7 @@ class _AuthFields extends StatelessWidget {
prefixIcon: Icon(
icon,
size: 21,
color: focused ? AppColors.blue : AppColors.muted,
color: focused ? AppColors.brandRed : AppColors.muted,
),
prefixIconConstraints: const BoxConstraints(
minWidth: _minTapTarget,
@@ -166,7 +163,7 @@ class _AuthFields extends StatelessWidget {
),
suffixIcon: suffix,
filled: true,
fillColor: AppColors.card,
fillColor: Colors.white.withValues(alpha: 0.05),
isDense: true,
contentPadding: const EdgeInsets.only(right: 16),
border: border,
@@ -175,7 +172,7 @@ class _AuthFields extends StatelessWidget {
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(_fieldRadius),
borderSide: const BorderSide(
color: AppColors.blue,
color: AppColors.brandRed,
width: _fieldBorderWidth,
),
),
@@ -204,17 +201,17 @@ class _AuthSubmitButton extends StatelessWidget {
style: ButtonStyle(
backgroundColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.disabled)) {
return AppColors.blue.withValues(alpha: 0.5);
return AppColors.brandRed.withValues(alpha: 0.5);
}
if (states.contains(WidgetState.pressed)) {
return AppColors.bluePressed;
return AppColors.brandRedPressed;
}
return AppColors.blue;
return AppColors.brandRed;
}),
foregroundColor: const WidgetStatePropertyAll(AppColors.onPrimary),
elevation: const WidgetStatePropertyAll(2),
shadowColor: WidgetStatePropertyAll(
AppColors.blue.withValues(alpha: 0.22),
AppColors.brandRed.withValues(alpha: 0.22),
),
padding: const WidgetStatePropertyAll(EdgeInsets.zero),
shape: WidgetStatePropertyAll(
@@ -235,7 +232,7 @@ class _AuthSubmitButton extends StatelessWidget {
status.signUpMode ? l10n.signUp : l10n.signIn,
style: const TextStyle(
fontSize: 15,
fontWeight: FontWeight.w800,
fontWeight: FontWeight.w600,
),
),
),
@@ -243,18 +240,16 @@ class _AuthSubmitButton extends StatelessWidget {
}
}
class _ModeSegment extends StatelessWidget {
const _ModeSegment({
class _ModeTab extends StatelessWidget {
const _ModeTab({
required this.segmentKey,
required this.label,
required this.hiddenLabel,
required this.selected,
required this.onTap,
});
final Key segmentKey;
final String label;
final String hiddenLabel;
final bool selected;
final VoidCallback? onTap;
@@ -264,43 +259,30 @@ class _ModeSegment extends StatelessWidget {
key: segmentKey,
behavior: HitTestBehavior.opaque,
onTap: onTap,
child: AnimatedContainer(
duration: _segmentDuration,
alignment: Alignment.center,
decoration: BoxDecoration(
color: selected ? AppColors.blue : AppColors.transparent,
borderRadius: BorderRadius.circular(18),
),
child: Stack(
fit: StackFit.expand,
children: [
Center(
child: Text(
label,
style: TextStyle(
color: selected ? AppColors.onPrimary : AppColors.onSurface,
fontSize: 14,
fontWeight: FontWeight.w700,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
label,
style: TextStyle(
color: selected ? AppColors.textPrimary : AppColors.muted,
fontSize: AppDimens.followingSegmentFont,
fontWeight: FontWeight.w400,
),
),
const SizedBox(height: AppDimens.followingSegmentIndicatorTopGap),
Container(
width: AppDimens.followingSegmentIndicatorWidth,
height: AppDimens.followingSegmentIndicatorHeight,
decoration: BoxDecoration(
color: selected ? AppColors.brandRed : AppColors.transparent,
borderRadius: BorderRadius.circular(
AppDimens.followingSegmentIndicatorRadius,
),
),
Positioned.fill(
child: ExcludeSemantics(
child: Opacity(
opacity: 0,
child: Center(
child: Text(
hiddenLabel,
maxLines: 1,
softWrap: false,
style: const TextStyle(fontSize: 14),
),
),
),
),
),
],
),
),
],
),
);
}
@@ -349,7 +331,7 @@ class _AuthBrand extends StatelessWidget {
style: const TextStyle(
color: AppColors.onSurface,
fontSize: 24,
fontWeight: FontWeight.w900,
fontWeight: FontWeight.w700,
height: 1.1,
),
),