Mobile adaptive updates
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user