This repository has been archived by the owner on May 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kenny <[email protected]>
- Loading branch information
Showing
13 changed files
with
855 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
105
lib/central_screen/records/ui/allergies/allergy_tile.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
104
lib/central_screen/records/ui/conditions/condition_tile.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(), | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.