fix design

merge-update-with-lab-changes
Mohammad Aljammal 5 years ago
parent 1f03919094
commit 72290f041f

@ -27,7 +27,7 @@ apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android { android {
compileSdkVersion 28 compileSdkVersion 30
sourceSets { sourceSets {
main.java.srcDirs += 'src/main/kotlin' main.java.srcDirs += 'src/main/kotlin'
@ -41,7 +41,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.cloud.diplomaticquarterapp" applicationId "com.cloud.diplomaticquarterapp"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 28 targetSdkVersion 30
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
multiDexEnabled true multiDexEnabled true

@ -68,12 +68,12 @@ class HMGUtils {
} }
} }
fun getGeoZonesFromPreference(context: Context):List<GeoZoneModel>{ fun getGeoZonesFromPreference(context: Context): List<GeoZoneModel> {
val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE)
val json = pref.getString(PREF_KEY_HMG_ZONES,"[]") val json = pref.getString(PREF_KEY_HMG_ZONES,"[]")
val geoZones = GeoZoneModel().listFrom(json) val geoZones = json?.let { GeoZoneModel().listFrom(it) }
return geoZones return geoZones!!
} }
} }

@ -168,20 +168,28 @@ class LineChartCurvedState extends State<LineChartCurved> {
double getMaxY() { double getMaxY() {
double max = 0; double max = 0;
widget.labResult.forEach((element) { widget.labResult.forEach((element) {
try{
double resultValueDouble = double.parse(element.resultValue); double resultValueDouble = double.parse(element.resultValue);
if (resultValueDouble > max) max = resultValueDouble; if (resultValueDouble > max) max = resultValueDouble;}
catch(e){
print(e);
}
}); });
return max.roundToDouble(); return max.roundToDouble();
} }
double getMinY() { double getMinY() {
double min = double.parse(widget.labResult[0].resultValue); double min = 0;
try{
min = double.parse(widget.labResult[0].resultValue);
widget.labResult.forEach((element) { widget.labResult.forEach((element) {
double resultValueDouble = double.parse(element.resultValue); double resultValueDouble = double.parse(element.resultValue);
if (resultValueDouble < min) min = resultValueDouble; if (resultValueDouble < min) min = resultValueDouble;
}); });}catch(e){
print(e);
}
int value = min.toInt(); int value = min.toInt();
return value.toDouble(); return value.toDouble();
@ -190,8 +198,14 @@ class LineChartCurvedState extends State<LineChartCurved> {
List<LineChartBarData> getData() { List<LineChartBarData> getData() {
List<FlSpot> spots = List(); List<FlSpot> spots = List();
for (int index = 0; index < widget.labResult.length; index++) { for (int index = 0; index < widget.labResult.length; index++) {
try{
var resultValueDouble = double.parse(widget.labResult[index].resultValue); var resultValueDouble = double.parse(widget.labResult[index].resultValue);
spots.add(FlSpot(index.toDouble(), resultValueDouble)); spots.add(FlSpot(index.toDouble(), resultValueDouble));
}catch(e){
print(e);
spots.add(FlSpot(index.toDouble(), 0.0));
}
} }
final LineChartBarData lineChartBarData1 = LineChartBarData( final LineChartBarData lineChartBarData1 = LineChartBarData(

@ -76,18 +76,12 @@ class AppScaffold extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppGlobal.context = context; AppGlobal.context = context;
ProjectViewModel projectViewModel = Provider.of<ProjectViewModel>(context);
AppGlobal.context = context;
PreferredSizeWidget appBar;
return Scaffold( return Scaffold(
backgroundColor: backgroundColor:
backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
appBar: isShowAppBar? AppBarWidget( appBar: isShowAppBar? AppBarWidget(
appBarTitle, appBarTitle:appBarTitle,
appBarIcons, appBarIcons:appBarIcons,
isShowAppBar,
isPharmacy: isPharmacy, isPharmacy: isPharmacy,
isShowDecPage: isShowDecPage, isShowDecPage: isShowDecPage,
image: image, image: image,
@ -95,22 +89,17 @@ class AppScaffold extends StatelessWidget {
body: (!Provider.of<ProjectViewModel>(context, listen: false).isLogin && body: (!Provider.of<ProjectViewModel>(context, listen: false).isLogin &&
isShowDecPage) isShowDecPage)
? NotAutPage( ? NotAutPage(
title: appBarTitle, title: title ?? appBarTitle,
description: description, description: description,
infoList: infoList, infoList: infoList,
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
) )
: baseViewModel != null : baseViewModel != null
? NetworkBaseView( ? NetworkBaseView(
child: buildBodyWidget(), child: body,
baseViewModel: baseViewModel, baseViewModel: baseViewModel,
) )
: buildBodyWidget(), : body,
bottomSheet: bottomSheet,
//floatingActionButton: floatingActionButton ?? floatingActionButton,
// bottomNavigationBar:
// this.isBottomBar == true ? BottomBarSearch() : SizedBox()
// floatingActionButton: FloatingSearchButton(),
); );
} }
@ -118,12 +107,6 @@ class AppScaffold extends StatelessWidget {
return isLoading ? AppLoaderWidget() : Container(); return isLoading ? AppLoaderWidget() : Container();
} }
buildBodyWidget() {
// return body; //Stack(children: <Widget>[body, buildAppLoaderWidget(isLoading)]);
return Stack(children: <Widget>[
body, /*FloatingSearchButton()*/
]);
}
} }
class AppBarWidget extends StatelessWidget with PreferredSizeWidget { class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
@ -132,13 +115,12 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
final String appBarTitle; final String appBarTitle;
final List<Widget> appBarIcons; final List<Widget> appBarIcons;
final bool isShowAppBar;
final bool isPharmacy; final bool isPharmacy;
final bool isShowDecPage; final bool isShowDecPage;
final String image; final String image;
AppBarWidget(this.appBarTitle, this.appBarIcons, this.isShowAppBar, AppBarWidget({this.appBarTitle, this.appBarIcons,
{this.isPharmacy = true, this.isShowDecPage = true, this.image}); this.isPharmacy = true, this.isShowDecPage = true, this.image});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -147,8 +129,7 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
Widget buildAppBar(BuildContext context) { Widget buildAppBar(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return isShowAppBar return AppBar(
? AppBar(
elevation: 0, elevation: 0,
backgroundColor: backgroundColor:
isPharmacy ? Colors.green : Theme.of(context).appBarTheme.color, isPharmacy ? Colors.green : Theme.of(context).appBarTheme.color,
@ -194,10 +175,7 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
), ),
if (appBarIcons != null) ...appBarIcons if (appBarIcons != null) ...appBarIcons
], ],
)
: Container(
height: 0,
width: 0,
); );
} }

Loading…
Cancel
Save