Skip to content

Commit

Permalink
Fix view error for smaller screens
Browse files Browse the repository at this point in the history
  • Loading branch information
omerfaunal committed Dec 23, 2023
1 parent 738808d commit ea19759
Showing 1 changed file with 29 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,35 @@ class _SelectButtonsState extends State<SelectButtons> {

@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SelectButton(
index: 0, name: "Trending", selected: selectedIndex == 0, onPressed: selectOne),
const SizedBox(width: 10.0),
SelectButton(index: 1, name: "Latest", selected: selectedIndex == 1, onPressed: selectOne),
const SizedBox(width: 10.0),
SelectButton(
index: 2, name: "Most Read", selected: selectedIndex == 2, onPressed: selectOne),
const SizedBox(width: 10.0),
SelectButton(index: 3, name: "Random", selected: selectedIndex == 3, onPressed: selectOne),
// if (Provider.of<Auth>(context).isSignedIn)
// Row(
// children: [
// const SizedBox(width: 10.0),
// SelectButton(
// index: 4, name: "For You", selected: selectedIndex == 4, onPressed: selectOne),
// ],
// ),
],
return SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SelectButton(
index: 0, name: "Trending", selected: selectedIndex == 0, onPressed: selectOne),
const SizedBox(width: 10.0),
SelectButton(
index: 1, name: "Latest", selected: selectedIndex == 1, onPressed: selectOne),
const SizedBox(width: 10.0),
SelectButton(
index: 2, name: "Most Read", selected: selectedIndex == 2, onPressed: selectOne),
const SizedBox(width: 10.0),
SelectButton(
index: 3, name: "Random", selected: selectedIndex == 3, onPressed: selectOne),
// if (Provider.of<Auth>(context).isSignedIn)
// Row(
// children: [
// const SizedBox(width: 10.0),
// SelectButton(
// index: 4, name: "For You", selected: selectedIndex == 4, onPressed: selectOne),
// ],
// ),
],
),
),
);
}
}

0 comments on commit ea19759

Please sign in to comment.