diff --git a/images/profile_pic.png b/images/profile_pic.png index 3fd3f73..d8b670e 100644 Binary files a/images/profile_pic.png and b/images/profile_pic.png differ diff --git a/lib/BMI/bmi_history.dart b/lib/BMI/bmi_history.dart index 256824d..a07f870 100644 --- a/lib/BMI/bmi_history.dart +++ b/lib/BMI/bmi_history.dart @@ -1,9 +1,12 @@ import 'dart:convert'; +import 'package:healthcare_user/chart/bmi_chart.dart'; import 'package:intl/intl.dart'; import 'package:flutter/material.dart'; import 'package:healthcare_user/models/bmi_history_model.dart'; import 'package:healthcare_user/common/settings.dart'; +import '../chart/bpchart.dart'; + class BMIHistory extends StatefulWidget { const BMIHistory({Key? key}) : super(key: key); @@ -12,8 +15,7 @@ class BMIHistory extends StatefulWidget { } class _BMIHistoryState extends State { - - bool isLoading=false; + bool isLoading = false; List bmiHistoryList = []; List FilteredList = []; var dateItems = [ @@ -21,47 +23,42 @@ class _BMIHistoryState extends State { 'last one month', 'last one year', ]; - var dateItemsVariable = 'last 7 days'; + var dateItemsVariable = 'last 7 days'; Future getBmiHistoryDetails(var selectedRange) async { - isLoading=true; - var response1= await AppSettings.getBmiHistory(); + isLoading = true; + var response1 = await AppSettings.getBmiHistory(); print(response1); setState(() { - bmiHistoryList = - ((jsonDecode(response1)) as List).map((dynamic model) { - return BmiHistoryModel.fromJson(model); - }).toList(); + bmiHistoryList = ((jsonDecode(response1)) as List).map((dynamic model) { + return BmiHistoryModel.fromJson(model); + }).toList(); var now = new DateTime.now(); var now_1w = now.subtract(Duration(days: 7)); - var now_1m = new DateTime(now.year, now.month-1, now.day); - var now_1y = new DateTime(now.year-1, now.month, now.day); + var now_1m = new DateTime(now.year, now.month - 1, now.day); + var now_1y = new DateTime(now.year - 1, now.month, now.day); - if(selectedRange.toString().toUpperCase()=='LAST 7 DAYS'){ - FilteredList=bmiHistoryList.where((product) { + if (selectedRange.toString().toUpperCase() == 'LAST 7 DAYS') { + FilteredList = bmiHistoryList.where((product) { final date = product.dateForFilter; return now_1w.isBefore(date); }).toList(); - } - else if(selectedRange.toString().toUpperCase()=='LAST ONE MONTH'){ - FilteredList=bmiHistoryList.where((product) { + } else if (selectedRange.toString().toUpperCase() == 'LAST ONE MONTH') { + FilteredList = bmiHistoryList.where((product) { final date = product.dateForFilter; return now_1m.isBefore(date); }).toList(); - } - else if(selectedRange.toString().toUpperCase()=='LAST ONE YEAR'){ - FilteredList=bmiHistoryList.where((product) { + } else if (selectedRange.toString().toUpperCase() == 'LAST ONE YEAR') { + FilteredList = bmiHistoryList.where((product) { final date = product.dateForFilter; return now_1y.isBefore(date); }).toList(); + } else { + FilteredList = bmiHistoryList; } - else{ - FilteredList=bmiHistoryList; - } - - isLoading=false; + isLoading = false; }); } @@ -71,76 +68,91 @@ class _BMIHistoryState extends State { super.initState(); } - Widget renderzUi(){ - if(bmiHistoryList.length!=0){ - - return Column( - crossAxisAlignment: CrossAxisAlignment.end, - 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 - ), + Widget renderzUi() { + if (bmiHistoryList.length != 0) { + return Column(crossAxisAlignment: CrossAxisAlignment.end, 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'), - // Down Arrow Icon - //icon: const Icon(Icons.keyboard_arrow_down), + hint: Text('Units'), + // 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!; - }); - getBmiHistoryDetails(dateItemsVariable); - }, - ),), - - Expanded(child:ListView.builder( - padding: EdgeInsets.all(0), + // 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!; + }); + getBmiHistoryDetails(dateItemsVariable); + }, + ), + ), + IconButton( + onPressed: () { + /*Navigator.push( + context, + MaterialPageRoute( + builder: (context) => BmiChart()), + );*/ + Navigator.push( + context, + new MaterialPageRoute( + builder: (__) => new BmiChart(myObject: FilteredList))); + // showBMIAdddialog(); + }, + icon: Icon( + Icons.auto_graph, + color: primaryColor, + ), + ), + Expanded( + child: ListView.builder( + padding: EdgeInsets.all(0), itemCount: FilteredList.length, itemBuilder: (BuildContext context, int index) { return Card( - color: Colors.white, child: Padding( - padding:EdgeInsets.all(8) , + padding: EdgeInsets.all(8), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Container( width: MediaQuery.of(context).size.width * .55, child: Column( @@ -152,13 +164,21 @@ class _BMIHistoryState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Image( - image: const AssetImage('images/height.png'), + image: const AssetImage( + 'images/height.png'), height: 25, width: 25, fit: BoxFit.fill), - Padding(padding: EdgeInsets.all(5), - child: Text(FilteredList[index].height.toString().toUpperCase()+' ft',style: valuesTextStyle()),) - + Padding( + padding: EdgeInsets.all(5), + child: Text( + FilteredList[index] + .height + .toString() + .toUpperCase() + + ' ft', + style: valuesTextStyle()), + ) ], ), Row( @@ -166,13 +186,21 @@ class _BMIHistoryState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Image( - image: const AssetImage('images/weight.png'), + image: const AssetImage( + 'images/weight.png'), height: 25, width: 25, fit: BoxFit.fill), - Padding(padding: EdgeInsets.all(5), - child: Text(FilteredList[index].weight.toString().toUpperCase()+' Kgs',style: valuesTextStyle()),) - + Padding( + padding: EdgeInsets.all(5), + child: Text( + FilteredList[index] + .weight + .toString() + .toUpperCase() + + ' Kgs', + style: valuesTextStyle()), + ) ], ), Row( @@ -180,13 +208,20 @@ class _BMIHistoryState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Image( - image: const AssetImage('images/date.png'), + image: + const AssetImage('images/date.png'), height: 25, width: 25, fit: BoxFit.fill), - Padding(padding: EdgeInsets.all(5), - child: Text(FilteredList[index].displayDate.toString().toUpperCase(),style: valuesTextStyle()),) - + Padding( + padding: EdgeInsets.all(5), + child: Text( + FilteredList[index] + .displayDate + .toString() + .toUpperCase(), + style: valuesTextStyle()), + ) ], ), Row( @@ -194,61 +229,60 @@ class _BMIHistoryState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Image( - image: const AssetImage('images/weight.png'), + image: const AssetImage( + 'images/weight.png'), height: 25, width: 25, fit: BoxFit.fill), - Padding(padding: EdgeInsets.all(5), - child: Text(FilteredList[index].bmiValue.toString().toUpperCase(),style: valuesTextStyle()),) - + Padding( + padding: EdgeInsets.all(5), + child: Text( + FilteredList[index] + .bmiValue + .toString() + .toUpperCase(), + style: valuesTextStyle()), + ) ], ), - - ], ), - - ), - ], - ), ), ); - }) ), - ]); - } - else{ - return Center( + })), + ]); + } else { + return Center( child: Padding( - padding: EdgeInsets.fromLTRB(0, 40, 0, 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox(height: MediaQuery.of(context).size.height * .25,), - 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 { - - }, - ), - ) - ], + padding: EdgeInsets.fromLTRB(0, 40, 0, 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: MediaQuery.of(context).size.height * .25, + ), + 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 {}, + ), + ) + ], + ), + )); } } @@ -256,12 +290,14 @@ class _BMIHistoryState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppSettings.appBar('Body Mass Index'), - body: isLoading?Center( - child: CircularProgressIndicator( - color: primaryColor, - strokeWidth: 5.0, - ), - ):renderzUi(), + body: isLoading + ? Center( + child: CircularProgressIndicator( + color: primaryColor, + strokeWidth: 5.0, + ), + ) + : renderzUi(), ); } } diff --git a/lib/BP/bp_history.dart b/lib/BP/bp_history.dart index eb5dcbb..ece8c03 100644 --- a/lib/BP/bp_history.dart +++ b/lib/BP/bp_history.dart @@ -1,5 +1,6 @@ import 'dart:convert'; import 'package:flutter/material.dart'; +import 'package:healthcare_user/chart/bpchart.dart'; import 'package:healthcare_user/models/bmi_history_model.dart'; import 'package:healthcare_user/common/settings.dart'; import 'package:healthcare_user/models/bp_history_model.dart'; @@ -75,7 +76,7 @@ class _BPHistoryState extends State { if(BpHistoryList.length!=0){ return Column( - crossAxisAlignment: CrossAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding(padding: EdgeInsets.fromLTRB(10, 10, 10, 10), child: DropdownButtonFormField( @@ -127,6 +128,21 @@ class _BPHistoryState extends State { }, ),), + 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, diff --git a/lib/Reports/add_reports.dart b/lib/Reports/add_reports.dart new file mode 100644 index 0000000..539ab53 --- /dev/null +++ b/lib/Reports/add_reports.dart @@ -0,0 +1,674 @@ +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:intl/intl.dart'; +import 'package:image_picker/image_picker.dart'; +import 'package:multi_image_picker/multi_image_picker.dart'; + +class AddReports extends StatefulWidget { + const AddReports({Key? key}) : super(key: key); + + @override + State createState() => _AddReportsState(); +} + +class _AddReportsState extends State { + TextEditingController doctorNameController = TextEditingController(); + TextEditingController hospitalNameController = TextEditingController(); + TextEditingController problemController = TextEditingController(); + TextEditingController dateInput = TextEditingController(); + TextEditingController patientNameController = TextEditingController(); + TextEditingController patientAgeController = TextEditingController(); + final ImagePicker _picker = ImagePicker(); + String Url = ''; + final ImagePicker imagePicker = ImagePicker(); + List imageFileList = []; + List imageFileListReports = []; + List imageFileListPrescriptions = []; + List uiFindingsImages = []; + List uiReportsImages = []; + List uiPrescriptionImages = []; + + List images = []; + String _error = 'No Error Dectected'; + String apiMultiImages = ''; + String? prescriptionFor; + String? gender; + + Future pickImageFromGallery() async { + imageFileList = []; + final List? selectedImages = await imagePicker.pickMultiImage(); + AppSettings.preLoaderDialog(context); + if (selectedImages!.isNotEmpty) { + imageFileList.addAll(selectedImages); + } + + var res = await AppSettings.uploadImageForFindings(imageFileList); + print(jsonDecode(res)); + Navigator.of(context, rootNavigator: true).pop(); + setState(() { + uiFindingsImages = jsonDecode(res)['findings']; + }); + } + + 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.uploadImageForFindingsCamera(image); + print(jsonDecode(res)); + Navigator.of(context, rootNavigator: true).pop(); + setState(() { + uiFindingsImages = jsonDecode(res)['findings']; + }); + } on PlatformException catch (e) { + print('Failed to pick image: $e'); + } + } + + + Future takeImageFromCameraForReports() 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.uploadImageForFindingsCamera(image); + print(jsonDecode(res)); + Navigator.of(context, rootNavigator: true).pop(); + setState(() { + uiReportsImages = jsonDecode(res)['findings']; + }); + } on PlatformException catch (e) { + print('Failed to pick image: $e'); + } + } + + Future pickImageFromGalleryForReports() async { + imageFileListReports = []; + final List? selectedImages = await imagePicker.pickMultiImage(); + AppSettings.preLoaderDialog(context); + if (selectedImages!.isNotEmpty) { + imageFileListReports.addAll(selectedImages); + } + + var res = await AppSettings.uploadImageForReports(imageFileListReports); + print(jsonDecode(res)); + Navigator.of(context, rootNavigator: true).pop(); + setState(() { + uiReportsImages = jsonDecode(res)['reports']; + }); + } + + + Future takeImageFromCameraForPrescriptions() 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.uploadImageForFindingsCamera(image); + print(jsonDecode(res)); + Navigator.of(context, rootNavigator: true).pop(); + setState(() { + uiFindingsImages = jsonDecode(res)['findings']; + }); + } on PlatformException catch (e) { + print('Failed to pick image: $e'); + } + } + + Future pickImageFromGalleryForPrescriptions() async { + imageFileListPrescriptions = []; + final List? selectedImages = await imagePicker.pickMultiImage(); + AppSettings.preLoaderDialog(context); + if (selectedImages!.isNotEmpty) { + imageFileListPrescriptions.addAll(selectedImages); + } + + var res = await AppSettings.uploadImageForPrescriptions(imageFileListPrescriptions); + print(jsonDecode(res)); + Navigator.of(context, rootNavigator: true).pop(); + setState(() { + uiPrescriptionImages = jsonDecode(res)['precription']; + }); + } + + + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppSettings.appBar('Reports'), + body: SingleChildScrollView( + child: Container( + child: Padding( + padding: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: TextFormField( + cursorColor: greyColor, + controller: doctorNameController, + textCapitalization: TextCapitalization.words, + decoration: textFormFieldDecoration( + Icons.person, 'Enter Doctor name'), + ), + ), + SizedBox( + height: MediaQuery.of(context).size.height * .02, + ), + Container( + child: TextFormField( + cursorColor: greyColor, + controller: hospitalNameController, + textCapitalization: TextCapitalization.words, + decoration: textFormFieldDecoration( + Icons.location_city_outlined, 'Enter Hospital name'), + ), + ), + SizedBox( + height: MediaQuery.of(context).size.height * .02, + ), + Container( + child: TextFormField( + cursorColor: greyColor, + controller: problemController, + textCapitalization: TextCapitalization.words, + decoration: textFormFieldDecoration( + Icons.report_problem, 'Enter Problem'), + ), + ), + SizedBox( + height: MediaQuery.of(context).size.height * .02, + ), + Container( + child: TextFormField( + cursorColor: greyColor, + controller: dateInput, + decoration: textFormFieldDecoration( + 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 {} + }, + ), + ), + Row( + children: [ + + Expanded(child: RadioListTile( + title: Text("For Yourself"), + value: "self", + groupValue: prescriptionFor, + activeColor: primaryColor, + onChanged: (value){ + setState(() { + prescriptionFor = value.toString(); + }); + }, + ),), + Expanded(child: RadioListTile( + title: Text("For Family"), + value: "others", + groupValue: prescriptionFor, + activeColor: primaryColor, + onChanged: (value){ + setState(() { + prescriptionFor = value.toString(); + }); + }, + ),), + ], + ), + Visibility( + visible:prescriptionFor.toString().toLowerCase()=='others' , + child: Container( + child: TextFormField( + cursorColor: greyColor, + controller: patientNameController, + decoration: textFormFieldDecoration(Icons.person,'Enter patient name'), + + ), + ),), + SizedBox(height:MediaQuery.of(context).size.height * .02,), + Visibility( + visible:prescriptionFor.toString().toLowerCase()=='others' , + child: Container( + child: TextFormField( + cursorColor: greyColor, + keyboardType: TextInputType.number, + controller: patientAgeController, + decoration: textFormFieldDecoration(Icons.person,'Enter patient age'), + + ), + ),), + Visibility( + visible:prescriptionFor.toString().toLowerCase()=='others' , + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + Expanded(child: RadioListTile( + title: Text("Male",style: TextStyle(fontSize: 10)), + value: "male", + groupValue: gender, + activeColor: primaryColor, + onChanged: (value){ + setState(() { + gender = value.toString(); + }); + }, + ),), + Expanded(child: RadioListTile( + title: Text("Female",style: TextStyle(fontSize: 10),), + value: "female", + groupValue: gender, + activeColor: primaryColor, + onChanged: (value){ + setState(() { + gender = value.toString(); + }); + }, + ),), + Expanded(child: RadioListTile( + title: Text("Others",style: TextStyle(fontSize: 10)), + value: "other", + groupValue: gender, + activeColor: primaryColor, + onChanged: (value){ + setState(() { + gender = value.toString(); + }); + }, + ),), + ], + ),), + ElevatedButton( + style: ElevatedButton.styleFrom( + primary: primaryColor, // background + onPrimary: Colors.white, // foreground + ), + onPressed: () async { + showModalBottomSheet( + context: context, + builder: (BuildContext context) { + return SizedBox( + height: 200, + child: Center( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + 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); + }, + ), + ], + ), + ), + ); + }); + }, + child: const Text('Select Findings'), + ), + Visibility( + visible: uiFindingsImages.length > 0, + child: Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * .20, + child: ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: uiFindingsImages.length, + itemBuilder: (context, index) { + return Column( + children: [ + Card( + child: Container( + width: MediaQuery.of(context).size.width * .30, + height: MediaQuery.of(context).size.height * .15, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + image: DecorationImage( + image: NetworkImage( + uiFindingsImages[index] + ['url']) + as ImageProvider, // picked file + fit: BoxFit.fill)), + ), + ), + /*Expanded(child:IconButton( + icon: const Icon(Icons.remove,color: Colors.red,), + + onPressed: () async{ + + }, + ),)*/ + ], + ); + }), + )), + ElevatedButton( + style: ElevatedButton.styleFrom( + primary: primaryColor, // background + onPrimary: Colors.white, // foreground + ), + onPressed: () async { + showModalBottomSheet( + context: context, + builder: (BuildContext context) { + return SizedBox( + height: 200, + child: Center( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + GestureDetector( + child: Icon( + Icons.camera_alt_outlined, + size: 100, + color: primaryColor, + ), + onTap: () async { + await takeImageFromCameraForReports(); + Navigator.pop(context); + }, + ), + SizedBox( + width: MediaQuery.of(context).size.width * + .20, + ), + GestureDetector( + child: Icon( + Icons.photo, + size: 100, + color: primaryColor, + ), + onTap: () async { + await pickImageFromGalleryForReports(); + Navigator.pop(context); + }, + ), + ], + ), + ), + ); + }); + }, + child: const Text('Select Reports'), + ), + Visibility( + visible: uiReportsImages.length > 0, + child: Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * .20, + child: ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: uiReportsImages.length, + itemBuilder: (context, index) { + return Column( + children: [ + Card( + child: Container( + width: MediaQuery.of(context).size.width * .30, + height: MediaQuery.of(context).size.height * .15, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + image: DecorationImage( + image: NetworkImage( + uiReportsImages[index] + ['url']) + as ImageProvider, // picked file + fit: BoxFit.fill)), + ), + ), + /*Expanded(child:IconButton( + icon: const Icon(Icons.remove,color: Colors.red,), + + onPressed: () async{ + + }, + ),)*/ + ], + ); + }), + )), + ElevatedButton( + style: ElevatedButton.styleFrom( + primary: primaryColor, // background + onPrimary: Colors.white, // foreground + ), + onPressed: () async { + showModalBottomSheet( + context: context, + builder: (BuildContext context) { + return SizedBox( + height: 200, + child: Center( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + GestureDetector( + child: Icon( + Icons.camera_alt_outlined, + size: 100, + color: primaryColor, + ), + onTap: () async { + await takeImageFromCameraForPrescriptions(); + Navigator.pop(context); + }, + ), + SizedBox( + width: MediaQuery.of(context).size.width * + .20, + ), + GestureDetector( + child: Icon( + Icons.photo, + size: 100, + color: primaryColor, + ), + onTap: () async { + await pickImageFromGalleryForPrescriptions(); + Navigator.pop(context); + }, + ), + ], + ), + ), + ); + }); + }, + child: const Text('Select Prescriptions'), + ), + + Visibility( + visible: uiPrescriptionImages.length > 0, + child: Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * .20, + child: ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: uiPrescriptionImages.length, + itemBuilder: (context, index) { + return Column( + children: [ + Card( + child: Container( + width: MediaQuery.of(context).size.width * .30, + height: MediaQuery.of(context).size.height * .15, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + image: DecorationImage( + image: NetworkImage( + uiPrescriptionImages[index] + ['url']) + as ImageProvider, // picked file + fit: BoxFit.fill)), + ), + ), + /*Expanded(child:IconButton( + icon: const Icon(Icons.remove,color: Colors.red,), + + onPressed: () async{ + + }, + ),)*/ + ], + ); + }), + )), + + Container( + width:double.infinity, + height: MediaQuery.of(context).size.height * .06, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + primary: buttonColors, // background + onPrimary: Colors.black, // foreground + ), + onPressed: () async{ + + if(doctorNameController.text!=''&& problemController.text!=''&& dateInput.text!=''&&prescriptionFor!=''){ + + String _name=''; + String _age=''; + String? _gender=''; + + if(prescriptionFor.toString().toLowerCase()=='others'){ + if(patientNameController!=''&& patientAgeController.text!=''&&gender!=''){ + _name=patientNameController.text; + _age=patientAgeController.text; + _gender=gender; + } + else{ + AppSettings.longFailedToast('Please enter details'); + } + } + else{ + _name=AppSettings.userName; + _age=AppSettings.age; + _gender=AppSettings.gender; + } + AppSettings.preLoaderDialog(context); + bool isOnline = await AppSettings.internetConnectivity(); + if(isOnline){ + + var payload = new Map(); + payload["problem"] = problemController.text.toString(); + payload["doctorName"] = doctorNameController.text.toString(); + payload["hospitalName"] = hospitalNameController.text.toString(); + payload["date"] = dateInput.text.toString(); + payload["findings_date"] = ''; + payload["reports_date"] = ''; + payload["prescription_date"] = ''; + payload["patientType"] = prescriptionFor.toString(); + payload["others"] ={ + "name": _name, + "age": int.parse(_age), + "gender": _gender.toString().toLowerCase() + }; + payload["findings"] =uiFindingsImages; + payload["reports"] =uiReportsImages; + payload["prescription"] =uiPrescriptionImages; + + bool uploadStatus = await AppSettings.addRecords(payload); + + try{ + if(uploadStatus){ + Navigator.of(context,rootNavigator: true).pop(); + AppSettings.longSuccessToast('Record added successfully'); + Navigator.pop(context); + } + else{ + Navigator.of(context,rootNavigator: true).pop(); + AppSettings.longFailedToast('Fail to add record details'); + } + } + catch(e){ + print(e); + Navigator.of(context,rootNavigator: true).pop(); + AppSettings.longFailedToast('Fail to add record details'); + } + + } + else{ + AppSettings.longFailedToast('Please check internet'); + } + + + + } + else{ + AppSettings.longFailedToast('Please enter valid details'); + } + }, + child: const Text('Submit'), + )), + ], + ), + ), + ), + )); + } +} diff --git a/lib/Reports/allreports.dart b/lib/Reports/allreports.dart new file mode 100644 index 0000000..385e138 --- /dev/null +++ b/lib/Reports/allreports.dart @@ -0,0 +1,526 @@ +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:healthcare_user/Reports/add_reports.dart'; +import 'package:healthcare_user/Reports/finding_images.dart'; +import 'package:healthcare_user/Reports/report_images.dart'; +import 'package:healthcare_user/common/settings.dart'; +import 'package:healthcare_user/common/zoom_image.dart'; +import 'package:healthcare_user/models/reports_model.dart'; +import 'package:photo_view/photo_view.dart'; + +class AllReports extends StatefulWidget { + const AllReports({Key? key}) : super(key: key); + + @override + State createState() => _AllReportsState(); +} + +class _AllReportsState extends State { + + + List reportsList = []; + List reportsListOriginal = []; + bool isReportsDataLoading = false; + bool isSereverIssue = false; + + Future gaetAllRecords() async { + isReportsDataLoading=true; + try { + var response = await AppSettings.getAllRecords(); + + setState(() { + reportsListOriginal = ((jsonDecode(response)) as List) + .map((dynamic model) { + return ReportsModel.fromJson(model); + }).toList(); + reportsList=reportsListOriginal.reversed.toList(); + isReportsDataLoading = false; + }); + } catch (e) { + setState(() { + isReportsDataLoading = false; + isSereverIssue = true; + }); + } + } + + @override + void initState() { + gaetAllRecords(); + super.initState(); + } + + + showPicDialog(var imageUrl){ + return showDialog( + context: context, + barrierDismissible: false, + builder: (BuildContext context) { + return StatefulBuilder( + builder: (BuildContext context, StateSetter setState) { + return AlertDialog( + title: const Text(''), + content: SingleChildScrollView( + child: ListBody( + children: [ + Container( + width: MediaQuery.of(context).size.width * .10, + height: MediaQuery.of(context).size.height * .50, + child: PhotoView( + imageProvider: NetworkImage(imageUrl) as ImageProvider, + maxScale: PhotoViewComputedScale.contained * 4.0, + minScale: PhotoViewComputedScale.contained, + initialScale: PhotoViewComputedScale.contained, + basePosition: Alignment.center, + + ) + ) + ], + ), + ), + actions: [ + TextButton( + child: Text('Close', style: textButtonStyle()), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ], + ); + }); + }, + ); + } + + + Widget findings(var obj){ + return Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * .20, + child: ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: obj.findingsImages.length, + itemBuilder: (context, index) { + return Column( + children: [ + Card( + child: GestureDetector( + onTap: (){ + /*showPicDialog(obj.findingsImages[index]['url']);*/ + Navigator.push( + context, + new MaterialPageRoute( + builder: (__) => new ImageZoomPage(imageName:'Findings',imageDetails:obj.findingsImages[index]['url']))); + }, + child: Container( + width: MediaQuery.of(context).size.width * + .30, + height: + MediaQuery.of(context).size.height * + .15, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + image: DecorationImage( + image: NetworkImage( + obj.findingsImages[index]['url']) + as ImageProvider, // picked file + fit: BoxFit.fill)), + ), + ), + ), + /*Expanded(child:IconButton( + icon: const Icon(Icons.remove,color: Colors.red,), + + onPressed: () async{ + + }, + ),)*/ + ], + ); + }), + ); + } + + Widget reports(var obj){ + + return Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * .20, + child: ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: obj.reportImages.length, + itemBuilder: (context, index) { + return Column( + children: [ + Card( + child: GestureDetector( + onTap: (){ + //showPicDialog(obj.reportImages[index]['url']); + + Navigator.push( + context, + new MaterialPageRoute( + builder: (__) => new ImageZoomPage(imageName:'Reports',imageDetails:obj.reportImages[index]['url']))); + + }, + child: Container( + width: MediaQuery.of(context).size.width * .30, + height: MediaQuery.of(context).size.height * .15, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + image: DecorationImage( + image: NetworkImage( + obj.reportImages[index] + ['url']) + as ImageProvider, // picked file + fit: BoxFit.fill)), + ), + ), + ), + /*Expanded(child:IconButton( + icon: const Icon(Icons.remove,color: Colors.red,), + + onPressed: () async{ + + }, + ),)*/ + ], + ); + }), + ); + + } + + Widget prescriptions(var obj){ + + return Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * .20, + child: ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: obj.prescriptionImages.length, + itemBuilder: (context, index) { + return Column( + children: [ + Card( + child: GestureDetector( + onTap: (){ + //showPicDialog(obj.prescriptionImages[index]['url']); + Navigator.push( + context, + new MaterialPageRoute( + builder: (__) => new ImageZoomPage(imageName:'Prescriptions',imageDetails:obj.prescriptionImages[index]['url']))); + + + + }, + child: Container( + width: MediaQuery.of(context).size.width * .30, + height: MediaQuery.of(context).size.height * .15, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + image: DecorationImage( + image: NetworkImage( + obj.prescriptionImages[index] + ['url']) + as ImageProvider, // picked file + fit: BoxFit.fill)), + ), + ), + ), + /*Expanded(child:IconButton( + icon: const Icon(Icons.remove,color: Colors.red,), + + onPressed: () async{ + + }, + ),)*/ + ], + ); + }), + ); + + } + + + Widget _allreports(){ + + if(reportsList.length!=0){ + return Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded(child:ListView.builder( + padding: EdgeInsets.all(0), + itemCount: reportsList.length, + itemBuilder: (BuildContext context, int index) { + return Card( + + //color: prescriptionsList[index].cardColor, + child: Padding( + padding:EdgeInsets.all(8) , + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + + Container( + width: MediaQuery.of(context).size.width * .55, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('Problem: '+reportsList[index].problem.toString().toUpperCase(),style: problemTextStyle()), + Text(reportsList[index].doctorName.toString().toUpperCase(),style: valuesTextStyle()), + Text(reportsList[index].hospitalName.toString().toUpperCase(),style: valuesTextStyle()), + Text(reportsList[index].date.toString().toUpperCase(),style: valuesTextStyle()), + Text(reportsList[index].patient_name.toString().toUpperCase(),style: valuesTextStyle()), + Text(reportsList[index].gender.toString().toUpperCase(),style: valuesTextStyle()), + Text(reportsList[index].age.toString().toUpperCase(),style: valuesTextStyle()), + ], + ), + + + ), + + + Expanded(child:IconButton( + icon: const Icon(Icons.edit,color: primaryColor,), + onPressed: () { + + + }, + ),), + Expanded(child:IconButton( + icon: const Icon(Icons.delete,color: primaryColor,), + + onPressed: () async{ + showDialog( + //if set to true allow to close popup by tapping out of the popup + //barrierDismissible: false, + context: context, + builder: (BuildContext context) => AlertDialog( + title: const Text('Do you want to delete Record?', + style: TextStyle( + color: primaryColor, + fontSize: 20, + )), + actionsAlignment: MainAxisAlignment.spaceBetween, + actions: [ + TextButton( + onPressed: ()async { + + bool deleteTankStatus = await AppSettings.deleteRecord(reportsList[index].recordId); + + + if(deleteTankStatus){ + gaetAllRecords(); + AppSettings.longSuccessToast('Record deleted successfully'); + Navigator.of(context).pop(true); + + } + else{ + AppSettings.longFailedToast('Record deletion failed'); + Navigator.of(context).pop(true); + } + }, + 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, + )), + ), + ], + ), + ); + + + + }, + ),) + + ], + + ), + + Row( + children: [ + ElevatedButton( + style: ElevatedButton.styleFrom( + primary: primaryColor, // background + onPrimary: Colors.white, // foreground + ), + onPressed: () async { + /*Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const FindingImages()), + );*/ + + Navigator.push( + context, + new MaterialPageRoute( + builder: (__) => new FindingImages(imageDetails:reportsList[index].findingsImages))); + }, + child: Text('Findings: '+reportsList[index].findingsImages.length.toString()), + ), + SizedBox( + width:MediaQuery.of(context).size.width * .05, + ), + ElevatedButton( + style: ElevatedButton.styleFrom( + primary: primaryColor, // background + onPrimary: Colors.white, // foreground + ), + onPressed: () async { + Navigator.push( + context, + new MaterialPageRoute( + builder: (__) => new ReportImages(imageDetails:reportsList[index].reportImages))); + + }, + child: Text('Reports: '+reportsList[index].reportImages.length.toString()), + ), + SizedBox( + width:MediaQuery.of(context).size.width * .05, + ), + ElevatedButton( + style: ElevatedButton.styleFrom( + primary: primaryColor, // background + onPrimary: Colors.white, // foreground + ), + onPressed: () async { + }, + child: Text('Prescriptions: '+reportsList[index].prescriptionImages.length.toString()), + ), + ], + ), + + + + Visibility( + visible: false, + child: Text('Findings',style: headingsTextStyle()),), + Visibility( + visible: false, + child: findings(reportsList[index])), + Visibility( + visible: false, + child: Text('Reports',style: headingsTextStyle()),), + Visibility( + visible: false, + child:reports(reportsList[index]) ), + Visibility( + visible: false, + child: Text('Prescriptions',style: headingsTextStyle()),), + Visibility( + visible:false, + child:prescriptions(reportsList[index]) ), + ], + ), + ), + ); + }) ), + Padding( + padding: EdgeInsets.fromLTRB(8, 8, 8, 8), + child: CircleAvatar( + backgroundColor: primaryColor, + radius: 40, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + IconButton( + iconSize: 40, + icon: const Icon( + Icons.add, + color: Colors.white, + ), + onPressed: () async{ + /*await Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AddPrescription()), + );*/ + Navigator.push(context, MaterialPageRoute(builder: (context) => AddReports())).then((value) { + gaetAllRecords(); + }); + //showBoreAddingDialog(); + }, + ), + /* Padding( + padding: EdgeInsets.fromLTRB(5, 0, 5, 5), + child: Text( + 'Add Tanks ', + style: TextStyle(color: Colors.white), + ), + )*/ + ], + ), + ), + ), + ]); + } + else{ + return Center( + child: Padding( + padding: EdgeInsets.fromLTRB(0, 40, 0, 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: MediaQuery.of(context).size.height * .25,), + Text('Click below icon to add new Record'), + SizedBox( + height: 20, + ), + CircleAvatar( + backgroundColor: primaryColor, + radius: 40, + child: IconButton( + iconSize: 40, + icon: const Icon( + Icons.add, + color: Colors.white, + ), + onPressed: () async { + Navigator.push(context, MaterialPageRoute(builder: (context) => AddReports())).then((value) { + gaetAllRecords(); + }); + }, + ), + ) + ], + ), + ) + ); + } + + + } + + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppSettings.appBar('Reports'), + body: isReportsDataLoading?Center( + child: CircularProgressIndicator( + color: primaryColor, + strokeWidth: 5.0, + ), + ): _allreports(), + ); + } +} diff --git a/lib/Reports/finding_images.dart b/lib/Reports/finding_images.dart new file mode 100644 index 0000000..412a463 --- /dev/null +++ b/lib/Reports/finding_images.dart @@ -0,0 +1,79 @@ +import 'package:flutter/material.dart'; +import 'package:healthcare_user/common/settings.dart'; +import 'package:healthcare_user/common/zoom_image.dart'; + +class FindingImages extends StatefulWidget { + var imageDetails; + FindingImages({this.imageDetails}); + + + @override + State createState() => _FindingImagesState(); +} + +class _FindingImagesState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppSettings.appBar('Finding Images'), + body:Container( + padding: EdgeInsets.all(12.0), + child: GridView.builder( + itemCount:widget.imageDetails.length, + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, + crossAxisSpacing: 2.0, + mainAxisSpacing: 2.0, + ), + itemBuilder: (BuildContext context, int index) { + return GestureDetector( + onTap: () { + + Navigator.push( + context, + new MaterialPageRoute( + builder: (__) => new ImageZoomPage(imageName:'Findings',imageDetails:widget.imageDetails[index]['url']))); + /*gridOntap(index);*/ + }, + child: Container( + width: MediaQuery.of(context).size.width * .30, + height: MediaQuery.of(context).size.height * .15, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + image: DecorationImage( + image: NetworkImage( + widget.imageDetails[index]['url']) + 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 { + + + + + }, + ), + /* color: Colors.pinkAccent, + width: 35, + height: 35,*/ + ), + )]), + ), + + //Image.network(widget.imageDetails[index]['url']), + ); + }, + )), + ); + } +} diff --git a/lib/Reports/report_images.dart b/lib/Reports/report_images.dart new file mode 100644 index 0000000..4dee705 --- /dev/null +++ b/lib/Reports/report_images.dart @@ -0,0 +1,114 @@ +import 'package:flutter/material.dart'; +import 'package:healthcare_user/common/settings.dart'; +import 'package:healthcare_user/common/zoom_image.dart'; + +class ReportImages extends StatefulWidget { + var imageDetails; + ReportImages({this.imageDetails}); + + @override + State createState() => _ReportImagesState(); +} + +class _ReportImagesState extends State { + Widget renderUi() { + + if(widget.imageDetails.length!=0){ + return GridView.builder( + itemCount: widget.imageDetails.length, + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, + crossAxisSpacing: 2.0, + mainAxisSpacing: 2.0, + ), + itemBuilder: (BuildContext context, int index) { + return GestureDetector( + onTap: () { + Navigator.push( + context, + new MaterialPageRoute( + builder: (__) => new ImageZoomPage( + imageName: 'Findings', + imageDetails: widget.imageDetails[index]['url']))); + /*gridOntap(index);*/ + }, + child: Container( + width: MediaQuery.of(context).size.width * .30, + height: MediaQuery.of(context).size.height * .15, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + image: DecorationImage( + image: NetworkImage(widget.imageDetails[index]['url']) + 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 {}, + ), + /* color: Colors.pinkAccent, + width: 35, + height: 35,*/ + ), + ) + ]), + ), + + //Image.network(widget.imageDetails[index]['url']), + ); + }, + ); + } + else{ + return Center( + child: Padding( + padding: EdgeInsets.fromLTRB(0, 40, 0, 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: MediaQuery.of(context).size.height * .25,), + Text('Click below icon to add new Report'), + SizedBox( + height: 20, + ), + CircleAvatar( + backgroundColor: primaryColor, + radius: 40, + child: IconButton( + iconSize: 40, + icon: const Icon( + Icons.add, + color: Colors.white, + ), + onPressed: () async { + /*Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const Login()), + );*/ + }, + ), + ) + ], + ), + ) + ); + } + + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppSettings.appBar('Report Images'), + body: Container(padding: EdgeInsets.all(12.0), child: renderUi()), + ); + } +} diff --git a/lib/chart/bmi_chart.dart b/lib/chart/bmi_chart.dart new file mode 100644 index 0000000..18b162b --- /dev/null +++ b/lib/chart/bmi_chart.dart @@ -0,0 +1,45 @@ +import 'package:flutter/material.dart'; +import 'package:healthcare_user/common/settings.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:healthcare_user/models/bmi_history_model.dart'; + + +class BmiChart extends StatefulWidget { + var myObject; + BmiChart({ + this.myObject + }); + + @override + State createState() => _BmiChartState(); +} + +class _BmiChartState extends State { + + + _getSeriesData() { + List> series = [ + charts.Series( + id: "Sales", + data: widget.myObject, + domainFn: (BmiHistoryModel series, _) => series.dateForFilter, + measureFn: (BmiHistoryModel series, _) => series.number2, + colorFn: (BmiHistoryModel series, _) => charts.MaterialPalette.blue.shadeDefault + ) + ]; + return series; + } + + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppSettings.appBar('BMI Chart'), + body: Container( + + child:new charts.TimeSeriesChart(_getSeriesData(), animate: true,), + + ), + ); + } +} diff --git a/lib/chart/bpchart.dart b/lib/chart/bpchart.dart new file mode 100644 index 0000000..f790b7f --- /dev/null +++ b/lib/chart/bpchart.dart @@ -0,0 +1,65 @@ +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:healthcare_user/common/settings.dart'; +class SalesData { + final int year; + final int sales; + + SalesData(this.year, this.sales); +} + +final data = [ + new SalesData(0, 1500000), + new SalesData(1, 1735000), + new SalesData(2, 1678000), + new SalesData(3, 1890000), + new SalesData(4, 1907000), + new SalesData(5, 2300000), + new SalesData(6, 2360000), + new SalesData(7, 1980000), + new SalesData(8, 2654000), + new SalesData(9, 2789070), + new SalesData(10, 3020000), + new SalesData(11, 3245900), + new SalesData(12, 4098500), + new SalesData(13, 4500000), + new SalesData(14, 4456500), + new SalesData(15, 3900500), + new SalesData(16, 5123400), + new SalesData(17, 5589000), + new SalesData(18, 5940000), + new SalesData(19, 6367000), +]; + + +_getSeriesData() { + List> series = [ + charts.Series( + id: "Sales", + data: data, + domainFn: (SalesData series, _) => series.year, + measureFn: (SalesData series, _) => series.sales, + colorFn: (SalesData series, _) => charts.MaterialPalette.blue.shadeDefault + ) + ]; + return series; +} + +class Bpchart extends StatefulWidget { + const Bpchart({Key? key}) : super(key: key); + + @override + State createState() => _BpchartState(); +} + +class _BpchartState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppSettings.appBar('Bp chart'), + body: Container( + child:new charts.LineChart(_getSeriesData(), animate: true,), + ), + ); + } +} diff --git a/lib/common/dashboard.dart b/lib/common/dashboard.dart index dbdea3f..4e7648c 100644 --- a/lib/common/dashboard.dart +++ b/lib/common/dashboard.dart @@ -1,6 +1,7 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:healthcare_user/Reports/allreports.dart'; import 'package:healthcare_user/common/updateprofile.dart'; import 'package:healthcare_user/emergency.dart'; import 'package:healthcare_user/howareufeeling_today.dart'; @@ -10,7 +11,7 @@ import 'package:healthcare_user/my_health.dart'; import 'package:healthcare_user/my_medicine_timings.dart'; import 'package:healthcare_user/prescriptions/prescriptions.dart'; import 'package:healthcare_user/report_my_self.dart'; -import 'package:healthcare_user/reports.dart'; +import 'package:healthcare_user/Reports/add_reports.dart'; import 'package:healthcare_user/seekopinion.dart'; import 'package:healthcare_user/common/settings.dart'; import 'package:image_picker/image_picker.dart'; @@ -75,7 +76,7 @@ class _DashboardState extends State { } else if (ind == 1) { Navigator.push( context, - MaterialPageRoute(builder: (context) => const Reports()), + MaterialPageRoute(builder: (context) => const AddReports()), ); } else if (ind == 2) { Navigator.push( @@ -274,7 +275,7 @@ class _DashboardState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => const Reports()), + builder: (context) => const AllReports()), ); }, ), diff --git a/lib/common/settings.dart b/lib/common/settings.dart index 404e0b9..d905300 100644 --- a/lib/common/settings.dart +++ b/lib/common/settings.dart @@ -12,6 +12,7 @@ import 'package:flutter_styled_toast/flutter_styled_toast.dart'; import 'dart:async'; import 'package:geolocator/geolocator.dart'; import 'package:fluttertoast/fluttertoast.dart'; +import 'package:path/path.dart' as path; //const Color primaryColor = Color(0XFF1786A3); const Color primaryColor = Color(0XFF68A85D); @@ -54,6 +55,22 @@ TextStyle valuesTextStyle() { ); } +TextStyle problemTextStyle() { + return TextStyle( + fontSize: 12, + fontWeight: FontWeight.bold, + color: Colors.red + ); +} + +TextStyle headingsTextStyle() { + return TextStyle( + fontSize: 12, + fontWeight: FontWeight.bold, + color: primaryColor + ); +} + TextStyle startAndStopHeading() { return TextStyle( fontSize: 14, @@ -220,12 +237,22 @@ class AppSettings { static String addMedicineTimingsUrl = host + 'medicine-timing'; static String getMedicineTimingsUrl = host + 'getmedicineztiming'; static String prescriptionUploadPicUrl = host + 'uploads-precription'; + static String findingsUploadPicUrl = host + 'uploads-findings-prescription'; + static String reportsUploadPicUrl = host + 'uploads-reports-prescription'; + static String recordPrescriptionsUploadPicUrl = host + 'uploads-prescription-prescription'; static String getAllpharmaciesDataUrl = host + 'getAllPharmacylist'; static String getAllQuotationRequestsUrl = host + 'userprecription'; static String getQuotationUrl = host + 'submitPicture'; static String addPrescriptionUrl = host + 'add-prescription-details'; + static String addRecordsUrl = host + 'add-record'; static String reportMySelfVideoUploadUrl = host + 'reportProblemVideo'; - static String getAllPrescriptionsDataUrl = host + 'usersinglerprecription'; + //static String getAllPrescriptionsDataUrl = host + 'usersinglerprecription'; + static String getAllPrescriptionsDataUrl = host + 'getAllPrescriptionDetails'; + + static String getRecordsDataUrl = host + 'getAllRecords'; + static String deleteRecordUrl = host + 'deleteRecord'; + + static File? updatedImage; static String image = ''; @@ -690,6 +717,60 @@ class AppSettings { return response.body; } + static Future uploadImageForFindings(file) async { + + var request = http.MultipartRequest( + 'POST', Uri.parse(findingsUploadPicUrl + '/' + customerId)); + if (file.length > 0) { + for (var i = 0; i < file.length; i++) { + request.files.add(await http.MultipartFile.fromPath('picture', file[i].path)); + }} + // request.files.add(await http.MultipartFile.fromPath('picture', images.toString().replaceAll('[', '').replaceAll(']',''))); + var res = await request.send(); + var response = await http.Response.fromStream(res); + return response.body; + } + + static Future uploadImageForReports(file) async { + + var request = http.MultipartRequest( + 'POST', Uri.parse(reportsUploadPicUrl + '/' + customerId)); + if (file.length > 0) { + for (var i = 0; i < file.length; i++) { + request.files.add(await http.MultipartFile.fromPath('picture', file[i].path)); + }} + // request.files.add(await http.MultipartFile.fromPath('picture', images.toString().replaceAll('[', '').replaceAll(']',''))); + var res = await request.send(); + var response = await http.Response.fromStream(res); + return response.body; + } + + + static Future uploadImageForPrescriptions(file) async { + + var request = http.MultipartRequest( + 'POST', Uri.parse(recordPrescriptionsUploadPicUrl + '/' + customerId)); + if (file.length > 0) { + for (var i = 0; i < file.length; i++) { + request.files.add(await http.MultipartFile.fromPath('picture', file[i].path)); + }} + // request.files.add(await http.MultipartFile.fromPath('picture', images.toString().replaceAll('[', '').replaceAll(']',''))); + var res = await request.send(); + var response = await http.Response.fromStream(res); + return response.body; + } + + static Future uploadImageForFindingsCamera(file) async { + + var request = http.MultipartRequest( + 'POST', Uri.parse(findingsUploadPicUrl + '/' + 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 uploadVideoInReportMySelf(file) async { var request = http.MultipartRequest( 'POST', Uri.parse(reportMySelfVideoUploadUrl + '/' + customerId)); @@ -859,6 +940,39 @@ class AppSettings { } } + + static Future addRecords(payload) async { + var uri = Uri.parse(addRecordsUrl + '/' + 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 getAllPrescriptions() async { var uri = Uri.parse(getAllPrescriptionsDataUrl + '/' + customerId); //uri = uri.replace(query: 'customerId=$customerId'); @@ -883,6 +997,61 @@ class AppSettings { } } + + static Future getAllRecords() async { + var uri = Uri.parse(getRecordsDataUrl + '/' + 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 deleteRecord(recordId) async { + var uri = Uri.parse(deleteRecordUrl + '/' + recordId); + + 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; + } + } + /*Apis ends here*/ //save data local diff --git a/lib/common/zoom_image.dart b/lib/common/zoom_image.dart new file mode 100644 index 0000000..5cc137a --- /dev/null +++ b/lib/common/zoom_image.dart @@ -0,0 +1,34 @@ +import 'package:flutter/material.dart'; +import 'package:healthcare_user/common/settings.dart'; +import 'package:photo_view/photo_view.dart'; +class ImageZoomPage extends StatefulWidget { + var imageName; + var imageDetails; + ImageZoomPage({this.imageName,this.imageDetails}); + + + @override + State createState() => _ImageZoomPageState(); +} + +class _ImageZoomPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppSettings.appBar(widget.imageName), + body: Container( + //width: MediaQuery.of(context).size.width * .10, + //height: MediaQuery.of(context).size.height * .50, + child: PhotoView( + imageProvider: NetworkImage(widget.imageDetails) as ImageProvider, + maxScale: PhotoViewComputedScale.contained * 4.0, + minScale: PhotoViewComputedScale.contained, + initialScale: PhotoViewComputedScale.contained, + basePosition: Alignment.center, + + ) + ), + + ); + } +} diff --git a/lib/models/bmi_history_model.dart b/lib/models/bmi_history_model.dart index 17d1340..a2c10c2 100644 --- a/lib/models/bmi_history_model.dart +++ b/lib/models/bmi_history_model.dart @@ -10,6 +10,8 @@ class BmiHistoryModel { String displayDate=''; DateTime dateForFilter=new DateTime.now(); + var number1; + var number2; BmiHistoryModel(); @@ -30,6 +32,8 @@ class BmiHistoryModel { rtvm.bmiValue = json['bmivalue'].toString() ?? ''; rtvm.height = json['height'].toString() ?? ''; rtvm.weight = json['weight'].toString() ?? ''; + rtvm.number1 = double.parse( rtvm.bmiValue); + rtvm.number2 = double.parse( rtvm.bmiValue); rtvm.date = json['createdAt'].toString() ?? ''; //DateTime tempDate = new DateFormat("yyyy-MM-dd hh:mm:ss").parse(rtvm.date); diff --git a/lib/models/prescriptions_model.dart b/lib/models/prescriptions_model.dart index 63a9a5d..9445846 100644 --- a/lib/models/prescriptions_model.dart +++ b/lib/models/prescriptions_model.dart @@ -8,13 +8,17 @@ class PrescriptionsModel { String age=''; String gender=''; String patient_type=''; + List prescriptionUrls=[]; + PrescriptionsModel(); factory PrescriptionsModel.fromJson(Map json){ PrescriptionsModel rtvm = new PrescriptionsModel(); - rtvm.prescription_name = json['name'] ?? ''; + rtvm.prescriptionUrls=json['precription']??[]; + + /*rtvm.prescription_name = json['name'] ?? ''; rtvm.patient_type = json['patientType'] ?? ''; rtvm.prescription_url = json['pictureUrl'][0] ?? ''; @@ -23,16 +27,12 @@ class PrescriptionsModel { rtvm.gender=AppSettings.gender; rtvm.patient_name=AppSettings.userName; } - /* "others": { - "name": "jhanu", - "age": 23, - "gender": "female" - },*/ + else{ rtvm.age=json['others']['age'].toString(); rtvm.gender=json['others']['gender']; rtvm.patient_name=json['others']['name']; - } + }*/ return rtvm; } diff --git a/lib/models/reports_model.dart b/lib/models/reports_model.dart new file mode 100644 index 0000000..7882c67 --- /dev/null +++ b/lib/models/reports_model.dart @@ -0,0 +1,47 @@ +import 'package:flutter/material.dart'; +import 'package:healthcare_user/common/settings.dart'; + +class ReportsModel { + String patient_name=''; + String age=''; + String gender=''; + String patient_type=''; + String problem=''; + String doctorName=''; + String hospitalName=''; + String date=''; + String recordId=''; + List findingsImages = []; + List reportImages = []; + List prescriptionImages = []; + + ReportsModel(); + + factory ReportsModel.fromJson(Map json){ + ReportsModel rtvm = new ReportsModel(); + + rtvm.patient_type = json['patientType'] ?? ''; + rtvm.doctorName = json['doctorName'] ?? ''; + rtvm.hospitalName = json['hospitalName'] ?? ''; + rtvm.problem = json['problem'] ?? ''; + rtvm.date = json['date'] ?? ''; + rtvm.recordId = json['recordId'] ?? ''; + rtvm.findingsImages = json['findings'] ?? []; + rtvm.reportImages = json['reports'] ?? []; + rtvm.prescriptionImages = json['prescription'] ?? []; + + if(rtvm.patient_type.toString().toLowerCase()=='self'){ + rtvm.age=AppSettings.age; + rtvm.gender=AppSettings.gender; + rtvm.patient_name=AppSettings.userName; + } + else{ + rtvm.age=json['others']['age'].toString(); + rtvm.gender=json['others']['gender']; + rtvm.patient_name=json['others']['name']; + } + + return rtvm; + } + +} \ No newline at end of file diff --git a/lib/prescriptions/oreder_medicines.dart b/lib/prescriptions/oreder_medicines.dart index e4a86db..7f52bad 100644 --- a/lib/prescriptions/oreder_medicines.dart +++ b/lib/prescriptions/oreder_medicines.dart @@ -4,6 +4,7 @@ import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:healthcare_user/common/settings.dart'; +import 'package:healthcare_user/common/zoom_image.dart'; import 'package:healthcare_user/google_maps_place_picker_mb/src/models/pick_result.dart'; import 'package:healthcare_user/google_maps_place_picker_mb/src/place_picker.dart'; import 'package:healthcare_user/keys.dart'; @@ -701,10 +702,10 @@ class _OrderMedicinesState extends State { payload["picture"] = widget.prescriptionDetails.prescription_url.toString(); payload["pharmacies"] = pharmaciesCheckboxes; payload["familyDetails"] = { - "patient_name": widget.prescriptionDetails.patient_name.toString(), - "patient_age": int.parse(widget.prescriptionDetails.age.toString()), - "patient_gender": widget.prescriptionDetails.gender.toString().toLowerCase(), - "patient_address": userAddress + "patient_name": widget.prescriptionDetails.patient_name.toString()??'', + "patient_age": int.parse(widget.prescriptionDetails.age.toString())??0, + "patient_gender": widget.prescriptionDetails.gender.toString().toLowerCase()??'', + "patient_address": userAddress??'' }; bool status = await AppSettings.getQuotation(payload); @@ -815,6 +816,58 @@ class _OrderMedicinesState extends State { super.initState(); } + + Widget prescriptions(var obj){ + + return Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * .20, + child: ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: obj.prescriptionUrls.length, + itemBuilder: (context, index) { + return Column( + children: [ + Card( + child: GestureDetector( + onTap: (){ + //showPicDialog(obj.prescriptionImages[index]['url']); + Navigator.push( + context, + new MaterialPageRoute( + builder: (__) => new ImageZoomPage(imageName:'Prescriptions',imageDetails:obj.prescriptionUrls[index]['url']))); + + + + }, + child: Container( + width: MediaQuery.of(context).size.width * .30, + height: MediaQuery.of(context).size.height * .15, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + image: DecorationImage( + image: NetworkImage( + obj.prescriptionUrls[index] + ['url']) + as ImageProvider, // picked file + fit: BoxFit.fill)), + ), + ), + ), + /*Expanded(child:IconButton( + icon: const Icon(Icons.remove,color: Colors.red,), + + onPressed: () async{ + + }, + ),)*/ + ], + ); + }), + ); + + } + @override Widget build(BuildContext context) { return Scaffold( @@ -825,51 +878,7 @@ class _OrderMedicinesState extends State { children: [ Padding( padding: EdgeInsets.all(10), - child: Row( - children: [ - Container( - width: MediaQuery.of(context).size.width * .18, - height: MediaQuery.of(context).size.height * .10, - decoration: BoxDecoration( - shape: BoxShape.rectangle, - image: DecorationImage( - image: NetworkImage(widget.prescriptionDetails.prescription_url) - as ImageProvider, // picked file - fit: BoxFit.contain)), - ), - SizedBox( - width: MediaQuery.of(context).size.width * .02, - ), - Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - widget.prescriptionDetails.prescription_name - .toString() - .toUpperCase(), - style: valuesTextStyle()), - Text( - widget.prescriptionDetails.patient_name - .toString() - .toUpperCase(), - style: valuesTextStyle()), - Text( - widget.prescriptionDetails.gender - .toString() - .toUpperCase(), - style: valuesTextStyle()), - Text( - widget.prescriptionDetails.age - .toString() - .toUpperCase(), - style: valuesTextStyle()), - ], - ), - ), - ], - )), + child: prescriptions(widget.prescriptionDetails),), Padding( padding: EdgeInsets.all(10), child: Row( diff --git a/lib/prescriptions/prescriptions.dart b/lib/prescriptions/prescriptions.dart index 4ccc2b3..c0d24da 100644 --- a/lib/prescriptions/prescriptions.dart +++ b/lib/prescriptions/prescriptions.dart @@ -4,6 +4,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:geolocator/geolocator.dart'; import 'package:healthcare_user/common/settings.dart'; +import 'package:healthcare_user/common/zoom_image.dart'; import 'package:healthcare_user/models/pharmacies_model.dart'; import 'package:healthcare_user/prescriptions/add_prescriptions.dart'; import 'package:healthcare_user/prescriptions/oreder_medicines.dart'; @@ -443,6 +444,57 @@ class _PrescriptionsState extends State { ); } + Widget prescriptions(var obj){ + + return Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * .20, + child: ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: obj.prescriptionUrls.length, + itemBuilder: (context, index) { + return Column( + children: [ + Card( + child: GestureDetector( + onTap: (){ + //showPicDialog(obj.prescriptionImages[index]['url']); + Navigator.push( + context, + new MaterialPageRoute( + builder: (__) => new ImageZoomPage(imageName:'Prescriptions',imageDetails:obj.prescriptionUrls[index]['url']))); + + + + }, + child: Container( + width: MediaQuery.of(context).size.width * .30, + height: MediaQuery.of(context).size.height * .15, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + image: DecorationImage( + image: NetworkImage( + obj.prescriptionUrls[index] + ['url']) + as ImageProvider, // picked file + fit: BoxFit.fill)), + ), + ), + ), + /*Expanded(child:IconButton( + icon: const Icon(Icons.remove,color: Colors.red,), + + onPressed: () async{ + + }, + ),)*/ + ], + ); + }), + ); + + } + Widget _allPrescriptions(){ if (prescriptionsList.length != 0) { return Column( @@ -460,114 +512,7 @@ class _PrescriptionsState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - GestureDetector( - 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(prescriptionsList[index].prescription_url) as ImageProvider, // picked file - fit: BoxFit.contain)), - ), - onTap: (){ - showPicDialog(prescriptionsList[index].prescription_url); - - }, - ), - SizedBox(width:MediaQuery.of(context).size.width * .02,), - - Container( - width: MediaQuery.of(context).size.width * .55, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(prescriptionsList[index].prescription_name.toString().toUpperCase(),style: valuesTextStyle()), - Text(prescriptionsList[index].patient_name.toString().toUpperCase(),style: valuesTextStyle()), - Text(prescriptionsList[index].gender.toString().toUpperCase(),style: valuesTextStyle()), - Text(prescriptionsList[index].age.toString().toUpperCase(),style: valuesTextStyle()), - ], - ), - - - ), - - - Expanded(child:IconButton( - icon: const Icon(Icons.edit,color: primaryColor,), - onPressed: () { - - - }, - ),), - Expanded(child:IconButton( - icon: const Icon(Icons.delete,color: primaryColor,), - - onPressed: () async{ - /* showDialog( - //if set to true allow to close popup by tapping out of the popup - //barrierDismissible: false, - context: context, - builder: (BuildContext context) => AlertDialog( - title: const Text('Do you want to delete tank?', - style: TextStyle( - color: primaryColor, - fontSize: 20, - )), - actionsAlignment: MainAxisAlignment.spaceBetween, - actions: [ - TextButton( - onPressed: ()async { - var payload = new Map(); - payload["tankLocation"] = modelTanksViewList[index].tank_location.toString().toLowerCase(); - bool deleteTankStatus = await AppSettings.deleteTank(modelTanksViewList[index].tank_name,payload); - - - if(deleteTankStatus){ - readJson(); - AppSettings.longSuccessToast('tank deleted successfully'); - Navigator.of(context).pop(true); - - } - else{ - AppSettings.longFailedToast('tank deletion failed'); - Navigator.of(context).pop(true); - } - }, - 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, - )), - ), - ], - ), - );*/ - - - - }, - ),) - - ], - - ), + prescriptions(prescriptionsList[index]), TextButton( child: const Text( 'Order Medicines', diff --git a/lib/reports.dart b/lib/reports.dart deleted file mode 100644 index e8ea39b..0000000 --- a/lib/reports.dart +++ /dev/null @@ -1,56 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:healthcare_user/common/settings.dart'; - -class Reports extends StatefulWidget { - const Reports({Key? key}) : super(key: key); - - @override - State createState() => _ReportsState(); -} - -class _ReportsState extends State { - - TextEditingController doctorNameController = TextEditingController(); - TextEditingController hospitalNameController = TextEditingController(); - TextEditingController problemController = TextEditingController(); - - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppSettings.appBar('Reports'), - body: Container( - child: Padding( - padding: EdgeInsets.all(10), - child: Column( - children: [ - Container( - child: TextFormField( - cursorColor: greyColor, - controller: doctorNameController, - decoration: textFormFieldDecoration(Icons.person,'Enter Doctor name'), - ), - ), - SizedBox(height:MediaQuery.of(context).size.height * .02,), - Container( - child: TextFormField( - cursorColor: greyColor, - controller: hospitalNameController, - decoration: textFormFieldDecoration(Icons.location_city_outlined,'Enter Hospital name'), - ), - ), - SizedBox(height:MediaQuery.of(context).size.height * .02,), - Container( - child: TextFormField( - cursorColor: greyColor, - controller: problemController, - decoration: textFormFieldDecoration(Icons.edit,'Enter Problem'), - ), - ), - ], - ), - ), - ), - ); - } -} diff --git a/pubspec.lock b/pubspec.lock index 3ea868b..14bcec6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -57,6 +57,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.1" + charts_common: + dependency: transitive + description: + name: charts_common + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.0" + charts_flutter: + dependency: "direct dev" + description: + name: charts_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.0" checked_yaml: dependency: transitive description: @@ -679,6 +693,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.1.1" + logging: + dependency: transitive + description: + name: logging + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.1" matcher: dependency: transitive description: @@ -700,6 +721,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.8.0" + multi_image_picker: + dependency: "direct dev" + description: + name: multi_image_picker + url: "https://pub.dartlang.org" + source: hosted + version: "4.8.01" nested: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 7061105..e5feb3a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -65,6 +65,8 @@ dev_dependencies: photo_view: ^0.14.0 pinch_zoom: ^1.0.0 dots_indicator: ^3.0.0 + multi_image_picker: ^4.8.1 + charts_flutter: ^0.12.0 flutter_icons: image_path_ios: 'images/appicon.png'