Skip to content

Commit 933a0ca

Browse files
authored
Merge pull request #3 from ph-value/feat/ui/til-layout
Feat/ui/til-layout
2 parents 6d1bd6a + 229d498 commit 933a0ca

File tree

4 files changed

+311
-74
lines changed

4 files changed

+311
-74
lines changed

lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class CustomAppBarScreenTest extends StatefulWidget {
4545
}
4646

4747
class _CustomAppBarScreenState extends State<CustomAppBarScreenTest> {
48-
int _selectedIndex = 1;
48+
int _selectedIndex = 0;
4949
String _seletedMenu = "Posts";
5050

5151
static final List<Widget> _widgetOptions = <Widget>[

lib/model/post_meta.dart

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,21 @@ import 'package:flutter/widgets.dart';
66
class PostMeta {
77
final String title;
88
final String category;
9+
final String tag;
910
final DateTime? date;
1011
final String slug;
1112

1213
PostMeta(
1314
{required this.title,
1415
required this.category,
16+
required this.tag,
1517
this.date,
1618
required this.slug});
1719

1820
factory PostMeta.fromJson(Map<String, dynamic> json) {
1921
final rawTitle = (json['title'] ?? '').toString().trim();
2022
final rawCategory = (json['category'] ?? 'Uncategorized').toString().trim();
23+
final rawTag = (json['tag'] ?? '').toString().trim();
2124
final rawDate = (json['date'] ?? '').toString().trim();
2225
DateTime? dt;
2326
if (rawDate.isNotEmpty) {
@@ -33,14 +36,19 @@ class PostMeta {
3336
.replaceAll(RegExp(r'^-+|-+$'), ''));
3437

3538
return PostMeta(
36-
title: rawTitle, category: rawCategory, date: dt, slug: rawSlug);
39+
title: rawTitle,
40+
category: rawCategory,
41+
tag: rawTag,
42+
date: dt,
43+
slug: rawSlug);
3744
}
3845

3946
PostMeta withFallbacks({required String fallbackTitle}) => PostMeta(
4047
title: title.isNotEmpty ? title : fallbackTitle,
4148
category: category.isNotEmpty ? category : 'Uncategorized',
4249
date: date,
4350
slug: slug,
51+
tag: tag.isNotEmpty ? tag : '',
4452
);
4553
}
4654

0 commit comments

Comments
 (0)