Skip to content

Commit 9a409e8

Browse files
committed
symptom data model/service, check-in button
1 parent a09b093 commit 9a409e8

File tree

4 files changed

+83
-4
lines changed

4 files changed

+83
-4
lines changed

lib/screens/checkin.screen.dart

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'package:flutter/material.dart';
22
import 'package:get/get.dart';
33
import 'package:symptom_tracker/screens/screens.dart';
4+
import 'package:symptom_tracker/shared/action_button.dart';
45
import 'package:symptom_tracker/shared/shared.dart';
56

67
class CheckinScreen extends StatelessWidget {
@@ -13,11 +14,45 @@ class CheckinScreen extends StatelessWidget {
1314
IconButton(icon: Icon(Icons.close), onPressed: () => Get.offAll(HomeScreen())),
1415
],
1516
),
16-
body: SafeArea(
17-
child: Center(
18-
child: Text('Checkin Screen'),
19-
),
17+
body: _buildBody(),
18+
);
19+
}
20+
21+
Widget _buildBody() {
22+
return SafeArea(
23+
child: Column(
24+
children: [
25+
SizedBox(height: 48),
26+
_buildHeader(),
27+
SizedBox(height: 24),
28+
Text('text'),
29+
SizedBox(height: 24),
30+
SharedActionButton(
31+
title: 'Submit',
32+
onPressed: () {
33+
Get.snackbar('Check-in complete', 'Be sure to check-in tomorrow as well!');
34+
Get.back();
35+
},
36+
),
37+
],
2038
),
2139
);
2240
}
41+
42+
Widget _buildHeader() {
43+
return Column(
44+
children: [
45+
Text(
46+
'Please select your symptoms',
47+
style: Get.theme.textTheme.headline4,
48+
),
49+
SizedBox(height: 8),
50+
Text(
51+
'Yesterday, you had cough, short of breath, and body aches',
52+
style: Get.theme.textTheme.headline5,
53+
textAlign: TextAlign.center,
54+
),
55+
],
56+
);
57+
}
2358
}

lib/services/services.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export 'symptom.model.dart';
2+
export 'symptom.service.dart';

lib/services/symptom.model.dart

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import 'package:flutter/material.dart';
2+
3+
class Symptom {
4+
bool isChecked;
5+
String name;
6+
IconData icon;
7+
symptomId id;
8+
9+
Symptom({this.isChecked = false, @required this.icon, @required this.name, @required this.id});
10+
}
11+
12+
enum symptomId {
13+
bodyAches,
14+
cough,
15+
diarrhea,
16+
feelingIll,
17+
headache,
18+
runnyNose,
19+
smell,
20+
sneezing,
21+
sob,
22+
soreThroat,
23+
taste,
24+
vomiting
25+
}

lib/services/symptom.service.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:flutter_icons/flutter_icons.dart';
3+
import 'package:get/get.dart';
4+
import 'package:symptom_tracker/services/services.dart';
5+
6+
class SymptomService extends GetController {
7+
static SymptomService get to => Get.find();
8+
9+
List<Symptom> get symptomList => _symptomList;
10+
11+
List<Symptom> _symptomList = [
12+
Symptom(icon: FlutterIcons.face_mco, name: 'Cough', id: symptomId.cough),
13+
Symptom(icon: FlutterIcons.face_mco, name: 'SOB', id: symptomId.cough),
14+
Symptom(icon: FlutterIcons.face_mco, name: 'dizzy', id: symptomId.cough),
15+
Symptom(icon: FlutterIcons.face_mco, name: 'get data', id: symptomId.cough),
16+
];
17+
}

0 commit comments

Comments
 (0)