Skip to content

Commit 98d6dd6

Browse files
committed
refactor: migrate bedtime theme to core_ui package
- Moved bedtime_theme.dart from app/lib/core/theme/ to packages/core_ui/lib/src/theme/ - Updated core_ui barrel export to include bedtime theme - Added re-export in app/lib/core/theme/bedtime_theme.dart for backward compatibility - Part of Task 1.1: Formalize super-app architecture
1 parent 5807b5f commit 98d6dd6

9 files changed

Lines changed: 1437 additions & 215 deletions

File tree

Lines changed: 4 additions & 214 deletions
Original file line numberDiff line numberDiff line change
@@ -1,214 +1,4 @@
1-
import 'package:flutter/material.dart';
2-
3-
/// Bedtime mode theme with AMOLED black, warm tint, and reduced motion
4-
class BedtimeTheme {
5-
static const Color _amoledBlack = Color(0xFF000000);
6-
static const Color _warmTint = Color(0xFFFFE4B5); // Moccasin - warm beige
7-
static const Color _darkGray = Color(0xFF1A1A1A);
8-
static const Color _mediumGray = Color(0xFF2D2D2D);
9-
10-
static ThemeData get bedtimeTheme {
11-
return ThemeData(
12-
useMaterial3: true,
13-
brightness: Brightness.dark,
14-
scaffoldBackgroundColor: _amoledBlack,
15-
primaryColor: _warmTint,
16-
primaryColorDark: _darkGray,
17-
18-
// Color scheme with warm tones
19-
colorScheme: const ColorScheme.dark(
20-
primary: _warmTint,
21-
onPrimary: _amoledBlack,
22-
secondary: Color(0xFFFFD699),
23-
onSecondary: _amoledBlack,
24-
surface: _darkGray,
25-
onSurface: _warmTint,
26-
error: Color(0xFFCF6679),
27-
onError: _amoledBlack,
28-
),
29-
30-
// AppBar theme
31-
appBarTheme: const AppBarTheme(
32-
backgroundColor: _darkGray,
33-
foregroundColor: _warmTint,
34-
elevation: 0,
35-
centerTitle: true,
36-
),
37-
38-
// Card theme
39-
cardTheme: CardThemeData(
40-
color: _mediumGray,
41-
elevation: 0,
42-
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
43-
),
44-
45-
// Button themes
46-
elevatedButtonTheme: ElevatedButtonThemeData(
47-
style: ElevatedButton.styleFrom(
48-
backgroundColor: _warmTint,
49-
foregroundColor: _amoledBlack,
50-
elevation: 0,
51-
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
52-
),
53-
),
54-
55-
outlinedButtonTheme: OutlinedButtonThemeData(
56-
style: OutlinedButton.styleFrom(
57-
foregroundColor: _warmTint,
58-
side: const BorderSide(color: _warmTint),
59-
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
60-
),
61-
),
62-
63-
textButtonTheme: TextButtonThemeData(
64-
style: TextButton.styleFrom(foregroundColor: _warmTint),
65-
),
66-
67-
// Input decoration theme
68-
inputDecorationTheme: InputDecorationTheme(
69-
filled: true,
70-
fillColor: _mediumGray,
71-
border: OutlineInputBorder(
72-
borderRadius: BorderRadius.circular(8),
73-
borderSide: const BorderSide(color: _mediumGray),
74-
),
75-
enabledBorder: OutlineInputBorder(
76-
borderRadius: BorderRadius.circular(8),
77-
borderSide: const BorderSide(color: _mediumGray),
78-
),
79-
focusedBorder: OutlineInputBorder(
80-
borderRadius: BorderRadius.circular(8),
81-
borderSide: const BorderSide(color: _warmTint),
82-
),
83-
labelStyle: const TextStyle(color: _warmTint),
84-
hintStyle: const TextStyle(color: Color(0xFF999999)),
85-
),
86-
87-
// Text themes with warm tint
88-
textTheme: const TextTheme(
89-
displayLarge: TextStyle(
90-
color: _warmTint,
91-
fontSize: 32,
92-
fontWeight: FontWeight.bold,
93-
),
94-
displayMedium: TextStyle(
95-
color: _warmTint,
96-
fontSize: 28,
97-
fontWeight: FontWeight.bold,
98-
),
99-
displaySmall: TextStyle(
100-
color: _warmTint,
101-
fontSize: 24,
102-
fontWeight: FontWeight.bold,
103-
),
104-
headlineLarge: TextStyle(
105-
color: _warmTint,
106-
fontSize: 24,
107-
fontWeight: FontWeight.bold,
108-
),
109-
headlineMedium: TextStyle(
110-
color: _warmTint,
111-
fontSize: 20,
112-
fontWeight: FontWeight.bold,
113-
),
114-
headlineSmall: TextStyle(
115-
color: _warmTint,
116-
fontSize: 18,
117-
fontWeight: FontWeight.bold,
118-
),
119-
titleLarge: TextStyle(
120-
color: _warmTint,
121-
fontSize: 16,
122-
fontWeight: FontWeight.bold,
123-
),
124-
titleMedium: TextStyle(
125-
color: _warmTint,
126-
fontSize: 14,
127-
fontWeight: FontWeight.bold,
128-
),
129-
titleSmall: TextStyle(
130-
color: _warmTint,
131-
fontSize: 12,
132-
fontWeight: FontWeight.bold,
133-
),
134-
bodyLarge: TextStyle(color: _warmTint, fontSize: 16),
135-
bodyMedium: TextStyle(color: _warmTint, fontSize: 14),
136-
bodySmall: TextStyle(color: Color(0xFFCCCCCC), fontSize: 12),
137-
labelLarge: TextStyle(
138-
color: _warmTint,
139-
fontSize: 14,
140-
fontWeight: FontWeight.bold,
141-
),
142-
labelMedium: TextStyle(
143-
color: _warmTint,
144-
fontSize: 12,
145-
fontWeight: FontWeight.bold,
146-
),
147-
labelSmall: TextStyle(
148-
color: _warmTint,
149-
fontSize: 10,
150-
fontWeight: FontWeight.bold,
151-
),
152-
),
153-
154-
// Navigation bar theme
155-
navigationBarTheme: NavigationBarThemeData(
156-
backgroundColor: _darkGray,
157-
indicatorColor: _warmTint,
158-
labelTextStyle: WidgetStateProperty.all(
159-
const TextStyle(color: _warmTint, fontSize: 12),
160-
),
161-
iconTheme: WidgetStateProperty.resolveWith((states) {
162-
if (states.contains(WidgetState.selected)) {
163-
return const IconThemeData(color: _amoledBlack);
164-
}
165-
return const IconThemeData(color: _warmTint);
166-
}),
167-
),
168-
169-
// Slider theme
170-
sliderTheme: const SliderThemeData(
171-
activeTrackColor: _warmTint,
172-
inactiveTrackColor: _mediumGray,
173-
thumbColor: _warmTint,
174-
overlayColor: Color(0x29FFE4B5),
175-
),
176-
177-
// Switch theme
178-
switchTheme: SwitchThemeData(
179-
thumbColor: WidgetStateProperty.resolveWith((states) {
180-
if (states.contains(WidgetState.selected)) {
181-
return _warmTint;
182-
}
183-
return _mediumGray;
184-
}),
185-
trackColor: WidgetStateProperty.resolveWith((states) {
186-
if (states.contains(WidgetState.selected)) {
187-
return _warmTint.withOpacity(0.5);
188-
}
189-
return _mediumGray;
190-
}),
191-
),
192-
193-
// Checkbox theme
194-
checkboxTheme: CheckboxThemeData(
195-
fillColor: WidgetStateProperty.resolveWith((states) {
196-
if (states.contains(WidgetState.selected)) {
197-
return _warmTint;
198-
}
199-
return _mediumGray;
200-
}),
201-
),
202-
203-
// Radio theme
204-
radioTheme: RadioThemeData(
205-
fillColor: WidgetStateProperty.resolveWith((states) {
206-
if (states.contains(WidgetState.selected)) {
207-
return _warmTint;
208-
}
209-
return _mediumGray;
210-
}),
211-
),
212-
);
213-
}
214-
}
1+
// Re-export BedtimeTheme from core_ui for backward compatibility.
2+
// New code should import directly from core_ui:
3+
// import 'package:core_ui/core_ui.dart';
4+
export 'package:core_ui/src/theme/bedtime_theme.dart';

app/lib/features/agent_chat/presentation/screens/profile_screen.dart

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import '../../../../core/http/http_dog.dart';
77
import '../../../../core/dictionary/dictionary.dart';
88
import '../../../../core/routing/route_names.dart';
99
import '../../../quotes/presentation/widgets/daily_quote_card.dart';
10+
import '../../../settings/presentation/screens/ai_models_screen.dart';
1011

1112
/// User profile screen
1213
class ProfileScreen extends ConsumerWidget {
@@ -97,6 +98,21 @@ class ProfileScreen extends ConsumerWidget {
9798
),
9899
),
99100

101+
// AI Models
102+
ListTile(
103+
leading: const Icon(Icons.model_training),
104+
title: const Text('AI Models'),
105+
subtitle: const Text('Browse and manage offline models'),
106+
trailing: const Icon(Icons.arrow_forward_ios, size: 16),
107+
onTap: () {
108+
Navigator.of(context).push(
109+
MaterialPageRoute(
110+
builder: (context) => const AIModelsScreen(),
111+
),
112+
);
113+
},
114+
),
115+
100116
const SizedBox(height: 32),
101117

102118
// Feature flags section

0 commit comments

Comments
 (0)