watch_theme_view.dart
1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../controllers/watch_theme_controller.dart';
import '../widgets/custom_theme_card.dart';
import '../widgets/official_theme_grid.dart';
import '../widgets/watch_theme_gradient_scaffold.dart';
import '../widgets/watch_theme_header.dart';
class WatchThemeView extends GetView<WatchThemeController> {
const WatchThemeView({super.key});
@override
Widget build(BuildContext context) {
final topPadding = MediaQuery.paddingOf(context).top + kToolbarHeight;
return WatchThemeGradientScaffold(
title: 'Watch主题',
onBack: controller.executeBackLogic,
body: Obx(
() => SingleChildScrollView(
physics: const AlwaysScrollableScrollPhysics(),
padding: EdgeInsets.only(top: topPadding, bottom: 24),
child: Column(
children: [
WatchThemeHeader(
themeImageUrl:
controller.selectedThemeItem.value?.energeticImage,
),
const SizedBox(height: 26),
OfficialThemeGrid(
themes: controller.officialThemeItems,
activeThemeId: controller.selectedThemeItem.value?.id ?? 0,
onThemeTap: controller.selectOfficialTheme,
),
const SizedBox(height: 12),
CustomThemeCard(
isPremium: controller.isPremium.value,
customThemes: controller.customThemeItems,
activeThemeId: controller.selectedThemeItem.value?.id ?? 0,
onCreateTap: controller.createCustomTheme,
onThemeTap: controller.previewCustomTheme,
),
],
),
),
),
);
}
}