Skip to content

Commit

Permalink
Emergency Page
Browse files Browse the repository at this point in the history
  • Loading branch information
uumair327 committed Feb 19, 2024
1 parent 78f9f9a commit c55a30f
Showing 1 changed file with 86 additions and 4 deletions.
90 changes: 86 additions & 4 deletions lib/screens/emergencyContactPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,92 @@ import 'package:flutter/material.dart';
class EmergencyContactPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Emergency Contact Page')),
body: Center(
child: Text('Emergency Contact Page'),
return SafeArea(
child: Scaffold(
appBar: AppBar(
title: Text('Emergency Contact'),
),
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// Emergency services section
_buildCard(
icon: Icons.local_hospital,
title: 'Emergency Services',
contacts: [
'Police: 911',
'Fire Department: 911',
'Medical Emergency: 911',
],
),
SizedBox(height: 20),
// Child safety section
_buildCard(
icon: Icons.child_care,
title: 'Child Safety',
contacts: [
'National Center for Missing & Exploited Children: 1-800-843-5678',
'Childhelp National Child Abuse Hotline: 1-800-422-4453',
'Poison Control Center: 1-800-222-1222',
],
),
],
),
),
),
),
);
}

Widget _buildCard({
required IconData icon,
required String title,
required List<String> contacts,
}) {
return Card(
elevation: 4,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Icon(
icon,
size: 48,
color: Colors.blue,
),
SizedBox(width: 10),
Text(
title,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
],
),
SizedBox(height: 10),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: contacts
.map((contact) => Padding(
padding: const EdgeInsets.symmetric(vertical: 4.0),
child: Text(
contact,
style: TextStyle(
fontSize: 16,
),
),
))
.toList(),
),
],
),
),
);
}
Expand Down

0 comments on commit c55a30f

Please sign in to comment.