Make app dymanically resizable for phone & web

This commit is contained in:
2024-07-11 13:31:02 +02:00
parent 98db9ce0c5
commit c8f99a03b4
35 changed files with 306 additions and 208 deletions

View File

@@ -33,6 +33,8 @@ class PrescripInput extends StatefulWidget {
class _PrescripInputState extends State<PrescripInput> {
//String perscriptionOutput = "";
List<List<String>> perscriptionOutput = [];
late double width;
late double height;
final numberOptions = [
"0",
@@ -260,7 +262,7 @@ class _PrescripInputState extends State<PrescripInput> {
icon: Icon(
Icons.delete_forever_outlined,
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
),
onPressed: () {
setState(() {
@@ -307,15 +309,26 @@ class _PrescripInputState extends State<PrescripInput> {
@override
Widget build(BuildContext context) {
return SizedBox(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
displayMedInput(),
displayPerscList(),
],
var size = MediaQuery.of(context).size;
setState(() {
width = size.width;
height = size.height;
});
return Container(
//width: ,
height: (height / 3) * 2,
child: SingleChildScrollView(
child: Wrap(
direction: Axis.horizontal,
alignment: WrapAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,
// mainAxisSize: MainAxisSize.max,
// crossAxisAlignment: CrossAxisAlignment.center,
children: [
displayMedInput(),
displayPerscList(),
],
),
),
);
}