cancel button added in image page

dev
Sneha 11 months ago
parent ed1ff5101b
commit eb3d18efa3

@ -12,7 +12,9 @@
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<application
android:requestLegacyExternalStorage="true"
android:label="HealthCare"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

@ -1,5 +1,5 @@
import 'dart:convert';
import 'package:intl/intl.dart';
import 'package:flutter/material.dart';
import 'package:healthcare_user/BMI/bmi_history.dart';
import 'package:healthcare_user/common/settings.dart';
@ -14,21 +14,30 @@ class BMICalculator extends StatefulWidget {
class _BMICalculatorState extends State<BMICalculator> {
TextEditingController heightController = TextEditingController();
TextEditingController inchesController = TextEditingController();
TextEditingController cmsController = TextEditingController();
TextEditingController weightController = TextEditingController();
TextEditingController ageController = TextEditingController();
TextEditingController dateInput = TextEditingController();
String bmiValue = '';
String bmiText = '';
var heightUnitItems = [
'feet',
'cm',
'inches',
];
var heightUnits = 'feet';
var weightUnitItems = [
'kg',
'gr',
];
var weightUnits = 'kg';
@override
void initState() {
ageController.text=AppSettings.age;
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -45,11 +54,13 @@ class _BMICalculatorState extends State<BMICalculator> {
cursorColor: greyColor,
controller: ageController,
textCapitalization: TextCapitalization.characters,
keyboardType: TextInputType.number,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.person,
color: primaryColor,
),
suffixText: "Yrs",
border: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor)),
focusedBorder: OutlineInputBorder(
@ -65,7 +76,57 @@ class _BMICalculatorState extends State<BMICalculator> {
),
),
SizedBox(height: 10),
Container(
DropdownButtonFormField(
// Initial Value
value: heightUnits,
isExpanded: true,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.ac_unit_outlined,
color: primaryColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
labelText: 'Select Height units',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
hint: Text('Units'),
// Down Arrow Icon
//icon: const Icon(Icons.keyboard_arrow_down),
// Array list of items
items: heightUnitItems.map((String items) {
return DropdownMenuItem(
value: items,
child: Text(
items,
style: TextStyle(
fontSize: 16,
),
textAlign: TextAlign.center,
));
}).toList(),
// After selecting the desired option,it will
// change button value to selected value
onChanged: (String? newValue) {
setState(() {
heightUnits = newValue!;
});
},
),
SizedBox(height: 10),
Visibility(
visible:heightUnits=='feet',
child: Container(
//height: 60,
child: Row(
children: [
@ -74,6 +135,7 @@ class _BMICalculatorState extends State<BMICalculator> {
cursorColor: greyColor,
controller: heightController,
textCapitalization: TextCapitalization.characters,
keyboardType: TextInputType.number,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.height,
@ -87,7 +149,7 @@ class _BMICalculatorState extends State<BMICalculator> {
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
labelText: 'Height',
labelText: 'Feets',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
@ -96,13 +158,14 @@ class _BMICalculatorState extends State<BMICalculator> {
),
SizedBox(width: 5),
Expanded(
child: DropdownButtonFormField(
// Initial Value
value: heightUnits,
isExpanded: true,
child: TextFormField(
cursorColor: greyColor,
controller: inchesController,
textCapitalization: TextCapitalization.characters,
keyboardType: TextInputType.number,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.ac_unit_outlined,
Icons.height,
color: primaryColor,
),
border: OutlineInputBorder(
@ -113,40 +176,54 @@ class _BMICalculatorState extends State<BMICalculator> {
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
labelText: 'Units',
labelText: 'Inches',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
hint: Text('Units'),
// Down Arrow Icon
//icon: const Icon(Icons.keyboard_arrow_down),
// Array list of items
items: heightUnitItems.map((String items) {
return DropdownMenuItem(
value: items,
child: Text(
items,
style: TextStyle(
fontSize: 16,
),
textAlign: TextAlign.center,
));
}).toList(),
// After selecting the desired option,it will
// change button value to selected value
onChanged: (String? newValue) {
setState(() {
heightUnits = newValue!;
});
},
),
)
SizedBox(width: 5),
],
),
),),
Visibility(
visible:heightUnits=='cm',
child: Container(
//height: 60,
child: Row(
children: [
Expanded(
child: TextFormField(
cursorColor: greyColor,
controller: cmsController,
textCapitalization: TextCapitalization.characters,
keyboardType: TextInputType.number,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.height,
color: primaryColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
labelText: 'Enter height in cms',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
),
),
],
),
),),
SizedBox(height: 10),
Container(
//height: 40,
@ -158,6 +235,7 @@ class _BMICalculatorState extends State<BMICalculator> {
cursorColor: greyColor,
controller: weightController,
textCapitalization: TextCapitalization.characters,
keyboardType: TextInputType.number,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.line_weight_outlined,
@ -232,23 +310,94 @@ class _BMICalculatorState extends State<BMICalculator> {
),
),
SizedBox(height: 10),
TextButton(
child: Text('Calculate BMI', style: textButtonStyle()),
Container(
child: TextFormField(
cursorColor: greyColor,
controller: dateInput,
decoration: textFormFieldDecorationBMI(
Icons.calendar_today, 'Enter Date'),
readOnly: true,
onTap: () async {
DateTime? pickedDate = await showDatePicker(
context: context,
initialDate: DateTime.now(),
firstDate: DateTime(1950),
lastDate: DateTime.now(),
builder: (BuildContext context, Widget? child) {
return Theme(
data: ThemeData.dark().copyWith(
colorScheme: ColorScheme.dark(
primary: buttonColors,
onPrimary: Colors.white,
surface: buttonColors,
onSurface: Colors.white,
),
dialogBackgroundColor: primaryColor,
),
child: child!,
);
},
);
if (pickedDate != null) {
print(
pickedDate); //pickedDate output format => 2021-03-10 00:00:00.000
String formattedDate =
DateFormat('dd-MM-yyyy').format(pickedDate);
print(
formattedDate); //formatted date output using intl package => 2021-03-16
setState(() {
dateInput.text =
formattedDate; //set output date to TextField value.
});
} else {}
},
),
),
SizedBox(height: 10),
Container(
width: double.infinity,
height:
MediaQuery.of(context).size.height * .05,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: buttonColors, // background
onPrimary: Colors.black, // foreground
),
onPressed: () async {
if (ageController.text != '' &&
heightController.text != '' &&
weightController.text != '') {
heightController.text != '' ||cmsController.text!=''&&
weightController.text != ''&&dateInput.text!='') {
AppSettings.preLoaderDialog(context);
var payload = new Map<String, dynamic>();
payload["age"] =
int.parse(ageController.text.toString());
payload["height"] = heightController.text.toString();
if(heightUnits.toString().toLowerCase()=='feet'){
cmsController.text='';
}
else{
heightController.text='';
inchesController.text='';
}
payload["age"] = int.parse(ageController.text.toString());
payload["feet"] = heightController.text.toString();
payload["inches"] = inchesController.text.toString();
payload["height"] = cmsController.text.toString();
payload["weight"] = weightController.text.toString();
payload["heightUnit"] = heightUnits.toString();
payload["weightUnit"] = weightUnits.toString();
payload["date"] = dateInput.text.toString();
try{
var value = await AppSettings.calculateBmi(payload);
var valueResponse = jsonDecode(value);
print(valueResponse);
Navigator.of(context, rootNavigator: true).pop();
heightController.clear();
cmsController.clear();
inchesController.clear();
weightController.clear();
dateInput.clear();
setState(() {
bmiValue = valueResponse['userDetails']['bmivalue'].toString();
if(double.parse(bmiValue)<18.5){
@ -263,17 +412,34 @@ class _BMICalculatorState extends State<BMICalculator> {
else if(double.parse(bmiValue)>=30){
bmiText='Obesity';
}
});
}
catch(e){
Navigator.of(context, rootNavigator: true).pop();
AppSettings.longFailedToast('Calculating BMI failed');
}
}
else{
AppSettings.longFailedToast('Please enter valid details');
}
},
),
SizedBox(height: 10),
child: const Text('Calculate BMI'),
)),
SizedBox(height: 20),
Container(
child: Row(
children: [
Text('Your Bmi value: $bmiValue'),
Text('Your BMI value: $bmiValue',style: TextStyle(fontSize:15,fontWeight: FontWeight.bold),),
SizedBox(width: 10,),
Text(bmiText,style: TextStyle(color: Colors.red)),
Text(bmiText,style: TextStyle(color: Colors.red,fontWeight: FontWeight.bold)),
],
)
),

@ -1,11 +1,9 @@
import 'dart:convert';
import 'package:healthcare_user/chart/bmi_chart.dart';
import 'package:intl/intl.dart';
import 'package:flutter/material.dart';
import 'package:healthcare_user/models/bmi_history_model.dart';
import 'package:healthcare_user/common/settings.dart';
import '../chart/bpchart.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
class BMIHistory extends StatefulWidget {
const BMIHistory({Key? key}) : super(key: key);
@ -19,11 +17,12 @@ class _BMIHistoryState extends State<BMIHistory> {
List<BmiHistoryModel> bmiHistoryList = [];
List<BmiHistoryModel> FilteredList = [];
var dateItems = [
'All',
'last 7 days',
'last one month',
'last one year',
];
var dateItemsVariable = 'last 7 days';
var dateItemsVariable = 'All';
Future<void> getBmiHistoryDetails(var selectedRange) async {
isLoading = true;
@ -43,6 +42,7 @@ class _BMIHistoryState extends State<BMIHistory> {
FilteredList = bmiHistoryList.where((product) {
final date = product.dateForFilter;
return now_1w.isBefore(date);
//reportsList=reportsListOriginal.reversed.toList();
}).toList();
} else if (selectedRange.toString().toUpperCase() == 'LAST ONE MONTH') {
FilteredList = bmiHistoryList.where((product) {
@ -68,6 +68,27 @@ class _BMIHistoryState extends State<BMIHistory> {
super.initState();
}
deleteBmiHistory(bmiId) async{
AppSettings.preLoaderDialog(context);
bool status = await AppSettings.deleteBMIDetails(bmiId);
if(status){
Navigator.of(context, rootNavigator: true).pop();
AppSettings.longSuccessToast("BMI record deleted successfully");
await getBmiHistoryDetails(dateItemsVariable);
}
else{
Navigator.of(context, rootNavigator: true).pop();
AppSettings.longFailedToast("BMI record deletion failed");
}
}
Widget renderzUi() {
if (bmiHistoryList.length != 0) {
return Column(crossAxisAlignment: CrossAxisAlignment.end, children: [
@ -90,7 +111,7 @@ class _BMIHistoryState extends State<BMIHistory> {
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
labelText: 'Units',
labelText: 'Select Date Range',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
@ -145,7 +166,40 @@ class _BMIHistoryState extends State<BMIHistory> {
padding: EdgeInsets.all(0),
itemCount: FilteredList.length,
itemBuilder: (BuildContext context, int index) {
return Card(
return Slidable(
key: const ValueKey(0),
endActionPane: ActionPane(
// A motion is a widget used to control how the pane animates.
motion: ScrollMotion(),
dragDismissible: false,
// A pane can dismiss the Slidable.
dismissible: DismissiblePane(onDismissed: () {
deleteBmiHistory(FilteredList[index].bmiInfoId);
}),
// All actions are defined in the children parameter.
children: [
// A SlidableAction can have an icon and/or a label.
SlidableAction(
backgroundColor: Color(0xFFFE4A49),
foregroundColor: Colors.white,
icon: Icons.delete,
label: 'Delete',
onPressed: (BuildContext context) {
deleteBmiHistory(FilteredList[index].bmiInfoId);
},
),
/*SlidableAction(
onPressed: doNothing,
backgroundColor: Color(0xFF21B7CA),
foregroundColor: Colors.white,
icon: Icons.share,
label: 'Share',
),*/
],
),
child: Card(
color: Colors.white,
child: Padding(
padding: EdgeInsets.all(8),
@ -176,7 +230,7 @@ class _BMIHistoryState extends State<BMIHistory> {
.height
.toString()
.toUpperCase() +
' ft',
' cms',
style: valuesTextStyle()),
)
],
@ -217,7 +271,7 @@ class _BMIHistoryState extends State<BMIHistory> {
padding: EdgeInsets.all(5),
child: Text(
FilteredList[index]
.displayDate
.actualDate
.toString()
.toUpperCase(),
style: valuesTextStyle()),
@ -230,7 +284,7 @@ class _BMIHistoryState extends State<BMIHistory> {
children: [
Image(
image: const AssetImage(
'images/weight.png'),
'images/bmi.png'),
height: 25,
width: 25,
fit: BoxFit.fill),
@ -245,13 +299,35 @@ class _BMIHistoryState extends State<BMIHistory> {
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image(
image: const AssetImage(
'images/bmi.png'),
height: 25,
width: 25,
fit: BoxFit.fill),
Padding(
padding: EdgeInsets.all(5),
child: Text(
FilteredList[index].bmiText
.toString()
.toUpperCase(),
style: valuesTextStyle()),
)
],
),
],
),
),
],
),
),
),
);
})),
]);
} else {

@ -1,9 +1,8 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:healthcare_user/BMI/bmi_history.dart';
import 'package:healthcare_user/BP/bp_history.dart';
import 'package:healthcare_user/common/settings.dart';
import 'package:intl/intl.dart';
class BPCalculator extends StatefulWidget {
const BPCalculator({Key? key}) : super(key: key);
@ -16,19 +15,10 @@ class _BPCalculatorState extends State<BPCalculator> {
TextEditingController systoloicController = TextEditingController();
TextEditingController diastolicController = TextEditingController();
TextEditingController dateInput = TextEditingController();
String bpValue = '';
String bpText = '';
var heightUnitItems = [
'feet',
'cm',
'inches',
];
var heightUnits = 'feet';
var weightUnitItems = [
'kg',
'gr',
];
var weightUnits = 'kg';
@override
Widget build(BuildContext context) {
return Scaffold(
@ -45,9 +35,10 @@ class _BPCalculatorState extends State<BPCalculator> {
cursorColor: greyColor,
controller: systoloicController,
textCapitalization: TextCapitalization.characters,
keyboardType: TextInputType.number,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.person,
Icons.upload,
color: primaryColor,
),
border: OutlineInputBorder(
@ -69,9 +60,10 @@ class _BPCalculatorState extends State<BPCalculator> {
cursorColor: greyColor,
controller: diastolicController,
textCapitalization: TextCapitalization.characters,
keyboardType: TextInputType.number,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.person,
Icons.download,
color: primaryColor,
),
border: OutlineInputBorder(
@ -89,47 +81,92 @@ class _BPCalculatorState extends State<BPCalculator> {
),
),
SizedBox(height: 10),
TextButton(
child: Text('Check BP', style: textButtonStyle()),
Container(
child: TextFormField(
cursorColor: greyColor,
controller: dateInput,
decoration: textFormFieldDecorationBMI(
Icons.calendar_today, 'Enter Date'),
readOnly: true,
onTap: () async {
DateTime? pickedDate = await showDatePicker(
context: context,
initialDate: DateTime.now(),
firstDate: DateTime(1950),
lastDate: DateTime.now(),
builder: (BuildContext context, Widget? child) {
return Theme(
data: ThemeData.dark().copyWith(
colorScheme: ColorScheme.dark(
primary: buttonColors,
onPrimary: Colors.white,
surface: buttonColors,
onSurface: Colors.white,
),
dialogBackgroundColor: primaryColor,
),
child: child!,
);
},
);
if (pickedDate != null) {
print(
pickedDate); //pickedDate output format => 2021-03-10 00:00:00.000
String formattedDate =
DateFormat('dd-MM-yyyy').format(pickedDate);
print(
formattedDate); //formatted date output using intl package => 2021-03-16
setState(() {
dateInput.text =
formattedDate; //set output date to TextField value.
});
} else {}
},
),
),
SizedBox(height: 10),
Container(
width: double.infinity,
height:
MediaQuery.of(context).size.height * .05,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: buttonColors, // background
onPrimary: Colors.black, // foreground
),
onPressed: () async {
if (systoloicController.text != '' &&
diastolicController.text != '') {
diastolicController.text != ''&&dateInput.text!='') {
AppSettings.preLoaderDialog(context);
var payload = new Map<String, dynamic>();
payload["Systolic"] = double.parse(systoloicController.text.toString());
payload["Diastolic"] = double.parse(diastolicController.text.toString());
payload["date"] =dateInput.text.toString();
var value = await AppSettings.calculateBP(payload);
var valueResponse = jsonDecode(value);
print(valueResponse);
setState(() {
bpValue = valueResponse['userDetails']['bpCategory'].toString();
/*bpValue = valueResponse['userDetails']['bmivalue'].toString();
if(double.parse(bpValue)<18.5){
bpText='Underweight';
}
else if(double.parse(bpValue)>=18.5&&double.parse(bpValue)<=24.9){
bpText='Normal weight';
}
else if(double.parse(bpValue)>=25&&double.parse(bpValue)<=29.9){
bpText='Overweight';
}
else if(double.parse(bpValue)>=30){
bpText='Obesity';
}*/
});
systoloicController.clear();
diastolicController.clear();
dateInput.clear();
Navigator.of(context,rootNavigator: true).pop();
}
else{
AppSettings.longFailedToast('Please enter valid details');
}
},
),
SizedBox(height: 10),
child: const Text('Check BP'),
)),
SizedBox(height: 20),
Container(
child: Row(
children: [
Text(bpValue,style: TextStyle(color: Colors.red),),
Text(bpValue,style: TextStyle(color: Colors.red,fontWeight: FontWeight.bold,fontSize: 15),),
],
)
),

@ -1,9 +1,9 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:healthcare_user/chart/bpchart.dart';
import 'package:healthcare_user/models/bmi_history_model.dart';
import 'package:healthcare_user/common/settings.dart';
import 'package:healthcare_user/models/bp_history_model.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
class BPHistory extends StatefulWidget {
const BPHistory({Key? key}) : super(key: key);
@ -13,72 +13,81 @@ class BPHistory extends StatefulWidget {
}
class _BPHistoryState extends State<BPHistory> {
bool isLoading=false;
bool isLoading = false;
List<BPHistoryModel> BpHistoryList = [];
List<BPHistoryModel> FilteredList = [];
var dateItems = [
'All',
'last 7 days',
'last one month',
'last one year',
];
var dateItemsVariable = 'last 7 days';
var dateItemsVariable = 'All';
Future<void> getBmiHistoryDetails(var selectedRange) async {
isLoading=true;
var response1= await AppSettings.getBPHistory();
Future<void> getBPHistoryDetails(var selectedRange) async {
isLoading = true;
var response1 = await AppSettings.getBPHistory();
print(response1);
setState(() {
BpHistoryList =
((jsonDecode(response1)) as List).map((dynamic model) {
BpHistoryList = ((jsonDecode(response1)) as List).map((dynamic model) {
return BPHistoryModel.fromJson(model);
}).toList();
var now = new DateTime.now();
var now_1w = now.subtract(Duration(days: 7));
var now_1m = new DateTime(now.year, now.month-1, now.day);
var now_1y = new DateTime(now.year-1, now.month, now.day);
var now_1m = new DateTime(now.year, now.month - 1, now.day);
var now_1y = new DateTime(now.year - 1, now.month, now.day);
if(selectedRange.toString().toUpperCase()=='LAST 7 DAYS'){
FilteredList=BpHistoryList.where((product) {
if (selectedRange.toString().toUpperCase() == 'LAST 7 DAYS') {
FilteredList = BpHistoryList.where((product) {
final date = product.dateForFilter;
return now_1w.isBefore(date);
}).toList();
}
else if(selectedRange.toString().toUpperCase()=='LAST ONE MONTH'){
FilteredList=BpHistoryList.where((product) {
} else if (selectedRange.toString().toUpperCase() == 'LAST ONE MONTH') {
FilteredList = BpHistoryList.where((product) {
final date = product.dateForFilter;
return now_1m.isBefore(date);
}).toList();
}
else if(selectedRange.toString().toUpperCase()=='LAST ONE YEAR'){
FilteredList=BpHistoryList.where((product) {
} else if (selectedRange.toString().toUpperCase() == 'LAST ONE YEAR') {
FilteredList = BpHistoryList.where((product) {
final date = product.dateForFilter;
return now_1y.isBefore(date);
}).toList();
}
else{
FilteredList=BpHistoryList;
} else {
FilteredList = BpHistoryList;
}
isLoading=false;
isLoading = false;
});
}
@override
void initState() {
getBmiHistoryDetails(dateItemsVariable);
getBPHistoryDetails(dateItemsVariable);
super.initState();
}
Widget renderzUi(){
if(BpHistoryList.length!=0){
deleteBpRecord(bpId) async {
AppSettings.preLoaderDialog(context);
bool status = await AppSettings.deleteBPDetails(bpId);
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
if (status) {
Navigator.of(context, rootNavigator: true).pop();
AppSettings.longSuccessToast("BP record deleted successfully");
await getBPHistoryDetails(dateItemsVariable);
} else {
Navigator.of(context, rootNavigator: true).pop();
AppSettings.longFailedToast("BP record deletion failed");
}
}
Widget renderzUi() {
if (BpHistoryList.length != 0) {
return Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Padding(
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
child: DropdownButtonFormField(
// Initial Value
value: dateItemsVariable,
@ -96,7 +105,7 @@ class _BPHistoryState extends State<BPHistory> {
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
labelText: 'Units',
labelText: 'Select Date Range',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
@ -124,16 +133,15 @@ class _BPHistoryState extends State<BPHistory> {
setState(() {
dateItemsVariable = newValue!;
});
getBmiHistoryDetails(dateItemsVariable);
getBPHistoryDetails(dateItemsVariable);
},
),),
),
),
IconButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Bpchart()),
MaterialPageRoute(builder: (context) => Bpchart()),
);
// showBMIAdddialog();
},
@ -142,18 +150,43 @@ class _BPHistoryState extends State<BPHistory> {
color: primaryColor,
),
),
Expanded(child:ListView.builder(
Expanded(
child: ListView.builder(
padding: EdgeInsets.all(0),
itemCount: FilteredList.length,
itemBuilder: (BuildContext context, int index) {
return Card(
return Slidable(
key: const ValueKey(0),
endActionPane: ActionPane(
// A motion is a widget used to control how the pane animates.
motion: ScrollMotion(),
dragDismissible: false,
// A pane can dismiss the Slidable.
dismissible: DismissiblePane(onDismissed: () {
deleteBpRecord(FilteredList[index].bpId);
}),
// All actions are defined in the children parameter.
children: [
// A SlidableAction can have an icon and/or a label.
SlidableAction(
backgroundColor: Color(0xFFFE4A49),
foregroundColor: Colors.white,
icon: Icons.delete,
label: 'Delete',
onPressed: (BuildContext context) {
deleteBpRecord(FilteredList[index].bpId);
},
),
],
),
child: Card(
color: Colors.white,
child: Padding(
padding:EdgeInsets.all(8) ,
padding: EdgeInsets.all(8),
child: Container(
width: MediaQuery.of(context).size.width * .55,
//width: MediaQuery.of(context).size.width * .55,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
@ -167,21 +200,41 @@ class _BPHistoryState extends State<BPHistory> {
height: 25,
width: 25,
fit: BoxFit.fill),*/
Text('Systolic',style: TextStyle(color: primaryColor),),
SizedBox(width: 5,),
Padding(padding: EdgeInsets.all(1),
child: Text(FilteredList[index].systolic.toString().toUpperCase(),style: valuesTextStyle()),)
Text(
'Systolic',
style: TextStyle(color: primaryColor),
),
SizedBox(
width: 5,
),
Padding(
padding: EdgeInsets.all(1),
child: Text(
FilteredList[index]
.systolic
.toString()
.toUpperCase(),
style: valuesTextStyle()),
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Diastolic',style: TextStyle(color: primaryColor),),
Padding(padding: EdgeInsets.all(1),
child: Text(FilteredList[index].diastolic.toString().toUpperCase(),style: valuesTextStyle()),)
Text(
'Diastolic',
style: TextStyle(color: primaryColor),
),
Padding(
padding: EdgeInsets.all(1),
child: Text(
FilteredList[index]
.diastolic
.toString()
.toUpperCase(),
style: valuesTextStyle()),
)
],
),
Row(
@ -189,13 +242,20 @@ class _BPHistoryState extends State<BPHistory> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image(
image: const AssetImage('images/height.png'),
image: const AssetImage(
'images/height.png'),
height: 25,
width: 25,
fit: BoxFit.fill),
Padding(padding: EdgeInsets.all(5),
child: Text(FilteredList[index].bpText.toString().toUpperCase(),style: valuesTextStyle()),)
Padding(
padding: EdgeInsets.all(5),
child: Text(
FilteredList[index]
.bpText
.toString()
.toUpperCase(),
style: valuesTextStyle()),
)
],
),
Row(
@ -203,35 +263,39 @@ class _BPHistoryState extends State<BPHistory> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image(
image: const AssetImage('images/date.png'),
image:
const AssetImage('images/date.png'),
height: 25,
width: 25,
fit: BoxFit.fill),
Padding(padding: EdgeInsets.all(5),
child: Text(FilteredList[index].displayDate.toString().toUpperCase(),style: valuesTextStyle()),)
Padding(
padding: EdgeInsets.all(5),
child: Text(
FilteredList[index]
.actualDate
.toString()
.toUpperCase(),
style: valuesTextStyle()),
)
],
),
],
),
),
),
);
}) ),
));
})),
]);
}
else{
} else {
return Center(
child: Padding(
padding: EdgeInsets.fromLTRB(0, 40, 0, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: MediaQuery.of(context).size.height * .25,),
SizedBox(
height: MediaQuery.of(context).size.height * .25,
),
Text('No data'),
SizedBox(
height: 20,
@ -245,15 +309,12 @@ class _BPHistoryState extends State<BPHistory> {
Icons.info,
color: Colors.white,
),
onPressed: () async {
},
onPressed: () async {},
),
)
],
),
)
);
));
}
}
@ -261,12 +322,14 @@ class _BPHistoryState extends State<BPHistory> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppSettings.appBar('Blood Pressure'),
body: isLoading?Center(
body: isLoading
? Center(
child: CircularProgressIndicator(
color: primaryColor,
strokeWidth: 5.0,
),
):renderzUi(),
)
: renderzUi(),
);
}
}

@ -1158,8 +1158,7 @@ class _AddReportsState extends State<AddReports> {
payload["reports"] = uiReportsImages;
payload["prescription"] = uiPrescriptionImages;
bool uploadStatus =
await AppSettings.addRecords(payload);
bool uploadStatus = await AppSettings.addRecords(payload);
try {
if (uploadStatus) {

@ -1000,6 +1000,7 @@ class _AllReportsTabState extends State<AllReportsTab>
title: Text('Reports'),
backgroundColor: primaryColor,
bottom: TabBar(
isScrollable: true,
controller: _controller,
tabs: topTabs,
indicatorColor: buttonColors,

@ -1,10 +1,9 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:healthcare_user/BMI/bmi_history.dart';
import 'package:healthcare_user/BP/bp_history.dart';
import 'package:healthcare_user/Sugar/sugar_history.dart';
import 'package:healthcare_user/common/settings.dart';
import 'package:intl/intl.dart';
class SugarCalculator extends StatefulWidget {
const SugarCalculator({Key? key}) : super(key: key);
@ -17,6 +16,7 @@ class _SugarCalculatorState extends State<SugarCalculator> {
TextEditingController fastingValueController = TextEditingController();
TextEditingController postParandialValueController = TextEditingController();
TextEditingController dateInput = TextEditingController();
String sugarValue = '';
@override
Widget build(BuildContext context) {
@ -80,16 +80,70 @@ class _SugarCalculatorState extends State<SugarCalculator> {
),
),
SizedBox(height: 10),
TextButton(
child: Text('Check Sugar', style: textButtonStyle()),
SizedBox(height: 10),
Container(
child: TextFormField(
cursorColor: greyColor,
controller: dateInput,
decoration: textFormFieldDecorationBMI(
Icons.calendar_today, 'Enter Date'),
readOnly: true,
onTap: () async {
DateTime? pickedDate = await showDatePicker(
context: context,
initialDate: DateTime.now(),
firstDate: DateTime(1950),
lastDate: DateTime.now(),
builder: (BuildContext context, Widget? child) {
return Theme(
data: ThemeData.dark().copyWith(
colorScheme: ColorScheme.dark(
primary: buttonColors,
onPrimary: Colors.white,
surface: buttonColors,
onSurface: Colors.white,
),
dialogBackgroundColor: primaryColor,
),
child: child!,
);
},
);
if (pickedDate != null) {
print(
pickedDate); //pickedDate output format => 2021-03-10 00:00:00.000
String formattedDate =
DateFormat('dd-MM-yyyy').format(pickedDate);
print(
formattedDate); //formatted date output using intl package => 2021-03-16
setState(() {
dateInput.text =
formattedDate; //set output date to TextField value.
});
} else {}
},
),
),
SizedBox(height: 10),
Container(
width: double.infinity,
height:
MediaQuery.of(context).size.height * .05,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: buttonColors, // background
onPrimary: Colors.black, // foreground
),
onPressed: () async {
if (fastingValueController.text != '' &&
postParandialValueController.text != '') {
postParandialValueController.text != ''&& dateInput.text!='') {
AppSettings.preLoaderDialog(context);
var payload = new Map<String, dynamic>();
payload["fasting"] = double.parse(fastingValueController.text.toString());
payload["postPrandial"] = double.parse(postParandialValueController.text.toString());
payload["date"] = dateInput.text.toString();
var value = await AppSettings.calculateSugar(payload);
var valueResponse = jsonDecode(value);
@ -100,15 +154,20 @@ class _SugarCalculatorState extends State<SugarCalculator> {
});
fastingValueController.clear();
postParandialValueController.clear();
dateInput.clear();
Navigator.of(context,rootNavigator: true).pop();
}
else{
AppSettings.longFailedToast('Please enter valid details');
}
},
),
child: const Text('Check Diabetes'),
)),
SizedBox(height: 10),
Container(
child: Row(
children: [
Text(sugarValue,style: TextStyle(color: Colors.red),),
Text(sugarValue,style: TextStyle(color: Colors.red,fontWeight: FontWeight.bold,fontSize: 15),),
],
)
),

@ -1,9 +1,8 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:healthcare_user/models/bmi_history_model.dart';
import 'package:healthcare_user/common/settings.dart';
import 'package:healthcare_user/models/bp_history_model.dart';
import 'package:healthcare_user/models/sugar_history_model.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
class SugarHistory extends StatefulWidget {
const SugarHistory({Key? key}) : super(key: key);
@ -13,56 +12,51 @@ class SugarHistory extends StatefulWidget {
}
class _SugarHistoryState extends State<SugarHistory> {
bool isLoading=false;
bool isLoading = false;
List<SugarHistoryModel> sugarHistoryList = [];
List<SugarHistoryModel> FilteredList = [];
var dateItems = [
'All',
'last 7 days',
'last one month',
'last one year',
];
var dateItemsVariable = 'last 7 days';
var dateItemsVariable = 'All';
Future<void> getSugarHistoryDetails(var selectedRange) async {
isLoading=true;
var response1= await AppSettings.getSugarHistory();
isLoading = true;
var response1 = await AppSettings.getSugarHistory();
print(response1);
setState(() {
sugarHistoryList =
((jsonDecode(response1)) as List).map((dynamic model) {
sugarHistoryList = ((jsonDecode(response1)) as List).map((dynamic model) {
return SugarHistoryModel.fromJson(model);
}).toList();
var now = new DateTime.now();
var now_1w = now.subtract(Duration(days: 7));
var now_1m = new DateTime(now.year, now.month-1, now.day);
var now_1y = new DateTime(now.year-1, now.month, now.day);
var now_1m = new DateTime(now.year, now.month - 1, now.day);
var now_1y = new DateTime(now.year - 1, now.month, now.day);
if(selectedRange.toString().toUpperCase()=='LAST 7 DAYS'){
FilteredList=sugarHistoryList.where((product) {
if (selectedRange.toString().toUpperCase() == 'LAST 7 DAYS') {
FilteredList = sugarHistoryList.where((product) {
final date = product.dateForFilter;
return now_1w.isBefore(date);
}).toList();
}
else if(selectedRange.toString().toUpperCase()=='LAST ONE MONTH'){
FilteredList=sugarHistoryList.where((product) {
} else if (selectedRange.toString().toUpperCase() == 'LAST ONE MONTH') {
FilteredList = sugarHistoryList.where((product) {
final date = product.dateForFilter;
return now_1m.isBefore(date);
}).toList();
}
else if(selectedRange.toString().toUpperCase()=='LAST ONE YEAR'){
FilteredList=sugarHistoryList.where((product) {
} else if (selectedRange.toString().toUpperCase() == 'LAST ONE YEAR') {
FilteredList = sugarHistoryList.where((product) {
final date = product.dateForFilter;
return now_1y.isBefore(date);
}).toList();
} else {
FilteredList = sugarHistoryList;
}
else{
FilteredList=sugarHistoryList;
}
isLoading=false;
isLoading = false;
});
}
@ -72,13 +66,27 @@ class _SugarHistoryState extends State<SugarHistory> {
super.initState();
}
Widget renderzUi(){
if(sugarHistoryList.length!=0){
deleteSugarRecord(sugarInfoId) async {
AppSettings.preLoaderDialog(context);
bool status = await AppSettings.deleteSugarDetails(sugarInfoId);
return Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Padding(padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
if (status) {
Navigator.of(context, rootNavigator: true).pop();
AppSettings.longSuccessToast("BP record deleted successfully");
await getSugarHistoryDetails(dateItemsVariable);
} else {
Navigator.of(context, rootNavigator: true).pop();
AppSettings.longFailedToast("BP record deletion failed");
}
}
Widget renderzUi() {
if (sugarHistoryList.length != 0) {
return Column(crossAxisAlignment: CrossAxisAlignment.end, children: [
Padding(
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
child: DropdownButtonFormField(
// Initial Value
value: dateItemsVariable,
@ -96,7 +104,7 @@ class _SugarHistoryState extends State<SugarHistory> {
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
labelText: 'Units',
labelText: 'Select Date Range',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
@ -126,116 +134,287 @@ class _SugarHistoryState extends State<SugarHistory> {
});
getSugarHistoryDetails(dateItemsVariable);
},
),),
Expanded(child:ListView.builder(
),
),
Expanded(
child: ListView.builder(
padding: EdgeInsets.all(0),
itemCount: FilteredList.length,
itemBuilder: (BuildContext context, int index) {
return Card(
return Slidable(
key: const ValueKey(0),
endActionPane: ActionPane(
// A motion is a widget used to control how the pane animates.
motion: ScrollMotion(),
dragDismissible: false,
// A pane can dismiss the Slidable.
dismissible: DismissiblePane(onDismissed: () {
deleteSugarRecord(FilteredList[index].sugarInfoId);
}),
// All actions are defined in the children parameter.
children: [
// A SlidableAction can have an icon and/or a label.
SlidableAction(
backgroundColor: Color(0xFFFE4A49),
foregroundColor: Colors.white,
icon: Icons.delete,
label: 'Delete',
onPressed: (BuildContext context) {
deleteSugarRecord(FilteredList[index].sugarInfoId);
},
),
],
),
child: Card(
color: Colors.white,
child: Padding(
padding:EdgeInsets.all(8) ,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
padding: EdgeInsets.all(8),
child:
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
Text(
'Fasting Sugar Value',
style: labelTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
'PostPrandial Sugar Value',
style: labelTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
'Actual Sugar Value',
style: labelTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
'Sugar Status',
style: labelTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
'Date',
style: labelTextStyle(),
),
],
),
SizedBox(width:MediaQuery.of(context).size.width * .01,),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image(
image: const AssetImage('images/height.png'),
height: 25,
width: 25,
fit: BoxFit.fill),
Padding(padding: EdgeInsets.all(5),
child: Text(FilteredList[index].fasting.toString().toUpperCase(),style: valuesTextStyle()),)
Text(
':',
style: labelTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
':',
style: labelTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
':',
style: labelTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
':',
style: labelTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
':',
style: labelTextStyle(),
),
],
),
Row(
SizedBox(width:MediaQuery.of(context).size.width * .01,),
Expanded(child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image(
image: const AssetImage('images/height.png'),
Text(
FilteredList[index]
.fasting
.toString()
.toUpperCase(),
style: valuesTextStyle()),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
FilteredList[index]
.postPrandial
.toString()
.toUpperCase(),
style: valuesTextStyle()),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
FilteredList[index]
.sugarValue
.toString()
.toUpperCase(),
style: valuesTextStyle()),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
FilteredList[index]
.sugartText
.toString()
.toUpperCase(),
style: wrapTextStyleBlack()),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
FilteredList[index]
.actualDate
.toString()
.toUpperCase(),
style: valuesTextStyle()),
],
),)
/*Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
*//*Image(
image: const AssetImage(
'images/height.png'),
height: 25,
width: 25,
fit: BoxFit.fill),
Padding(padding: EdgeInsets.all(5),
child: Text(FilteredList[index].postPrandial.toString().toUpperCase(),style: valuesTextStyle()),)
fit: BoxFit.fill),*//*
Text(
'Fasting Sugar Value',
style: TextStyle(color: primaryColor),
),
Padding(
padding: EdgeInsets.all(5),
child: Text(
FilteredList[index]
.fasting
.toString()
.toUpperCase(),
style: valuesTextStyle()),
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'PostPrandial Sugar Value',
style: TextStyle(color: primaryColor),
),
Padding(
padding: EdgeInsets.all(5),
child: Text(
FilteredList[index]
.postPrandial
.toString()
.toUpperCase(),
style: valuesTextStyle()),
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Image(
image: const AssetImage('images/height.png'),
image: const AssetImage(
'images/height.png'),
height: 25,
width: 25,
fit: BoxFit.fill),
Padding(padding: EdgeInsets.all(5),
child: Text(FilteredList[index].sugarValue.toString().toUpperCase(),style: valuesTextStyle()),)
Padding(
padding: EdgeInsets.all(5),
child: Text(
FilteredList[index]
.sugarValue
.toString()
.toUpperCase(),
style: valuesTextStyle()),
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Image(
image: const AssetImage('images/height.png'),
image: const AssetImage(
'images/height.png'),
height: 25,
width: 25,
fit: BoxFit.fill),
Padding(padding: EdgeInsets.all(5),
child: Text(FilteredList[index].sugartText.toString().toUpperCase(),style: valuesTextStyle()),)
Padding(
padding: EdgeInsets.all(5),
child: Text(
FilteredList[index]
.sugartText
.toString()
.toUpperCase(),
style: valuesTextStyle()),
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Image(
image: const AssetImage('images/date.png'),
image: const AssetImage(
'images/date.png'),
height: 25,
width: 25,
fit: BoxFit.fill),
Padding(padding: EdgeInsets.all(5),
child: Text(FilteredList[index].displayDate.toString().toUpperCase(),style: valuesTextStyle()),)
Padding(
padding: EdgeInsets.all(5),
child: Text(
FilteredList[index]
.actualDate
.toString()
.toUpperCase(),
style: valuesTextStyle()),
)
],
),
],
),
),*/
],
),
),
);
}) ),
));
})),
]);
}
else{
} else {
return Center(
child: Padding(
padding: EdgeInsets.fromLTRB(0, 40, 0, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: MediaQuery.of(context).size.height * .25,),
SizedBox(
height: MediaQuery.of(context).size.height * .25,
),
Text('No data'),
SizedBox(
height: 20,
@ -249,15 +428,12 @@ class _SugarHistoryState extends State<SugarHistory> {
Icons.info,
color: Colors.white,
),
onPressed: () async {
},
onPressed: () async {},
),
)
],
),
)
);
));
}
}
@ -265,12 +441,14 @@ class _SugarHistoryState extends State<SugarHistory> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppSettings.appBar('Diabetes'),
body: isLoading?Center(
body: isLoading
? Center(
child: CircularProgressIndicator(
color: primaryColor,
strokeWidth: 5.0,
),
):renderzUi(),
)
: renderzUi(),
);
}
}

@ -20,7 +20,7 @@ class _BmiChartState extends State<BmiChart> {
_getSeriesData() {
List<charts.Series<BmiHistoryModel, DateTime>> series = [
charts.Series(
id: "Sales",
id: "Bmi",
data: widget.myObject,
domainFn: (BmiHistoryModel series, _) => series.dateForFilter,
measureFn: (BmiHistoryModel series, _) => series.number2,

@ -10,8 +10,9 @@ import 'package:healthcare_user/medicines.dart';
import 'package:healthcare_user/my_health.dart';
import 'package:healthcare_user/my_medicine_timings.dart';
import 'package:healthcare_user/prescriptions/prescriptions.dart';
import 'package:healthcare_user/report_my_self.dart';
import 'package:healthcare_user/report_problem/report_my_self.dart';
import 'package:healthcare_user/Reports/add_reports.dart';
import 'package:healthcare_user/report_problem/all_problems.dart';
import 'package:healthcare_user/seekopinion.dart';
import 'package:healthcare_user/common/settings.dart';
import 'package:healthcare_user/updates/update_location.dart';
@ -371,19 +372,15 @@ class _DashboardState extends State<Dashboard> {
shape: BoxShape.circle,
image: DecorationImage(
image: AssetImage(
"images/invitations.png"), // picked file
"images/myconnections.png"), // picked file
fit: BoxFit.fitWidth)),
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const Invitations()),
);
},
),
Text(
'Invitations',
'My Connections',
style: dashboardTextStyle(),
),
],
@ -774,7 +771,7 @@ class _DashboardState extends State<Dashboard> {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const ReportMySelf()),
builder: (context) => AllProblemsReportMyself()),
);
},
),
@ -785,7 +782,7 @@ class _DashboardState extends State<Dashboard> {
title: Row(
children: [
Image(
image: const AssetImage('images/myconnections.png'),
image: const AssetImage('images/invitations.png'),
height: 25,
width: 25,
fit: BoxFit.fill),
@ -795,10 +792,16 @@ class _DashboardState extends State<Dashboard> {
const SizedBox(
width: 10,
),
Text('My Connections', style: drawerListItemsTextStyle()),
Text('Invitations', style: drawerListItemsTextStyle()),
],
),
onTap: () {},
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const Invitations()),
);
},
),
Divider(
color: Colors.grey,

@ -194,6 +194,28 @@ InputDecoration textFormFieldDecoration(IconData icon, var text) {
);
}
InputDecoration textFormFieldDecorationBMI(IconData icon, var text) {
return InputDecoration(
//filled: true,
//fillColor: Colors.white,
prefixIcon: Icon(
icon,
color: primaryColor,
),
border: OutlineInputBorder(borderSide: BorderSide(color: primaryColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
labelText: text,
labelStyle: TextStyle(
//color: Colors.black, //<-- SEE HERE
),
);
}
final GlobalKey<State> preloaderWindowKey = new GlobalKey<State>();
Future<void> preloaderWindow(BuildContext context) async {
try {
@ -250,6 +272,7 @@ class AppSettings {
static String getBpHistoryUrl = host + 'usersbp';
static String getSugarHistoryUrl = host + 'userssugar';
static String addMedicineTimingsUrl = host + 'medicine-timing';
static String updateMedicineTimingsUrl = host + 'update-medicine-timing';
static String getMedicineTimingsUrl = host + 'getmedicineztiming';
static String findingsUploadPicUrl = host + 'uploads-findings-prescription';
static String addFindingsUrl = host + 'update-uploads-findingsPictureId-prescription';
@ -268,6 +291,8 @@ class AppSettings {
static String addRecordsUrl = host + 'add-record';
static String updateRecordsUrl = host + 'records';
static String reportMySelfVideoUploadUrl = host + 'reportProblemVideo';
static String uploadReportMyselfPictureUrl = host + 'reportProblemPicture';
//static String getAllPrescriptionsDataUrl = host + 'usersinglerprecription';
static String getAllPrescriptionsDataUrl = host + 'getAllPrescriptionDetails';
static String getRecordsDataUrl = host + 'getAllRecords';
@ -276,6 +301,16 @@ class AppSettings {
static String deletePrescriptionsUrl = host + 'delete-prescription';
static String deleteReportsUrl = host + 'delete-report';
static String deleteRecordsUrl = host + 'delete-url';
static String deleteBMIDetailsUrl = host + 'deleteBMI';
static String deleteBPDetailsUrl = host + 'deleteBP';
static String deleteSugarDetailsUrl = host + 'deleteSugar';
static String addReportMySelfProblemUrl = host + 'insertReport';
static String getAllReportProblemDetalisUrl = host + 'userreport';
static String deleteReportMySelfProblemUrl = host + 'deleteReportProblem';
@ -1052,6 +1087,16 @@ class AppSettings {
return response.body;
}
static Future<String> uploadReportMyselfPicture(file) async {
var request = http.MultipartRequest('POST', Uri.parse(uploadReportMyselfPictureUrl + '/' + customerId));
request.files.add(await http.MultipartFile.fromPath('picture', file.path));
var res = await request.send();
var response = await http.Response.fromStream(res);
return response.body;
}
static Future<String> getAllpharmacies() async {
var uri = Uri.parse(getAllpharmaciesDataUrl);
//uri = uri.replace(query: 'customerId=$customerId');
@ -1125,6 +1170,31 @@ class AppSettings {
}
}
static Future<String> updateMedicineTimings(payload) async {
var uri = Uri.parse(updateMedicineTimingsUrl + '/' + customerId);
var response = await http.post(uri,
body: json.encode(payload), headers: await buildRequestHeaders());
if (response.statusCode == 200) {
return response.body;
} else if (response.statusCode == 401) {
bool status = await AppSettings.resetToken();
if (status) {
response = await http.post(uri,
body: json.encode(payload), headers: await buildRequestHeaders());
if (response.statusCode == 200) {
return response.body;
} else {
return '';
}
} else {
return '';
}
} else {
return '';
}
}
static Future<String> getMedicineTimings() async {
var uri = Uri.parse(getMedicineTimingsUrl + '/' + customerId);
@ -1473,7 +1543,6 @@ class AppSettings {
}
}*/
static Future<bool> deleteRecords(payload, recordId) async {
var uri = Uri.parse(deleteRecordsUrl + '/' + customerId+'/'+recordId);
@ -1503,8 +1572,6 @@ class AppSettings {
}
}
static Future<String> deleteRecordsNew(payload, recordId) async {
var uri = Uri.parse(deleteRecordsUrl + '/' + customerId+'/'+recordId);
@ -1534,9 +1601,178 @@ class AppSettings {
}
}
static Future<bool> deleteBMIDetails(bmiId) async {
var uri = Uri.parse(deleteBMIDetailsUrl + '/' + customerId+'/'+ bmiId);
try {
var response = await http.delete(uri, headers: await buildRequestHeaders());
if (response.statusCode == 200) {
return true;
} else if (response.statusCode == 401) {
bool status = await AppSettings.resetToken();
if (status) {
response = await http.delete(uri, headers: await buildRequestHeaders());
if (response.statusCode == 200) {
return true;
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
} catch (e) {
print(e);
return false;
}
}
static Future<bool> deleteBPDetails(bmiId) async {
var uri = Uri.parse(deleteBPDetailsUrl + '/' + customerId+'/'+ bmiId);
try {
var response = await http.delete(uri, headers: await buildRequestHeaders());
if (response.statusCode == 200) {
return true;
} else if (response.statusCode == 401) {
bool status = await AppSettings.resetToken();
if (status) {
response = await http.delete(uri, headers: await buildRequestHeaders());
if (response.statusCode == 200) {
return true;
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
} catch (e) {
print(e);
return false;
}
}
static Future<bool> deleteSugarDetails(bmiId) async {
var uri = Uri.parse(deleteSugarDetailsUrl + '/' + customerId+'/'+ bmiId);
try {
var response = await http.delete(uri, headers: await buildRequestHeaders());
if (response.statusCode == 200) {
return true;
} else if (response.statusCode == 401) {
bool status = await AppSettings.resetToken();
if (status) {
response = await http.delete(uri, headers: await buildRequestHeaders());
if (response.statusCode == 200) {
return true;
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
} catch (e) {
print(e);
return false;
}
}
static Future<bool> addReportMySelfProblem(payload) async {
var uri = Uri.parse(addReportMySelfProblemUrl + '/' + customerId);
var response = await http.post(uri,
body: json.encode(payload), headers: await buildRequestHeaders());
if (response.statusCode == 200) {
try {
var _response = json.decode(response.body);
print(_response);
return true;
} catch (e) {
print(e);
return false;
}
} else if (response.statusCode == 401) {
bool status = await AppSettings.resetToken();
if (status) {
response = await http.post(uri,
body: json.encode(payload), headers: await buildRequestHeaders());
if (response.statusCode == 200) {
return true;
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
}
static Future<String> getAllReportProblemDetalis() async {
var uri = Uri.parse(getAllReportProblemDetalisUrl+'/'+customerId);
//uri = uri.replace(query: 'customerId=$customerId');
var response = await http.get(uri, headers: await buildRequestHeaders());
if (response.statusCode == 200) {
return response.body;
} else if (response.statusCode == 401) {
bool status = await AppSettings.resetToken();
if (status) {
response = await http.get(uri, headers: await buildRequestHeaders());
if (response.statusCode == 200) {
return response.body;
} else {
return '';
}
} else {
return '';
}
} else {
return '';
}
}
static Future<bool> deleteReportMySelfProblem(problemId) async {
var uri = Uri.parse(deleteReportMySelfProblemUrl + '/' +problemId);
try {
var response = await http.put (uri, headers: await buildPutRequestHeaders());
if (response.statusCode == 200) {
return true;
} else if (response.statusCode == 401) {
bool status = await AppSettings.resetToken();
if (status) {
response = await http.put(uri, headers: await buildPutRequestHeaders());
if (response.statusCode == 200) {
return true;
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
} catch (e) {
print(e);
return false;
}
}
/*Apis ends here*/

@ -15,10 +15,33 @@ class _ImageZoomPageState extends State<ImageZoomPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppSettings.appBar(widget.imageName),
appBar:AppBar(
backgroundColor: primaryColor,
title: Text(widget.imageName),
actions: [
IconButton(
onPressed: () {
Navigator.pop(context);
},
icon: Icon(
Icons.cancel,
color: Colors.red,
size: 30,
),
),
],
),
body: Container(
//width: MediaQuery.of(context).size.width * .10,
//height: MediaQuery.of(context).size.height * .50,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(padding:EdgeInsets.fromLTRB(10,10,10,0),
child: Text('Use two fingers to zoom/double tap',style: TextStyle(color: Colors.black,fontSize: 12),),),
SizedBox(height:MediaQuery.of(context).size.height * .02,),
Expanded(
child: PhotoView(
imageProvider: NetworkImage(widget.imageDetails) as ImageProvider,
maxScale: PhotoViewComputedScale.contained * 4.0,
@ -26,6 +49,9 @@ class _ImageZoomPageState extends State<ImageZoomPage> {
initialScale: PhotoViewComputedScale.contained,
basePosition: Alignment.center,
),
)
],
)
),

@ -1,15 +1,415 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:healthcare_user/common/settings.dart';
import 'package:day_night_time_picker/day_night_time_picker.dart';
import 'package:intl/intl.dart';
class EditMedicineTimings extends StatefulWidget {
const EditMedicineTimings({Key? key}) : super(key: key);
var medicineTimings;
EditMedicineTimings({this.medicineTimings});
@override
State<EditMedicineTimings> createState() => _EditMedicineTimingsState();
}
class _EditMedicineTimingsState extends State<EditMedicineTimings> {
Time _time = Time(hour: 0, minute: 0, second: 0);
Time _wakeupTime = Time(hour: 0, minute: 0, second: 0);
Time _beforeBreakfastTime = Time(hour: 0, minute: 0, second: 0);
Time _afterBreakfastTime = Time(hour: 0, minute: 0, second: 0);
Time _beforeLunchTime = Time(hour: 0, minute: 0, second: 0);
Time _afterLunchTime = Time(hour: 0, minute: 0, second: 0);
Time _eveningTeaTime = Time(hour: 0, minute: 0, second: 0);
Time _beforeDinnerTime = Time(hour: 0, minute: 0, second: 0);
Time _afterDinnerTime = Time(hour: 0, minute: 0, second: 0);
Time _sleepTime = Time(hour: 0, minute: 0, second: 0);
DateTime wakeUp = DateTime.now();
String wakeUpfForApi='';
String _beforeBreakfastTimeForApi='';
String _afterBreakfastTimeForApi='';
String _beforeLunchTimeForApi='';
String _afterLunchTimeForApi='';
String _eveningTeaTimeForApi='';
String _beforeDinnerTimeForApi='';
String _afterDinnerTimeForApi='';
String _sleepTimeForApi='';
List timings = [
{'name': 'Wakeup'},
{'name': 'Before breakfast'},
{'name': 'After- breakfast'},
{'name': 'Before lunch'},
{'name': 'After lunch'},
{'name': 'Evening tea'},
{'name': 'Before dinner'},
{'name': 'After dinner'},
{'name': 'Sleep'}
];
@override
void initState() {
wakeUpfForApi=widget.medicineTimings['wakeUp'];
_beforeBreakfastTimeForApi=widget.medicineTimings['beforeBreakfast'];
_afterBreakfastTimeForApi=widget.medicineTimings['afterBreakfast'];
_beforeLunchTimeForApi=widget.medicineTimings['beforeLunch'];
_afterLunchTimeForApi=widget.medicineTimings['afterLunch'];
_eveningTeaTimeForApi=widget.medicineTimings['eveningTea'];
_beforeDinnerTimeForApi=widget.medicineTimings['beforeDinner'];
_afterDinnerTimeForApi=widget.medicineTimings['afterDinner'];
_sleepTimeForApi=widget.medicineTimings['sleep'];
super.initState();
}
Widget textForSelectedTime(int index) {
if (index == 0) {
return
Text(
wakeUpfForApi,
style: TextStyle(color: Colors.black),
);
} else if (index == 1) {
return Text(
_beforeBreakfastTimeForApi,
style: TextStyle(color: Colors.black),
);
} else if (index == 2) {
return Text(
_afterBreakfastTimeForApi,
style: TextStyle(color: Colors.black),
);
} else if (index == 3) {
return Text(
_beforeLunchTimeForApi,
style: TextStyle(color: Colors.black),
);
} else if (index == 4) {
return Text(
_afterLunchTimeForApi,
style: TextStyle(color: Colors.black),
);
} else if (index == 5) {
return Text(
_eveningTeaTimeForApi,
style: TextStyle(color: Colors.black),
);
} else if (index == 6) {
return Text(
_beforeDinnerTimeForApi,
style: TextStyle(color: Colors.black),
);
} else if (index == 7) {
return Text(
_afterDinnerTimeForApi,
style: TextStyle(color: Colors.black),
);
} else if (index == 8) {
return Text(
_sleepTimeForApi,
style: TextStyle(color: Colors.black),
);
} else {
return Container();
}
}
void onTimeChanged(Time newTime, int index) {
setState(() {
_time=newTime;
});
if (index == 0) {
setState(() {
_wakeupTime = newTime;
});
final now = new DateTime.now();
final dt = DateTime(now.year, now.month, now.day, _wakeupTime.hour, _wakeupTime.minute);
final format = DateFormat.jm();
setState(() {
wakeUpfForApi=format.format(dt);
});
}
else if (index == 1) {
setState(() {
_beforeBreakfastTime = newTime;
});
final now = new DateTime.now();
final dt = DateTime(now.year, now.month, now.day, _beforeBreakfastTime.hour, _beforeBreakfastTime.minute);
final format = DateFormat.jm();
setState(() {
_beforeBreakfastTimeForApi=format.format(dt);
});
}
else if (index == 2) {
setState(() {
_afterBreakfastTime = newTime;
});
final now = new DateTime.now();
final dt = DateTime(now.year, now.month, now.day, _afterBreakfastTime.hour, _afterBreakfastTime.minute);
final format = DateFormat.jm();
setState(() {
_afterBreakfastTimeForApi=format.format(dt);
});
}
else if (index == 3) {
setState(() {
_beforeLunchTime = newTime;
});
final now = new DateTime.now();
final dt = DateTime(now.year, now.month, now.day, _beforeLunchTime.hour, _beforeLunchTime.minute);
final format = DateFormat.jm();
setState(() {
_beforeLunchTimeForApi=format.format(dt);
});
}
else if (index == 4) {
setState(() {
_afterLunchTime = newTime;
});
final now = new DateTime.now();
final dt = DateTime(now.year, now.month, now.day, _afterLunchTime.hour, _afterLunchTime.minute);
final format = DateFormat.jm();
setState(() {
_afterLunchTimeForApi=format.format(dt);
});
}
else if (index == 5) {
setState(() {
_eveningTeaTime = newTime;
});
final now = new DateTime.now();
final dt = DateTime(now.year, now.month, now.day, _eveningTeaTime.hour, _eveningTeaTime.minute);
final format = DateFormat.jm();
setState(() {
_eveningTeaTimeForApi=format.format(dt);
});
}
else if (index == 6) {
setState(() {
_beforeDinnerTime = newTime;
});
final now = new DateTime.now();
final dt = DateTime(now.year, now.month, now.day, _beforeDinnerTime.hour, _beforeDinnerTime.minute);
final format = DateFormat.jm();
setState(() {
_beforeDinnerTimeForApi=format.format(dt);
});
}
else if (index == 7) {
setState(() {
_afterDinnerTime = newTime;
});
final now = new DateTime.now();
final dt = DateTime(now.year, now.month, now.day, _afterDinnerTime.hour, _afterDinnerTime.minute);
final format = DateFormat.jm();
setState(() {
_afterDinnerTimeForApi=format.format(dt);
});
}
else if (index == 8) {
setState(() {
_sleepTime = newTime;
});
final now = new DateTime.now();
final dt = DateTime(now.year, now.month, now.day, _sleepTime.hour, _sleepTime.minute);
final format = DateFormat.jm();
setState(() {
_sleepTimeForApi=format.format(dt);
});
}
}
void _selectedDateWithTime(DateTime newTime,int ind){
if (ind == 0) {
setState(() {
wakeUp = newTime;
String formattedDate = DateFormat('yyyy-MM-dd kk:mm').format(wakeUp);
// DateTime parseDate = new DateFormat("dd-MM-yyyy HH:mm:ss").parse(wakeUp);
print(formattedDate);
});
}
/* else if (ind == 1) {
setState(() {
_beforeBreakfastTime = newTime as Time ;
});
}
else if (ind == 2) {
setState(() {
_afterBreakfastTime = newTime as Time;
});
}
else if (ind == 3) {
setState(() {
_beforeLunchTime = newTime as Time;
});
}
else if (ind == 4) {
setState(() {
_afterLunchTime = newTime as Time;
});
}
else if (ind == 5) {
setState(() {
_eveningTeaTime = newTime as Time;
});
}
else if (ind == 6) {
setState(() {
_beforeDinnerTime = newTime as Time;
});
}
else if (ind == 7) {
setState(() {
_afterDinnerTime = newTime as Time;
});
}
else if (ind == 8) {
setState(() {
_sleepTime = newTime as Time;
});
}*/
}
Widget renderTimings(){
return Column(
children: [
Expanded(
child: ListView.separated(
separatorBuilder: (context, index) => const Divider(
height: 4.0,
color: primaryColor,
),
//padding: EdgeInsets.all(8),
itemCount: timings.length,
itemBuilder: (BuildContext context, int index) {
return Padding(
padding: EdgeInsets.all(10),
child: Container(
padding: EdgeInsets.fromLTRB(8, 8, 0, 0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Container(
width:
MediaQuery.of(context).size.width * .40,
child: Text(
timings[index]['name'],
style: wrapTextStyle(),
),
),
GestureDetector(
onTap: () {
Navigator.of(context).push(
showPicker(
showSecondSelector: true,
context: context,
value: _time,
//onChange: onTimeChanged,
onChange: (val) {
onTimeChanged(val, index);
},
is24HrFormat: false,
sunrise: TimeOfDay(
hour: 6, minute: 0), // optional
sunset: TimeOfDay(hour: 18, minute: 0),
minuteInterval: TimePickerInterval.FIVE,
// Optional onChange to receive value as DateTime
onChangeDateTime: (DateTime dateTime) {
_selectedDateWithTime(dateTime,index);
},
),
);
},
child: Image(
image: AssetImage('images/time.png'),
width: 30,
height: 30,
),
),
textForSelectedTime(index)
],
),
],
)),
);
})),
Padding(padding: EdgeInsets.fromLTRB(10, 10, 10, 40),
child: Row(
children: [
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: primaryColor, // background
onPrimary: Colors.white, // foreground
),
onPressed: () async {
AppSettings.preLoaderDialog(context);
bool isOnline = await AppSettings.internetConnectivity();
if(isOnline){
if(_time!=TimeOfDay(hour: 0,minute: 0)){
var payload = new Map<String, dynamic>();
payload["wakeUp"] = wakeUpfForApi;//_wakeupTime.hour.toString()+':'+_wakeupTime.minute.toString();
payload["beforeBreakfast"] = _beforeBreakfastTimeForApi;
payload["afterBreakfast"] = _afterBreakfastTimeForApi;
payload["beforeLunch"] = _beforeLunchTimeForApi;
payload["afterLunch"] = _afterLunchTimeForApi;
payload["eveningTea"] = _eveningTeaTimeForApi;
payload["beforeDinner"] = _beforeDinnerTimeForApi;
payload["afterDinner"] = _afterDinnerTimeForApi;
payload["sleep"] = _sleepTimeForApi;
var value = await AppSettings.updateMedicineTimings(payload);
var valueResponse = jsonDecode(value);
Navigator.of(context,rootNavigator: true).pop();
Navigator.pop(context);
//getMedicineTimingsList();
}
else{
Navigator.of(context,rootNavigator: true).pop();
AppSettings.longFailedToast('Please select timing' );
}
}
else{
Navigator.of(context,rootNavigator: true).pop();
AppSettings.longFailedToast('Please check internet' );
}
},
child: const Text('Update'),
),
],
)
)
],
);
}
@override
Widget build(BuildContext context) {
return const Placeholder();
return Scaffold(
appBar: AppSettings.appBar('Edit Medicine Timings'),
body: Container(
child: //Text(widget.medicineTimings.toString())
renderTimings(),
)
//medicineTimings.length==0?renderUi():renderTimings(),
);
}
}

@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:healthcare_user/common/settings.dart';
import 'package:healthcare_user/report_my_self.dart';
import 'package:healthcare_user/report_problem/report_my_self.dart';
class HowAreYouFellingToday extends StatefulWidget {
@ -18,7 +18,11 @@ class _HowAreYouFellingTodayState extends State<HowAreYouFellingToday> {
body: Container(
child: Padding(
padding: EdgeInsets.all(10),
child: TextButton(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
/*TextButton(
child: const Text(
'Report a problem!',
style: TextStyle(fontSize: 15,
@ -32,7 +36,161 @@ class _HowAreYouFellingTodayState extends State<HowAreYouFellingToday> {
);
//signup screen
},
),*/
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Column(
children: [
GestureDetector(
child: Container(
width: MediaQuery.of(context).size.width * .20,
height: MediaQuery.of(context).size.height * .15,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
image: DecorationImage(
image: AssetImage(
"images/happy.png"), // picked file
fit: BoxFit.fitWidth)),
),
onTap: () {
},
),
Text('Happy', style: TextStyle(color: primaryColor,fontSize: 14,fontWeight: FontWeight.bold),)
],
),
Column(
children: [
GestureDetector(
child: Container(
width: MediaQuery.of(context).size.width * .20,
height: MediaQuery.of(context).size.height * .15,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
image: DecorationImage(
image: AssetImage(
"images/ok.png"), // picked file
fit: BoxFit.fitWidth)),
),
onTap: () async {
showDialog(
//barrierDismissible: false,
context: context,
builder: (BuildContext context) => AlertDialog(
title: const Text('Would you like to leave a message?',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
actionsAlignment: MainAxisAlignment.spaceBetween,
actions: [
TextButton(
onPressed: ()async {
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const ReportMySelf()),
);
},
child: const Text('Yes',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
),
TextButton(
onPressed: () {
Navigator.of(context).pop(true);
},
child: const Text('No',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
),
],
),
);
},
),
Text('Ok', style: TextStyle(color: buttonColors,fontSize: 14,fontWeight: FontWeight.bold),)
],
),
Column(
children: [
GestureDetector(
child:
Container(
width: MediaQuery.of(context).size.width * .20,
height: MediaQuery.of(context).size.height * .15,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
image: DecorationImage(
image: AssetImage(
"images/sad.png"), // picked file
fit: BoxFit.fitWidth)),
),
onTap: () async {
showDialog(
//barrierDismissible: false,
context: context,
builder: (BuildContext context) => AlertDialog(
title: const Text('Would you like to leave a message?',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
actionsAlignment: MainAxisAlignment.spaceBetween,
actions: [
TextButton(
onPressed: ()async {
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const ReportMySelf()),
);
},
child: const Text('Yes',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
),
TextButton(
onPressed: () {
Navigator.of(context).pop(true);
},
child: const Text('No',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
),
],
),
);
},
),
Text('Sick', style: TextStyle(color: Colors.red,fontSize: 14,fontWeight: FontWeight.bold),)
],
),
],
)
],
)
),
),
);

@ -75,7 +75,7 @@ class _InvitationsState extends State<Invitations> {
payload["name"] = nameController.text;
payload["name"] = AppSettings.userName;
payload["phone"] = mobileNumberController.text;
payload["dateAndTime"] = formattedDate;
bool invitationStatus = await AppSettings.inviteFriend(payload);
@ -148,7 +148,7 @@ class _InvitationsState extends State<Invitations> {
}
}
payload["name"] =_contact!.fullName;
payload["name"] =AppSettings.userName;
payload["phone"] = stringAfterRemovingWhiteSpace;
payload["dateAndTime"] = formattedDate;
bool invitationStatus = await AppSettings.inviteFriend(payload);

@ -0,0 +1,33 @@
import 'package:intl/intl.dart';
class AllProblemsModel {
String problem='';
String audio='';
String description='';
String video='';
String date='';
String problemId='';
List picture = [];
String image='';
bool isAudioButtonEnabled=false;
DateTime dateForFilter=new DateTime.now();
String dateNew='';
AllProblemsModel();
factory AllProblemsModel.fromJson(Map<String, dynamic> json){
AllProblemsModel rtvm = new AllProblemsModel();
rtvm.problem = json['name'] ?? '';
rtvm.audio = json['audio'] ?? '';
rtvm.description = json['description'] ?? '';
rtvm.video = json['video'] ?? '';
rtvm.date = json['date'] ?? '';
rtvm.dateForFilter = DateFormat('dd-MM-yyyy').parse(rtvm.date);
rtvm.problemId = json['reportId'] ?? '';
rtvm.picture = json['picture'] ?? [];
rtvm.image=json['picture'][0]['url']??'';
return rtvm;
}
}

@ -1,4 +1,3 @@
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
@ -7,8 +6,11 @@ class BmiHistoryModel {
String height= '';
String weight= '';
String date= '';
String actualDate= '';
String displayDate='';
DateTime dateForFilter=new DateTime.now();
String bmiInfoId = '';
String bmiText = '';
var number1;
var number2;
@ -18,7 +20,7 @@ class BmiHistoryModel {
factory BmiHistoryModel.fromJson(Map<String, dynamic> json){
BmiHistoryModel rtvm = new BmiHistoryModel();
/*"heightUnit": "feet",
"weightUnit": "kg",
"weightUnit": "kg",oh
"_id": "6493fe48eca67b71b8444e24",
"bmiinfoid": "BMI1687420488845468",
"customerId": "AHSUSNE2",
@ -30,18 +32,26 @@ class BmiHistoryModel {
"updatedAt": "2023-06-22T07:54:48.847Z",*/
rtvm.bmiValue = json['bmivalue'].toString() ?? '';
rtvm.bmiInfoId = json['bmiinfoid'].toString() ?? '';
rtvm.height = json['height'].toString() ?? '';
rtvm.weight = json['weight'].toString() ?? '';
rtvm.number1 = double.parse( rtvm.bmiValue);
rtvm.number2 = double.parse( rtvm.bmiValue);
rtvm.date = json['createdAt'].toString() ?? '';
//DateTime tempDate = new DateFormat("yyyy-MM-dd hh:mm:ss").parse(rtvm.date);
DateTime parseDate = new DateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").parse(rtvm.date);
var outputFormat = DateFormat('MM/dd/yyyy hh:mm a');
rtvm.dateForFilter=parseDate;
var outputDate = outputFormat.format(parseDate);
rtvm.displayDate=outputDate;
rtvm.actualDate = json['date'].toString() ?? '';
rtvm.dateForFilter = DateFormat('dd-MM-yyyy').parse(rtvm.actualDate);
if(double.parse(rtvm.bmiValue)<18.5){
rtvm.bmiText='Underweight';
}
else if(double.parse(rtvm.bmiValue)>=18.5&&double.parse(rtvm.bmiValue)<=24.9){
rtvm.bmiText='Normal weight';
}
else if(double.parse(rtvm.bmiValue)>=25&&double.parse(rtvm.bmiValue)<=29.9){
rtvm.bmiText='Overweight';
}
else if(double.parse(rtvm.bmiValue)>=30){
rtvm.bmiText='Obesity';
}
return rtvm;

@ -7,7 +7,9 @@ class BPHistoryModel {
String systolic= '';
String diastolic= '';
String date= '';
String bpId= '';
String displayDate='';
String actualDate='';
DateTime dateForFilter=new DateTime.now();
@ -15,29 +17,15 @@ class BPHistoryModel {
factory BPHistoryModel.fromJson(Map<String, dynamic> json){
BPHistoryModel rtvm = new BPHistoryModel();
/*"heightUnit": "feet",
"weightUnit": "kg",
"_id": "6493fe48eca67b71b8444e24",
"bmiinfoid": "BMI1687420488845468",
"customerId": "AHSUSNE2",
"height": "164.592",
"weight": "50",
"age": 27,
"bmivalue": 18.46,
"createdAt": "2023-06-22T07:54:48.847Z",
"updatedAt": "2023-06-22T07:54:48.847Z",*/
rtvm.bpText = json['bpCategory'].toString() ?? '';
rtvm.systolic = json['Systolic'].toString() ?? '';
rtvm.diastolic = json['Diastolic'].toString() ?? '';
rtvm.date = json['createdAt'].toString() ?? '';
rtvm.actualDate = json['date'].toString() ?? '';
rtvm.bpId= json['bpinfoid'].toString() ?? '';
//DateTime tempDate = new DateFormat("yyyy-MM-dd hh:mm:ss").parse(rtvm.date);
DateTime parseDate = new DateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").parse(rtvm.date);
var outputFormat = DateFormat('MM/dd/yyyy hh:mm a');
rtvm.dateForFilter=parseDate;
var outputDate = outputFormat.format(parseDate);
rtvm.displayDate=outputDate;
rtvm.dateForFilter = DateFormat('dd-MM-yyyy').parse(rtvm.actualDate);
return rtvm;

@ -9,6 +9,8 @@ class SugarHistoryModel {
String postPrandial= '';
String date= '';
String displayDate='';
String actualDate='';
String sugarInfoId='';
DateTime dateForFilter=new DateTime.now();
@ -16,30 +18,18 @@ class SugarHistoryModel {
factory SugarHistoryModel.fromJson(Map<String, dynamic> json){
SugarHistoryModel rtvm = new SugarHistoryModel();
/*"heightUnit": "feet",
"weightUnit": "kg",
"_id": "6493fe48eca67b71b8444e24",
"bmiinfoid": "BMI1687420488845468",
"customerId": "AHSUSNE2",
"height": "164.592",
"weight": "50",
"age": 27,
"bmivalue": 18.46,
"createdAt": "2023-06-22T07:54:48.847Z",
"updatedAt": "2023-06-22T07:54:48.847Z",*/
rtvm.sugartText = json['sugarCategory'].toString() ?? '';
rtvm.sugarValue = json['sugarValue'].toString() ?? '';
rtvm.fasting = json['fasting'].toString() ?? '';
rtvm.postPrandial = json['postPrandial'].toString() ?? '';
rtvm.date = json['createdAt'].toString() ?? '';
rtvm.actualDate = json['date'].toString() ?? '';
rtvm.sugarInfoId = json['sugarinfoid'].toString() ?? '';
//DateTime tempDate = new DateFormat("yyyy-MM-dd hh:mm:ss").parse(rtvm.date);
DateTime parseDate = new DateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").parse(rtvm.date);
var outputFormat = DateFormat('MM/dd/yyyy hh:mm a');
rtvm.dateForFilter=parseDate;
var outputDate = outputFormat.format(parseDate);
rtvm.displayDate=outputDate;
rtvm.dateForFilter = DateFormat('dd-MM-yyyy').parse(rtvm.actualDate);
return rtvm;

@ -422,7 +422,9 @@ class _MyHealthState extends State<MyHealth> {
],
),
)),
Card(
Visibility(
visible: false,
child: Card(
child: Padding(
padding: EdgeInsets.all(3),
child: Row(
@ -441,8 +443,10 @@ class _MyHealthState extends State<MyHealth> {
)
],
),
)),
Card(
)),),
Visibility(
visible: false,
child: Card(
child: Padding(
padding: EdgeInsets.all(3),
child: Row(
@ -462,8 +466,10 @@ class _MyHealthState extends State<MyHealth> {
)
],
),
)),
Card(
))),
Visibility(
visible: false,
child: Card(
child: Padding(
padding: EdgeInsets.all(3),
child: Row(
@ -483,7 +489,7 @@ class _MyHealthState extends State<MyHealth> {
)
],
),
))
)))
],
),
),

@ -1,4 +1,5 @@
import 'dart:convert';
import 'package:healthcare_user/edit_medicine_timings.dart';
import 'package:intl/intl.dart';
import 'package:flutter/material.dart';
import 'package:healthcare_user/common/settings.dart';
@ -321,7 +322,11 @@ class _MyMedicineTimingsState extends State<MyMedicineTimings> {
//padding: EdgeInsets.all(8),
itemCount: timings.length,
itemBuilder: (BuildContext context, int index) {
return Padding(
return GestureDetector(
onTap: (){
AppSettings.longSuccessToast('Please click on edit button');
},
child: Padding(
padding: EdgeInsets.all(10),
child: Container(
padding: EdgeInsets.fromLTRB(8, 8, 0, 0),
@ -353,6 +358,7 @@ class _MyMedicineTimingsState extends State<MyMedicineTimings> {
),
],
)),
),
);
})),
Padding(padding: EdgeInsets.fromLTRB(10, 10, 10, 40),
@ -365,10 +371,14 @@ class _MyMedicineTimingsState extends State<MyMedicineTimings> {
),
onPressed: () async {
editTimingsDialog();
/*Navigator.push(context, MaterialPageRoute(builder: (context) => EditMedicineTimings())).then((value) {
//editTimingsDialog();
Navigator.push(
context,
new MaterialPageRoute(
builder: (__) => new EditMedicineTimings(medicineTimings:medicineTimings,))).then((value) {
getMedicineTimingsList();
});*/
});
},
child: const Text('Edit'),
),
@ -616,265 +626,6 @@ class _MyMedicineTimingsState extends State<MyMedicineTimings> {
return Scaffold(
appBar: AppSettings.appBar('My medicine timings'),
body: medicineTimings.length==0?renderUi():renderTimings(),
/*Container(
child: Padding(
padding: EdgeInsets.all(10),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 10,),
Text('Wakeup'),
SizedBox(height: 10,),
Text('Before breakfast'),
SizedBox(height: 15,),
Text('After breakfast'),
SizedBox(height: 15,),
Text('Before lunch'),
SizedBox(height: 15,),
Text('After lunch'),
SizedBox(height: 15,),
Text('Evening Tea'),
SizedBox(height: 15,),
Text('Before dinner'),
SizedBox(height: 15,),
Text('After dinner'),
SizedBox(height: 15,),
Text('Sleep'),
],
),
Column(
children: [
GestureDetector(
onTap: (){
Navigator.of(context).push(
showPicker(
showSecondSelector: true,
context: context,
value: _time,
onChange: onTimeChanged,
minuteInterval: TimePickerInterval.FIVE,
// Optional onChange to receive value as DateTime
onChangeDateTime: (DateTime dateTime) {
// print(dateTime);
debugPrint("[debug datetime]: $dateTime");
},
),
);
},
child: Image(
image: AssetImage('images/time.png'),
width: 30,
height: 30,
),
),
GestureDetector(
onTap: (){
Navigator.of(context).push(
showPicker(
showSecondSelector: true,
context: context,
value: _time,
onChange: onTimeChanged,
minuteInterval: TimePickerInterval.FIVE,
// Optional onChange to receive value as DateTime
onChangeDateTime: (DateTime dateTime) {
// print(dateTime);
debugPrint("[debug datetime]: $dateTime");
},
),
);
},
child: Image(
image: AssetImage('images/time.png'),
width: 30,
height: 30,
),
),
GestureDetector(
onTap: (){
Navigator.of(context).push(
showPicker(
showSecondSelector: true,
context: context,
value: _time,
onChange: onTimeChanged,
minuteInterval: TimePickerInterval.FIVE,
// Optional onChange to receive value as DateTime
onChangeDateTime: (DateTime dateTime) {
// print(dateTime);
debugPrint("[debug datetime]: $dateTime");
},
),
);
},
child: Image(
image: AssetImage('images/time.png'),
width: 30,
height: 30,
),
),
GestureDetector(
onTap: (){
Navigator.of(context).push(
showPicker(
showSecondSelector: true,
context: context,
value: _time,
onChange: onTimeChanged,
minuteInterval: TimePickerInterval.FIVE,
// Optional onChange to receive value as DateTime
onChangeDateTime: (DateTime dateTime) {
// print(dateTime);
debugPrint("[debug datetime]: $dateTime");
},
),
);
},
child: Image(
image: AssetImage('images/time.png'),
width: 30,
height: 30,
),
),
GestureDetector(
onTap: (){
Navigator.of(context).push(
showPicker(
showSecondSelector: true,
context: context,
value: _time,
onChange: onTimeChanged,
minuteInterval: TimePickerInterval.FIVE,
// Optional onChange to receive value as DateTime
onChangeDateTime: (DateTime dateTime) {
// print(dateTime);
debugPrint("[debug datetime]: $dateTime");
},
),
);
},
child: Image(
image: AssetImage('images/time.png'),
width: 30,
height: 30,
),
),
GestureDetector(
onTap: (){
Navigator.of(context).push(
showPicker(
showSecondSelector: true,
context: context,
value: _time,
onChange: onTimeChanged,
minuteInterval: TimePickerInterval.FIVE,
// Optional onChange to receive value as DateTime
onChangeDateTime: (DateTime dateTime) {
// print(dateTime);
debugPrint("[debug datetime]: $dateTime");
},
),
);
},
child: Image(
image: AssetImage('images/time.png'),
width: 30,
height: 30,
),
),
GestureDetector(
onTap: (){
Navigator.of(context).push(
showPicker(
showSecondSelector: true,
context: context,
value: _time,
onChange: onTimeChanged,
minuteInterval: TimePickerInterval.FIVE,
// Optional onChange to receive value as DateTime
onChangeDateTime: (DateTime dateTime) {
// print(dateTime);
debugPrint("[debug datetime]: $dateTime");
},
),
);
},
child: Image(
image: AssetImage('images/time.png'),
width: 30,
height: 30,
),
),
SizedBox(height: 5,),
GestureDetector(
onTap: (){
Navigator.of(context).push(
showPicker(
showSecondSelector: true,
context: context,
value: _time,
onChange: onTimeChanged,
minuteInterval: TimePickerInterval.FIVE,
// Optional onChange to receive value as DateTime
onChangeDateTime: (DateTime dateTime) {
// print(dateTime);
debugPrint("[debug datetime]: $dateTime");
},
),
);
},
child: Image(
image: AssetImage('images/time.png'),
width: 30,
height: 30,
),
),
SizedBox(height: 5,),
GestureDetector(
onTap: (){
Navigator.of(context).push(
showPicker(
showSecondSelector: true,
context: context,
value: _time,
onChange: onTimeChanged,
minuteInterval: TimePickerInterval.FIVE,
// Optional onChange to receive value as DateTime
onChangeDateTime: (DateTime dateTime) {
// print(dateTime);
debugPrint("[debug datetime]: $dateTime");
},
),
);
},
child: Image(
image: AssetImage('images/time.png'),
width: 30,
height: 30,
),
),
],
),
],
),
],
),
)
)*/
);
}
}

@ -1036,6 +1036,55 @@ class _OrderMedicinesState extends State<OrderMedicines> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Problem: ' +
widget.prescriptionDetails.problem
.toString()
.toUpperCase(),
style: problemTextStyle()),
Text(
widget.prescriptionDetails.doctorName
.toString()
.toUpperCase(),
style: valuesTextStyle()),
Text(
widget.prescriptionDetails.hospitalName
.toString()
.toUpperCase(),
style: valuesTextStyle()),
Text(widget.prescriptionDetails.date.toString().toUpperCase(),
style: valuesTextStyle()),
Text(
widget.prescriptionDetails.patient_name
.toString()
.toUpperCase(),
style: valuesTextStyle()),
Row(
children: [
Text(
widget.prescriptionDetails.gender
.toString()
.toUpperCase(),
style: valuesTextStyle()),
SizedBox(
width: MediaQuery.of(context).size.width * .05,
),
Text(
widget.prescriptionDetails.age
.toString()
.toUpperCase() +
" Yrs",
style: valuesTextStyle()),
],
)
],
),
),
Padding(
padding: EdgeInsets.all(10),
child: prescriptions(widget.prescriptionDetails),
@ -1260,7 +1309,10 @@ class _OrderMedicinesState extends State<OrderMedicines> {
items: AreaItems.map((String items) {
return DropdownMenuItem(
value: items,
child: Text(items,style: TextStyle(fontSize: 12),),
child: Text(
items,
style: TextStyle(fontSize: 12),
),
);
}).toList(),
// After selecting the desired option,it will

@ -656,17 +656,11 @@ class _PrescriptionsState extends State<Prescriptions> {
payload["url"] = obj.prescriptionImages[index]['url'];
try {
var res = await AppSettings
.deleteRecordsNew(
payload,
obj.recordId);
var res = await AppSettings.deleteRecordsNew(payload, obj.recordId);
print(jsonDecode(res));
Navigator.of(context,
rootNavigator: true)
.pop();
Navigator.of(context, rootNavigator: true).pop();
Navigator.of(context).pop(true);
AppSettings.longSuccessToast(
"Image deleted Successfully");
AppSettings.longSuccessToast("Image deleted Successfully");
setState(() {
obj.prescriptionImages =
jsonDecode(

@ -1,219 +0,0 @@
import 'dart:convert';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:healthcare_user/common/settings.dart';
import 'package:image_picker/image_picker.dart';
class ReportMySelf extends StatefulWidget {
const ReportMySelf({Key? key}) : super(key: key);
@override
State<ReportMySelf> createState() => _ReportMySelfState();
}
class _ReportMySelfState extends State<ReportMySelf> {
TextEditingController problemNameController = TextEditingController();
TextEditingController descriptionController = TextEditingController();
final ImagePicker _picker = ImagePicker();
String videoUrl='';
Future takeVideoFromCamera() async {
try {
final image = await _picker.pickVideo(source: ImageSource.camera);
if (image == null) return;
final imageTemp = File(image.path);
AppSettings.preLoaderDialog(context);
var res = await AppSettings.uploadVideoInReportMySelf(image);
print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop();
setState(() {
videoUrl = jsonDecode(res)['picture'];
});
} on PlatformException catch (e) {
print('Failed to pick video: $e');
}
}
Future pickVideoFromGallery() async {
try {
final image = await _picker.pickVideo(source: ImageSource.gallery);
if (image == null) return;
final imageTemp = File(image.path);
AppSettings.preLoaderDialog(context);
var res = await AppSettings.uploadVideoInReportMySelf(image);
print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop();
setState(() {
videoUrl = jsonDecode(res)['picture'];
});
} on PlatformException catch (e) {
print('Failed to pick video: $e');
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppSettings.appBar('Report MySelf'),
body: Container(
child: Padding(
padding: EdgeInsets.all(10),
child:Column(
children: [
Container(
padding: const EdgeInsets.all(10),
child: TextFormField(
cursorColor: greyColor,
controller: problemNameController,
keyboardType: TextInputType.number,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.phone,
color: greyColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color:primaryColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
labelText: 'Enter problem name',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
),
),
const SizedBox(
height: 15,
),
Container(
padding: const EdgeInsets.all(10),
child: TextFormField(
cursorColor: greyColor,
controller: descriptionController,
keyboardType: TextInputType.number,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.description,
color: greyColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color:primaryColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
labelText: 'Description',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
),
),
Row(
children: [
IconButton(
icon: Icon(
Icons.audio_file,
color: primaryColor,
),
onPressed: () {
},
),
SizedBox(width: 10,),
IconButton(
icon: Icon(
Icons.video_camera_back_rounded,
color: primaryColor,
),
onPressed: () {
showModalBottomSheet<void>(
context: context,
builder: (BuildContext context) {
return SizedBox(
height: 200,
child: Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
GestureDetector(
child: Icon(
Icons.camera_alt_outlined,
size: 100,
color: greyColor,
),
onTap: () async {
await takeVideoFromCamera();
Navigator.pop(context);
},
),
SizedBox(
width: MediaQuery.of(context).size.width * .20,
),
GestureDetector(
child: Icon(
Icons.photo,
size: 100,
color: greyColor,
),
onTap: () async {
await pickVideoFromGallery();
Navigator.pop(context);
},
),
],
),
),
);
});
},
),
SizedBox(width: 10,),
IconButton(
icon: Icon(
Icons.image,
color: primaryColor,
),
onPressed: () {
},
),
],
),
Visibility(
visible: videoUrl != '',
child: Padding(
padding: EdgeInsets.fromLTRB(10,0,0,0),
child: Container(
width: MediaQuery.of(context).size.width * .18,
height: MediaQuery.of(context).size.height * .10,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
image: DecorationImage(
image: NetworkImage(videoUrl) as ImageProvider, // picked file
fit: BoxFit.contain)),
),
),
),
],
),
),
),
);
}
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,59 @@
import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';
import 'package:flick_video_player/flick_video_player.dart';
class ProblemAudio extends StatefulWidget {
var videoUrl;
ProblemAudio({this.videoUrl});
@override
State<ProblemAudio> createState() => _ProblemAudioState();
}
class _ProblemAudioState extends State<ProblemAudio> {
late VideoPlayerController _controller;
late Future<void> _initializeVideoPlayerFuture;
late FlickManager flickManager;
@override
void initState() {
super.initState();
_controller = VideoPlayerController.networkUrl(
Uri.parse(widget.videoUrl,),
);
flickManager = FlickManager(
videoPlayerController:
VideoPlayerController.networkUrl(Uri.parse(widget.videoUrl,),)
);
_initializeVideoPlayerFuture = _controller.initialize();
_controller.setLooping(false);
}
@override
void dispose() {
// Ensure disposing of the VideoPlayerController to free up resources.
_controller.dispose();
flickManager.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Container(
height: MediaQuery.of(context).size.height * .30,
width: double.infinity,
child:FlickVideoPlayer(
flickManager: flickManager,
flickVideoWithControls: FlickVideoWithControls(
videoFit: BoxFit.fill,
controls: FlickPortraitControls(
progressBarSettings:
FlickProgressBarSettings(playedColor: Colors.green),
),
),
),
);
}
}

@ -0,0 +1,783 @@
import 'dart:convert';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:healthcare_user/common/settings.dart';
import 'package:image_picker/image_picker.dart';
import 'package:video_player/video_player.dart';
import 'package:flick_video_player/flick_video_player.dart';
import 'package:flutter_sound/flutter_sound.dart';
import 'package:assets_audio_player/assets_audio_player.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:intl/date_symbol_data_local.dart';
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:path/path.dart' as path;
import 'package:intl/intl.dart' show DateFormat;
import 'package:path_provider/path_provider.dart';
class ReportMySelf extends StatefulWidget {
const ReportMySelf({Key? key}) : super(key: key);
@override
State<ReportMySelf> createState() => _ReportMySelfState();
}
class _ReportMySelfState extends State<ReportMySelf> {
TextEditingController problemNameController = TextEditingController();
TextEditingController descriptionController = TextEditingController();
TextEditingController dateInput = TextEditingController();
final ImagePicker _picker = ImagePicker();
String videoUrl='';
late VideoPlayerController _controller;
late Future<void> _initializeVideoPlayerFuture;
late FlickManager flickManager;
late FlutterSoundRecorder _recordingSession;
final recordingPlayer = AssetsAudioPlayer();
String pathToAudio='';
bool _playAudio = false;
String _timerText = '00:00:00';
bool isAudioButtonPressed=false;
String recordingTime = '0:0'; // to store value
bool isRecording = false;
String problemPictureUrl='';
void initializer() async {
pathToAudio = '/sdcard/Download/temp.wav';
_recordingSession = FlutterSoundRecorder();
await _recordingSession.openAudioSession(
focus: AudioFocus.requestFocusAndStopOthers,
category: SessionCategory.playAndRecord,
mode: SessionMode.modeDefault,
device: AudioDevice.speaker);
await _recordingSession.setSubscriptionDuration(Duration(milliseconds: 10));
await initializeDateFormatting();
await Permission.microphone.request();
await Permission.storage.request();
await Permission.manageExternalStorage.request();
}
@override
void initState() {
super.initState();
_controller = VideoPlayerController.networkUrl(
Uri.parse(videoUrl,),
);
flickManager = FlickManager(
videoPlayerController:
VideoPlayerController.networkUrl(Uri.parse(videoUrl,),)
);
_initializeVideoPlayerFuture = _controller.initialize();
_controller.setLooping(false);
/*initializer();*/
}
@override
void dispose() {
// Ensure disposing of the VideoPlayerController to free up resources.
_controller.dispose();
flickManager.dispose();
_recordingSession.dispositionStream();
pathToAudio='';
super.dispose();
recordingPlayer.stop();
_deleteCacheDir();
_deleteAppDir();
}
Future<void> _deleteCacheDir() async {
Directory tempDir = await getTemporaryDirectory();
if (tempDir.existsSync()) {
tempDir.deleteSync(recursive: true);
}
}
Future<void> _deleteAppDir() async {
Directory appDocDir = await getApplicationDocumentsDirectory();
if (appDocDir.existsSync()) {
appDocDir.deleteSync(recursive: true);
}
}
Future<void> startRecording() async {
initializer();
setState(() {
isRecording=true;
});
Directory directory = Directory(path.dirname(pathToAudio));
if (!directory.existsSync()) {
directory.createSync();
}
_recordingSession=(await FlutterSoundRecorder().openAudioSession())!;
await _recordingSession.startRecorder(
toFile: pathToAudio,
codec: Codec.pcm16WAV,
);
recordTime();
StreamSubscription _recorderSubscription = _recordingSession.onProgress!.listen((e) {
/*var date = DateTime.fromMillisecondsSinceEpoch(e.duration.inMilliseconds,
isUtc: true);
var timeText = DateFormat('mm:ss:SS', 'en_GB').format(date);
setState(() {
_timerText = timeText.substring(0, 8);
});*/
});
_recorderSubscription.cancel();
}
void recordTime() {
var startTime = DateTime.now();
Timer.periodic(const Duration(seconds: 1), (Timer t) {
var diff = DateTime.now().difference(startTime);
if (!isRecording) {
t.cancel(); //cancel function calling
}
setState(() {
recordingTime =
'${diff.inHours < 60 ? diff.inHours : 0}:${diff.inMinutes < 60 ? diff.inMinutes : 0}:${diff.inSeconds < 60 ? diff.inSeconds : 0}';
print(recordingTime);
});
});
}
Future<String?> stopRecording() async {
setState(() {
isRecording=false;
});
_recordingSession.closeAudioSession();
return await _recordingSession.stopRecorder();
}
Future<void> playFunc() async {
recordingPlayer.open(
Audio.file(pathToAudio),
autoStart: true,
showNotification: true,
);
}
Future<void> stopPlayFunc() async {
recordingPlayer.stop();
}
Future takeVideoFromCamera() async {
try {
final image = await _picker.pickVideo(source: ImageSource.camera);
if (image == null) return;
final imageTemp = File(image.path);
AppSettings.preLoaderDialog(context);
var res = await AppSettings.uploadVideoInReportMySelf(image);
print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop();
setState(() {
videoUrl = jsonDecode(res)['picture'];
_controller = VideoPlayerController.networkUrl(Uri.parse(videoUrl,),);
flickManager = FlickManager(
videoPlayerController:
VideoPlayerController.networkUrl(Uri.parse(videoUrl,),)
);
});
_initializeVideoPlayerFuture = _controller.initialize();
_controller.setLooping(true);
} on PlatformException catch (e) {
print('Failed to pick video: $e');
}
}
Future pickVideoFromGallery() async {
try {
final image = await _picker.pickVideo(source: ImageSource.gallery);
if (image == null) return;
final imageTemp = File(image.path);
AppSettings.preLoaderDialog(context);
var res = await AppSettings.uploadVideoInReportMySelf(image);
print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop();
setState(() {
videoUrl = jsonDecode(res)['picture'];
_controller = VideoPlayerController.networkUrl(Uri.parse(videoUrl,),);
});
_initializeVideoPlayerFuture = _controller.initialize();
_controller.setLooping(true);
} on PlatformException catch (e) {
print('Failed to pick video: $e');
}
}
Future pickImageFromGallery() async {
try {
final image = await _picker.pickImage(source: ImageSource.gallery);
if (image == null) return;
final imageTemp = File(image.path);
AppSettings.preLoaderDialog(context);
var res = await AppSettings.uploadReportMyselfPicture(image);
print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop();
setState(() {
problemPictureUrl = jsonDecode(res)['pictures'][0];
});
} on PlatformException catch (e) {
print('Failed to pick image: $e');
}
}
Future takeImageFromCamera() async {
try {
final image = await _picker.pickImage(source: ImageSource.camera);
if (image == null) return;
final imageTemp = File(image.path);
AppSettings.preLoaderDialog(context);
var res = await AppSettings.uploadReportMyselfPicture(image);
print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop();
setState(() {
problemPictureUrl = jsonDecode(res)['pictures'][0];
});
} on PlatformException catch (e) {
print('Failed to pick image: $e');
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppSettings.appBar('Report MySelf'),
body: SingleChildScrollView(
child: Container(
child: Padding(
padding: EdgeInsets.all(10),
child:Column(
children: [
Container(
child: TextFormField(
cursorColor: greyColor,
controller: problemNameController,
textCapitalization: TextCapitalization.words,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.report_problem,
color: greyColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color:primaryColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
labelText: 'Enter problem name',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
),
),
const SizedBox(
height: 10,
),
Container(
child: TextFormField(
cursorColor: greyColor,
controller: descriptionController,
textCapitalization: TextCapitalization.words,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.description,
color: greyColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color:primaryColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
labelText: 'Description',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
),
),
SizedBox(height: 10),
Container(
child: TextFormField(
cursorColor: greyColor,
controller: dateInput,
decoration: textFormFieldDecorationBMI(
Icons.calendar_today, 'Enter Date'),
readOnly: true,
onTap: () async {
DateTime? pickedDate = await showDatePicker(
context: context,
initialDate: DateTime.now(),
firstDate: DateTime(1950),
lastDate: DateTime.now(),
builder: (BuildContext context, Widget? child) {
return Theme(
data: ThemeData.dark().copyWith(
colorScheme: ColorScheme.dark(
primary: buttonColors,
onPrimary: Colors.white,
surface: buttonColors,
onSurface: Colors.white,
),
dialogBackgroundColor: primaryColor,
),
child: child!,
);
},
);
if (pickedDate != null) {
print(
pickedDate); //pickedDate output format => 2021-03-10 00:00:00.000
String formattedDate =
DateFormat('dd-MM-yyyy').format(pickedDate);
print(
formattedDate); //formatted date output using intl package => 2021-03-16
setState(() {
dateInput.text =
formattedDate; //set output date to TextField value.
});
} else {}
},
),
),
SizedBox(height: 10),
Row(
children: [
IconButton(
icon: Icon(
Icons.audio_file,
color: primaryColor,
size: 40,
),
onPressed: () {
if(!isAudioButtonPressed){
setState(() {
isAudioButtonPressed=true;
});
}
else{
setState(() {
isAudioButtonPressed=false;
pathToAudio='';
recordingTime = '0:0';
});
}
},
),
SizedBox(width: 10,),
IconButton(
icon: Icon(
Icons.video_camera_back_rounded,
color: primaryColor,
size: 40,
),
onPressed: () {
showModalBottomSheet<void>(
context: context,
builder: (BuildContext context) {
return SizedBox(
height: 200,
child: Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
GestureDetector(
child: Icon(
Icons.camera_alt_outlined,
size: 100,
color: primaryColor,
),
onTap: () async {
await takeVideoFromCamera();
Navigator.pop(context);
},
),
SizedBox(
width: MediaQuery.of(context).size.width * .20,
),
GestureDetector(
child: Icon(
Icons.photo,
size: 100,
color: primaryColor,
),
onTap: () async {
await pickVideoFromGallery();
Navigator.pop(context);
},
),
],
),
),
);
});
},
),
SizedBox(width: 10,),
IconButton(
icon: Icon(
Icons.image,
color: primaryColor,
size: 40,
),
onPressed: () async {
showModalBottomSheet<void>(
context: context,
builder: (BuildContext context) {
return SizedBox(
height: 200,
child: Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
GestureDetector(
child: Icon(
Icons.camera_alt_outlined,
size: 100,
color: primaryColor,
),
onTap: () async {
await takeImageFromCamera();
Navigator.pop(context);
},
),
SizedBox(
width:
MediaQuery.of(context).size.width *
.20,
),
GestureDetector(
child: Icon(
Icons.photo,
size: 100,
color: primaryColor,
),
onTap: () async {
await pickImageFromGallery();
Navigator.pop(context);
},
),
],
),
),
);
});
},
),
/*SizedBox(width: 10,),
IconButton(
icon: Icon(
Icons.description,
color: primaryColor,
size: 40,
),
onPressed: () {
},
),*/
],
),
Visibility(
visible: isAudioButtonPressed,
child: Column(
children: [
Container(
child: Center(
child: Text(
recordingTime,
style: TextStyle(fontSize: 70, color: Colors.red),
),
),
),
SizedBox(
height: 20,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
IconButton(
icon: Icon(
Icons.mic,
color: !isRecording?Colors.red:greyColor,
),
onPressed: () {
if(!isRecording){
startRecording();
}
else{
AppSettings.longSuccessToast('please stop recording');
}
},
),
SizedBox(
width: 30,
),
IconButton(
icon: Icon(
Icons.stop,
color: isRecording?Colors.red:greyColor,
),
onPressed: () {
if(isRecording){
stopRecording();
}
else{
AppSettings.longSuccessToast('please start recording');
}
},
),
],
),
SizedBox(
height: 20,
),
Visibility(
visible: pathToAudio!=''&&!isRecording,
child:Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton.icon(
style:
ElevatedButton.styleFrom(elevation: 9.0, primary: Colors.red),
onPressed: () {
setState(() {
_playAudio = !_playAudio;
});
if (_playAudio) playFunc();
if (!_playAudio) stopPlayFunc();
},
icon: _playAudio
? Icon(
Icons.stop,
)
: Icon(Icons.play_arrow),
label: _playAudio
? Text(
"Stop",
style: TextStyle(
fontSize: 28,
),
)
: Text(
"Play",
style: TextStyle(
fontSize: 28,
),
),
),
IconButton(
icon: Icon(
Icons.delete,
color: Colors.red,
size: 30,
),
onPressed: () {
setState(() {
pathToAudio='';
recordingTime = '0:0';
});
},
),
],
)
)
],
)),
Visibility(
visible: videoUrl != '',
child: Padding(
padding: EdgeInsets.all(10),
child: Container(
height: MediaQuery.of(context).size.height * .30,
width: double.infinity,
child:FlickVideoPlayer(
flickManager: flickManager,
flickVideoWithControls: FlickVideoWithControls(
videoFit: BoxFit.fill,
controls: FlickPortraitControls(
progressBarSettings:
FlickProgressBarSettings(playedColor: Colors.green),
),
),
),
/*FutureBuilder(
future: _initializeVideoPlayerFuture,
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
return AspectRatio(
aspectRatio: _controller.value.aspectRatio,
child: VideoPlayer(_controller),
);
} else {
return const Center(
child: CircularProgressIndicator(),
);
}
},
),*/
),
),
),
Visibility(
visible: problemPictureUrl!='',
child: Container(
width: double.infinity,
height:
MediaQuery.of(context).size.height *
.30,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
image: DecorationImage(
image: NetworkImage(problemPictureUrl) as ImageProvider, // picked file
fit: BoxFit.fill)),
child: Stack(children: [
Positioned(
right: 0,
child: Container(
child: IconButton(
iconSize: 30,
icon: const Icon(
Icons.cancel,
color: Colors.red,
),
onPressed: () async {
setState(() {
problemPictureUrl='';
});
},
),
),
)
]),
),),
SizedBox(height: 10),
Container(
width: double.infinity,
height:
MediaQuery.of(context).size.height * .05,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: buttonColors, // background
onPrimary: Colors.black, // foreground
),
onPressed: () async {
if(problemNameController.text!=''&&(pathToAudio!=''||problemPictureUrl!=''||videoUrl!='')&&dateInput.text!=''){
AppSettings.preLoaderDialog(context);
bool isOnline =
await AppSettings.internetConnectivity();
if (isOnline) {
var payload = new Map<String, dynamic>();
List picture=[];
picture.add({'url':problemPictureUrl});
payload["name"] = problemNameController.text.toString();
payload["description"] = descriptionController.text.toString();
payload["date"] = dateInput.text.toString();
payload["audio"] =pathToAudio.toString();
payload["video"] = videoUrl.toString();
payload["picture"] = picture;
bool uploadStatus = await AppSettings.addReportMySelfProblem(payload);
try {
if (uploadStatus) {
Navigator.of(context, rootNavigator: true)
.pop();
AppSettings.longSuccessToast(
'Report problem added successfully');
Navigator.pop(context);
} else {
Navigator.of(context, rootNavigator: true)
.pop();
AppSettings.longFailedToast(
'Fail to add report problem details');
}
} catch (e) {
print(e);
Navigator.of(context, rootNavigator: true)
.pop();
AppSettings.longFailedToast(
'Fail to add report problem details');
}
}
else{
AppSettings.longFailedToast('please check internet connection');
}
}
else{
AppSettings.longFailedToast('please enter valid details');
}
},
child: const Text('Report a problem'),
)),
],
),
),
),
)
);
}
}

