fix design

merge-requests/235/head
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"
android {
compileSdkVersion 28
compileSdkVersion 30
sourceSets {
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).
applicationId "com.cloud.diplomaticquarterapp"
minSdkVersion 21
targetSdkVersion 28
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
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 json = pref.getString(PREF_KEY_HMG_ZONES,"[]")
val geoZones = GeoZoneModel().listFrom(json)
return geoZones
val geoZones = json?.let { GeoZoneModel().listFrom(it) }
return geoZones!!
}
}

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

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

Loading…
Cancel
Save