watch_theme_view.dart
3.34 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import 'package:doublefeel_flutter/app/modules/watch_theme/models/watch_theme_models.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.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_colors.dart';
import '../widgets/watch_theme_header.dart';
import '../widgets/watch_theme_nav_bar.dart';
class WatchThemeView extends GetView<WatchThemeController> {
const WatchThemeView({super.key});
@override
Widget build(BuildContext context) {
return AnnotatedRegion<SystemUiOverlayStyle>(
value: const SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
statusBarIconBrightness: Brightness.dark,
statusBarBrightness: Brightness.light,
systemNavigationBarColor: WatchThemeColors.background,
systemNavigationBarIconBrightness: Brightness.dark,
),
child: Scaffold(
backgroundColor: WatchThemeColors.background,
body: Stack(
children: [
const Positioned(
left: 0,
right: 0,
top: 0,
height: 300,
child: DecoratedBox(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
WatchThemeColors.gradientTop,
WatchThemeColors.background,
],
),
),
),
),
SafeArea(
bottom: false,
child: Column(
children: [
WatchThemeNavBar(
title: 'Watch主题',
onBack: controller.executeBackLogic,
),
Expanded(
child: Obx(
() => SingleChildScrollView(
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.only(bottom: 24),
child: Column(
children: [
const WatchThemeHeader(),
const SizedBox(height: 26),
OfficialThemeGrid(
themes: officialThemes,
selectedIndex:
controller.selectedOfficialIndex.value,
onThemeTap: controller.selectOfficialTheme,
),
const SizedBox(height: 12),
CustomThemeCard(
isPremium: controller.isPremium.value,
hasCustomThemes: controller.hasCustomThemes.value,
customThemes: customThemes,
onCreateTap: controller.createCustomTheme,
onThemeTap: controller.previewCustomTheme,
),
],
),
),
),
),
],
),
),
],
),
),
);
}
}