@ -0,0 +1,59 @@
import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';
import 'package:flick_video_player/flick_video_player.dart';
class ProblemVideo extends StatefulWidget {
var videoUrl;
ProblemVideo({this.videoUrl});
@override
State<ProblemVideo> createState() => _ProblemVideoState();
}
class _ProblemVideoState extends State<ProblemVideo> {
late VideoPlayerController _controller;
late Future<void> _initializeVideoPlayerFuture;
late FlickManager flickManager;
@override
void initState() {
super.initState();
_controller = VideoPlayerController.networkUrl(
Uri.parse(widget.videoUrl,),
);
flickManager = FlickManager(
videoPlayerController:
VideoPlayerController.networkUrl(Uri.parse(widget.videoUrl,),)
);
_initializeVideoPlayerFuture = _controller.initialize();
_controller.setLooping(false);
}
@override
void dispose() {
// Ensure disposing of the VideoPlayerController to free up resources.
_controller.dispose();
flickManager.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Container(
height: MediaQuery.of(context).size.height * .30,
width: double.infinity,
child:FlickVideoPlayer(
flickManager: flickManager,
flickVideoWithControls: FlickVideoWithControls(
videoFit: BoxFit.fill,
controls: FlickPortraitControls(
progressBarSettings:
FlickProgressBarSettings(playedColor: Colors.green),
),
),
),
);
}
}

