111
This commit is contained in:
@@ -6,12 +6,12 @@ import '../../../core/theme/app_theme.dart';
|
||||
import '../../../core/theme/app_theme_extension.dart';
|
||||
import '../../../core/storage/local_storage.dart';
|
||||
|
||||
/// 引导页数据模型
|
||||
/// 引導頁數據模型
|
||||
class _OnboardingItem {
|
||||
final String title;
|
||||
final String description;
|
||||
final IconData? icon; // 图标(二选一)
|
||||
final String? imagePath; // 图片路径(二选一)
|
||||
final IconData? icon; // 圖標(二選一)
|
||||
final String? imagePath; // 圖片路徑(二選一)
|
||||
final List<Color> gradientColors;
|
||||
|
||||
const _OnboardingItem({
|
||||
@@ -23,7 +23,7 @@ class _OnboardingItem {
|
||||
});
|
||||
}
|
||||
|
||||
/// 首次启动引导页
|
||||
/// 首次啟動引導頁
|
||||
class OnboardingPage extends StatefulWidget {
|
||||
final VoidCallback onComplete;
|
||||
|
||||
@@ -39,27 +39,27 @@ class _OnboardingPageState extends State<OnboardingPage> {
|
||||
|
||||
final _items = const [
|
||||
_OnboardingItem(
|
||||
title: '实时行情',
|
||||
description: '全球市场行情实时更新,把握每一个投资机会',
|
||||
imagePath: 'assets/images/onboarding_1.png', // 替换为你的图片
|
||||
title: '實時行情',
|
||||
description: '全球市場行情實時更新,把握每一個投資機會',
|
||||
imagePath: 'assets/images/onboarding_1.png', // 替換為你的圖片
|
||||
gradientColors: [AppColorScheme.darkPrimary, AppColorScheme.darkPrimaryContainer],
|
||||
),
|
||||
_OnboardingItem(
|
||||
title: '模拟交易',
|
||||
description: '零风险体验真实交易,学习投资策略',
|
||||
imagePath: 'assets/images/onboarding_2.png', // 替换为你的图片
|
||||
title: '模擬交易',
|
||||
description: '零風險體驗真實交易,學習投資策略',
|
||||
imagePath: 'assets/images/onboarding_2.png', // 替換為你的圖片
|
||||
gradientColors: [AppColorScheme.darkTertiary, AppColorScheme.darkTertiaryContainer],
|
||||
),
|
||||
_OnboardingItem(
|
||||
title: '资产管理',
|
||||
description: '清晰的资产概览,轻松管理你的投资组合',
|
||||
imagePath: 'assets/images/onboarding_3.png', // 替换为你的图片
|
||||
title: '資產管理',
|
||||
description: '清晰的資產概覽,輕鬆管理你的投資組合',
|
||||
imagePath: 'assets/images/onboarding_3.png', // 替換為你的圖片
|
||||
gradientColors: [AppColorScheme.darkSecondary, AppColorScheme.darkSecondaryFixed],
|
||||
),
|
||||
_OnboardingItem(
|
||||
title: '安全可靠',
|
||||
description: '数据加密存储,保护你的隐私安全',
|
||||
imagePath: 'assets/images/onboarding_4.png', // 替换为你的图片
|
||||
description: '數據加密存儲,保護你的隱私安全',
|
||||
imagePath: 'assets/images/onboarding_4.png', // 替換為你的圖片
|
||||
gradientColors: [AppColorScheme.darkPrimaryFixed, AppColorScheme.darkPrimaryFixedDim],
|
||||
),
|
||||
];
|
||||
@@ -97,7 +97,7 @@ class _OnboardingPageState extends State<OnboardingPage> {
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
// 顶部跳过按钮
|
||||
// 頂部跳過按鈕
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: AppSpacing.lg,
|
||||
@@ -109,7 +109,7 @@ class _OnboardingPageState extends State<OnboardingPage> {
|
||||
TextButton(
|
||||
onPressed: _skip,
|
||||
child: Text(
|
||||
'跳过',
|
||||
'跳過',
|
||||
style: AppTextStyles.headlineMedium(context).copyWith(
|
||||
color: context.colors.onSurfaceVariant,
|
||||
),
|
||||
@@ -118,7 +118,7 @@ class _OnboardingPageState extends State<OnboardingPage> {
|
||||
],
|
||||
),
|
||||
),
|
||||
// 页面内容
|
||||
// 頁面內容
|
||||
Expanded(
|
||||
child: PageView.builder(
|
||||
controller: _pageController,
|
||||
@@ -133,7 +133,7 @@ class _OnboardingPageState extends State<OnboardingPage> {
|
||||
},
|
||||
),
|
||||
),
|
||||
// 底部指示器和按钮
|
||||
// 底部指示器和按鈕
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
AppSpacing.lg,
|
||||
@@ -143,7 +143,7 @@ class _OnboardingPageState extends State<OnboardingPage> {
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
// 页面指示器
|
||||
// 頁面指示器
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: List.generate(
|
||||
@@ -152,7 +152,7 @@ class _OnboardingPageState extends State<OnboardingPage> {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: AppSpacing.xl),
|
||||
// 下一步/开始按钮
|
||||
// 下一步/開始按鈕
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
height: 56,
|
||||
@@ -167,7 +167,7 @@ class _OnboardingPageState extends State<OnboardingPage> {
|
||||
elevation: 0,
|
||||
),
|
||||
child: Text(
|
||||
_currentPage == _items.length - 1 ? '开始使用' : '下一步',
|
||||
_currentPage == _items.length - 1 ? '開始使用' : '下一步',
|
||||
style: AppTextStyles.headlineLarge(context).copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
@@ -189,7 +189,7 @@ class _OnboardingPageState extends State<OnboardingPage> {
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
// 图标/图片容器
|
||||
// 圖標/圖片容器
|
||||
Container(
|
||||
width: 200,
|
||||
height: 200,
|
||||
@@ -217,7 +217,7 @@ class _OnboardingPageState extends State<OnboardingPage> {
|
||||
height: 180,
|
||||
fit: BoxFit.cover,
|
||||
errorBuilder: (context, error, stackTrace) {
|
||||
// 图片加载失败时显示图标
|
||||
// 圖片加載失敗時顯示圖標
|
||||
return Icon(
|
||||
item.icon ?? LucideIcons.image,
|
||||
size: 72,
|
||||
@@ -234,7 +234,7 @@ class _OnboardingPageState extends State<OnboardingPage> {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: AppSpacing.xxl + AppSpacing.lg),
|
||||
// 标题
|
||||
// 標題
|
||||
Text(
|
||||
item.title,
|
||||
style: AppTextStyles.displaySmall(context).copyWith(
|
||||
|
||||
Reference in New Issue
Block a user