feat(flutter): 重设计创作与我的页面
This commit is contained in:
1 parent
d50c6e6d9f
commit
03c3964353
17 files changed
+807
-234
No files matched your search
@@ -7,7 +7,7 @@ import '../../core/theme/app_dimens.dart';
|
||||
import '../../core/theme/app_theme.dart';
|
||||
import '../../l10n/app_localizations.dart';
|
||||
|
||||
/// K28-A1 创作页占位骨架。
|
||||
/// K28-B 创作页:AI 制作与上传发布入口。
|
||||
class CreatePage extends StatelessWidget {
|
||||
const CreatePage({super.key});
|
||||
|
||||
@@ -18,7 +18,7 @@ class CreatePage extends StatelessWidget {
|
||||
data: AppTheme.light(),
|
||||
child: SafeArea(
|
||||
bottom: false,
|
||||
child: Padding(
|
||||
child: ListView(
|
||||
key: const Key('create-page'),
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
AppDimens.pageHorizontal,
|
||||
@@ -26,30 +26,165 @@ class CreatePage extends StatelessWidget {
|
||||
AppDimens.pageHorizontal,
|
||||
AppDimens.spaceXl,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
l10n.createTab,
|
||||
style: const TextStyle(
|
||||
fontFamily: 'Outfit',
|
||||
color: AppColors.onSurface,
|
||||
fontSize: AppDimens.pageTitle,
|
||||
fontWeight: FontWeight.w800,
|
||||
),
|
||||
children: [
|
||||
Text(
|
||||
l10n.createTab,
|
||||
style: const TextStyle(
|
||||
fontFamily: 'Outfit',
|
||||
color: AppColors.onSurface,
|
||||
fontSize: AppDimens.heroTitle,
|
||||
fontWeight: FontWeight.w800,
|
||||
),
|
||||
const SizedBox(height: AppDimens.spaceSm),
|
||||
Text(
|
||||
l10n.createSubtitle,
|
||||
style: const TextStyle(
|
||||
color: AppColors.muted,
|
||||
fontSize: AppDimens.body,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: AppDimens.spaceSm),
|
||||
Text(
|
||||
l10n.createSubtitle,
|
||||
style: const TextStyle(
|
||||
color: AppColors.muted,
|
||||
fontSize: AppDimens.body,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: AppDimens.spaceXl),
|
||||
_CreateEntry(
|
||||
key: const Key('create-ai'),
|
||||
icon: Icons.auto_awesome_rounded,
|
||||
title: l10n.createAiTitle,
|
||||
subtitle: l10n.createAiSubtitle,
|
||||
onTap: () => _openPlaceholder(context, l10n.createAiTitle),
|
||||
),
|
||||
const SizedBox(height: AppDimens.spaceMd),
|
||||
_CreateEntry(
|
||||
key: const Key('create-upload'),
|
||||
icon: Icons.upload_file_rounded,
|
||||
title: l10n.createUploadTitle,
|
||||
subtitle: l10n.createUploadSubtitle,
|
||||
onTap: () => _openPlaceholder(context, l10n.createUploadTitle),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _openPlaceholder(BuildContext context, String title) {
|
||||
Navigator.of(context).push<void>(
|
||||
MaterialPageRoute(builder: (_) => _CreatePlaceholderPage(title: title)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _CreateEntry extends StatelessWidget {
|
||||
const _CreateEntry({
|
||||
super.key,
|
||||
required this.icon,
|
||||
required this.title,
|
||||
required this.subtitle,
|
||||
required this.onTap,
|
||||
});
|
||||
|
||||
final IconData icon;
|
||||
final String title;
|
||||
final String subtitle;
|
||||
final VoidCallback onTap;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.card,
|
||||
borderRadius: BorderRadius.circular(AppDimens.cardRadius),
|
||||
boxShadow: const [AppTheme.cardShadow],
|
||||
),
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(AppDimens.cardRadius),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(AppDimens.cardPadding),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: AppDimens.buttonLarge,
|
||||
height: AppDimens.buttonLarge,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.badgePink,
|
||||
borderRadius: BorderRadius.circular(AppDimens.innerRadius),
|
||||
),
|
||||
child: Icon(icon, color: AppColors.secondary, size: 22),
|
||||
),
|
||||
const SizedBox(width: AppDimens.spaceMd),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
color: AppColors.onSurface,
|
||||
fontSize: AppDimens.listTitle,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: AppDimens.spaceXs),
|
||||
Text(
|
||||
subtitle,
|
||||
style: const TextStyle(
|
||||
color: AppColors.muted,
|
||||
fontSize: AppDimens.caption,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Icon(
|
||||
Icons.chevron_right_rounded,
|
||||
color: AppColors.subtle,
|
||||
size: 20,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _CreatePlaceholderPage extends StatelessWidget {
|
||||
const _CreatePlaceholderPage({required this.title});
|
||||
|
||||
final String title;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
return Scaffold(
|
||||
key: const Key('create-placeholder-page'),
|
||||
backgroundColor: AppColors.ink,
|
||||
appBar: AppBar(title: Text(title)),
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.construction_rounded,
|
||||
color: AppColors.blue,
|
||||
size: 42,
|
||||
),
|
||||
const SizedBox(height: AppDimens.spaceMd),
|
||||
Text(
|
||||
l10n.comingSoon,
|
||||
style: const TextStyle(
|
||||
color: AppColors.onSurface,
|
||||
fontSize: AppDimens.sectionTitle,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user