add safearea

This commit is contained in:
2024-08-28 12:05:25 +02:00
parent fb9f525cc3
commit 12dd69b5d7
9 changed files with 764 additions and 735 deletions

View File

@@ -387,12 +387,15 @@ class _HomeTileGridState extends State<HomeTileGrid> {
final Size size = MediaQuery.sizeOf(context);
final double width = size.width;
//final double height = size.height;
return Scaffold(
return PopScope(
canPop: false,
child: Scaffold(
appBar: const MIHAppBar(barTitle: "Mzansi Innovation\nHub"),
drawer: MIHAppDrawer(
signedInUser: widget.signedInUser,
),
body: Column(
body: SafeArea(
child: Column(
children: [
const SizedBox(height: 10),
Padding(
@@ -452,16 +455,19 @@ class _HomeTileGridState extends State<HomeTileGrid> {
),
// physics: ,
// shrinkWrap: true,
itemCount: searchApp(pbswitch[_selectedIndex], appSearch).length,
itemCount:
searchApp(pbswitch[_selectedIndex], appSearch).length,
gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
maxCrossAxisExtent: 200),
itemBuilder: (context, index) {
return searchApp(pbswitch[_selectedIndex], appSearch)[index];
return searchApp(
pbswitch[_selectedIndex], appSearch)[index];
},
),
),
],
),
),
//),
// ],
@@ -474,7 +480,8 @@ class _HomeTileGridState extends State<HomeTileGrid> {
//hoverColor: Colors.lightBlueAccent,
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
iconSize: 35.0,
activeColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
activeColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
tabBackgroundColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
//gap: 20,
@@ -503,6 +510,7 @@ class _HomeTileGridState extends State<HomeTileGrid> {
),
),
),
),
);
}
}

View File

