Skip to content

Commit d163ef4

Browse files
Fixes #2098 Fix:Overflow Error on PostWideget (#2104)
* Fix:Overflow Error on PostWideget * Remove:Unused Hive Boxes * Fix:Responsiveness on Icons
1 parent 10d050f commit d163ef4

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

lib/widgets/multi_reaction.dart

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ class _MultiReactionButtonState extends State<MultiReactButton> {
2222
icon: Padding(
2323
padding: const EdgeInsets.all(8.0),
2424
child: SizedBox(
25-
height: 35,
26-
width: 35,
25+
height: (MediaQuery.sizeOf(context).width / 392) * 35,
26+
width: (MediaQuery.sizeOf(context).width / 392) * 35,
2727
child: SvgPicture.asset(
2828
'assets/images/🦆 icon _like_.svg',
2929
),
@@ -36,8 +36,8 @@ class _MultiReactionButtonState extends State<MultiReactButton> {
3636
icon: Padding(
3737
padding: const EdgeInsets.all(8.0),
3838
child: SizedBox(
39-
height: 35,
40-
width: 35,
39+
height: (MediaQuery.sizeOf(context).width / 392) * 35,
40+
width: (MediaQuery.sizeOf(context).width / 392) * 35,
4141
child: SvgPicture.asset(
4242
'assets/icons/angel.svg',
4343
),
@@ -49,8 +49,8 @@ class _MultiReactionButtonState extends State<MultiReactButton> {
4949
icon: Padding(
5050
padding: const EdgeInsets.all(8.0),
5151
child: SizedBox(
52-
height: 35,
53-
width: 35,
52+
height: (MediaQuery.sizeOf(context).width / 392) * 35,
53+
width: (MediaQuery.sizeOf(context).width / 392) * 35,
5454
child: SvgPicture.asset(
5555
'assets/icons/happy.svg',
5656
),
@@ -62,8 +62,8 @@ class _MultiReactionButtonState extends State<MultiReactButton> {
6262
icon: Padding(
6363
padding: const EdgeInsets.all(8.0),
6464
child: SizedBox(
65-
height: 35,
66-
width: 35,
65+
height: (MediaQuery.sizeOf(context).width / 392) * 35,
66+
width: (MediaQuery.sizeOf(context).width / 392) * 35,
6767
child: SvgPicture.asset(
6868
'assets/icons/laugh.svg',
6969
),
@@ -75,8 +75,8 @@ class _MultiReactionButtonState extends State<MultiReactButton> {
7575
icon: Padding(
7676
padding: const EdgeInsets.all(8.0),
7777
child: SizedBox(
78-
height: 35,
79-
width: 35,
78+
height: (MediaQuery.sizeOf(context).width / 392) * 35,
79+
width: (MediaQuery.sizeOf(context).width / 392) * 35,
8080
child: SvgPicture.asset(
8181
'assets/icons/love.svg',
8282
),
@@ -88,8 +88,8 @@ class _MultiReactionButtonState extends State<MultiReactButton> {
8888
icon: Padding(
8989
padding: const EdgeInsets.all(8.0),
9090
child: SizedBox(
91-
height: 35,
92-
width: 35,
91+
height: (MediaQuery.sizeOf(context).width / 392) * 35,
92+
width: (MediaQuery.sizeOf(context).width / 392) * 35,
9393
child: SvgPicture.asset(
9494
'assets/icons/tear.svg',
9595
),
@@ -101,8 +101,8 @@ class _MultiReactionButtonState extends State<MultiReactButton> {
101101
icon: Padding(
102102
padding: const EdgeInsets.all(8.0),
103103
child: SizedBox(
104-
height: 35,
105-
width: 35,
104+
height: (MediaQuery.sizeOf(context).width / 392) * 35,
105+
width: (MediaQuery.sizeOf(context).width / 392) * 35,
106106
child: SvgPicture.asset(
107107
'assets/icons/angry.svg',
108108
),

lib/widgets/post_widget.dart

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class NewsPost extends StatelessWidget {
5757
fontSize: 20,
5858
),
5959
title: Row(
60+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
6061
children: [
6162
Text(
6263
"${post.creator!.firstName} ${post.creator!.lastName}",
@@ -66,9 +67,6 @@ class NewsPost extends StatelessWidget {
6667
color: Colors.black38,
6768
),
6869
),
69-
const SizedBox(
70-
width: 115,
71-
),
7270
IconButton(
7371
onPressed: () {
7472
showModalBottomSheet<void>(
@@ -152,8 +150,12 @@ class NewsPost extends StatelessWidget {
152150
child: Padding(
153151
padding: const EdgeInsets.all(8.0),
154152
child: SizedBox(
155-
height: 35,
156-
width: 35,
153+
height: (MediaQuery.sizeOf(context).width /
154+
392) *
155+
35,
156+
width: (MediaQuery.sizeOf(context).width /
157+
392) *
158+
35,
157159
child: SvgPicture.asset(
158160
'assets/images/comment.svg',
159161
),

0 commit comments

Comments
 (0)