Skip to content

Commit

Permalink
simple update to the category detail screen
Browse files Browse the repository at this point in the history
  • Loading branch information
zaihcodes committed Jul 13, 2024
1 parent 57c9887 commit 8748c9d
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 6 deletions.
42 changes: 42 additions & 0 deletions lib/src/category/data/data source/category_remote_date_source.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class CategoryRemoteDataSourceImpl implements CategoryRemoteDataSource {
throw ServerException(
'Failed to load categories: ${response.reasonPhrase}');
}

// return staticBody.map((json) => CategoryModel.fromJson(json)).toList();
}

@override
Expand All @@ -55,3 +57,43 @@ class CategoryRemoteDataSourceImpl implements CategoryRemoteDataSource {
}
}
}

const List<Map<String, dynamic>> staticBody = [
{
"id": "1",
"title": "القرآن الكريم وعلومه",
"hadeeths_count": "197",
"parent_id": null
},
{
"id": "2",
"title": "الحديث وعلومه",
"hadeeths_count": "15",
"parent_id": null
},
{"id": "3", "title": "العقيدة", "hadeeths_count": "711", "parent_id": null},
{
"id": "4",
"title": "الفقه وأصوله",
"hadeeths_count": "1807",
"parent_id": null
},
{
"id": "5",
"title": "الفضائل والآداب",
"hadeeths_count": "1008",
"parent_id": null
},
{
"id": "6",
"title": "الدعوة والحسبة",
"hadeeths_count": "137",
"parent_id": null
},
{
"id": "7",
"title": "السيرة والتاريخ",
"hadeeths_count": "353",
"parent_id": null
}
];
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class CategoryDetailScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Theme.of(context).colorScheme.background,
backgroundColor: Theme.of(context).colorScheme.surface,
body: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expand All @@ -28,7 +28,7 @@ class CategoryDetailScreen extends StatelessWidget {
child: Container(
padding: const EdgeInsets.only(top: 20, left: 20, right: 20),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.secondaryContainer,
// color: Theme.of(context).colorScheme.secondaryContainer,
borderRadius:
const BorderRadius.vertical(top: Radius.circular(40))),
child: BlocBuilder<CategoryDetailBloc, CategoryDetailState>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,30 @@ class SingleCategory extends StatelessWidget {
padding: const EdgeInsets.all(20),
margin: const EdgeInsets.only(bottom: 10),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.background,
borderRadius: BorderRadius.circular(10)),
color: Theme.of(context).colorScheme.primaryFixedDim,
borderRadius: BorderRadius.circular(10),
),
child: Row(
children: [
Container(
width: 60,
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.primaryContainer,
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color:
Theme.of(context).colorScheme.shadow.withOpacity(0.2),
spreadRadius: 3,
blurRadius: 5,
offset: const Offset(0, 2))
],
),
child: Center(
child: Text(category.hadeethsCount),
),
),
Expanded(
child: Text(
category.title,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@ class CategoryDetailItem extends StatelessWidget {
padding: const EdgeInsets.all(20),
margin: const EdgeInsets.only(bottom: 10),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.background,
borderRadius: BorderRadius.circular(10)),
// color: Theme.of(context).colorScheme.primaryFixedDim,
borderRadius: BorderRadius.circular(10),
border: Border.all(
width: 2,
color: Theme.of(context).colorScheme.primaryFixedDim,
),
),
child: Row(
children: [
Expanded(
Expand Down

0 comments on commit 8748c9d

Please sign in to comment.