cancel button added in image page

dev
Sneha 1 year ago
parent ed1ff5101b
commit eb3d18efa3

@ -12,7 +12,9 @@
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<application <application
android:requestLegacyExternalStorage="true"
android:label="HealthCare" android:label="HealthCare"
android:name="${applicationName}" android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"> 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 'dart:convert';
import 'package:intl/intl.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:healthcare_user/BMI/bmi_history.dart'; import 'package:healthcare_user/BMI/bmi_history.dart';
import 'package:healthcare_user/common/settings.dart'; import 'package:healthcare_user/common/settings.dart';
@ -14,21 +14,30 @@ class BMICalculator extends StatefulWidget {
class _BMICalculatorState extends State<BMICalculator> { class _BMICalculatorState extends State<BMICalculator> {
TextEditingController heightController = TextEditingController(); TextEditingController heightController = TextEditingController();
TextEditingController inchesController = TextEditingController();
TextEditingController cmsController = TextEditingController();
TextEditingController weightController = TextEditingController(); TextEditingController weightController = TextEditingController();
TextEditingController ageController = TextEditingController(); TextEditingController ageController = TextEditingController();
TextEditingController dateInput = TextEditingController();
String bmiValue = ''; String bmiValue = '';
String bmiText = ''; String bmiText = '';
var heightUnitItems = [ var heightUnitItems = [
'feet', 'feet',
'cm', 'cm',
'inches',
]; ];
var heightUnits = 'feet'; var heightUnits = 'feet';
var weightUnitItems = [ var weightUnitItems = [
'kg', 'kg',
'gr',
]; ];
var weightUnits = 'kg'; var weightUnits = 'kg';
@override
void initState() {
ageController.text=AppSettings.age;
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -45,11 +54,13 @@ class _BMICalculatorState extends State<BMICalculator> {
cursorColor: greyColor, cursorColor: greyColor,
controller: ageController, controller: ageController,
textCapitalization: TextCapitalization.characters, textCapitalization: TextCapitalization.characters,
keyboardType: TextInputType.number,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.person, Icons.person,
color: primaryColor, color: primaryColor,
), ),
suffixText: "Yrs",
border: OutlineInputBorder( border: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor)), borderSide: BorderSide(color: primaryColor)),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
@ -65,7 +76,57 @@ class _BMICalculatorState extends State<BMICalculator> {
), ),
), ),
SizedBox(height: 10), 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, //height: 60,
child: Row( child: Row(
children: [ children: [
@ -74,6 +135,7 @@ class _BMICalculatorState extends State<BMICalculator> {
cursorColor: greyColor, cursorColor: greyColor,
controller: heightController, controller: heightController,
textCapitalization: TextCapitalization.characters, textCapitalization: TextCapitalization.characters,
keyboardType: TextInputType.number,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.height, Icons.height,
@ -87,7 +149,7 @@ class _BMICalculatorState extends State<BMICalculator> {
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor), borderSide: BorderSide(color: primaryColor),
), ),
labelText: 'Height', labelText: 'Feets',
labelStyle: TextStyle( labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE color: greyColor, //<-- SEE HERE
), ),
@ -96,13 +158,14 @@ class _BMICalculatorState extends State<BMICalculator> {
), ),
SizedBox(width: 5), SizedBox(width: 5),
Expanded( Expanded(
child: DropdownButtonFormField( child: TextFormField(
// Initial Value cursorColor: greyColor,
value: heightUnits, controller: inchesController,
isExpanded: true, textCapitalization: TextCapitalization.characters,
keyboardType: TextInputType.number,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.ac_unit_outlined, Icons.height,
color: primaryColor, color: primaryColor,
), ),
border: OutlineInputBorder( border: OutlineInputBorder(
@ -113,40 +176,54 @@ class _BMICalculatorState extends State<BMICalculator> {
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor), borderSide: BorderSide(color: primaryColor),
), ),
labelText: 'Units', labelText: 'Inches',
labelStyle: TextStyle( labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE 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), SizedBox(height: 10),
Container( Container(
//height: 40, //height: 40,
@ -158,6 +235,7 @@ class _BMICalculatorState extends State<BMICalculator> {
cursorColor: greyColor, cursorColor: greyColor,
controller: weightController, controller: weightController,
textCapitalization: TextCapitalization.characters, textCapitalization: TextCapitalization.characters,
keyboardType: TextInputType.number,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.line_weight_outlined, Icons.line_weight_outlined,
@ -232,48 +310,136 @@ class _BMICalculatorState extends State<BMICalculator> {
), ),
), ),
SizedBox(height: 10), SizedBox(height: 10),
TextButton( Container(
child: Text('Calculate BMI', style: textButtonStyle()), child: TextFormField(
onPressed: () async { cursorColor: greyColor,
if (ageController.text != '' && controller: dateInput,
heightController.text != '' && decoration: textFormFieldDecorationBMI(
weightController.text != '') { Icons.calendar_today, 'Enter Date'),
var payload = new Map<String, dynamic>(); 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 != '' ||cmsController.text!=''&&
weightController.text != ''&&dateInput.text!='') {
AppSettings.preLoaderDialog(context);
var payload = new Map<String, dynamic>();
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);
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){
bmiText='Underweight';
}
else if(double.parse(bmiValue)>=18.5&&double.parse(bmiValue)<=24.9){
bmiText='Normal weight';
}
else if(double.parse(bmiValue)>=25&&double.parse(bmiValue)<=29.9){
bmiText='Overweight';
}
else if(double.parse(bmiValue)>=30){
bmiText='Obesity';
}
});
}
catch(e){
Navigator.of(context, rootNavigator: true).pop();
AppSettings.longFailedToast('Calculating BMI failed');
}
payload["age"] =
int.parse(ageController.text.toString());
payload["height"] = heightController.text.toString();
payload["weight"] = weightController.text.toString();
payload["heightUnit"] = heightUnits.toString();
payload["weightUnit"] = weightUnits.toString();
var value = await AppSettings.calculateBmi(payload);
var valueResponse = jsonDecode(value);
print(valueResponse);
setState(() {
bmiValue = valueResponse['userDetails']['bmivalue'].toString();
if(double.parse(bmiValue)<18.5){
bmiText='Underweight';
}
else if(double.parse(bmiValue)>=18.5&&double.parse(bmiValue)<=24.9){
bmiText='Normal weight';
}
else if(double.parse(bmiValue)>=25&&double.parse(bmiValue)<=29.9){
bmiText='Overweight';
} }
else if(double.parse(bmiValue)>=30){ else{
bmiText='Obesity'; AppSettings.longFailedToast('Please enter valid details');
} }
}); },
} child: const Text('Calculate BMI'),
}, )),
), SizedBox(height: 20),
SizedBox(height: 10),
Container( Container(
child: Row( child: Row(
children: [ children: [
Text('Your Bmi value: $bmiValue'), Text('Your BMI value: $bmiValue',style: TextStyle(fontSize:15,fontWeight: FontWeight.bold),),
SizedBox(width: 10,), 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 'dart:convert';
import 'package:healthcare_user/chart/bmi_chart.dart'; import 'package:healthcare_user/chart/bmi_chart.dart';
import 'package:intl/intl.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:healthcare_user/models/bmi_history_model.dart'; import 'package:healthcare_user/models/bmi_history_model.dart';
import 'package:healthcare_user/common/settings.dart'; import 'package:healthcare_user/common/settings.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
import '../chart/bpchart.dart';
class BMIHistory extends StatefulWidget { class BMIHistory extends StatefulWidget {
const BMIHistory({Key? key}) : super(key: key); const BMIHistory({Key? key}) : super(key: key);
@ -19,11 +17,12 @@ class _BMIHistoryState extends State<BMIHistory> {
List<BmiHistoryModel> bmiHistoryList = []; List<BmiHistoryModel> bmiHistoryList = [];
List<BmiHistoryModel> FilteredList = []; List<BmiHistoryModel> FilteredList = [];
var dateItems = [ var dateItems = [
'All',
'last 7 days', 'last 7 days',
'last one month', 'last one month',
'last one year', 'last one year',
]; ];
var dateItemsVariable = 'last 7 days'; var dateItemsVariable = 'All';
Future<void> getBmiHistoryDetails(var selectedRange) async { Future<void> getBmiHistoryDetails(var selectedRange) async {
isLoading = true; isLoading = true;
@ -43,6 +42,7 @@ class _BMIHistoryState extends State<BMIHistory> {
FilteredList = bmiHistoryList.where((product) { FilteredList = bmiHistoryList.where((product) {
final date = product.dateForFilter; final date = product.dateForFilter;
return now_1w.isBefore(date); return now_1w.isBefore(date);
//reportsList=reportsListOriginal.reversed.toList();
}).toList(); }).toList();
} else if (selectedRange.toString().toUpperCase() == 'LAST ONE MONTH') { } else if (selectedRange.toString().toUpperCase() == 'LAST ONE MONTH') {
FilteredList = bmiHistoryList.where((product) { FilteredList = bmiHistoryList.where((product) {
@ -68,6 +68,27 @@ class _BMIHistoryState extends State<BMIHistory> {
super.initState(); 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() { Widget renderzUi() {
if (bmiHistoryList.length != 0) { if (bmiHistoryList.length != 0) {
return Column(crossAxisAlignment: CrossAxisAlignment.end, children: [ return Column(crossAxisAlignment: CrossAxisAlignment.end, children: [
@ -90,7 +111,7 @@ class _BMIHistoryState extends State<BMIHistory> {
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor), borderSide: BorderSide(color: primaryColor),
), ),
labelText: 'Units', labelText: 'Select Date Range',
labelStyle: TextStyle( labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE color: greyColor, //<-- SEE HERE
), ),
@ -145,113 +166,168 @@ class _BMIHistoryState extends State<BMIHistory> {
padding: EdgeInsets.all(0), padding: EdgeInsets.all(0),
itemCount: FilteredList.length, itemCount: FilteredList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Card( return Slidable(
color: Colors.white, key: const ValueKey(0),
child: Padding( endActionPane: ActionPane(
padding: EdgeInsets.all(8), // A motion is a widget used to control how the pane animates.
child: Row( motion: ScrollMotion(),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, dragDismissible: false,
children: [ // A pane can dismiss the Slidable.
Container( dismissible: DismissiblePane(onDismissed: () {
width: MediaQuery.of(context).size.width * .55, deleteBmiHistory(FilteredList[index].bmiInfoId);
child: Column( }),
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, // All actions are defined in the children parameter.
children: [ children: [
Row( // A SlidableAction can have an icon and/or a label.
mainAxisAlignment: MainAxisAlignment.start, SlidableAction(
crossAxisAlignment: CrossAxisAlignment.start, backgroundColor: Color(0xFFFE4A49),
children: [ foregroundColor: Colors.white,
Image( icon: Icons.delete,
image: const AssetImage( label: 'Delete',
'images/height.png'), onPressed: (BuildContext context) {
height: 25, deleteBmiHistory(FilteredList[index].bmiInfoId);
width: 25, },
fit: BoxFit.fill), ),
Padding( /*SlidableAction(
padding: EdgeInsets.all(5), onPressed: doNothing,
child: Text( backgroundColor: Color(0xFF21B7CA),
FilteredList[index] foregroundColor: Colors.white,
.height icon: Icons.share,
.toString() label: 'Share',
.toUpperCase() + ),*/
' ft', ],
style: valuesTextStyle()), ),
) child: Card(
], color: Colors.white,
), child: Padding(
Row( padding: EdgeInsets.all(8),
mainAxisAlignment: MainAxisAlignment.start, child: Row(
crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ crossAxisAlignment: CrossAxisAlignment.center,
Image( children: [
image: const AssetImage( Container(
'images/weight.png'), width: MediaQuery.of(context).size.width * .55,
height: 25, child: Column(
width: 25, mainAxisAlignment: MainAxisAlignment.start,
fit: BoxFit.fill), crossAxisAlignment: CrossAxisAlignment.start,
Padding( children: [
padding: EdgeInsets.all(5), Row(
child: Text( mainAxisAlignment: MainAxisAlignment.start,
FilteredList[index] crossAxisAlignment: CrossAxisAlignment.start,
.weight children: [
.toString() Image(
.toUpperCase() + image: const AssetImage(
' Kgs', 'images/height.png'),
style: valuesTextStyle()), height: 25,
) width: 25,
], fit: BoxFit.fill),
), Padding(
Row( padding: EdgeInsets.all(5),
mainAxisAlignment: MainAxisAlignment.start, child: Text(
crossAxisAlignment: CrossAxisAlignment.start, FilteredList[index]
children: [ .height
Image( .toString()
image: .toUpperCase() +
const AssetImage('images/date.png'), ' cms',
height: 25, style: valuesTextStyle()),
width: 25, )
fit: BoxFit.fill), ],
Padding( ),
padding: EdgeInsets.all(5), Row(
child: Text( mainAxisAlignment: MainAxisAlignment.start,
FilteredList[index] crossAxisAlignment: CrossAxisAlignment.start,
.displayDate children: [
.toString() Image(
.toUpperCase(), image: const AssetImage(
style: valuesTextStyle()), 'images/weight.png'),
) height: 25,
], width: 25,
), fit: BoxFit.fill),
Row( Padding(
mainAxisAlignment: MainAxisAlignment.start, padding: EdgeInsets.all(5),
crossAxisAlignment: CrossAxisAlignment.start, child: Text(
children: [ FilteredList[index]
Image( .weight
image: const AssetImage( .toString()
'images/weight.png'), .toUpperCase() +
height: 25, ' Kgs',
width: 25, style: valuesTextStyle()),
fit: BoxFit.fill), )
Padding( ],
padding: EdgeInsets.all(5), ),
child: Text( Row(
FilteredList[index] mainAxisAlignment: MainAxisAlignment.start,
.bmiValue crossAxisAlignment: CrossAxisAlignment.start,
.toString() children: [
.toUpperCase(), Image(
style: valuesTextStyle()), image:
) const AssetImage('images/date.png'),
], height: 25,
), width: 25,
], fit: BoxFit.fill),
Padding(
padding: EdgeInsets.all(5),
child: Text(
FilteredList[index]
.actualDate
.toString()
.toUpperCase(),
style: valuesTextStyle()),
)
],
),
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]
.bmiValue
.toString()
.toUpperCase(),
style: valuesTextStyle()),
)
],
),
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 { } else {

@ -1,9 +1,8 @@
import 'dart:convert'; import 'dart:convert';
import 'package:flutter/material.dart'; 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/BP/bp_history.dart';
import 'package:healthcare_user/common/settings.dart'; import 'package:healthcare_user/common/settings.dart';
import 'package:intl/intl.dart';
class BPCalculator extends StatefulWidget { class BPCalculator extends StatefulWidget {
const BPCalculator({Key? key}) : super(key: key); const BPCalculator({Key? key}) : super(key: key);
@ -16,19 +15,10 @@ class _BPCalculatorState extends State<BPCalculator> {
TextEditingController systoloicController = TextEditingController(); TextEditingController systoloicController = TextEditingController();
TextEditingController diastolicController = TextEditingController(); TextEditingController diastolicController = TextEditingController();
TextEditingController dateInput = TextEditingController();
String bpValue = ''; String bpValue = '';
String bpText = ''; String bpText = '';
var heightUnitItems = [
'feet',
'cm',
'inches',
];
var heightUnits = 'feet';
var weightUnitItems = [
'kg',
'gr',
];
var weightUnits = 'kg';
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -45,9 +35,10 @@ class _BPCalculatorState extends State<BPCalculator> {
cursorColor: greyColor, cursorColor: greyColor,
controller: systoloicController, controller: systoloicController,
textCapitalization: TextCapitalization.characters, textCapitalization: TextCapitalization.characters,
keyboardType: TextInputType.number,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.person, Icons.upload,
color: primaryColor, color: primaryColor,
), ),
border: OutlineInputBorder( border: OutlineInputBorder(
@ -69,9 +60,10 @@ class _BPCalculatorState extends State<BPCalculator> {
cursorColor: greyColor, cursorColor: greyColor,
controller: diastolicController, controller: diastolicController,
textCapitalization: TextCapitalization.characters, textCapitalization: TextCapitalization.characters,
keyboardType: TextInputType.number,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.person, Icons.download,
color: primaryColor, color: primaryColor,
), ),
border: OutlineInputBorder( border: OutlineInputBorder(
@ -89,47 +81,92 @@ class _BPCalculatorState extends State<BPCalculator> {
), ),
), ),
SizedBox(height: 10), SizedBox(height: 10),
TextButton( Container(
child: Text('Check BP', style: textButtonStyle()), child: TextFormField(
onPressed: () async { cursorColor: greyColor,
if (systoloicController.text != '' && controller: dateInput,
diastolicController.text != '') { decoration: textFormFieldDecorationBMI(
AppSettings.preLoaderDialog(context); Icons.calendar_today, 'Enter Date'),
var payload = new Map<String, dynamic>(); 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!,
);
},
);
payload["Systolic"] = double.parse(systoloicController.text.toString()); if (pickedDate != null) {
payload["Diastolic"] = double.parse(diastolicController.text.toString()); 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 != ''&&dateInput.text!='') {
AppSettings.preLoaderDialog(context);
var payload = new Map<String, dynamic>();
var value = await AppSettings.calculateBP(payload); payload["Systolic"] = double.parse(systoloicController.text.toString());
var valueResponse = jsonDecode(value); payload["Diastolic"] = double.parse(diastolicController.text.toString());
print(valueResponse); payload["date"] =dateInput.text.toString();
setState(() {
bpValue = valueResponse['userDetails']['bpCategory'].toString(); var value = await AppSettings.calculateBP(payload);
/*bpValue = valueResponse['userDetails']['bmivalue'].toString(); var valueResponse = jsonDecode(value);
if(double.parse(bpValue)<18.5){ print(valueResponse);
bpText='Underweight'; setState(() {
} bpValue = valueResponse['userDetails']['bpCategory'].toString();
else if(double.parse(bpValue)>=18.5&&double.parse(bpValue)<=24.9){ });
bpText='Normal weight'; systoloicController.clear();
diastolicController.clear();
dateInput.clear();
Navigator.of(context,rootNavigator: true).pop();
} }
else if(double.parse(bpValue)>=25&&double.parse(bpValue)<=29.9){ else{
bpText='Overweight'; AppSettings.longFailedToast('Please enter valid details');
} }
else if(double.parse(bpValue)>=30){ },
bpText='Obesity'; child: const Text('Check BP'),
}*/ )),
}); SizedBox(height: 20),
systoloicController.clear();
diastolicController.clear();
Navigator.of(context,rootNavigator: true).pop();
}
},
),
SizedBox(height: 10),
Container( Container(
child: Row( child: Row(
children: [ 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 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:healthcare_user/chart/bpchart.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/common/settings.dart';
import 'package:healthcare_user/models/bp_history_model.dart'; import 'package:healthcare_user/models/bp_history_model.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
class BPHistory extends StatefulWidget { class BPHistory extends StatefulWidget {
const BPHistory({Key? key}) : super(key: key); const BPHistory({Key? key}) : super(key: key);
@ -13,247 +13,308 @@ class BPHistory extends StatefulWidget {
} }
class _BPHistoryState extends State<BPHistory> { class _BPHistoryState extends State<BPHistory> {
bool isLoading = false;
bool isLoading=false;
List<BPHistoryModel> BpHistoryList = []; List<BPHistoryModel> BpHistoryList = [];
List<BPHistoryModel> FilteredList = []; List<BPHistoryModel> FilteredList = [];
var dateItems = [ var dateItems = [
'All',
'last 7 days', 'last 7 days',
'last one month', 'last one month',
'last one year', 'last one year',
]; ];
var dateItemsVariable = 'last 7 days'; var dateItemsVariable = 'All';
Future<void> getBmiHistoryDetails(var selectedRange) async { Future<void> getBPHistoryDetails(var selectedRange) async {
isLoading=true; isLoading = true;
var response1= await AppSettings.getBPHistory(); var response1 = await AppSettings.getBPHistory();
print(response1); print(response1);
setState(() { setState(() {
BpHistoryList = BpHistoryList = ((jsonDecode(response1)) as List).map((dynamic model) {
((jsonDecode(response1)) as List).map((dynamic model) { return BPHistoryModel.fromJson(model);
return BPHistoryModel.fromJson(model); }).toList();
}).toList();
var now = new DateTime.now(); var now = new DateTime.now();
var now_1w = now.subtract(Duration(days: 7)); var now_1w = now.subtract(Duration(days: 7));
var now_1m = new DateTime(now.year, now.month-1, 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); var now_1y = new DateTime(now.year - 1, now.month, now.day);
if(selectedRange.toString().toUpperCase()=='LAST 7 DAYS'){ if (selectedRange.toString().toUpperCase() == 'LAST 7 DAYS') {
FilteredList=BpHistoryList.where((product) { FilteredList = BpHistoryList.where((product) {
final date = product.dateForFilter; final date = product.dateForFilter;
return now_1w.isBefore(date); return now_1w.isBefore(date);
}).toList(); }).toList();
} } else if (selectedRange.toString().toUpperCase() == 'LAST ONE MONTH') {
else if(selectedRange.toString().toUpperCase()=='LAST ONE MONTH'){ FilteredList = BpHistoryList.where((product) {
FilteredList=BpHistoryList.where((product) {
final date = product.dateForFilter; final date = product.dateForFilter;
return now_1m.isBefore(date); return now_1m.isBefore(date);
}).toList(); }).toList();
} } else if (selectedRange.toString().toUpperCase() == 'LAST ONE YEAR') {
else if(selectedRange.toString().toUpperCase()=='LAST ONE YEAR'){ FilteredList = BpHistoryList.where((product) {
FilteredList=BpHistoryList.where((product) {
final date = product.dateForFilter; final date = product.dateForFilter;
return now_1y.isBefore(date); return now_1y.isBefore(date);
}).toList(); }).toList();
} } else {
else{ FilteredList = BpHistoryList;
FilteredList=BpHistoryList;
} }
isLoading = false;
isLoading=false;
}); });
} }
@override @override
void initState() { void initState() {
getBmiHistoryDetails(dateItemsVariable); getBPHistoryDetails(dateItemsVariable);
super.initState(); super.initState();
} }
Widget renderzUi(){ deleteBpRecord(bpId) async {
if(BpHistoryList.length!=0){ AppSettings.preLoaderDialog(context);
bool status = await AppSettings.deleteBPDetails(bpId);
return Column( if (status) {
crossAxisAlignment: CrossAxisAlignment.start, Navigator.of(context, rootNavigator: true).pop();
children: [
Padding(padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
child: DropdownButtonFormField(
// Initial Value
value: dateItemsVariable,
isExpanded: true,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.calendar_month,
color: primaryColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
labelText: 'Units',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
hint: Text('Units'), AppSettings.longSuccessToast("BP record deleted successfully");
// Down Arrow Icon await getBPHistoryDetails(dateItemsVariable);
//icon: const Icon(Icons.keyboard_arrow_down), } else {
Navigator.of(context, rootNavigator: true).pop();
// Array list of items AppSettings.longFailedToast("BP record deletion failed");
items: dateItems.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(() {
dateItemsVariable = newValue!;
});
getBmiHistoryDetails(dateItemsVariable);
},
),),
IconButton( Widget renderzUi() {
onPressed: () { if (BpHistoryList.length != 0) {
Navigator.push( return Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
context, Padding(
MaterialPageRoute( padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
builder: (context) => Bpchart()), child: DropdownButtonFormField(
); // Initial Value
// showBMIAdddialog(); value: dateItemsVariable,
}, isExpanded: true,
icon: Icon( decoration: const InputDecoration(
Icons.auto_graph, prefixIcon: Icon(
Icons.calendar_month,
color: primaryColor, color: primaryColor,
), ),
border: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
labelText: 'Select Date Range',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
), ),
Expanded(child:ListView.builder( hint: Text('Units'),
padding: EdgeInsets.all(0), // Down Arrow Icon
//icon: const Icon(Icons.keyboard_arrow_down),
// Array list of items
items: dateItems.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(() {
dateItemsVariable = newValue!;
});
getBPHistoryDetails(dateItemsVariable);
},
),
),
IconButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => Bpchart()),
);
// showBMIAdddialog();
},
icon: Icon(
Icons.auto_graph,
color: primaryColor,
),
),
Expanded(
child: ListView.builder(
padding: EdgeInsets.all(0),
itemCount: FilteredList.length, itemCount: FilteredList.length,
itemBuilder: (BuildContext context, int index) { 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(),
color: Colors.white, dragDismissible: false,
child: Padding( // A pane can dismiss the Slidable.
padding:EdgeInsets.all(8) , dismissible: DismissiblePane(onDismissed: () {
child: Container( deleteBpRecord(FilteredList[index].bpId);
width: MediaQuery.of(context).size.width * .55, }),
child: Column(
mainAxisAlignment: MainAxisAlignment.start, // All actions are defined in the children parameter.
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ // A SlidableAction can have an icon and/or a label.
Row( 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),
child: Container(
//width: MediaQuery.of(context).size.width * .55,
child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
/* Image( Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
/* Image(
image: const AssetImage('images/height.png'), image: const AssetImage('images/height.png'),
height: 25, height: 25,
width: 25, width: 25,
fit: BoxFit.fill),*/ fit: BoxFit.fill),*/
Text('Systolic',style: TextStyle(color: primaryColor),), Text(
SizedBox(width: 5,), 'Systolic',
Padding(padding: EdgeInsets.all(1), style: TextStyle(color: primaryColor),
child: Text(FilteredList[index].systolic.toString().toUpperCase(),style: valuesTextStyle()),) ),
SizedBox(
], width: 5,
), ),
Row( Padding(
mainAxisAlignment: MainAxisAlignment.start, padding: EdgeInsets.all(1),
crossAxisAlignment: CrossAxisAlignment.start, child: Text(
children: [ FilteredList[index]
Text('Diastolic',style: TextStyle(color: primaryColor),), .systolic
Padding(padding: EdgeInsets.all(1), .toString()
child: Text(FilteredList[index].diastolic.toString().toUpperCase(),style: valuesTextStyle()),) .toUpperCase(),
style: valuesTextStyle()),
], )
), ],
Row( ),
mainAxisAlignment: MainAxisAlignment.start, Row(
crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Image( children: [
image: const AssetImage('images/height.png'), Text(
height: 25, 'Diastolic',
width: 25, style: TextStyle(color: primaryColor),
fit: BoxFit.fill), ),
Padding(padding: EdgeInsets.all(5), Padding(
child: Text(FilteredList[index].bpText.toString().toUpperCase(),style: valuesTextStyle()),) padding: EdgeInsets.all(1),
child: Text(
], FilteredList[index]
), .diastolic
Row( .toString()
mainAxisAlignment: MainAxisAlignment.start, .toUpperCase(),
crossAxisAlignment: CrossAxisAlignment.start, style: valuesTextStyle()),
children: [ )
Image( ],
image: const AssetImage('images/date.png'), ),
height: 25, Row(
width: 25, mainAxisAlignment: MainAxisAlignment.start,
fit: BoxFit.fill), crossAxisAlignment: CrossAxisAlignment.start,
Padding(padding: EdgeInsets.all(5), children: [
child: Text(FilteredList[index].displayDate.toString().toUpperCase(),style: valuesTextStyle()),) Image(
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()),
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image(
image:
const AssetImage('images/date.png'),
height: 25,
width: 25,
fit: BoxFit.fill),
Padding(
padding: EdgeInsets.all(5),
child: Text(
FilteredList[index]
.actualDate
.toString()
.toUpperCase(),
style: valuesTextStyle()),
)
],
),
], ],
), ),
),
],
), ),
));
})),
), ]);
), } else {
); return Center(
}) ),
]);
}
else{
return Center(
child: Padding( child: Padding(
padding: EdgeInsets.fromLTRB(0, 40, 0, 0), padding: EdgeInsets.fromLTRB(0, 40, 0, 0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
SizedBox(height: MediaQuery.of(context).size.height * .25,), SizedBox(
Text('No data'), height: MediaQuery.of(context).size.height * .25,
SizedBox(
height: 20,
),
CircleAvatar(
backgroundColor: primaryColor,
radius: 40,
child: IconButton(
iconSize: 40,
icon: const Icon(
Icons.info,
color: Colors.white,
),
onPressed: () async {
},
),
)
],
), ),
) Text('No data'),
); SizedBox(
height: 20,
),
CircleAvatar(
backgroundColor: primaryColor,
radius: 40,
child: IconButton(
iconSize: 40,
icon: const Icon(
Icons.info,
color: Colors.white,
),
onPressed: () async {},
),
)
],
),
));
} }
} }
@ -261,12 +322,14 @@ class _BPHistoryState extends State<BPHistory> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppSettings.appBar('Blood Pressure'), appBar: AppSettings.appBar('Blood Pressure'),
body: isLoading?Center( body: isLoading
child: CircularProgressIndicator( ? Center(
color: primaryColor, child: CircularProgressIndicator(
strokeWidth: 5.0, color: primaryColor,
), strokeWidth: 5.0,
):renderzUi(), ),
)
: renderzUi(),
); );
} }
} }

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

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

@ -1,10 +1,9 @@
import 'dart:convert'; import 'dart:convert';
import 'package:flutter/material.dart'; 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/Sugar/sugar_history.dart';
import 'package:healthcare_user/common/settings.dart'; import 'package:healthcare_user/common/settings.dart';
import 'package:intl/intl.dart';
class SugarCalculator extends StatefulWidget { class SugarCalculator extends StatefulWidget {
const SugarCalculator({Key? key}) : super(key: key); const SugarCalculator({Key? key}) : super(key: key);
@ -17,6 +16,7 @@ class _SugarCalculatorState extends State<SugarCalculator> {
TextEditingController fastingValueController = TextEditingController(); TextEditingController fastingValueController = TextEditingController();
TextEditingController postParandialValueController = TextEditingController(); TextEditingController postParandialValueController = TextEditingController();
TextEditingController dateInput = TextEditingController();
String sugarValue = ''; String sugarValue = '';
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -80,35 +80,94 @@ class _SugarCalculatorState extends State<SugarCalculator> {
), ),
), ),
SizedBox(height: 10), SizedBox(height: 10),
TextButton( SizedBox(height: 10),
child: Text('Check Sugar', style: textButtonStyle()), Container(
onPressed: () async { child: TextFormField(
if (fastingValueController.text != '' && cursorColor: greyColor,
postParandialValueController.text != '') { controller: dateInput,
AppSettings.preLoaderDialog(context); decoration: textFormFieldDecorationBMI(
var payload = new Map<String, dynamic>(); 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!,
);
},
);
payload["fasting"] = double.parse(fastingValueController.text.toString()); if (pickedDate != null) {
payload["postPrandial"] = double.parse(postParandialValueController.text.toString()); 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 != ''&& dateInput.text!='') {
AppSettings.preLoaderDialog(context);
var payload = new Map<String, dynamic>();
var value = await AppSettings.calculateSugar(payload); payload["fasting"] = double.parse(fastingValueController.text.toString());
var valueResponse = jsonDecode(value); payload["postPrandial"] = double.parse(postParandialValueController.text.toString());
print(valueResponse); payload["date"] = dateInput.text.toString();
setState(() {
sugarValue = valueResponse['userSugarDetails']['sugarCategory'].toString();
}); var value = await AppSettings.calculateSugar(payload);
fastingValueController.clear(); var valueResponse = jsonDecode(value);
postParandialValueController.clear(); print(valueResponse);
Navigator.of(context,rootNavigator: true).pop(); setState(() {
} sugarValue = valueResponse['userSugarDetails']['sugarCategory'].toString();
},
), });
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), SizedBox(height: 10),
Container( Container(
child: Row( child: Row(
children: [ 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 'dart:convert';
import 'package:flutter/material.dart'; 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/common/settings.dart';
import 'package:healthcare_user/models/bp_history_model.dart';
import 'package:healthcare_user/models/sugar_history_model.dart'; import 'package:healthcare_user/models/sugar_history_model.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
class SugarHistory extends StatefulWidget { class SugarHistory extends StatefulWidget {
const SugarHistory({Key? key}) : super(key: key); const SugarHistory({Key? key}) : super(key: key);
@ -13,56 +12,51 @@ class SugarHistory extends StatefulWidget {
} }
class _SugarHistoryState extends State<SugarHistory> { class _SugarHistoryState extends State<SugarHistory> {
bool isLoading = false;
bool isLoading=false;
List<SugarHistoryModel> sugarHistoryList = []; List<SugarHistoryModel> sugarHistoryList = [];
List<SugarHistoryModel> FilteredList = []; List<SugarHistoryModel> FilteredList = [];
var dateItems = [ var dateItems = [
'All',
'last 7 days', 'last 7 days',
'last one month', 'last one month',
'last one year', 'last one year',
]; ];
var dateItemsVariable = 'last 7 days'; var dateItemsVariable = 'All';
Future<void> getSugarHistoryDetails(var selectedRange) async { Future<void> getSugarHistoryDetails(var selectedRange) async {
isLoading=true; isLoading = true;
var response1= await AppSettings.getSugarHistory(); var response1 = await AppSettings.getSugarHistory();
print(response1); print(response1);
setState(() { setState(() {
sugarHistoryList = sugarHistoryList = ((jsonDecode(response1)) as List).map((dynamic model) {
((jsonDecode(response1)) as List).map((dynamic model) { return SugarHistoryModel.fromJson(model);
return SugarHistoryModel.fromJson(model); }).toList();
}).toList();
var now = new DateTime.now(); var now = new DateTime.now();
var now_1w = now.subtract(Duration(days: 7)); var now_1w = now.subtract(Duration(days: 7));
var now_1m = new DateTime(now.year, now.month-1, 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); var now_1y = new DateTime(now.year - 1, now.month, now.day);
if(selectedRange.toString().toUpperCase()=='LAST 7 DAYS'){ if (selectedRange.toString().toUpperCase() == 'LAST 7 DAYS') {
FilteredList=sugarHistoryList.where((product) { FilteredList = sugarHistoryList.where((product) {
final date = product.dateForFilter; final date = product.dateForFilter;
return now_1w.isBefore(date); return now_1w.isBefore(date);
}).toList(); }).toList();
} } else if (selectedRange.toString().toUpperCase() == 'LAST ONE MONTH') {
else if(selectedRange.toString().toUpperCase()=='LAST ONE MONTH'){ FilteredList = sugarHistoryList.where((product) {
FilteredList=sugarHistoryList.where((product) {
final date = product.dateForFilter; final date = product.dateForFilter;
return now_1m.isBefore(date); return now_1m.isBefore(date);
}).toList(); }).toList();
} } else if (selectedRange.toString().toUpperCase() == 'LAST ONE YEAR') {
else if(selectedRange.toString().toUpperCase()=='LAST ONE YEAR'){ FilteredList = sugarHistoryList.where((product) {
FilteredList=sugarHistoryList.where((product) {
final date = product.dateForFilter; final date = product.dateForFilter;
return now_1y.isBefore(date); return now_1y.isBefore(date);
}).toList(); }).toList();
} } else {
else{ FilteredList = sugarHistoryList;
FilteredList=sugarHistoryList;
} }
isLoading = false;
isLoading=false;
}); });
} }
@ -72,192 +66,374 @@ class _SugarHistoryState extends State<SugarHistory> {
super.initState(); super.initState();
} }
Widget renderzUi(){ deleteSugarRecord(sugarInfoId) async {
if(sugarHistoryList.length!=0){ AppSettings.preLoaderDialog(context);
bool status = await AppSettings.deleteSugarDetails(sugarInfoId);
return Column( if (status) {
crossAxisAlignment: CrossAxisAlignment.end, Navigator.of(context, rootNavigator: true).pop();
children: [
Padding(padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
child: DropdownButtonFormField(
// Initial Value
value: dateItemsVariable,
isExpanded: true,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.calendar_month,
color: primaryColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
labelText: 'Units',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
hint: Text('Units'), AppSettings.longSuccessToast("BP record deleted successfully");
// Down Arrow Icon await getSugarHistoryDetails(dateItemsVariable);
//icon: const Icon(Icons.keyboard_arrow_down), } else {
Navigator.of(context, rootNavigator: true).pop();
// Array list of items AppSettings.longFailedToast("BP record deletion failed");
items: dateItems.map((String items) { }
return DropdownMenuItem( }
value: items,
child: Text( Widget renderzUi() {
items, if (sugarHistoryList.length != 0) {
style: TextStyle( return Column(crossAxisAlignment: CrossAxisAlignment.end, children: [
fontSize: 16, Padding(
), padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
textAlign: TextAlign.center, child: DropdownButtonFormField(
)); // Initial Value
}).toList(), value: dateItemsVariable,
// After selecting the desired option,it will isExpanded: true,
// change button value to selected value decoration: const InputDecoration(
onChanged: (String? newValue) { prefixIcon: Icon(
setState(() { Icons.calendar_month,
dateItemsVariable = newValue!; color: primaryColor,
}); ),
getSugarHistoryDetails(dateItemsVariable); border: OutlineInputBorder(
}, borderSide: BorderSide(color: primaryColor)),
),), focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
labelText: 'Select Date Range',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
Expanded(child:ListView.builder( hint: Text('Units'),
padding: EdgeInsets.all(0), // Down Arrow Icon
//icon: const Icon(Icons.keyboard_arrow_down),
// Array list of items
items: dateItems.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(() {
dateItemsVariable = newValue!;
});
getSugarHistoryDetails(dateItemsVariable);
},
),
),
Expanded(
child: ListView.builder(
padding: EdgeInsets.all(0),
itemCount: FilteredList.length, itemCount: FilteredList.length,
itemBuilder: (BuildContext context, int index) { 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(),
color: Colors.white, dragDismissible: false,
child: Padding( // A pane can dismiss the Slidable.
padding:EdgeInsets.all(8) , dismissible: DismissiblePane(onDismissed: () {
child: Row( deleteSugarRecord(FilteredList[index].sugarInfoId);
mainAxisAlignment: MainAxisAlignment.spaceBetween, }),
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Column( // 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.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ 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].fasting.toString().toUpperCase(),style: valuesTextStyle()),)
], Column(
),
Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Image( Text(
image: const AssetImage('images/height.png'), 'Fasting Sugar Value',
height: 25, style: labelTextStyle(),
width: 25, ),
fit: BoxFit.fill), SizedBox(height:MediaQuery.of(context).size.height * .01,),
Padding(padding: EdgeInsets.all(5), Text(
child: Text(FilteredList[index].postPrandial.toString().toUpperCase(),style: valuesTextStyle()),) '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(),
),
], ],
), ),
Row( SizedBox(width:MediaQuery.of(context).size.width * .01,),
Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Image( Text(
image: const AssetImage('images/height.png'), ':',
height: 25, style: labelTextStyle(),
width: 25, ),
fit: BoxFit.fill), SizedBox(height:MediaQuery.of(context).size.height * .01,),
Padding(padding: EdgeInsets.all(5), Text(
child: Text(FilteredList[index].sugarValue.toString().toUpperCase(),style: valuesTextStyle()),) ':',
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, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Image( Text(
image: const AssetImage('images/height.png'), FilteredList[index]
height: 25, .fasting
width: 25, .toString()
fit: BoxFit.fill), .toUpperCase(),
Padding(padding: EdgeInsets.all(5), style: valuesTextStyle()),
child: Text(FilteredList[index].sugartText.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()),
], ],
), ),)
Row(
/*Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Image( Row(
image: const AssetImage('images/date.png'), mainAxisAlignment: MainAxisAlignment.start,
height: 25, crossAxisAlignment:
width: 25, CrossAxisAlignment.start,
fit: BoxFit.fill), children: [
Padding(padding: EdgeInsets.all(5), *//*Image(
child: Text(FilteredList[index].displayDate.toString().toUpperCase(),style: valuesTextStyle()),) image: const AssetImage(
'images/height.png'),
height: 25,
width: 25,
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,
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'),
height: 25,
width: 25,
fit: BoxFit.fill),
Padding(
padding: EdgeInsets.all(5),
child: Text(
FilteredList[index]
.sugarValue
.toString()
.toUpperCase(),
style: valuesTextStyle()),
)
],
),
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]
.sugartText
.toString()
.toUpperCase(),
style: valuesTextStyle()),
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Image(
image: const AssetImage(
'images/date.png'),
height: 25,
width: 25,
fit: BoxFit.fill),
Padding(
padding: EdgeInsets.all(5),
child: Text(
FilteredList[index]
.actualDate
.toString()
.toUpperCase(),
style: valuesTextStyle()),
)
],
),
], ],
), ),*/
], ],
), ),
),
], ));
})),
), ]);
), } else {
); return Center(
}) ),
]);
}
else{
return Center(
child: Padding( child: Padding(
padding: EdgeInsets.fromLTRB(0, 40, 0, 0), padding: EdgeInsets.fromLTRB(0, 40, 0, 0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
SizedBox(height: MediaQuery.of(context).size.height * .25,), SizedBox(
Text('No data'), height: MediaQuery.of(context).size.height * .25,
SizedBox( ),
height: 20, Text('No data'),
), SizedBox(
CircleAvatar( height: 20,
backgroundColor: primaryColor,
radius: 40,
child: IconButton(
iconSize: 40,
icon: const Icon(
Icons.info,
color: Colors.white,
),
onPressed: () async {
},
),
)
],
), ),
) CircleAvatar(
); backgroundColor: primaryColor,
radius: 40,
child: IconButton(
iconSize: 40,
icon: const Icon(
Icons.info,
color: Colors.white,
),
onPressed: () async {},
),
)
],
),
));
} }
} }
@ -265,12 +441,14 @@ class _SugarHistoryState extends State<SugarHistory> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppSettings.appBar('Diabetes'), appBar: AppSettings.appBar('Diabetes'),
body: isLoading?Center( body: isLoading
child: CircularProgressIndicator( ? Center(
color: primaryColor, child: CircularProgressIndicator(
strokeWidth: 5.0, color: primaryColor,
), strokeWidth: 5.0,
):renderzUi(), ),
)
: renderzUi(),
); );
} }
} }

