null safety issue fixed.

dev_v3.13.6_voipcall
Sultan khan 2 years ago
parent 1a5687a27c
commit c96c151f44

@ -30,7 +30,7 @@ class ProjectAvgERWaitingTime {
distanceInKilometers = json['DistanceInKilometers'];
latitude = json['Latitude'];
longitude = json['Longitude'];
phonenumber = json['Phonenum?ber'];
phonenumber = json['PhoneNumber'];
projectImageURL = json['ProjectImageURL'];
projectName = json['ProjectName'];
}
@ -44,7 +44,7 @@ class ProjectAvgERWaitingTime {
data['DistanceInKilometers'] = this.distanceInKilometers;
data['Latitude'] = this.latitude;
data['Longitude'] = this.longitude;
data['Phonenum?ber'] = this.phonenumber;
data['PhoneNumber'] = this.phonenumber;
data['ProjectImageURL'] = this.projectImageURL;
data['ProjectName'] = this.projectName;
return data;

@ -112,7 +112,7 @@ class OrderPreviewViewModel extends BaseViewModel {
ShoppingCartResponse _handleGetShoppingCartResponse(Map res) {
cartResponse.totalAmount = 0.0;
totalAdditionalShippingCharge = 0;
if (res == null) {
if (res.isEmpty) {
error = "response is null";
setState(ViewState.Error);
return ShoppingCartResponse();

@ -74,6 +74,7 @@ class _NearestErState extends State<NearestEr> {
location.locationName = projectAvgERWaitingTimeModelList[index].projectName;
location.cityName = projectAvgERWaitingTimeModelList[index].projectName;
location.projectImageURL = projectAvgERWaitingTimeModelList[index].projectImageURL;
print(projectAvgERWaitingTimeModelList[index].phonenumber);
location.phoneNumber = projectAvgERWaitingTimeModelList[index].phonenumber;
location.latitude = projectAvgERWaitingTimeModelList[index].latitude;
location.longitude = projectAvgERWaitingTimeModelList[index].longitude;

@ -227,7 +227,7 @@ class OrderLogPage extends StatelessWidget {
100,
),
),
Column(
Expanded(child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
@ -236,10 +236,10 @@ class OrderLogPage extends StatelessWidget {
),
Text(
order.dropOffLocation!.trim().toString(),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48), overflow: TextOverflow.ellipsis,
),
],
),
)),
],
),
],

@ -76,7 +76,7 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
children: [
PharmacyPage(),
PharmacyCategorisePage(),
PharmacyProfilePage(moveToOrder: false, changeTab: changeCurrentTab),
PharmacyProfilePage(moveToOrder: false, changeTab: (){changeCurrentTab(2);}),
CartOrderPage(changeTab: changeCurrentTab),
],
),

