Mobile adaptive updates

This commit is contained in:
2024-05-13 15:28:44 +03:00
parent 51b0cbe89b
commit e177c81f8b
6 changed files with 70 additions and 15 deletions

View File

@@ -180,6 +180,21 @@ class _BasketPageState extends State<BasketPage> {
);
}
Widget _buildRowOrCol(
{required BuildContext context, required List<Widget> children}) {
if (MediaQuery.of(context).size.width > 600) {
return Row(children: children);
}
return Column(children: children);
}
Widget _buildSpacer() {
if (MediaQuery.of(context).size.width > 600) {
return const Spacer();
}
return const SizedBox(height: 10);
}
@override
Widget build(BuildContext context) {
return Scaffold(
@@ -213,7 +228,8 @@ class _BasketPageState extends State<BasketPage> {
),
)
: Expanded(
child: Row(
child: _buildRowOrCol(
context: context,
children: [
Expanded(
child: ListView.builder(
@@ -236,7 +252,7 @@ class _BasketPageState extends State<BasketPage> {
},
),
),
const Spacer(),
_buildSpacer(),
Padding(
padding: const EdgeInsetsDirectional.symmetric(
horizontal: 10, vertical: 10),