@ -20,7 +20,7 @@ class _BmiChartState extends State<BmiChart> {
_getSeriesData() { _getSeriesData() {
List<charts.Series<BmiHistoryModel, DateTime>> series = [ List<charts.Series<BmiHistoryModel, DateTime>> series = [
charts.Series( charts.Series(
id: "Sales", id: "Bmi",
data: widget.myObject, data: widget.myObject,
domainFn: (BmiHistoryModel series, _) => series.dateForFilter, domainFn: (BmiHistoryModel series, _) => series.dateForFilter,
measureFn: (BmiHistoryModel series, _) => series.number2, 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_health.dart';
import 'package:healthcare_user/my_medicine_timings.dart'; import 'package:healthcare_user/my_medicine_timings.dart';
import 'package:healthcare_user/prescriptions/prescriptions.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/Reports/add_reports.dart';
import 'package:healthcare_user/report_problem/all_problems.dart';
import 'package:healthcare_user/seekopinion.dart'; import 'package:healthcare_user/seekopinion.dart';
import 'package:healthcare_user/common/settings.dart'; import 'package:healthcare_user/common/settings.dart';
import 'package:healthcare_user/updates/update_location.dart'; import 'package:healthcare_user/updates/update_location.dart';
@ -371,19 +372,15 @@ class _DashboardState extends State<Dashboard> {
shape: BoxShape.circle, shape: BoxShape.circle,
image: DecorationImage( image: DecorationImage(
image: AssetImage( image: AssetImage(
"images/invitations.png"), // picked file "images/myconnections.png"), // picked file
fit: BoxFit.fitWidth)), fit: BoxFit.fitWidth)),
), ),
onTap: () { onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const Invitations()),
);
}, },
), ),
Text( Text(
'Invitations', 'My Connections',
style: dashboardTextStyle(), style: dashboardTextStyle(),
), ),
], ],
@ -774,7 +771,7 @@ class _DashboardState extends State<Dashboard> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => const ReportMySelf()), builder: (context) => AllProblemsReportMyself()),
); );
}, },
), ),
@ -785,7 +782,7 @@ class _DashboardState extends State<Dashboard> {
title: Row( title: Row(
children: [ children: [
Image( Image(
image: const AssetImage('images/myconnections.png'), image: const AssetImage('images/invitations.png'),
height: 25, height: 25,
width: 25, width: 25,
fit: BoxFit.fill), fit: BoxFit.fill),
@ -795,10 +792,16 @@ class _DashboardState extends State<Dashboard> {
const SizedBox( const SizedBox(
width: 10, width: 10,
), ),
Text('My Connections', style: drawerListItemsTextStyle()), Text('Invitations', style: drawerListItemsTextStyle()),
], ],
), ),
onTap: () {}, onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const Invitations()),
);
},
), ),
Divider( Divider(
color: Colors.grey, 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>(); final GlobalKey<State> preloaderWindowKey = new GlobalKey<State>();
Future<void> preloaderWindow(BuildContext context) async { Future<void> preloaderWindow(BuildContext context) async {
try { try {
@ -250,6 +272,7 @@ class AppSettings {
static String getBpHistoryUrl = host + 'usersbp'; static String getBpHistoryUrl = host + 'usersbp';
static String getSugarHistoryUrl = host + 'userssugar'; static String getSugarHistoryUrl = host + 'userssugar';
static String addMedicineTimingsUrl = host + 'medicine-timing'; static String addMedicineTimingsUrl = host + 'medicine-timing';
static String updateMedicineTimingsUrl = host + 'update-medicine-timing';
static String getMedicineTimingsUrl = host + 'getmedicineztiming'; static String getMedicineTimingsUrl = host + 'getmedicineztiming';
static String findingsUploadPicUrl = host + 'uploads-findings-prescription'; static String findingsUploadPicUrl = host + 'uploads-findings-prescription';
static String addFindingsUrl = host + 'update-uploads-findingsPictureId-prescription'; static String addFindingsUrl = host + 'update-uploads-findingsPictureId-prescription';
@ -268,6 +291,8 @@ class AppSettings {
static String addRecordsUrl = host + 'add-record'; static String addRecordsUrl = host + 'add-record';
static String updateRecordsUrl = host + 'records'; static String updateRecordsUrl = host + 'records';
static String reportMySelfVideoUploadUrl = host + 'reportProblemVideo'; static String reportMySelfVideoUploadUrl = host + 'reportProblemVideo';
static String uploadReportMyselfPictureUrl = host + 'reportProblemPicture';
//static String getAllPrescriptionsDataUrl = host + 'usersinglerprecription'; //static String getAllPrescriptionsDataUrl = host + 'usersinglerprecription';
static String getAllPrescriptionsDataUrl = host + 'getAllPrescriptionDetails'; static String getAllPrescriptionsDataUrl = host + 'getAllPrescriptionDetails';
static String getRecordsDataUrl = host + 'getAllRecords'; static String getRecordsDataUrl = host + 'getAllRecords';
@ -276,6 +301,16 @@ class AppSettings {
static String deletePrescriptionsUrl = host + 'delete-prescription'; static String deletePrescriptionsUrl = host + 'delete-prescription';
static String deleteReportsUrl = host + 'delete-report'; static String deleteReportsUrl = host + 'delete-report';
static String deleteRecordsUrl = host + 'delete-url'; 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; 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 { static Future<String> getAllpharmacies() async {
var uri = Uri.parse(getAllpharmaciesDataUrl); var uri = Uri.parse(getAllpharmaciesDataUrl);
//uri = uri.replace(query: 'customerId=$customerId'); //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 { static Future<String> getMedicineTimings() async {
var uri = Uri.parse(getMedicineTimingsUrl + '/' + customerId); var uri = Uri.parse(getMedicineTimingsUrl + '/' + customerId);
@ -1473,7 +1543,6 @@ class AppSettings {
} }
}*/ }*/
static Future<bool> deleteRecords(payload, recordId) async { static Future<bool> deleteRecords(payload, recordId) async {
var uri = Uri.parse(deleteRecordsUrl + '/' + customerId+'/'+recordId); var uri = Uri.parse(deleteRecordsUrl + '/' + customerId+'/'+recordId);
@ -1503,8 +1572,6 @@ class AppSettings {
} }
} }
static Future<String> deleteRecordsNew(payload, recordId) async { static Future<String> deleteRecordsNew(payload, recordId) async {
var uri = Uri.parse(deleteRecordsUrl + '/' + customerId+'/'+recordId); 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*/ /*Apis ends here*/

@ -15,17 +15,43 @@ class _ImageZoomPageState extends State<ImageZoomPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( 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( body: Container(
//width: MediaQuery.of(context).size.width * .10, //width: MediaQuery.of(context).size.width * .10,
//height: MediaQuery.of(context).size.height * .50, //height: MediaQuery.of(context).size.height * .50,
child: PhotoView( child: Column(
imageProvider: NetworkImage(widget.imageDetails) as ImageProvider, crossAxisAlignment: CrossAxisAlignment.start,
maxScale: PhotoViewComputedScale.contained * 4.0, children: [
minScale: PhotoViewComputedScale.contained, Padding(padding:EdgeInsets.fromLTRB(10,10,10,0),
initialScale: PhotoViewComputedScale.contained, child: Text('Use two fingers to zoom/double tap',style: TextStyle(color: Colors.black,fontSize: 12),),),
basePosition: Alignment.center, SizedBox(height:MediaQuery.of(context).size.height * .02,),
Expanded(
child: PhotoView(
imageProvider: NetworkImage(widget.imageDetails) as ImageProvider,
maxScale: PhotoViewComputedScale.contained * 4.0,
minScale: PhotoViewComputedScale.contained,
initialScale: PhotoViewComputedScale.contained,
basePosition: Alignment.center,
),
)
],
) )
), ),

@ -1,15 +1,415 @@
import 'dart:convert';
import 'package:flutter/material.dart'; 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 { class EditMedicineTimings extends StatefulWidget {
const EditMedicineTimings({Key? key}) : super(key: key);
var medicineTimings;
EditMedicineTimings({this.medicineTimings});
@override @override
State<EditMedicineTimings> createState() => _EditMedicineTimingsState(); State<EditMedicineTimings> createState() => _EditMedicineTimingsState();
} }
class _EditMedicineTimingsState extends State<EditMedicineTimings> { 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 @override
Widget build(BuildContext context) { 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:flutter/material.dart';
import 'package:healthcare_user/common/settings.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 { class HowAreYouFellingToday extends StatefulWidget {
@ -18,21 +18,179 @@ class _HowAreYouFellingTodayState extends State<HowAreYouFellingToday> {
body: Container( body: Container(
child: Padding( child: Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: TextButton( child: Column(
child: const Text( crossAxisAlignment: CrossAxisAlignment.center,
'Report a problem!', mainAxisAlignment: MainAxisAlignment.center,
style: TextStyle(fontSize: 15, children: [
decoration: TextDecoration.underline,color: greyColor), /*TextButton(
), child: const Text(
onPressed: () { 'Report a problem!',
Navigator.push( style: TextStyle(fontSize: 15,
context, decoration: TextDecoration.underline,color: greyColor),
MaterialPageRoute( ),
builder: (context) => const ReportMySelf()), onPressed: () {
); Navigator.push(
//signup screen context,
}, MaterialPageRoute(
), builder: (context) => const ReportMySelf()),
);
//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["phone"] = mobileNumberController.text;
payload["dateAndTime"] = formattedDate; payload["dateAndTime"] = formattedDate;
bool invitationStatus = await AppSettings.inviteFriend(payload); 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["phone"] = stringAfterRemovingWhiteSpace;
payload["dateAndTime"] = formattedDate; payload["dateAndTime"] = formattedDate;
bool invitationStatus = await AppSettings.inviteFriend(payload); 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'; import 'package:intl/intl.dart';
@ -7,8 +6,11 @@ class BmiHistoryModel {
String height= ''; String height= '';
String weight= ''; String weight= '';
String date= ''; String date= '';
String actualDate= '';
String displayDate=''; String displayDate='';
DateTime dateForFilter=new DateTime.now(); DateTime dateForFilter=new DateTime.now();
String bmiInfoId = '';
String bmiText = '';
var number1; var number1;
var number2; var number2;
@ -18,7 +20,7 @@ class BmiHistoryModel {
factory BmiHistoryModel.fromJson(Map<String, dynamic> json){ factory BmiHistoryModel.fromJson(Map<String, dynamic> json){
BmiHistoryModel rtvm = new BmiHistoryModel(); BmiHistoryModel rtvm = new BmiHistoryModel();
/*"heightUnit": "feet", /*"heightUnit": "feet",
"weightUnit": "kg", "weightUnit": "kg",oh
"_id": "6493fe48eca67b71b8444e24", "_id": "6493fe48eca67b71b8444e24",
"bmiinfoid": "BMI1687420488845468", "bmiinfoid": "BMI1687420488845468",
"customerId": "AHSUSNE2", "customerId": "AHSUSNE2",
@ -30,18 +32,26 @@ class BmiHistoryModel {
"updatedAt": "2023-06-22T07:54:48.847Z",*/ "updatedAt": "2023-06-22T07:54:48.847Z",*/
rtvm.bmiValue = json['bmivalue'].toString() ?? ''; rtvm.bmiValue = json['bmivalue'].toString() ?? '';
rtvm.bmiInfoId = json['bmiinfoid'].toString() ?? '';
rtvm.height = json['height'].toString() ?? ''; rtvm.height = json['height'].toString() ?? '';
rtvm.weight = json['weight'].toString() ?? ''; rtvm.weight = json['weight'].toString() ?? '';
rtvm.number1 = double.parse( rtvm.bmiValue); rtvm.number1 = double.parse( rtvm.bmiValue);
rtvm.number2 = double.parse( rtvm.bmiValue); rtvm.number2 = double.parse( rtvm.bmiValue);
rtvm.date = json['createdAt'].toString() ?? ''; rtvm.date = json['createdAt'].toString() ?? '';
rtvm.actualDate = json['date'].toString() ?? '';
//DateTime tempDate = new DateFormat("yyyy-MM-dd hh:mm:ss").parse(rtvm.date); rtvm.dateForFilter = DateFormat('dd-MM-yyyy').parse(rtvm.actualDate);
DateTime parseDate = new DateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").parse(rtvm.date); if(double.parse(rtvm.bmiValue)<18.5){
var outputFormat = DateFormat('MM/dd/yyyy hh:mm a'); rtvm.bmiText='Underweight';
rtvm.dateForFilter=parseDate; }
var outputDate = outputFormat.format(parseDate); else if(double.parse(rtvm.bmiValue)>=18.5&&double.parse(rtvm.bmiValue)<=24.9){
rtvm.displayDate=outputDate; 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; return rtvm;

@ -7,7 +7,9 @@ class BPHistoryModel {
String systolic= ''; String systolic= '';
String diastolic= ''; String diastolic= '';
String date= ''; String date= '';
String bpId= '';
String displayDate=''; String displayDate='';
String actualDate='';
DateTime dateForFilter=new DateTime.now(); DateTime dateForFilter=new DateTime.now();
@ -15,29 +17,15 @@ class BPHistoryModel {
factory BPHistoryModel.fromJson(Map<String, dynamic> json){ factory BPHistoryModel.fromJson(Map<String, dynamic> json){
BPHistoryModel rtvm = new BPHistoryModel(); 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.bpText = json['bpCategory'].toString() ?? '';
rtvm.systolic = json['Systolic'].toString() ?? ''; rtvm.systolic = json['Systolic'].toString() ?? '';
rtvm.diastolic = json['Diastolic'].toString() ?? ''; rtvm.diastolic = json['Diastolic'].toString() ?? '';
rtvm.date = json['createdAt'].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); rtvm.dateForFilter = DateFormat('dd-MM-yyyy').parse(rtvm.actualDate);
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;
return rtvm; return rtvm;

@ -9,6 +9,8 @@ class SugarHistoryModel {
String postPrandial= ''; String postPrandial= '';
String date= ''; String date= '';
String displayDate=''; String displayDate='';
String actualDate='';
String sugarInfoId='';
DateTime dateForFilter=new DateTime.now(); DateTime dateForFilter=new DateTime.now();
@ -16,30 +18,18 @@ class SugarHistoryModel {
factory SugarHistoryModel.fromJson(Map<String, dynamic> json){ factory SugarHistoryModel.fromJson(Map<String, dynamic> json){
SugarHistoryModel rtvm = new SugarHistoryModel(); 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.sugartText = json['sugarCategory'].toString() ?? '';
rtvm.sugarValue = json['sugarValue'].toString() ?? ''; rtvm.sugarValue = json['sugarValue'].toString() ?? '';
rtvm.fasting = json['fasting'].toString() ?? ''; rtvm.fasting = json['fasting'].toString() ?? '';
rtvm.postPrandial = json['postPrandial'].toString() ?? ''; rtvm.postPrandial = json['postPrandial'].toString() ?? '';
rtvm.date = json['createdAt'].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 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); rtvm.dateForFilter = DateFormat('dd-MM-yyyy').parse(rtvm.actualDate);
var outputFormat = DateFormat('MM/dd/yyyy hh:mm a');
rtvm.dateForFilter=parseDate;
var outputDate = outputFormat.format(parseDate);
rtvm.displayDate=outputDate;
return rtvm; return rtvm;

@ -422,68 +422,74 @@ class _MyHealthState extends State<MyHealth> {
], ],
), ),
)), )),
Card( Visibility(
visible: false,
child: Card(
child: Padding( child: Padding(
padding: EdgeInsets.all(3), padding: EdgeInsets.all(3),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Container( Container(
width: MediaQuery.of(context).size.width * .30, width: MediaQuery.of(context).size.width * .30,
child: Text('Cholesterol'), ), child: Text('Cholesterol'), ),
IconButton( IconButton(
onPressed: () {}, onPressed: () {},
icon: Icon( icon: Icon(
Icons.add, Icons.add,
color: greyColor, color: greyColor,
), ),
) )
], ],
),
)),
Card(
child: Padding(
padding: EdgeInsets.all(3),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
width: MediaQuery.of(context).size.width * .30,
child: Text('Habbits'),
), ),
)),),
IconButton( Visibility(
onPressed: () {}, visible: false,
icon: Icon( child: Card(
Icons.add,
color: greyColor,
),
)
],
),
)),
Card(
child: Padding( child: Padding(
padding: EdgeInsets.all(3), padding: EdgeInsets.all(3),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Container( Container(
width: MediaQuery.of(context).size.width * .30, width: MediaQuery.of(context).size.width * .30,
child: Text('Allergies'), child: Text('Habbits'),
),
IconButton(
onPressed: () {},
icon: Icon(
Icons.add,
color: greyColor,
),
)
],
), ),
))),
Visibility(
visible: false,
child: Card(
child: Padding(
padding: EdgeInsets.all(3),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
width: MediaQuery.of(context).size.width * .30,
child: Text('Allergies'),
),
IconButton( IconButton(
onPressed: () {}, onPressed: () {},
icon: Icon( icon: Icon(
Icons.add, Icons.add,
color: greyColor, color: greyColor,
), ),
) )
], ],
), ),
)) )))
], ],
), ),
), ),

