@@ -16,7 +16,7 @@ class ImageWrapper extends StatelessWidget {
1616 //TODO Listen to inherited widget width updates.
1717 double width = MediaQuery .of (context).size.width;
1818 return Container (
19- margin: EdgeInsets .symmetric (vertical: 24 ),
19+ margin: const EdgeInsets .symmetric (vertical: 24 ),
2020 child: Image .asset (
2121 image,
2222 width: width,
@@ -57,11 +57,11 @@ class Tag extends StatelessWidget {
5757 tag,
5858 style: GoogleFonts .openSans (color: Colors .white, fontSize: 14 ),
5959 ),
60- fillColor: Color (0xFF242424 ),
61- padding: EdgeInsets .symmetric (horizontal: 16 ),
60+ fillColor: const Color (0xFF242424 ),
61+ padding: const EdgeInsets .symmetric (horizontal: 16 ),
6262 elevation: 0 ,
6363 hoverElevation: 0 ,
64- hoverColor: Color (0xFFC7C7C7 ),
64+ hoverColor: const Color (0xFFC7C7C7 ),
6565 highlightElevation: 0 ,
6666 focusElevation: 0 ,
6767 );
@@ -102,20 +102,20 @@ class ReadMoreButton extends StatelessWidget {
102102 states.contains (MaterialState .hovered) ||
103103 states.contains (MaterialState .pressed)) {
104104 return GoogleFonts .montserrat (
105- textStyle: TextStyle (
105+ textStyle: const TextStyle (
106106 fontSize: 14 , color: Colors .white, letterSpacing: 1 ),
107107 );
108108 }
109109
110110 return GoogleFonts .montserrat (
111- textStyle:
112- TextStyle ( fontSize: 14 , color: textPrimary, letterSpacing: 1 ),
111+ textStyle: const TextStyle (
112+ fontSize: 14 , color: textPrimary, letterSpacing: 1 ),
113113 );
114114 }),
115115 padding: MaterialStateProperty .all <EdgeInsetsGeometry >(
116116 const EdgeInsets .symmetric (horizontal: 12 , vertical: 16 )),
117117 ),
118- child: Text (
118+ child: const Text (
119119 "READ MORE" ,
120120 ),
121121 );
@@ -125,7 +125,7 @@ class ReadMoreButton extends StatelessWidget {
125125const Widget divider = Divider (color: Color (0xFFEEEEEE ), thickness: 1 );
126126Widget dividerSmall = Container (
127127 width: 40 ,
128- decoration: BoxDecoration (
128+ decoration: const BoxDecoration (
129129 border: Border (
130130 bottom: BorderSide (
131131 color: Color (0xFFA0A0A0 ),
@@ -139,14 +139,14 @@ List<Widget> authorSection({String? imageUrl, String? name, String? bio}) {
139139 return [
140140 divider,
141141 Container (
142- padding: EdgeInsets .symmetric (vertical: 40 ),
142+ padding: const EdgeInsets .symmetric (vertical: 40 ),
143143 child: Row (
144144 children: < Widget > [
145145 if (imageUrl != null )
146146 Container (
147- margin: EdgeInsets .only (right: 25 ),
147+ margin: const EdgeInsets .only (right: 25 ),
148148 child: Material (
149- shape: CircleBorder (),
149+ shape: const CircleBorder (),
150150 clipBehavior: Clip .hardEdge,
151151 color: Colors .transparent,
152152 child: Image .asset (
@@ -184,6 +184,8 @@ List<Widget> authorSection({String? imageUrl, String? name, String? bio}) {
184184}
185185
186186class PostNavigation extends StatelessWidget {
187+ const PostNavigation ({Key ? key}) : super (key: key);
188+
187189 // TODO Get PostID from Global Routing Singleton.
188190 // Example: String currentPage = RouteController.of(context).currentPage;
189191 @override
@@ -193,19 +195,19 @@ class PostNavigation extends StatelessWidget {
193195 children: < Widget > [
194196 Row (
195197 children: < Widget > [
196- Icon (
198+ const Icon (
197199 Icons .keyboard_arrow_left,
198200 size: 25 ,
199201 color: textSecondary,
200202 ),
201203 Text ("PREVIOUS POST" , style: buttonTextStyle),
202204 ],
203205 ),
204- Spacer (),
206+ const Spacer (),
205207 Row (
206208 children: < Widget > [
207209 Text ("NEXT POST" , style: buttonTextStyle),
208- Icon (
210+ const Icon (
209211 Icons .keyboard_arrow_right,
210212 size: 25 ,
211213 color: textSecondary,
@@ -218,26 +220,28 @@ class PostNavigation extends StatelessWidget {
218220}
219221
220222class ListNavigation extends StatelessWidget {
223+ const ListNavigation ({Key ? key}) : super (key: key);
224+
221225 @override
222226 Widget build (BuildContext context) {
223227 return Row (
224228 mainAxisAlignment: MainAxisAlignment .spaceBetween,
225229 children: < Widget > [
226230 Row (
227231 children: < Widget > [
228- Icon (
232+ const Icon (
229233 Icons .keyboard_arrow_left,
230234 size: 25 ,
231235 color: textSecondary,
232236 ),
233237 Text ("NEWER POSTS" , style: buttonTextStyle),
234238 ],
235239 ),
236- Spacer (),
240+ const Spacer (),
237241 Row (
238242 children: < Widget > [
239243 Text ("OLDER POSTS" , style: buttonTextStyle),
240- Icon (
244+ const Icon (
241245 Icons .keyboard_arrow_right,
242246 size: 25 ,
243247 color: textSecondary,
@@ -250,12 +254,14 @@ class ListNavigation extends StatelessWidget {
250254}
251255
252256class Footer extends StatelessWidget {
257+ const Footer ({Key ? key}) : super (key: key);
258+
253259 // TODO Add additional footer components (i.e. about, links, logos).
254260 @override
255261 Widget build (BuildContext context) {
256262 return Container (
257- padding: EdgeInsets .symmetric (vertical: 40 ),
258- child: Align (
263+ padding: const EdgeInsets .symmetric (vertical: 40 ),
264+ child: const Align (
259265 alignment: Alignment .centerRight,
260266 child: TextBody (text: "Copyright © 2020" ),
261267 ),
@@ -278,10 +284,8 @@ class ListItem extends StatelessWidget {
278284 return Column (
279285 children: < Widget > [
280286 if (imageUrl != null )
281- Container (
282- child: ImageWrapper (
283- image: imageUrl! ,
284- ),
287+ ImageWrapper (
288+ image: imageUrl! ,
285289 ),
286290 Align (
287291 alignment: Alignment .centerLeft,
@@ -327,13 +331,15 @@ class ListItem extends StatelessWidget {
327331 * a hamburger menu on screens smaller than 400px.
328332 */
329333class MenuBar extends StatelessWidget {
334+ const MenuBar ({Key ? key}) : super (key: key);
335+
330336 @override
331337 Widget build (BuildContext context) {
332338 return Column (
333339 mainAxisSize: MainAxisSize .min,
334340 children: < Widget > [
335341 Container (
336- margin: EdgeInsets .symmetric (vertical: 30 ),
342+ margin: const EdgeInsets .symmetric (vertical: 30 ),
337343 child: Row (
338344 children: < Widget > [
339345 GestureDetector (
@@ -412,8 +418,8 @@ class MenuBar extends StatelessWidget {
412418 ),
413419 Container (
414420 height: 1 ,
415- margin: EdgeInsets .only (bottom: 30 ),
416- color: Color (0xFFEEEEEE )),
421+ margin: const EdgeInsets .only (bottom: 30 ),
422+ color: const Color (0xFFEEEEEE )),
417423 ],
418424 );
419425 }
0 commit comments