@ -22,7 +22,7 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class CartOrderPage extends StatefulWidget {
final dynamic? changeTab;
final void Function(int)? changeTab;
CartOrderPage({Key? key, this.changeTab}) : super(key: key);
@ -57,8 +57,10 @@ class _CartOrderPageState extends State<CartOrderPage> {
isMainPharmacyPages: true,
showPharmacyCart: false,
baseViewModel: model,
backButtonTab:
widget.changeTab!,
backButtonTab:(){
widget.changeTab!;
}
,
backgroundColor: Colors.white,
body: NetworkBaseView(

@ -132,13 +132,13 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
),
),
),
if (model.isStockAvailable != null && !model.isStockAvailable)
if (model.isStockAvailable && !model.isStockAvailable)
Container(
height: MediaQuery.of(context).size.height * .40,
color: Colors.white.withOpacity(0.6),
// child: AppText("Out of Stock"),
),
if (model.isStockAvailable != null && !model.isStockAvailable)
if (model.isStockAvailable && !model.isStockAvailable)
Positioned(
// bottom: 10,
top: MediaQuery.of(context).size.height * .088,

@ -30,7 +30,8 @@ dynamic languageID;
class PharmacyProfilePage extends StatefulWidget {
final bool moveToOrder;
final dynamic changeTab;
final void Function()? changeTab;
PharmacyProfilePage({required this.moveToOrder, this.changeTab});
@ -55,8 +56,8 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
}
getCustomer() async {
String custID;
String custGUID;
String? custID;
String? custGUID;
custID = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
custGUID = await sharedPref.getObject(PHARMACY_CUSTOMER_GUID);
setState(() {

@ -10,7 +10,7 @@ import 'avatar/large_avatar.dart';
import 'my_rich_text.dart';
class HospitalLocation extends StatelessWidget {
final GetHMGLocationsModel location;
final GetHMGLocationsModel? location;
final bool showCity;
final String? waitingTime;
@ -41,7 +41,7 @@ class HospitalLocation extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
location.locationName!.trim(),
location!.locationName!.trim(),
style: TextStyle(fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600, color: Color(0xff2E303A)),
),
SizedBox(height: 10),
@ -60,8 +60,8 @@ class HospitalLocation extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (showCity) MyRichText(TranslationBase.of(context).city + ":", location.cityName!.trim().toString(), projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).distance + ":", location.distanceInKilometers.toString() + " " + TranslationBase.of(context).km_ ?? "", projectViewModel.isArabic),
if (showCity) MyRichText(TranslationBase.of(context).city + ":", location!.cityName!.trim().toString(), projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).distance + ":", location!.distanceInKilometers.toString() + " " + TranslationBase.of(context).km_ ?? "", projectViewModel.isArabic),
if (waitingTime != null) MyRichText(TranslationBase.of(context).waitingTime, waitingTime!, projectViewModel.isArabic),
],
),
@ -79,14 +79,15 @@ class HospitalLocation extends StatelessWidget {
() async {
await MapLauncher.showMarker(
mapType: MapType.google,
coords: Coords(double.parse(location.latitude!), double.parse(location.longitude!)),
title: location.locationName!,
coords: Coords(double.parse(location!.latitude!), double.parse(location!.longitude!)),
title: location!.locationName!,
);
},
),
SizedBox(height: 10),
contactButton(Icons.call, TranslationBase.of(context).callNow, () {
launchUrl(Uri.parse("tel://" + location.phoneNumber!));
contactButton(Icons.call, TranslationBase.of(context).callNow, () async{
await launchUrl(Uri.parse("tel://" + location!.phoneNumber.toString()));
}),
],
),

@ -285,7 +285,7 @@ class _AppScaffoldState extends State<AppScaffold> {
bottomNavigationBar: widget.isBottomBar
? BottomNavPharmacyBar(
changeIndex: changeCurrentTab,
index: widget.currentTab!,
index: widget.currentTab==null ? 0: widget.currentTab!,
)
: null,
floatingActionButton: widget.floatingActionButton,
@ -508,7 +508,7 @@ class AppBarWidgetState extends State<AppBarWidget> {
? IconButton(
icon: badge_import.Badge(
badgeContent: Text(
orderPreviewViewModel.cartResponse.quantityCount.toString(),
orderPreviewViewModel.cartResponse.quantityCount !=null? orderPreviewViewModel.cartResponse.quantityCount.toString() :"",
style: TextStyle(color: Colors.white),
),
child: Icon(Icons.shopping_cart)),

@ -87,7 +87,7 @@ class BottomNavPharmacyItem extends StatelessWidget {
),
),
),
if (currentIndex == 3 && Provider.of<OrderPreviewViewModel>(context, listen: false).cartResponse.quantityCount != 0)
if (currentIndex == 3 && Provider.of<OrderPreviewViewModel>(context, listen: false).cartResponse.quantityCount!=null && Provider.of<OrderPreviewViewModel>(context, listen: false).cartResponse.quantityCount!=0)
Positioned(
top: 11.5,
right: -3.5,

Loading…
Cancel
Save