@ -0,0 +1,89 @@
import 'dart:convert';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:healthcare_user/common/settings.dart';
import 'package:image_picker/image_picker.dart';
import 'package:visibility_detector/visibility_detector.dart';
class VideoRecorderPage extends StatefulWidget {
const VideoRecorderPage({Key? key}) : super(key: key);
@override
State<VideoRecorderPage> createState() => _VideoRecorderPageState();
}
class _VideoRecorderPageState extends State<VideoRecorderPage> {
final ImagePicker _picker = ImagePicker();
Future takeVideoFromCamera() async {
try {
final image = await _picker.pickVideo(source: ImageSource.camera);
if (image == null) return;
final imageTemp = File(image.path);
} on PlatformException catch (e) {
print('Failed to pick video: $e');
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppSettings.appBar('Video recorder'),
body: Container(
child: IconButton(
icon: Icon(
Icons.video_camera_back_rounded,
color: primaryColor,
size: 40,
),
onPressed: () {
showModalBottomSheet<void>(
context: context,
builder: (BuildContext context) {
return SizedBox(
height: 200,
child: Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
GestureDetector(
child: Icon(
Icons.camera_alt_outlined,
size: 100,
color: primaryColor,
),
onTap: () async {
await takeVideoFromCamera();
Navigator.pop(context);
},
),
SizedBox(
width: MediaQuery.of(context).size.width * .20,
),
GestureDetector(
child: Icon(
Icons.photo,
size: 100,
color: primaryColor,
),
onTap: () async {
// await pickVideoFromGallery();
Navigator.pop(context);
},
),
],
),
),
);
});
},
),
),
);
}
}

