-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp_theme.dart
40 lines (33 loc) · 951 Bytes
/
app_theme.dart
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
import 'package:flutter/material.dart';
import 'package:open_work_flutter/theme/color/color_seed.dart';
class AppTheme {
final ThemeMode mode;
final ColorSeed seed;
const AppTheme({
required this.mode,
required this.seed,
});
ThemeData asDark() => _create(Brightness.dark);
ThemeData asLight() => _create(Brightness.light);
ThemeData _create(Brightness brightness) {
return ThemeData(
useMaterial3: true,
brightness: brightness,
colorSchemeSeed: seed.color,
);
// final color = data.colorScheme.surfaceContainer;
// return data.copyWith(
// appBarTheme: AppBarTheme(
// systemOverlayStyle: SystemUiOverlayStyle(
// systemNavigationBarColor: color,
// statusBarColor: color,
// ),
// ),
// );
}
AppTheme copyWith({
ThemeMode? mode,
ColorSeed? seed,
}) =>
AppTheme(mode: mode ?? this.mode, seed: seed ?? this.seed);
}