@ -1,4 +1,5 @@
import 'dart:convert'; import 'dart:convert';
import 'package:healthcare_user/edit_medicine_timings.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:healthcare_user/common/settings.dart'; import 'package:healthcare_user/common/settings.dart';
@ -321,38 +322,43 @@ class _MyMedicineTimingsState extends State<MyMedicineTimings> {
//padding: EdgeInsets.all(8), //padding: EdgeInsets.all(8),
itemCount: timings.length, itemCount: timings.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Padding( return GestureDetector(
padding: EdgeInsets.all(10), onTap: (){
child: Container( AppSettings.longSuccessToast('Please click on edit button');
padding: EdgeInsets.fromLTRB(8, 8, 0, 0), },
child: Column( child: Padding(
mainAxisAlignment: MainAxisAlignment.start, padding: EdgeInsets.all(10),
crossAxisAlignment: CrossAxisAlignment.start, child: Container(
children: [ padding: EdgeInsets.fromLTRB(8, 8, 0, 0),
Row( child: Column(
children: [ mainAxisAlignment: MainAxisAlignment.start,
Container( crossAxisAlignment: CrossAxisAlignment.start,
width: children: [
MediaQuery.of(context).size.width * .40, Row(
child: Text( children: [
timings[index]['name'], Container(
style: wrapTextStyle(), width:
MediaQuery.of(context).size.width * .40,
child: Text(
timings[index]['name'],
style: wrapTextStyle(),
),
), ),
), GestureDetector(
GestureDetector( onTap: () {
onTap: () { },
}, child: Image(
child: Image( image: AssetImage('images/time.png'),
image: AssetImage('images/time.png'), width: 30,
width: 30, height: 30,
height: 30, ),
), ),
), textForSelectedTime(index)
textForSelectedTime(index) ],
], ),
), ],
], )),
)), ),
); );
})), })),
Padding(padding: EdgeInsets.fromLTRB(10, 10, 10, 40), Padding(padding: EdgeInsets.fromLTRB(10, 10, 10, 40),
@ -365,10 +371,14 @@ class _MyMedicineTimingsState extends State<MyMedicineTimings> {
), ),
onPressed: () async { onPressed: () async {
editTimingsDialog(); //editTimingsDialog();
/*Navigator.push(context, MaterialPageRoute(builder: (context) => EditMedicineTimings())).then((value) {
Navigator.push(
context,
new MaterialPageRoute(
builder: (__) => new EditMedicineTimings(medicineTimings:medicineTimings,))).then((value) {
getMedicineTimingsList(); getMedicineTimingsList();
});*/ });
}, },
child: const Text('Edit'), child: const Text('Edit'),
), ),
@ -616,265 +626,6 @@ class _MyMedicineTimingsState extends State<MyMedicineTimings> {
return Scaffold( return Scaffold(
appBar: AppSettings.appBar('My medicine timings'), appBar: AppSettings.appBar('My medicine timings'),
body: medicineTimings.length==0?renderUi():renderTimings(), 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, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ 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(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: prescriptions(widget.prescriptionDetails), child: prescriptions(widget.prescriptionDetails),
@ -1260,7 +1309,10 @@ class _OrderMedicinesState extends State<OrderMedicines> {
items: AreaItems.map((String items) { items: AreaItems.map((String items) {
return DropdownMenuItem( return DropdownMenuItem(
value: items, value: items,
child: Text(items,style: TextStyle(fontSize: 12),), child: Text(
items,
style: TextStyle(fontSize: 12),
),
); );
}).toList(), }).toList(),
// After selecting the desired option,it will // After selecting the desired option,it will

@ -656,17 +656,11 @@ class _PrescriptionsState extends State<Prescriptions> {
payload["url"] = obj.prescriptionImages[index]['url']; payload["url"] = obj.prescriptionImages[index]['url'];
try { try {
var res = await AppSettings var res = await AppSettings.deleteRecordsNew(payload, obj.recordId);
.deleteRecordsNew(
payload,
obj.recordId);
print(jsonDecode(res)); print(jsonDecode(res));
Navigator.of(context, Navigator.of(context, rootNavigator: true).pop();
rootNavigator: true)
.pop();
Navigator.of(context).pop(true); Navigator.of(context).pop(true);
AppSettings.longSuccessToast( AppSettings.longSuccessToast("Image deleted Successfully");
"Image deleted Successfully");
setState(() { setState(() {
obj.prescriptionImages = obj.prescriptionImages =
jsonDecode( 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 FlutterMacOS
import Foundation import Foundation
import assets_audio_player
import assets_audio_player_web
import cloud_firestore import cloud_firestore
import device_info_plus_macos import device_info_plus_macos
import file_selector_macos import file_selector_macos
@ -14,10 +16,14 @@ import flutter_local_notifications
import geolocator_apple import geolocator_apple
import location import location
import package_info_plus_macos import package_info_plus_macos
import path_provider_foundation
import shared_preferences_foundation import shared_preferences_foundation
import url_launcher_macos import url_launcher_macos
import wakelock_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 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")) FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
@ -27,6 +33,8 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin")) GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
LocationPlugin.register(with: registry.registrar(forPlugin: "LocationPlugin")) LocationPlugin.register(with: registry.registrar(forPlugin: "LocationPlugin"))
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
WakelockMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockMacosPlugin"))
} }

@ -22,6 +22,20 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.4.1" 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: async:
dependency: transitive dependency: transitive
description: description:
@ -37,14 +51,14 @@ packages:
source: hosted source: hosted
version: "2.1.0" version: "2.1.0"
card_swiper: card_swiper:
dependency: "direct dev" dependency: "direct main"
description: description:
name: card_swiper name: card_swiper
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.4" version: "2.0.4"
carousel_slider: carousel_slider:
dependency: "direct dev" dependency: "direct main"
description: description:
name: carousel_slider name: carousel_slider
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -57,6 +71,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.1" version: "1.2.1"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
charts_common: charts_common:
dependency: transitive dependency: transitive
description: description:
@ -65,7 +86,7 @@ packages:
source: hosted source: hosted
version: "0.12.0" version: "0.12.0"
charts_flutter: charts_flutter:
dependency: "direct dev" dependency: "direct main"
description: description:
name: charts_flutter name: charts_flutter
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -93,7 +114,7 @@ packages:
source: hosted source: hosted
version: "1.1.1" version: "1.1.1"
cloud_firestore: cloud_firestore:
dependency: "direct dev" dependency: "direct main"
description: description:
name: cloud_firestore name: cloud_firestore
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -114,7 +135,7 @@ packages:
source: hosted source: hosted
version: "3.7.1" version: "3.7.1"
cloudinary_public: cloudinary_public:
dependency: "direct dev" dependency: "direct main"
description: description:
name: cloudinary_public name: cloudinary_public
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -163,14 +184,14 @@ packages:
source: hosted source: hosted
version: "1.0.5" version: "1.0.5"
date_time_picker: date_time_picker:
dependency: "direct dev" dependency: "direct main"
description: description:
name: date_time_picker name: date_time_picker
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0" version: "2.1.0"
day_night_time_picker: day_night_time_picker:
dependency: "direct dev" dependency: "direct main"
description: description:
name: day_night_time_picker name: day_night_time_picker
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -184,7 +205,7 @@ packages:
source: hosted source: hosted
version: "0.7.4" version: "0.7.4"
device_info_plus: device_info_plus:
dependency: "direct dev" dependency: "direct main"
description: description:
name: device_info_plus name: device_info_plus
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -226,21 +247,21 @@ packages:
source: hosted source: hosted
version: "2.1.1" version: "2.1.1"
device_information: device_information:
dependency: "direct dev" dependency: "direct main"
description: description:
name: device_information name: device_information
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.0.4" version: "0.0.4"
dio: dio:
dependency: "direct dev" dependency: "direct main"
description: description:
name: dio name: dio
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.3.3" version: "5.3.3"
dots_indicator: dots_indicator:
dependency: "direct dev" dependency: "direct main"
description: description:
name: dots_indicator name: dots_indicator
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -317,7 +338,7 @@ packages:
source: hosted source: hosted
version: "2.8.0" version: "2.8.0"
firebase_messaging: firebase_messaging:
dependency: "direct dev" dependency: "direct main"
description: description:
name: firebase_messaging name: firebase_messaging
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -337,27 +358,34 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.5.7" 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: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_cupertino_datetime_picker: flutter_cupertino_datetime_picker:
dependency: "direct dev" dependency: "direct main"
description: description:
name: flutter_cupertino_datetime_picker name: flutter_cupertino_datetime_picker
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.0" version: "3.0.0"
flutter_datetime_picker: flutter_datetime_picker:
dependency: "direct dev" dependency: "direct main"
description: description:
name: flutter_datetime_picker name: flutter_datetime_picker
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.5.1" version: "1.5.1"
flutter_device_type: flutter_device_type:
dependency: "direct dev" dependency: "direct main"
description: description:
name: flutter_device_type name: flutter_device_type
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -378,7 +406,7 @@ packages:
source: hosted source: hosted
version: "2.0.2" version: "2.0.2"
flutter_local_notifications: flutter_local_notifications:
dependency: "direct dev" dependency: "direct main"
description: description:
name: flutter_local_notifications name: flutter_local_notifications
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -399,7 +427,7 @@ packages:
source: hosted source: hosted
version: "5.0.0" version: "5.0.0"
flutter_native_contact_picker: flutter_native_contact_picker:
dependency: "direct dev" dependency: "direct main"
description: description:
name: flutter_native_contact_picker name: flutter_native_contact_picker
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -413,12 +441,40 @@ packages:
source: hosted source: hosted
version: "2.0.15" version: "2.0.15"
flutter_polyline_points: flutter_polyline_points:
dependency: "direct dev" dependency: "direct main"
description: description:
name: flutter_polyline_points name: flutter_polyline_points
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0" 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: flutter_svg:
dependency: "direct main" dependency: "direct main"
description: description:
@ -444,14 +500,14 @@ packages:
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
fluttertoast: fluttertoast:
dependency: "direct dev" dependency: "direct main"
description: description:
name: fluttertoast name: fluttertoast
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "8.2.2" version: "8.2.2"
geocoding: geocoding:
dependency: "direct dev" dependency: "direct main"
description: description:
name: geocoding name: geocoding
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -521,7 +577,7 @@ packages:
source: hosted source: hosted
version: "0.1.3" version: "0.1.3"
get: get:
dependency: "direct dev" dependency: "direct main"
description: description:
name: get name: get
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -577,7 +633,7 @@ packages:
source: hosted source: hosted
version: "0.5.3" version: "0.5.3"
google_maps_place_picker_mb: google_maps_place_picker_mb:
dependency: "direct dev" dependency: "direct main"
description: description:
name: google_maps_place_picker_mb name: google_maps_place_picker_mb
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -619,7 +675,7 @@ packages:
source: hosted source: hosted
version: "3.3.0" version: "3.3.0"
image_picker: image_picker:
dependency: "direct dev" dependency: "direct main"
description: description:
name: image_picker name: image_picker
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -675,7 +731,7 @@ packages:
source: hosted source: hosted
version: "0.2.1" version: "0.2.1"
intl: intl:
dependency: "direct dev" dependency: "direct main"
description: description:
name: intl name: intl
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -730,6 +786,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.1.1" version: "3.1.1"
logger:
dependency: transitive
description:
name: logger
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.0"
logging: logging:
dependency: transitive dependency: transitive
description: description:
@ -766,7 +829,7 @@ packages:
source: hosted source: hosted
version: "1.0.4" version: "1.0.4"
multi_image_picker: multi_image_picker:
dependency: "direct dev" dependency: "direct main"
description: description:
name: multi_image_picker name: multi_image_picker
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -780,7 +843,7 @@ packages:
source: hosted source: hosted
version: "1.0.0" version: "1.0.0"
overlay_support: overlay_support:
dependency: "direct dev" dependency: "direct main"
description: description:
name: overlay_support name: overlay_support
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -829,7 +892,7 @@ packages:
source: hosted source: hosted
version: "1.0.5" version: "1.0.5"
path: path:
dependency: transitive dependency: "direct main"
description: description:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -849,6 +912,27 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.1" 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: path_provider_linux:
dependency: transitive dependency: transitive
description: description:
@ -871,7 +955,7 @@ packages:
source: hosted source: hosted
version: "2.0.7" version: "2.0.7"
permission_handler: permission_handler:
dependency: "direct dev" dependency: "direct main"
description: description:
name: permission_handler name: permission_handler
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -913,14 +997,14 @@ packages:
source: hosted source: hosted
version: "5.1.0" version: "5.1.0"
photo_view: photo_view:
dependency: "direct dev" dependency: "direct main"
description: description:
name: photo_view name: photo_view
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.14.0" version: "0.14.0"
pinch_zoom: pinch_zoom:
dependency: "direct dev" dependency: "direct main"
description: description:
name: pinch_zoom name: pinch_zoom
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -961,6 +1045,20 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.0.5" 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: sanitize_html:
dependency: transitive dependency: transitive
description: description:
@ -969,7 +1067,7 @@ packages:
source: hosted source: hosted
version: "2.1.0" version: "2.1.0"
shared_preferences: shared_preferences:
dependency: "direct dev" dependency: "direct main"
description: description:
name: shared_preferences name: shared_preferences
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -1018,7 +1116,7 @@ packages:
source: hosted source: hosted
version: "2.3.0" version: "2.3.0"
sizer: sizer:
dependency: "direct dev" dependency: "direct main"
description: description:
name: sizer name: sizer
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -1064,6 +1162,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.1" version: "1.1.1"
synchronized:
dependency: transitive
description:
name: synchronized
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.0"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
@ -1099,6 +1204,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.2" 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: universal_io:
dependency: transitive dependency: transitive
description: description:
@ -1107,7 +1219,7 @@ packages:
source: hosted source: hosted
version: "2.2.0" version: "2.2.0"
url_launcher: url_launcher:
dependency: "direct dev" dependency: "direct main"
description: description:
name: url_launcher name: url_launcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -1176,6 +1288,83 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.2" 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: win32:
dependency: transitive dependency: transitive
description: description:

@ -11,30 +11,20 @@ dependencies:
sdk: flutter sdk: flutter
cupertino_icons: ^1.0.2 cupertino_icons: ^1.0.2
location: ^4.4.0 location: ^4.4.0
geolocator: ^9.0.2 geolocator: ^9.0.2
google_api_headers: ^1.2.0 google_api_headers: ^1.2.0
google_maps_flutter: ^2.2.3 google_maps_flutter: ^2.2.3
google_maps_webservice: ^0.0.20-nullsafety.5 google_maps_webservice: ^0.0.20-nullsafety.5
http: ^0.13.5
provider: ^6.0.5 provider: ^6.0.5
tuple: ^2.0.1 tuple: ^2.0.1
uuid: ^3.0.7 uuid: ^3.0.7
flutter_svg_provider: ^1.0.3 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 http: ^0.13.5
shared_preferences: ^2.0.15 shared_preferences: ^2.0.15
sizer: ^2.0.11 sizer: ^2.0.11
geolocator: ^9.0.2
geocoding: ^2.0.4 geocoding: ^2.0.4
image_picker: ^0.8.6+1 image_picker: ^0.8.6+1
flutter_launcher_icons: ^0.11.0
url_launcher: ^6.1.9 url_launcher: ^6.1.9
intl: ^0.17.0 intl: ^0.17.0
flutter_svg: ^1.0.1 flutter_svg: ^1.0.1
@ -51,10 +41,8 @@ dev_dependencies:
device_info_plus: ^3.2.4 device_info_plus: ^3.2.4
overlay_support: ^2.1.0 overlay_support: ^2.1.0
dio: ^5.1.1 dio: ^5.1.1
google_maps_flutter: ^2.2.5
flutter_polyline_points: ^1.0.0 flutter_polyline_points: ^1.0.0
get: ^4.6.5 get: ^4.6.5
location: ^4.4.0
permission_handler: ^10.2.0 permission_handler: ^10.2.0
cloudinary_public: ^0.21.0 cloudinary_public: ^0.21.0
carousel_slider: ^4.2.1 carousel_slider: ^4.2.1
@ -66,6 +54,21 @@ dev_dependencies:
multi_image_picker: ^4.8.1 multi_image_picker: ^4.8.1
charts_flutter: ^0.12.0 charts_flutter: ^0.12.0
flutter_native_contact_picker: ^0.0.4 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: flutter_icons:
image_path_ios: 'images/appicon.png' image_path_ios: 'images/appicon.png'

Loading…
Cancel
Save