@ -5,6 +5,8 @@
import FlutterMacOS
import Foundation
import assets_audio_player
import assets_audio_player_web
import cloud_firestore
import device_info_plus_macos
import file_selector_macos
@ -14,10 +16,14 @@ import flutter_local_notifications
import geolocator_apple
import location
import package_info_plus_macos
import path_provider_foundation
import shared_preferences_foundation
import url_launcher_macos
import wakelock_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AssetsAudioPlayerPlugin.register(with: registry.registrar(forPlugin: "AssetsAudioPlayerPlugin"))
AssetsAudioPlayerWebPlugin.register(with: registry.registrar(forPlugin: "AssetsAudioPlayerWebPlugin"))
FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
@ -27,6 +33,8 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
LocationPlugin.register(with: registry.registrar(forPlugin: "LocationPlugin"))
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
WakelockMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockMacosPlugin"))
}

@ -22,6 +22,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.1"
assets_audio_player:
dependency: "direct main"
description:
name: assets_audio_player
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.6"
assets_audio_player_web:
dependency: transitive
description:
name: assets_audio_player_web
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.1"
async:
dependency: transitive
description:
@ -37,14 +51,14 @@ packages:
source: hosted
version: "2.1.0"
card_swiper:
dependency: "direct dev"
dependency: "direct main"
description:
name: card_swiper
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
carousel_slider:
dependency: "direct dev"
dependency: "direct main"
description:
name: carousel_slider
url: "https://pub.dartlang.org"
@ -57,6 +71,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
charts_common:
dependency: transitive
description:
@ -65,7 +86,7 @@ packages:
source: hosted
version: "0.12.0"
charts_flutter:
dependency: "direct dev"
dependency: "direct main"
description:
name: charts_flutter
url: "https://pub.dartlang.org"
@ -93,7 +114,7 @@ packages:
source: hosted
version: "1.1.1"
cloud_firestore:
dependency: "direct dev"
dependency: "direct main"
description:
name: cloud_firestore
url: "https://pub.dartlang.org"
@ -114,7 +135,7 @@ packages:
source: hosted
version: "3.7.1"
cloudinary_public:
dependency: "direct dev"
dependency: "direct main"
description:
name: cloudinary_public
url: "https://pub.dartlang.org"
@ -163,14 +184,14 @@ packages:
source: hosted
version: "1.0.5"
date_time_picker:
dependency: "direct dev"
dependency: "direct main"
description:
name: date_time_picker
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
day_night_time_picker:
dependency: "direct dev"
dependency: "direct main"
description:
name: day_night_time_picker
url: "https://pub.dartlang.org"
@ -184,7 +205,7 @@ packages:
source: hosted
version: "0.7.4"
device_info_plus:
dependency: "direct dev"
dependency: "direct main"
description:
name: device_info_plus
url: "https://pub.dartlang.org"
@ -226,21 +247,21 @@ packages:
source: hosted
version: "2.1.1"
device_information:
dependency: "direct dev"
dependency: "direct main"
description:
name: device_information
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.4"
dio:
dependency: "direct dev"
dependency: "direct main"
description:
name: dio
url: "https://pub.dartlang.org"
source: hosted
version: "5.3.3"
dots_indicator:
dependency: "direct dev"
dependency: "direct main"
description:
name: dots_indicator
url: "https://pub.dartlang.org"
@ -317,7 +338,7 @@ packages:
source: hosted
version: "2.8.0"
firebase_messaging:
dependency: "direct dev"
dependency: "direct main"
description:
name: firebase_messaging
url: "https://pub.dartlang.org"
@ -337,27 +358,34 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.5.7"
flick_video_player:
dependency: "direct main"
description:
name: flick_video_player
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.0"
flutter:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_cupertino_datetime_picker:
dependency: "direct dev"
dependency: "direct main"
description:
name: flutter_cupertino_datetime_picker
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
flutter_datetime_picker:
dependency: "direct dev"
dependency: "direct main"
description:
name: flutter_datetime_picker
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.1"
flutter_device_type:
dependency: "direct dev"
dependency: "direct main"
description:
name: flutter_device_type
url: "https://pub.dartlang.org"
@ -378,7 +406,7 @@ packages:
source: hosted
version: "2.0.2"
flutter_local_notifications:
dependency: "direct dev"
dependency: "direct main"
description:
name: flutter_local_notifications
url: "https://pub.dartlang.org"
@ -399,7 +427,7 @@ packages:
source: hosted
version: "5.0.0"
flutter_native_contact_picker:
dependency: "direct dev"
dependency: "direct main"
description:
name: flutter_native_contact_picker
url: "https://pub.dartlang.org"
@ -413,12 +441,40 @@ packages:
source: hosted
version: "2.0.15"
flutter_polyline_points:
dependency: "direct dev"
dependency: "direct main"
description:
name: flutter_polyline_points
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
flutter_slidable:
dependency: "direct main"
description:
name: flutter_slidable
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
flutter_sound:
dependency: "direct main"
description:
name: flutter_sound
url: "https://pub.dartlang.org"
source: hosted
version: "8.5.0"
flutter_sound_platform_interface:
dependency: transitive
description:
name: flutter_sound_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "8.5.0"
flutter_sound_web:
dependency: transitive
description:
name: flutter_sound_web
url: "https://pub.dartlang.org"
source: hosted
version: "8.5.0"
flutter_svg:
dependency: "direct main"
description:
@ -444,14 +500,14 @@ packages:
source: sdk
version: "0.0.0"
fluttertoast:
dependency: "direct dev"
dependency: "direct main"
description:
name: fluttertoast
url: "https://pub.dartlang.org"
source: hosted
version: "8.2.2"
geocoding:
dependency: "direct dev"
dependency: "direct main"
description:
name: geocoding
url: "https://pub.dartlang.org"
@ -521,7 +577,7 @@ packages:
source: hosted
version: "0.1.3"
get:
dependency: "direct dev"
dependency: "direct main"
description:
name: get
url: "https://pub.dartlang.org"
@ -577,7 +633,7 @@ packages:
source: hosted
version: "0.5.3"
google_maps_place_picker_mb:
dependency: "direct dev"
dependency: "direct main"
description:
name: google_maps_place_picker_mb
url: "https://pub.dartlang.org"
@ -619,7 +675,7 @@ packages:
source: hosted
version: "3.3.0"
image_picker:
dependency: "direct dev"
dependency: "direct main"
description:
name: image_picker
url: "https://pub.dartlang.org"
@ -675,7 +731,7 @@ packages:
source: hosted
version: "0.2.1"
intl:
dependency: "direct dev"
dependency: "direct main"
description:
name: intl
url: "https://pub.dartlang.org"
@ -730,6 +786,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.1"
logger:
dependency: transitive
description:
name: logger
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.0"
logging:
dependency: transitive
description:
@ -766,7 +829,7 @@ packages:
source: hosted
version: "1.0.4"
multi_image_picker:
dependency: "direct dev"
dependency: "direct main"
description:
name: multi_image_picker
url: "https://pub.dartlang.org"
@ -780,7 +843,7 @@ packages:
source: hosted
version: "1.0.0"
overlay_support:
dependency: "direct dev"
dependency: "direct main"
description:
name: overlay_support
url: "https://pub.dartlang.org"
@ -829,7 +892,7 @@ packages:
source: hosted
version: "1.0.5"
path:
dependency: transitive
dependency: "direct main"
description:
name: path
url: "https://pub.dartlang.org"
@ -849,6 +912,27 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
path_provider:
dependency: transitive
description:
name: path_provider
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.15"
path_provider_android:
dependency: transitive
description:
name: path_provider_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
path_provider_foundation:
dependency: transitive
description:
name: path_provider_foundation
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.0"
path_provider_linux:
dependency: transitive
description:
@ -871,7 +955,7 @@ packages:
source: hosted
version: "2.0.7"
permission_handler:
dependency: "direct dev"
dependency: "direct main"
description:
name: permission_handler
url: "https://pub.dartlang.org"
@ -913,14 +997,14 @@ packages:
source: hosted
version: "5.1.0"
photo_view:
dependency: "direct dev"
dependency: "direct main"
description:
name: photo_view
url: "https://pub.dartlang.org"
source: hosted
version: "0.14.0"
pinch_zoom:
dependency: "direct dev"
dependency: "direct main"
description:
name: pinch_zoom
url: "https://pub.dartlang.org"
@ -961,6 +1045,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.5"
recase:
dependency: transitive
description:
name: recase
url: "https://pub.dartlang.org"
source: hosted
version: "4.1.0"
rxdart:
dependency: transitive
description:
name: rxdart
url: "https://pub.dartlang.org"
source: hosted
version: "0.27.7"
sanitize_html:
dependency: transitive
description:
@ -969,7 +1067,7 @@ packages:
source: hosted
version: "2.1.0"
shared_preferences:
dependency: "direct dev"
dependency: "direct main"
description:
name: shared_preferences
url: "https://pub.dartlang.org"
@ -1018,7 +1116,7 @@ packages:
source: hosted
version: "2.3.0"
sizer:
dependency: "direct dev"
dependency: "direct main"
description:
name: sizer
url: "https://pub.dartlang.org"
@ -1064,6 +1162,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
synchronized:
dependency: transitive
description:
name: synchronized
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.0"
term_glyph:
dependency: transitive
description:
@ -1099,6 +1204,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.2"
universal_html:
dependency: transitive
description:
name: universal_html
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.2"
universal_io:
dependency: transitive
description:
@ -1107,7 +1219,7 @@ packages:
source: hosted
version: "2.2.0"
url_launcher:
dependency: "direct dev"
dependency: "direct main"
description:
name: url_launcher
url: "https://pub.dartlang.org"
@ -1176,6 +1288,83 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.2"
video_player:
dependency: "direct main"
description:
name: video_player
url: "https://pub.dartlang.org"
source: hosted
version: "2.7.0"
video_player_android:
dependency: transitive
description:
name: video_player_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.9"
video_player_avfoundation:
dependency: transitive
description:
name: video_player_avfoundation
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.9"
video_player_platform_interface:
dependency: transitive
description:
name: video_player_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "6.2.0"
video_player_web:
dependency: transitive
description:
name: video_player_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.16"
visibility_detector:
dependency: "direct main"
description:
name: visibility_detector
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.0+2"
wakelock:
dependency: transitive
description:
name: wakelock
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.2"
wakelock_macos:
dependency: transitive
description:
name: wakelock_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.0"
wakelock_platform_interface:
dependency: transitive
description:
name: wakelock_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.0"
wakelock_web:
dependency: transitive
description:
name: wakelock_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.0"
wakelock_windows:
dependency: transitive
description:
name: wakelock_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
win32:
dependency: transitive
description:

