Skip to content
This repository was archived by the owner on Feb 5, 2024. It is now read-only.

Commit 73eb15f

Browse files
committed
Theme change completed
1 parent 640ac2e commit 73eb15f

13 files changed

Lines changed: 375 additions & 1053 deletions

File tree

.flutter-plugins-dependencies

Lines changed: 4 additions & 0 deletions
Large diffs are not rendered by default.

lib/main.dart

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,6 @@ class MainApp extends StatelessWidget {
103103
debugShowCheckedModeBanner: false,
104104
theme: kTheme,
105105
home: Provider.value(value: credManager, child: Home()),
106-
routes: <String, WidgetBuilder>{
107-
'/login': (BuildContext context) =>
108-
Provider.value(value: credManager, child: const LoginPage()),
109-
'/home': (BuildContext context) =>
110-
Provider.value(value: credManager, child: Home()),
111-
// '/floorMap': (BuildContext context) => HackRUMap(),
112-
},
113106
onUnknownRoute: (RouteSettings setting) {
114107
var unknownRoute = setting.name;
115108
return MaterialPageRoute(

lib/styles.dart

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ import 'package:flutter/material.dart';
3737

3838
abstract class HackRUColors {
3939
static const Color blue = Color(0xff1f6aa0);
40-
static const Color blue_grey = Color(0xffd1e9ef);
40+
static const Color off_white_blue = Color(0xffd1e9ef);
41+
static const Color blue_grey = Colors.blueGrey;
4142
static const LinearGradient loading_gradient = LinearGradient(colors: [
4243
Colors.black26,
4344
Colors.transparent,
@@ -123,124 +124,124 @@ ThemeData _buildTheme() {
123124
textTheme: const TextTheme(
124125
headline1: TextStyle(
125126
fontSize: 100.0,
126-
color: HackRUColors.white,
127+
color: HackRUColors.off_white_blue,
127128
fontWeight: FontWeight.w600,
128129
),
129130
headline2: TextStyle(
130131
fontSize: 90.0,
131-
color: HackRUColors.white,
132+
color: HackRUColors.off_white_blue,
132133
fontWeight: FontWeight.bold,
133134
),
134135
headline3: TextStyle(
135136
fontSize: 45.0,
136-
color: HackRUColors.white,
137+
color: HackRUColors.off_white_blue,
137138
),
138139
headline4: TextStyle(
139140
fontSize: 35.0,
140-
color: HackRUColors.white,
141+
color: HackRUColors.off_white_blue,
141142
),
142143
headline5: TextStyle(
143144
fontSize: 25.0,
144-
color: HackRUColors.charcoal_light,
145+
color: HackRUColors.off_white_blue,
145146
fontWeight: FontWeight.w700,
146147
),
147148
headline6: TextStyle(
148149
fontSize: 20.0,
149-
color: HackRUColors.charcoal_light,
150+
color: HackRUColors.off_white_blue,
150151
fontWeight: FontWeight.w700,
151152
),
152153
subtitle1: TextStyle(
153154
fontSize: 18.0,
154-
color: HackRUColors.charcoal_light,
155+
color: HackRUColors.off_white_blue,
155156
fontWeight: FontWeight.w700,
156157
),
157158
bodyText1: TextStyle(
158-
color: HackRUColors.charcoal_light,
159+
color: HackRUColors.off_white_blue,
159160
),
160161
bodyText2: TextStyle(
161-
color: HackRUColors.charcoal_light,
162+
color: HackRUColors.off_white_blue,
162163
),
163164
),
164165
primaryTextTheme: const TextTheme(
165166
headline1: TextStyle(
166167
fontSize: 100.0,
167-
color: HackRUColors.pink,
168+
color: HackRUColors.off_white_blue,
168169
fontWeight: FontWeight.w600,
169170
),
170171
headline2: TextStyle(
171172
fontSize: 90.0,
172-
color: HackRUColors.pink,
173+
color: HackRUColors.off_white_blue,
173174
fontWeight: FontWeight.bold,
174175
),
175176
headline3: TextStyle(
176177
fontSize: 45.0,
177-
color: HackRUColors.pink,
178+
color: HackRUColors.off_white_blue,
178179
),
179180
headline4: TextStyle(
180181
fontSize: 35.0,
181-
color: HackRUColors.pink,
182+
color: HackRUColors.off_white_blue,
182183
),
183184
headline5: TextStyle(
184185
fontSize: 25.0,
185-
color: HackRUColors.pink,
186+
color: HackRUColors.off_white_blue,
186187
fontWeight: FontWeight.w700,
187188
),
188189
headline6: TextStyle(
189190
fontSize: 20.0,
190-
color: HackRUColors.pink,
191+
color: HackRUColors.off_white_blue,
191192
fontWeight: FontWeight.w700,
192193
),
193194
subtitle1: TextStyle(
194195
fontSize: 18.0,
195-
color: HackRUColors.pink,
196+
color: HackRUColors.off_white_blue,
196197
fontWeight: FontWeight.w700,
197198
),
198199
bodyText1: TextStyle(
199-
color: HackRUColors.pink,
200+
color: HackRUColors.off_white_blue,
200201
),
201202
bodyText2: TextStyle(
202-
color: HackRUColors.pink,
203+
color: HackRUColors.off_white_blue,
203204
),
204205
),
205206
accentTextTheme: const TextTheme(
206207
headline1: TextStyle(
207208
fontSize: 100.0,
208-
color: HackRUColors.yellow,
209+
color: HackRUColors.blue_grey,
209210
fontWeight: FontWeight.w600,
210211
),
211212
headline2: TextStyle(
212213
fontSize: 90.0,
213-
color: HackRUColors.yellow,
214+
color: HackRUColors.blue_grey,
214215
fontWeight: FontWeight.bold,
215216
),
216217
headline3: TextStyle(
217218
fontSize: 45.0,
218-
color: HackRUColors.yellow,
219+
color: HackRUColors.blue_grey,
219220
),
220221
headline4: TextStyle(
221222
fontSize: 35.0,
222-
color: HackRUColors.yellow,
223+
color: HackRUColors.blue_grey,
223224
),
224225
headline5: TextStyle(
225226
fontSize: 25.0,
226-
color: HackRUColors.charcoal_light,
227+
color: HackRUColors.blue_grey,
227228
fontWeight: FontWeight.w700,
228229
),
229230
headline6: TextStyle(
230231
fontSize: 20.0,
231-
color: HackRUColors.yellow,
232+
color: HackRUColors.blue_grey,
232233
fontWeight: FontWeight.w700,
233234
),
234235
subtitle1: TextStyle(
235236
fontSize: 18.0,
236-
color: HackRUColors.yellow,
237+
color: HackRUColors.blue_grey,
237238
fontWeight: FontWeight.w700,
238239
),
239240
bodyText1: TextStyle(
240-
color: HackRUColors.yellow,
241+
color: HackRUColors.blue_grey,
241242
),
242243
bodyText2: TextStyle(
243-
color: HackRUColors.yellow,
244+
color: HackRUColors.blue_grey,
244245
),
245246
),
246247
);

lib/ui/pages/annoucements/announcements.dart

Lines changed: 63 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,11 @@ class AnnouncementsState extends State {
1616
static List<Announcement>? cachedMsgs;
1717

1818
Future<List<Announcement>> _getSlacks() async {
19-
// var streamCtrl = StreamController<List<Announcement>>();
20-
// if (cachedMsgs != null) {
21-
// streamCtrl.sink.add(cachedMsgs!);
22-
// }
2319
var slackMessages = List<Announcement>.empty();
2420
try {
2521
await slackResources().then((slackMsgs) {
26-
// debugPrint('======= slacks: $slackMsgs');
2722
slackMessages = slackMsgs;
2823
});
29-
// if (cacheTTL.isBefore(DateTime.now())) {
30-
// slackResources().then((slackMsgs) {
31-
// streamCtrl.sink.add(slackMsgs);
32-
// persistSlackAnnouncements(slackMsgs);
33-
// cacheTTL = DateTime.now().add(Duration(minutes: 5));
34-
// streamCtrl.close();
35-
// });
36-
// }
3724
} catch (e) {
3825
print('***********************\nSlack data stream ctrl error: ' +
3926
e.toString());
@@ -45,81 +32,72 @@ class AnnouncementsState extends State {
4532
Widget build(BuildContext context) {
4633
return Scaffold(
4734
backgroundColor: Colors.transparent,
48-
body: Column(children: [
49-
Padding(
50-
padding: const EdgeInsets.all(8.0),
51-
child: Align(
52-
alignment: Alignment.centerLeft,
53-
child: Text(
54-
'Announcements:',
55-
style: Theme.of(context)
56-
.textTheme
57-
.subtitle1!
58-
.copyWith(color: Color.fromRGBO(209, 233, 239, 1)),
59-
),
60-
),
61-
),
62-
FutureBuilder<List<Announcement>?>(
63-
future: _getSlacks(),
64-
builder: (BuildContext context,
65-
AsyncSnapshot<List<Announcement>?> snapshot) {
66-
if (snapshot.hasError) {
67-
debugPrint('ERROR-->DASHBOARD: ${snapshot.hasError}');
68-
}
69-
var resources = snapshot.data ?? [];
70-
debugPrint(resources.length.toString());
71-
return Container(
72-
padding: const EdgeInsets.symmetric(horizontal: 5.0),
73-
child: RefreshIndicator(
74-
color: Colors.white,
75-
backgroundColor: HackRUColors.pink,
76-
strokeWidth: 4,
77-
onRefresh: () async {
78-
var refreshedResources = await _getSlacks();
79-
if (mounted) {
80-
setState(() {
81-
resources = refreshedResources;
82-
});
83-
}
84-
},
85-
child: resources.length == 0
86-
? Padding(
87-
padding: const EdgeInsets.all(8.0),
88-
child: Column(
89-
children: const [
90-
Center(
91-
child:
92-
Text("Fetching Announcements from Slack..."),
93-
),
94-
Padding(
95-
padding: EdgeInsets.all(20.0),
96-
child: Center(
97-
child: CircularProgressIndicator(),
35+
body: FutureBuilder<List<Announcement>?>(
36+
future: _getSlacks(),
37+
builder: (BuildContext context,
38+
AsyncSnapshot<List<Announcement>?> snapshot) {
39+
if (snapshot.hasError) {
40+
debugPrint('ERROR-->DASHBOARD: ${snapshot.hasError}');
41+
}
42+
var resources = snapshot.data ?? [];
43+
debugPrint(resources.length.toString());
44+
return Container(
45+
padding: const EdgeInsets.symmetric(horizontal: 5.0),
46+
child: RefreshIndicator(
47+
color: Colors.white,
48+
backgroundColor: HackRUColors.pink,
49+
strokeWidth: 4,
50+
onRefresh: () async {
51+
var refreshedResources = await _getSlacks();
52+
if (mounted) {
53+
setState(() {
54+
resources = refreshedResources;
55+
});
56+
}
57+
},
58+
child: resources.length == 0
59+
? Column(
60+
mainAxisAlignment: MainAxisAlignment.center,
61+
children: [
62+
Padding(
63+
padding: const EdgeInsets.all(8.0),
64+
child: Column(
65+
children: const [
66+
Center(
67+
child: Text(
68+
"Fetching Announcements from Slack...",
69+
style: TextStyle(
70+
color: HackRUColors.off_white_blue),
71+
),
9872
),
99-
),
100-
],
101-
),
102-
)
103-
: ListView.builder(
104-
shrinkWrap: true,
105-
physics: const AlwaysScrollableScrollPhysics(),
106-
padding: const EdgeInsets.only(
107-
bottom: 25.0,
73+
Padding(
74+
padding: EdgeInsets.all(20.0),
75+
child: Center(
76+
child: CircularProgressIndicator(),
77+
),
78+
),
79+
],
80+
),
10881
),
109-
// itemCount: resources.length+1,
110-
controller: ScrollController(),
111-
itemCount: resources.length,
112-
itemBuilder: (context, index) {
113-
return AnnouncementCard(
114-
resource: resources[index],
115-
);
116-
},
82+
],
83+
)
84+
: ListView.builder(
85+
physics: const AlwaysScrollableScrollPhysics(),
86+
padding: const EdgeInsets.only(
87+
bottom: 25.0,
11788
),
118-
),
119-
);
120-
},
121-
),
122-
]),
89+
controller: ScrollController(),
90+
itemCount: resources.length,
91+
itemBuilder: (context, index) {
92+
return AnnouncementCard(
93+
resource: resources[index],
94+
);
95+
},
96+
),
97+
),
98+
);
99+
},
100+
),
123101
);
124102
}
125103
}

0 commit comments

Comments
 (0)