diff --git a/lib/config/config.dart b/lib/config/config.dart index 6bf726ac..0b3fc7ea 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -12,8 +12,8 @@ const PACKAGES_PRODUCTS = '/api/products'; const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index d9440990..f9a8ebf7 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -96,8 +96,8 @@ class _HomePageFragment2State extends State { margin: EdgeInsets.only(left: 20, right: 20, top: 8, bottom: 6), child: SliderView( onLoginClick: () { - // widget.onLoginClick(); - navigateTo(context, CallHomePage()); + widget.onLoginClick(); + // navigateTo(context, CallHomePage()); }, ), // height: MediaQuery.of(context).size.width / 2.6, diff --git a/lib/pages/medical/vital_sign/LineChartCurved.dart b/lib/pages/medical/vital_sign/LineChartCurved.dart index f097f44c..55e5581f 100644 --- a/lib/pages/medical/vital_sign/LineChartCurved.dart +++ b/lib/pages/medical/vital_sign/LineChartCurved.dart @@ -17,6 +17,8 @@ class LineChartCurved extends StatelessWidget { double minY = 0; double maxY = 0; + double intialY = 0; + double lastY = 0; double minX = 0; double maxX = 0; @@ -26,6 +28,7 @@ class LineChartCurved extends StatelessWidget { Widget build(BuildContext context) { getXaxix(); getYaxix(); + getInitialY(); calculateMaxAndMin(); return AspectRatio( aspectRatio: 1.0, @@ -100,7 +103,7 @@ class LineChartCurved extends StatelessWidget { touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), - gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true,horizontalInterval: 14,verticalInterval: 14), + gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14), titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, @@ -165,12 +168,14 @@ class LineChartCurved extends StatelessWidget { ), minX: minX, maxX: maxX, - maxY: maxY, - minY: 0, + maxY: lastY+50, + minY: intialY, lineBarsData: getData(context), ); } + + calculateMaxAndMin() { getMaxY(); getMaxX(); @@ -185,12 +190,29 @@ class LineChartCurved extends StatelessWidget { maxY = 0; timeSeries.forEach((element) { double resultValueDouble = element.sales; - if (resultValueDouble > maxY) maxY = resultValueDouble; + if (resultValueDouble > maxY) { + lastY = resultValueDouble; + maxY = resultValueDouble; + } }); - + print("maxY " + lastY.toString()); return maxY.roundToDouble(); } + double getInitialY() { + try { + intialY = timeSeries.first.sales; + timeSeries.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble < intialY) intialY = resultValueDouble; + }); + } catch (e) { + intialY = 0; + } + + return intialY.roundToDouble(); + } + getMaxX() { maxX = (timeSeries.length - 1).toDouble(); }