Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
uumair327 committed Feb 18, 2024
2 parents bf445eb + 31262d5 commit 0322d29
Show file tree
Hide file tree
Showing 5 changed files with 186 additions and 11 deletions.
64 changes: 64 additions & 0 deletions lib/screens/CaseQuestionsPage.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@


import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class CaseQuestionsPage extends StatelessWidget {
final String caseName;
final List<String> questions;

CaseQuestionsPage(this.caseName, this.questions);

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(caseName),
),
body: SingleChildScrollView(
padding: EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
_buildCaseTitle(),
SizedBox(height: 20),
_buildQuestionList(),
SizedBox(height: 20),
ElevatedButton(
onPressed: () {
// Handle submission of answers
},
child: Text('Submit'),
),
],
),
),
);
}

Widget _buildCaseTitle() {
return Text(
'Report $caseName',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
),
);
}

Widget _buildQuestionList() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: questions.map((question) {
return CheckboxListTile(
title: Text(question),
controlAffinity: ListTileControlAffinity.leading,
value: false, // Implement logic for checkbox state
onChanged: (bool? value) {
// Implement logic for handling checkbox state change
},
);
}).toList(),
);
}
}
4 changes: 2 additions & 2 deletions lib/screens/forumPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import 'package:flutter/material.dart';
class ForumPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return const Scaffold(
return Scaffold(
extendBody: true,
body: SafeArea(
child: Center(
child: Text(
"Forum Page",
"forum Page",
))),
);
}
Expand Down
123 changes: 117 additions & 6 deletions lib/screens/reportPage.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,126 @@
import 'package:flutter/material.dart';
import 'CaseQuestionsPage.dart'; // Import the CaseQuestionsPage

class ReportPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
extendBody: true,
body: SafeArea(
child: Center(
child: Text(
"Report Page",
))),
appBar: AppBar(
title: Text('Report an Issue'),
),
body: SingleChildScrollView(
padding: EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
_buildReportTitle(),
SizedBox(height: 20),
_buildCategoryButtons(context),
],
),
),
);
}

Widget _buildReportTitle() {
return Text(
'Report an Issue',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
),
);
}

Widget _buildCategoryButtons(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
_buildButton(context, 'Environmental Safety', _environmentalSafetySubTopics),
SizedBox(height: 10),
_buildButton(context, 'Online Safety', _onlineSafetySubTopics),
SizedBox(height: 10),
_buildButton(context, 'Educational Safety', _educationalSafetySubTopics),
SizedBox(height: 10),
_buildButton(context, 'Mental Health', _mentalHealthSubTopics),
SizedBox(height: 10),
_buildButton(context, 'Community Safety', _communitySafetySubTopics),
SizedBox(height: 10),
_buildButton(context, 'Promoting Positive Development', _positiveDevelopmentSubTopics),
],
);
}

Widget _buildButton(BuildContext context, String category, List<String> subTopics) {
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
ElevatedButton(
onPressed: () {
// Navigate to the page with questions for the selected category
Navigator.push(
context,
MaterialPageRoute(builder: (context) => CaseQuestionsPage(category, subTopics)),
);
},
child: Text(category),
),
SizedBox(height: 10),
// Create buttons for each subtopic
...subTopics.map((subTopic) => ElevatedButton(
onPressed: () {
// Navigate to the page with questions for the selected subtopic
Navigator.push(
context,
MaterialPageRoute(builder: (context) => CaseQuestionsPage(category, [subTopic])),
);
},
child: Text(subTopic),
)).toList(),
],
);
}

// Subtopics for each category
static const List<String> _environmentalSafetySubTopics = [
'Poisoning',
'Fire Safety',
'Drowning',
'Falls',
'Exposure to dangerous chemicals or toxins',
];

static const List<String> _onlineSafetySubTopics = [
'Cyberbullying',
'Exposure to inappropriate content',
'Online predators',
'Addiction to gaming or social media',
];

static const List<String> _educationalSafetySubTopics = [
'Physical violence or bullying',
'Emotional abuse or neglect',
'Exposure to hazardous materials or unsafe environments',
];

static const List<String> _mentalHealthSubTopics = [
'Anxiety and depression',
'Eating disorders',
'Self-harm or suicidal thoughts',
'The impact of trauma or abuse',
];

static const List<String> _communitySafetySubTopics = [
'Gang violence',
'Drug use and abuse',
'Human trafficking',
'Exposure to violence or crime',
];

static const List<String> _positiveDevelopmentSubTopics = [
'Providing access to quality education and healthcare',
'Creating safe and nurturing environments',
'Teaching children about safety and risk prevention',
'Building strong and supportive relationships with children',
];
}
2 changes: 1 addition & 1 deletion lib/screens/searchPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class SearchPage extends StatelessWidget {
body: SafeArea(
child: Center(
child: Text(
"Search PAge",
"SEARCHPAGE",
))),
);
}
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ dev_dependencies:

flutter:
uses-material-design: true
assets:
- assets/images/
# assets:
# - assets/images/



Expand Down

0 comments on commit 0322d29

Please sign in to comment.