forked from mhmzdev/hacktoberfest-flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
themes.dart
105 lines (53 loc) · 1.86 KB
/
themes.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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
var colorList = [
Colors.orange,
Colors.blue,
Colors.cyan,
Colors.green,
Colors.pink,
Colors.red,
Colors.brown,
Colors.deepPurple,
// Colors.grey,
];
bool isDarkMode = false;
class MyTheme {
static ThemeData lightTheme(BuildContext context) => ThemeData(
primarySwatch: colorList[Random().nextInt(colorList.length)],
accentColor: Colors.white,
// splashColor: Colors.transparent,
fontFamily: GoogleFonts.poppins().fontFamily,
canvasColor: Colors.white,
// highlightColor: Colors.transparent,
pageTransitionsTheme: PageTransitionsTheme(
builders: {
TargetPlatform.iOS: ZoomPageTransitionsBuilder(),
TargetPlatform.android: OpenUpwardsPageTransitionsBuilder(),
TargetPlatform.windows: OpenUpwardsPageTransitionsBuilder(),
},
),
appBarTheme: AppBarTheme(
elevation: 2,
iconTheme: IconThemeData(
color: Colors.white,
),
textTheme: Theme.of(context).textTheme),
);
static ThemeData darkTheme(BuildContext context) => ThemeData(
primaryColor: Colors.black,
brightness: Brightness.dark,
fontFamily: GoogleFonts.poppins().fontFamily,
bottomNavigationBarTheme:
BottomNavigationBarThemeData(backgroundColor: Colors.black),
textButtonTheme: TextButtonThemeData(),
pageTransitionsTheme: PageTransitionsTheme(
builders: {
TargetPlatform.iOS: ZoomPageTransitionsBuilder(),
TargetPlatform.android: OpenUpwardsPageTransitionsBuilder(),
TargetPlatform.windows: OpenUpwardsPageTransitionsBuilder(),
},
),
);
}