@@ -59,7 +59,8 @@ class _FullScreenFileViewerState extends State<FullScreenFileViewer> {
if (getExtType(widget.arguments.path).toLowerCase() == "pdf") {
return Scaffold(
body: Stack(
body: SafeArea(
child: Stack(
children: [
Container(
width: width,
@@ -185,7 +186,8 @@ class _FullScreenFileViewerState extends State<FullScreenFileViewer> {
});
} else {
setState(() {
pdfViewerController.zoomLevel = startZoomLevel + 0.25;
pdfViewerController.zoomLevel =
startZoomLevel + 0.25;
startZoomLevel = pdfViewerController.zoomLevel;
});
}
@@ -202,7 +204,8 @@ class _FullScreenFileViewerState extends State<FullScreenFileViewer> {
onPressed: () {
if (pdfViewerController.zoomLevel > 1) {
setState(() {
pdfViewerController.zoomLevel = startZoomLevel - 0.25;
pdfViewerController.zoomLevel =
startZoomLevel - 0.25;
startZoomLevel = pdfViewerController.zoomLevel;
});
} else {
@@ -241,6 +244,7 @@ class _FullScreenFileViewerState extends State<FullScreenFileViewer> {
),
],
),
),
);
} else {
return Scaffold(

View File

@@ -269,7 +269,7 @@ class _PatientAccessRequestState extends State<PatientAccessRequest> {
return Scaffold(
appBar: const MIHAppBar(barTitle: "Access Reviews"),
//drawer: MIHAppDrawer(signedInUser: widget.signedInUser),
body: viewAccessRequest(screenWidth, screenHeight),
body: SafeArea(child: viewAccessRequest(screenWidth, screenHeight)),
);
}
}

View File

@@ -345,7 +345,8 @@ class _AddPatientState extends State<AddPatient> {
return Scaffold(
appBar: const MIHAppBar(barTitle: "Add Patient"),
//drawer: MIHAppDrawer(signedInUser: widget.signedInUser),
body: KeyboardListener(
body: SafeArea(
child: KeyboardListener(
focusNode: _focusNode,
autofocus: true,
onKeyEvent: (event) async {
@@ -356,6 +357,7 @@ class _AddPatientState extends State<AddPatient> {
},
child: displayForm(),
),
),
);
}
}

View File

@@ -609,7 +609,8 @@ class _EditPatientState extends State<EditPatient> {
return Scaffold(
appBar: const MIHAppBar(barTitle: "Edit Patient"),
body: KeyboardListener(
body: SafeArea(
child: KeyboardListener(
focusNode: _focusNode,
autofocus: true,
onKeyEvent: (event) async {
@@ -620,6 +621,7 @@ class _EditPatientState extends State<EditPatient> {
},
child: displayForm(),
),
),
);
}
}

View File

@@ -98,9 +98,11 @@ class _PatientViewState extends State<PatientView> {
return Scaffold(
appBar: const MIHAppBar(barTitle: "Patient Profile"),
//drawer: showDrawer(),
body: SingleChildScrollView(
body: SafeArea(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 15.0),
padding:
const EdgeInsets.symmetric(vertical: 10.0, horizontal: 15.0),
child: Column(
children: [
Row(
@@ -150,6 +152,7 @@ class _PatientViewState extends State<PatientView> {
),
),
),
),
);
}
}

View File

@@ -231,7 +231,8 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
return Scaffold(
appBar: const MIHAppBar(barTitle: "Add Business"),
//drawer: MIHAppDrawer(signedInUser: widget.signedInUser),
body: KeyboardListener(
body: SafeArea(
child: KeyboardListener(
focusNode: _focusNode,
autofocus: true,
onKeyEvent: (event) async {
@@ -311,7 +312,8 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
),
const SizedBox(height: 15.0),
Divider(
color: MzanziInnovationHub.of(context)?.theme.secondaryColor(),
color:
MzanziInnovationHub.of(context)?.theme.secondaryColor(),
),
const SizedBox(height: 15.0),
const Text(
@@ -392,6 +394,7 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
),
),
),
),
);
}
}

View File

@@ -314,7 +314,8 @@ class _ProfileBusinessUpdateState extends State<ProfileBusinessUpdate> {
return Scaffold(
appBar: const MIHAppBar(barTitle: "Business Profile"),
//drawer: MIHAppDrawer(signedInUser: widget.arguments.signedInUser),
body: KeyboardListener(
body: SafeArea(
child: KeyboardListener(
focusNode: _focusNode,
autofocus: true,
onKeyEvent: (event) async {
@@ -397,8 +398,9 @@ class _ProfileBusinessUpdateState extends State<ProfileBusinessUpdate> {
),
const SizedBox(height: 15.0),
Divider(
color:
MzanziInnovationHub.of(context)?.theme.secondaryColor(),
color: MzanziInnovationHub.of(context)
?.theme
.secondaryColor(),
),
],
),
@@ -469,12 +471,13 @@ class _ProfileBusinessUpdateState extends State<ProfileBusinessUpdate> {
width: 500.0,
height: 50.0,
child: MIHButton(
buttonText: "Add",
buttonText: "Update",
buttonColor: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
textColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
textColor: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
onTap: () {
//print(business_id);
submitForm(business_id);
@@ -487,6 +490,7 @@ class _ProfileBusinessUpdateState extends State<ProfileBusinessUpdate> {
),
),
),
),
);
}
}

View File

@@ -169,7 +169,8 @@ class _ProfileUserUpdateState extends State<ProfileUserUpdate> {
return Scaffold(
appBar: const MIHAppBar(barTitle: "Update Profile"),
//drawer: MIHAppDrawer(signedInUser: widget.signedInUser),
body: Padding(
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Center(
child: KeyboardListener(
@@ -242,8 +243,9 @@ class _ProfileUserUpdateState extends State<ProfileUserUpdate> {
height: 50.0,
child: MIHButton(
buttonText: "Update",
buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
buttonColor: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
textColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
onTap: () {
@@ -256,6 +258,7 @@ class _ProfileUserUpdateState extends State<ProfileUserUpdate> {
),
),
),
),
);
}
}