Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
dc80cf7
Initial Commit
ReduxGB Feb 12, 2024
c5030b8
Implements top app bar
ReduxGB Feb 12, 2024
16cb1df
Layout for bottom navigation bar
ReduxGB Feb 12, 2024
1782260
Top app bar
ReduxGB Feb 12, 2024
9bd874b
General Page Layout
ReduxGB Feb 12, 2024
cb7d3b5
Merge pull request #32 from REMAR-Project/feature/top_bottom_layout
findingaadi Feb 18, 2024
971fc8f
Had build error due to "const" constructor. error resolved
findingaadi Feb 18, 2024
cc16194
Merge pull request #33 from REMAR-Project/Aadi_Branch
ReduxGB Feb 19, 2024
1db9be9
Added the JSON files to the repo which consists of all questions alon…
findingaadi Feb 19, 2024
5b8caca
Added the JSON files to the repo which consists of all questions alon…
findingaadi Feb 19, 2024
2a3b938
changed bottom navigation bar so the number of pages currently user i…
findingaadi Mar 3, 2024
3779f6c
question 10 page, uses string questions intead of directly fetching j…
findingaadi Mar 7, 2024
871ac80
fixed the images loading issue, where the image couldnt be fetched pr…
findingaadi Mar 10, 2024
3940827
question 8 and 9 using json data.
findingaadi Mar 10, 2024
b7a8dc3
fixed the issue with "question" being fetched from the wrong question…
findingaadi Mar 10, 2024
d44214e
fixed both json data loading as there was an error wher question 9 wa…
findingaadi Mar 10, 2024
2edd99a
app navigation can be done now, since i have 2 pages i am working on,…
findingaadi Mar 10, 2024
8e38aae
first commit
thonisett Mar 11, 2024
ea5e9bd
first commit
thonisett Mar 11, 2024
cd7233c
basic screen working
thonisett Mar 11, 2024
6102ce9
Updated elements for sizing on screen 3
thonisett Mar 17, 2024
81dd0ab
Updated elements for sizing on screen 4
thonisett Mar 17, 2024
c379b17
Updated question7.dart
thonisett Mar 17, 2024
54fdf9b
question8.dart pulling county list based on hard coded state
thonisett Mar 17, 2024
01ad6d7
Pass state, crab name and image file to question8.dart
thonisett Mar 17, 2024
df7f8d0
Pass crab name and image file to question3.dart
thonisett Mar 17, 2024
cc86e24
Pass crab name and image file to question4.dart
thonisett Mar 17, 2024
537481c
Data now passed to Q3, Q4, Q7, Q8
thonisett Mar 17, 2024
dcda075
Screens refactored to work with amended modifiedquestions JSON
thonisett Mar 24, 2024
2433ff4
Merge remote-tracking branch 'origin/dev' into feature-tim-pages
thonisett Mar 24, 2024
b8d9c21
Screens refactored to work with amended modified questions JSON. Bott…
thonisett Mar 24, 2024
ffa71da
Merge pull request #52 from REMAR-Project/feature-tim-pages
tayyabcreator Mar 25, 2024
e2e288a
Code base from Tayyab now in this feature branch. Runs with issues on…
thonisett Apr 7, 2024
f537236
Code base from Tayyab now in this feature branch. Runs with issues on…
thonisett Apr 7, 2024
2862da8
Added all image assets from original Android app
thonisett Apr 7, 2024
83506c7
Merge remote-tracking branch 'origin/dev' into feature-taylab-new-pag…
thonisett Apr 7, 2024
92297a3
Pass data back from page3. Returned data variables defined
thonisett Apr 8, 2024
12e2bb2
Pass data back from page4.
thonisett Apr 8, 2024
2f3f2d3
Page 4 listbox size fixed for web
thonisett Apr 8, 2024
12012f0
Refactored questions_utils.dart
thonisett Apr 8, 2024
01ea365
Refactored questions_utils.dart
thonisett Apr 8, 2024
05d5e2b
question6.dart page added and linked
thonisett Apr 8, 2024
028d866
question6.dart page added and linked
thonisett Apr 8, 2024
1285bc9
question6.dart page added and linked
thonisett Apr 8, 2024
275e8c6
question6.dart page added and linked
thonisett Apr 8, 2024
6dc797d
question6.dart page added and linked
thonisett Apr 8, 2024
e6c65c0
Revert "question6.dart page added and linked"
thonisett Apr 8, 2024
5729605
Page 6 added
thonisett Apr 8, 2024
fe128cd
question9.dart added
thonisett Apr 8, 2024
1c635a8
Merge remote-tracking branch 'origin/feature-taylab-new-pages-April' …
thonisett Apr 8, 2024
226ca22
added question6.dart
thonisett Apr 8, 2024
8ce69e4
added question6.dart
thonisett Apr 8, 2024
154bb23
Merge remote-tracking branch 'origin/feature-taylab-new-pages-April' …
thonisett Apr 8, 2024
c36a15d
Merge remote-tracking branch 'origin/feature-taylab-new-pages-April' …
thonisett Apr 8, 2024
c29e606
Merge remote-tracking branch 'origin/feature-taylab-new-pages-April' …
thonisett Apr 8, 2024
bcb84d3
Merge remote-tracking branch 'origin/feature-taylab-new-pages-April' …
thonisett Apr 8, 2024
ab5ca63
Merge remote-tracking branch 'origin/feature-taylab-new-pages-April' …
thonisett Apr 8, 2024
a989e1b
Selected state now passed to question12 to display correct counties
thonisett Apr 8, 2024
c789143
Merge remote-tracking branch 'origin/feature-taylab-new-pages-April' …
thonisett Apr 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
basic screen working
  • Loading branch information