@ -11,30 +11,20 @@ dependencies:
sdk: flutter
cupertino_icons: ^1.0.2
location: ^4.4.0
geolocator: ^9.0.2
google_api_headers: ^1.2.0
google_maps_flutter: ^2.2.3
google_maps_webservice: ^0.0.20-nullsafety.5
http: ^0.13.5
provider: ^6.0.5
tuple: ^2.0.1
uuid: ^3.0.7
flutter_svg_provider: ^1.0.3
flutter_svg: ^1.0.1
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
http: ^0.13.5
shared_preferences: ^2.0.15
sizer: ^2.0.11
geolocator: ^9.0.2
geocoding: ^2.0.4
image_picker: ^0.8.6+1
flutter_launcher_icons: ^0.11.0
url_launcher: ^6.1.9
intl: ^0.17.0
flutter_svg: ^1.0.1
@ -51,10 +41,8 @@ dev_dependencies:
device_info_plus: ^3.2.4
overlay_support: ^2.1.0
dio: ^5.1.1
google_maps_flutter: ^2.2.5
flutter_polyline_points: ^1.0.0
get: ^4.6.5
location: ^4.4.0
permission_handler: ^10.2.0
cloudinary_public: ^0.21.0
carousel_slider: ^4.2.1
@ -66,6 +54,21 @@ dev_dependencies:
multi_image_picker: ^4.8.1
charts_flutter: ^0.12.0
flutter_native_contact_picker: ^0.0.4
flutter_slidable: ^2.0.0
video_player: ^2.5.2
flick_video_player: ^0.5.0
flutter_sound: ^8.1.9
assets_audio_player: ^3.0.3+3
path: ^1.8.0
visibility_detector: ^0.4.0+2
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
flutter_launcher_icons: ^0.11.0
flutter_icons:
image_path_ios: 'images/appicon.png'

Loading…
Cancel
Save