191 lines
5.7 KiB
Dart
191 lines
5.7 KiB
Dart
// Author: fruit.com.cn
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import '../../core/theme/app_colors.dart';
|
|
import '../../core/theme/app_dimens.dart';
|
|
import '../../core/theme/app_theme.dart';
|
|
import '../../l10n/app_localizations.dart';
|
|
|
|
/// K28-B 创作页:AI 制作与上传发布入口。
|
|
class CreatePage extends StatelessWidget {
|
|
const CreatePage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final l10n = AppLocalizations.of(context)!;
|
|
return Theme(
|
|
data: AppTheme.light(),
|
|
child: SafeArea(
|
|
bottom: false,
|
|
child: ListView(
|
|
key: const Key('create-page'),
|
|
padding: const EdgeInsets.fromLTRB(
|
|
AppDimens.pageHorizontal,
|
|
AppDimens.spaceXl,
|
|
AppDimens.pageHorizontal,
|
|
AppDimens.spaceXl,
|
|
),
|
|
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.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,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|