thonisett committed Mar 11, 2024
commit cd7233c8a5b3ca0c5ff987532ea7fd609fabea15
8 changes: 8 additions & 0 deletions assets/raw_eng/questions2Modified.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
"questionText": "When did you observe andada? Touch screen, move finger and tap to choose the correct year.",
"answers": ["2016","2027","2018","2019","2020","2021","2022","2023","2024","2025","2025","2026"]
},
{
"questionNumber": 4,
"questionType": "MonthChoice",
"questionPicture": "raster_q0_(2:0)",
"questionTitle": "crab_title_(2:0)",
"questionText": "Touch screen and move finger to choose correct month. In case you saw two andadas this month (one around new moon and one around full moon), please run the app for each andada seperately.",
"answers": ["January","February","March","April","May","June","July","August","September","October","November","December"]
},
{
"questionNumber": 9,
"questionType": "YesNoExtra",
Expand Down
2 changes: 1 addition & 1 deletion lib/bottom_navigation_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class CustomBottomNavigationBar extends StatelessWidget {
onPageChanged(currentPageIndex - 1); // Go to previous page
},
),
Text('Page ${currentPageIndex + 1} of 3'),
Text('Page ${currentPageIndex + 1} of 4'),
IconButton(
icon: const Icon(Icons.arrow_forward),
onPressed: () {
Expand Down
2 changes: 2 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:remar_flutter_app/question9.dart';
import 'package:remar_flutter_app/questions.dart';
import 'package:remar_flutter_app/questions3.dart';
import 'package:remar_flutter_app/questions4.dart';
import 'app_bar.dart';
import 'bottom_navigation_bar.dart';

Expand All @@ -19,6 +20,7 @@ class _MyAppState extends State<MyApp> {

final List<Widget> _pages = [
QuestionAnswer3Page(),
QuestionAnswer4Page(),
QuestionAnswer9Page(), // Page 1
QuestionAnswerPage(), // Page 2
];
Expand Down
115 changes: 115 additions & 0 deletions lib/questions4.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

import 'app_bar.dart';

class QuestionAnswer4Page extends StatefulWidget {
@override
_QuestionAnswerPage4State createState() => _QuestionAnswerPage4State();
}

class _QuestionAnswerPage4State extends State<QuestionAnswer4Page> {
String selectedArea = '';
List<String> answers = [];
String questionText = '';

@override
void initState() {
super.initState();
loadQuestions();
}

void loadQuestions() async {
// Load the JSON data from the file
String jsonString = await DefaultAssetBundle.of(context)
.loadString('assets/raw_eng/questions2Modified.json');

// Parse the JSON string into a list of objects
List<dynamic> jsonData = jsonDecode(jsonString);

// Extract data from the first question (question number 9)
Map<String, dynamic> firstQuestionData = jsonData[1];


// Set question text and answers list
setState(() {
questionText = firstQuestionData['questionText'];

// Extract answers from the answers map
List<dynamic> answerList = firstQuestionData['answers'];

// Cast answers to List<String>
answers = answerList.map((answer) => answer.toString()).toList();
});
}


@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Image.asset(
'assets/images/raster_q0_0.png',
width: 100,
height: 75,
),
const Text(
"Cardisoma_guanhumi",
style: TextStyle(fontSize: 20),
),
],
),
SizedBox(
width: 350,
height: 100,
child: Text(questionText),
),
SizedBox(
width: 500,
height: 350,
child: Scrollbar(
child: ListView.builder(
itemCount: answers.length,
itemBuilder: (BuildContext context, int index) {
return buildAnswerButton(answers[index]);
},
),
),
),
], // Column children
), // Column
), // Scaffold
); // MaterialApp
}

Widget buildAnswerButton(String answer) {
bool isSelected = answer == selectedArea;

return GestureDetector(
onTap: () {
setState(() {
selectedArea = answer;
});
},
child: Container(
color: isSelected ? Colors.green : null,
padding: const EdgeInsets.all(12.0),
margin: const EdgeInsets.symmetric(vertical: 8.0),
child: Text(
answer,
style: TextStyle(
color: isSelected ? Colors.white : Colors.black,
fontWeight: FontWeight.bold,
),
),
),
);
}
}