Skip to content
This repository has been archived by the owner on May 15, 2021. It is now read-only.

Commit

Permalink
Finished records feature
Browse files Browse the repository at this point in the history
Signed-off-by: Kenny <[email protected]>
  • Loading branch information
knewman55 committed Jul 24, 2020
1 parent 823dcd6 commit 50dce25
Show file tree
Hide file tree
Showing 13 changed files with 855 additions and 18 deletions.
53 changes: 53 additions & 0 deletions lib/central_screen/records/ui/allergies/allergies.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:patientapp/central_screen/records/ui/allergies/allergy_tile.dart';

class Allergies extends StatefulWidget {
@override
_AllergiesState createState() => _AllergiesState();
}

class _AllergiesState extends State<Allergies> {
final List<AllergyTile> conditions = <AllergyTile>[
AllergyTile(),
AllergyTile(),
];

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Allergies'),
),
body: SafeArea(
child: Center(
child: ListView.separated(
padding: const EdgeInsets.all(8),
itemCount: conditions.length,
itemBuilder: (BuildContext context, int index) {
return Padding(
padding:
const EdgeInsets.symmetric(vertical: 1.0, horizontal: 4.0),
child: Container(
child: conditions[index],
padding: EdgeInsets.all(2),
decoration: new BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: new BorderRadius.only(
topLeft: const Radius.circular(4.0),
topRight: const Radius.circular(4.0),
bottomLeft: const Radius.circular(4.0),
bottomRight: const Radius.circular(4.0),
),
),
),
);
},
separatorBuilder: (BuildContext context, int index) =>
const Divider(),
),
),
),
);
}
}
105 changes: 105 additions & 0 deletions lib/central_screen/records/ui/allergies/allergy_tile.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class AllergyTile extends StatefulWidget {
@override
_AllergyTileState createState() => _AllergyTileState();
}

class _AllergyTileState extends State<AllergyTile> {
@override
Widget build(BuildContext context) {
return Card(
child: InkWell(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(
Icons.bug_report,
color: Theme.of(context).accentColor,
),
Text('Peanut Allergy'),
Text('Hives'),
],
),
onTap: () {
_showModalBottomSheet(context);
},
),
);
}

void _showModalBottomSheet(BuildContext context) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
backgroundColor: Colors.transparent,
builder: (context) => Container(
height: MediaQuery.of(context).size.height * .85,
decoration: new BoxDecoration(
color: Colors.white,
borderRadius: new BorderRadius.only(
topLeft: const Radius.circular(25.0),
topRight: const Radius.circular(25.0),
),
),
child: Scaffold(
body: Center(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
children: [
EntryContainer('Allergy:'),
Spacer(),
EntryContainer('Peanuts'),
],
),
SizedBox(height: 10),
Row(
children: [
EntryContainer('Symptoms:'),
Spacer(),
EntryContainer('Hives'),
],
),
],
),
),
),
)),
);
}
}

class EntryContainer extends StatefulWidget {
@override
_EntryContainerState createState() => _EntryContainerState();

final String text;

EntryContainer(this.text);
}

class _EntryContainerState extends State<EntryContainer> {
@override
Widget build(BuildContext context) {
return Container(
child: Text(widget.text,
style: new TextStyle(fontSize: 25.0, fontWeight: FontWeight.bold)),
//width: 150,
padding: EdgeInsets.all(5),
decoration: new BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: new BorderRadius.only(
topLeft: const Radius.circular(10.0),
topRight: const Radius.circular(10.0),
bottomLeft: const Radius.circular(10.0),
bottomRight: const Radius.circular(10.0),
),
),
);
}
}
104 changes: 104 additions & 0 deletions lib/central_screen/records/ui/conditions/condition_tile.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class ConditionTile extends StatefulWidget {
@override
_ConditionTile createState() => _ConditionTile();
}

class _ConditionTile extends State<ConditionTile> {
@override
Widget build(BuildContext context) {
return Card(
child: InkWell(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(
Icons.hdr_strong,
color: Theme.of(context).accentColor,
),
Text('Asthma'),
],
),
onTap: () {
_showModalBottomSheet(context);
},
),
);
}

void _showModalBottomSheet(BuildContext context) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
backgroundColor: Colors.transparent,
builder: (context) => Container(
height: MediaQuery.of(context).size.height * .85,
decoration: new BoxDecoration(
color: Colors.white,
borderRadius: new BorderRadius.only(
topLeft: const Radius.circular(25.0),
topRight: const Radius.circular(25.0),
),
),
child: Scaffold(
body: Center(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
children: [
EntryContainer('Condition:'),
Spacer(),
EntryContainer('Asthma'),
],
),
SizedBox(height: 10),
Row(
children: [
EntryContainer('Last Tested on:'),
Spacer(),
EntryContainer('6/1/19'),
],
),
],
),
),
),
)),
);
}
}

class EntryContainer extends StatefulWidget {
@override
_EntryContainerState createState() => _EntryContainerState();

final String text;

EntryContainer(this.text);
}

class _EntryContainerState extends State<EntryContainer> {
@override
Widget build(BuildContext context) {
return Container(
child: Text(widget.text,
style: new TextStyle(fontSize: 25.0, fontWeight: FontWeight.bold)),
//width: 150,
padding: EdgeInsets.all(5),
decoration: new BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: new BorderRadius.only(
topLeft: const Radius.circular(10.0),
topRight: const Radius.circular(10.0),
bottomLeft: const Radius.circular(10.0),
bottomRight: const Radius.circular(10.0),
),
),
);
}
}
55 changes: 55 additions & 0 deletions lib/central_screen/records/ui/conditions/conditions.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

import 'condition_tile.dart';

class Conditions extends StatefulWidget {
@override
_ConditionsState createState() => _ConditionsState();
}

class _ConditionsState extends State<Conditions> {
final List<ConditionTile> conditions = <ConditionTile>[
ConditionTile(),
ConditionTile()
];

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Conditions'),
),
body: SafeArea(
child: Center(
child: ListView.separated(
padding: const EdgeInsets.all(8),
itemCount: conditions.length,
itemBuilder: (BuildContext context, int index) {
//return LogEntryAdd();
return Padding(
padding:
const EdgeInsets.symmetric(vertical: 1.0, horizontal: 4.0),
child: Container(
child: conditions[index],
padding: EdgeInsets.all(2),
decoration: new BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: new BorderRadius.only(
topLeft: const Radius.circular(4.0),
topRight: const Radius.circular(4.0),
bottomLeft: const Radius.circular(4.0),
bottomRight: const Radius.circular(4.0),
),
),
),
);
},
separatorBuilder: (BuildContext context, int index) =>
const Divider(),
),
),
),
);
}
}
Loading

0 comments on commit 50dce25

Please sign in to comment.