Merge branch 'development_new_design_2.0' into Fatima-New-Design

# Conflicts:
#	lib/pages/pharmacies/screens/cart-order-page.dart
#	lib/pages/pharmacies/screens/cart-page/cart-order-page.dart
merge-update-with-lab-changes
Fatimah Alshammari 4 years ago
commit 5e75860d43

@ -112,5 +112,8 @@ dependencies {
implementation "com.opentok.android:opentok-android-sdk:2.19.1" implementation "com.opentok.android:opentok-android-sdk:2.19.1"
compile 'com.facebook.stetho:stetho:1.5.1'
implementation 'com.facebook.stetho:stetho-urlconnection:1.5.1'
} }

@ -1,16 +1,40 @@
//package com.cloud.diplomaticquarterapp //package com.cloud.diplomaticquarterapp
package com.ejada.hmg package com.ejada.hmg
import com.facebook.stetho.Stetho
import io.flutter.app.FlutterApplication import io.flutter.app.FlutterApplication
import io.flutter.plugin.common.PluginRegistry import io.flutter.plugin.common.PluginRegistry
import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback
import io.flutter.plugins.GeneratedPluginRegistrant
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService
class Application : FlutterApplication(), PluginRegistrantCallback { class Application : FlutterApplication(), PluginRegistrantCallback {
override fun onCreate() { override fun onCreate() {
super.onCreate() super.onCreate()
FlutterFirebaseMessagingService.setPluginRegistrant(this) FlutterFirebaseMessagingService.setPluginRegistrant(this)
// Stetho.initializeWithDefaults(this);
// Create an InitializerBuilder
// Create an InitializerBuilder
val initializerBuilder = Stetho.newInitializerBuilder(this)
// Enable Chrome DevTools
initializerBuilder.enableWebKitInspector(
Stetho.defaultInspectorModulesProvider(this)
)
// Enable command line interface
initializerBuilder.enableDumpapp(
Stetho.defaultDumperPluginsProvider(this)
)
// Use the InitializerBuilder to generate an Initializer
val initializer = initializerBuilder.build()
// Initialize Stetho with the Initializer
Stetho.initialize(initializer)
} }
override fun registerWith(registry: PluginRegistry) { override fun registerWith(registry: PluginRegistry) {

@ -5,8 +5,10 @@ import android.os.Handler
import android.os.Looper import android.os.Looper
import android.util.Log import android.util.Log
import android.view.ViewGroup import android.view.ViewGroup
import com.facebook.stetho.urlconnection.StethoURLConnectionManager
import com.opentok.android.* import com.opentok.android.*
import io.flutter.embedding.engine.FlutterEngine import io.flutter.embedding.engine.FlutterEngine
import io.flutter.embedding.engine.plugins.util.GeneratedPluginRegister
import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel import io.flutter.plugin.common.MethodChannel
@ -21,7 +23,7 @@ enum class OpenTokSDKState {
class OpenTok(private var context: Context, private var flutterEngine: FlutterEngine){ class OpenTok(private var context: Context, private var flutterEngine: FlutterEngine){
private lateinit var remoteVideoPlatformView: RemoteVideoPlatformView private lateinit var remoteVideoPlatformView: RemoteVideoPlatformView
private lateinit var localVideoPlatformView: LocalVideoPlatformView private lateinit var localVideoPlatformView: LocalVideoPlatformView
init { init {
remoteVideoPlatformView = RemoteVideoFactory.getViewInstance(context) remoteVideoPlatformView = RemoteVideoFactory.getViewInstance(context)
flutterEngine flutterEngine

@ -450,6 +450,10 @@ PODS:
- TOCropViewController (~> 2.5.4) - TOCropViewController (~> 2.5.4)
- image_picker (0.0.1): - image_picker (0.0.1):
- Flutter - Flutter
- in_app_review (0.2.0):
- Flutter
- in_app_update (0.0.1):
- Flutter
- just_audio (0.0.1): - just_audio (0.0.1):
- Flutter - Flutter
- leveldb-library (1.22) - leveldb-library (1.22)
@ -579,6 +583,8 @@ DEPENDENCIES:
- huawei_map (from `.symlinks/plugins/huawei_map/ios`) - huawei_map (from `.symlinks/plugins/huawei_map/ios`)
- image_cropper (from `.symlinks/plugins/image_cropper/ios`) - image_cropper (from `.symlinks/plugins/image_cropper/ios`)
- image_picker (from `.symlinks/plugins/image_picker/ios`) - image_picker (from `.symlinks/plugins/image_picker/ios`)
- in_app_review (from `.symlinks/plugins/in_app_review/ios`)
- in_app_update (from `.symlinks/plugins/in_app_update/ios`)
- just_audio (from `.symlinks/plugins/just_audio/ios`) - just_audio (from `.symlinks/plugins/just_audio/ios`)
- local_auth (from `.symlinks/plugins/local_auth/ios`) - local_auth (from `.symlinks/plugins/local_auth/ios`)
- location (from `.symlinks/plugins/location/ios`) - location (from `.symlinks/plugins/location/ios`)
@ -719,6 +725,10 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/image_cropper/ios" :path: ".symlinks/plugins/image_cropper/ios"
image_picker: image_picker:
:path: ".symlinks/plugins/image_picker/ios" :path: ".symlinks/plugins/image_picker/ios"
in_app_review:
:path: ".symlinks/plugins/in_app_review/ios"
in_app_update:
:path: ".symlinks/plugins/in_app_update/ios"
just_audio: just_audio:
:path: ".symlinks/plugins/just_audio/ios" :path: ".symlinks/plugins/just_audio/ios"
local_auth: local_auth:
@ -843,6 +853,8 @@ SPEC CHECKSUMS:
huawei_map: 34fbad9c274ea78a4151487c9ebe27f1887777e7 huawei_map: 34fbad9c274ea78a4151487c9ebe27f1887777e7
image_cropper: c8f9b4157933c7bb965a66d1c5e6c8fd408c6eb4 image_cropper: c8f9b4157933c7bb965a66d1c5e6c8fd408c6eb4
image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09 image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09
in_app_review: 4a97249f7a2f539a0f294c2d9196b7fe35e49541
in_app_update: 16e877e205f4360264cb536e3a6481f0d90299e1
just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa
leveldb-library: 55d93ee664b4007aac644a782d11da33fba316f7 leveldb-library: 55d93ee664b4007aac644a782d11da33fba316f7
Libyuv: 5f79ced0ee66e60a612ca97de1e6ccacd187a437 Libyuv: 5f79ced0ee66e60a612ca97de1e6ccacd187a437

@ -1290,7 +1290,7 @@ const Map localizedValues = {
"pay-options": {"en": "You can pay by the following Options:", "ar": "يمكنك الدفع عن طريق الخيارات التالية:"}, "pay-options": {"en": "You can pay by the following Options:", "ar": "يمكنك الدفع عن طريق الخيارات التالية:"},
"livecare-service": {"en": "LiveCare Service", "ar": "خدمة لايف كير"}, "livecare-service": {"en": "LiveCare Service", "ar": "خدمة لايف كير"},
"livecare-service-desc": {"en": "is to obtain medical advice with a specialist doctor Via a video call", "ar": "هي الحصول على استشارة طبية مع طبيب مختص عن طريق اتصال فيديو"}, "livecare-service-desc": {"en": "is to obtain medical advice with a specialist doctor Via a video call", "ar": "هي الحصول على استشارة طبية مع طبيب مختص عن طريق اتصال فيديو"},
"why-livecare": {"en": "WHY LIVECARE", "ar": "لماذا خدمة اللايف كير"}, "why-livecare": {"en": "Why LiveCare?", "ar": "?لماذا خدمة اللايف كير"},
"livecare-point-1": {"en": "No need to wait you will get Medical consultation immediately via Video call", "ar": "لا داعي للانتظار سوف تحصل على الاستشارة الطبية فورا عن طريق مكالمة الفيديو"}, "livecare-point-1": {"en": "No need to wait you will get Medical consultation immediately via Video call", "ar": "لا داعي للانتظار سوف تحصل على الاستشارة الطبية فورا عن طريق مكالمة الفيديو"},
"doc-virtual-appo-ins4": {"en": "The doctor will see your medical file", "ar": "سوف يتمكن الطبيب من الاطلاع على ملفك الطبي كامل"}, "doc-virtual-appo-ins4": {"en": "The doctor will see your medical file", "ar": "سوف يتمكن الطبيب من الاطلاع على ملفك الطبي كامل"},
"doc-virtual-appo-ins5": {"en": "Free prescription delivery service", "ar": "خدمة توصيل الادوية مجانا"}, "doc-virtual-appo-ins5": {"en": "Free prescription delivery service", "ar": "خدمة توصيل الادوية مجانا"},
@ -1298,7 +1298,7 @@ const Map localizedValues = {
"en": "** The service is included with some insurance companies according to the terms and conditions with our best wishes for health and wellness", "en": "** The service is included with some insurance companies according to the terms and conditions with our best wishes for health and wellness",
"ar": "** الخدمة مشمولة لدى بعض شركات التامين على حسب الشروط والاحكام مع تمنياتنا لكم بدوام الصحة والعافية" "ar": "** الخدمة مشمولة لدى بعض شركات التامين على حسب الشروط والاحكام مع تمنياتنا لكم بدوام الصحة والعافية"
}, },
"livecare-option-1": {"en": "Get Medical consultation immediately", "ar": "الحصول على الاستشارة فورا"}, "livecare-option-1": {"en": "Get consultation immediately", "ar": "الحصول على الاستشارة فورا"},
"livecare-option-2": {"en": "Instant video call", "ar": "اتصال فيديو فوري"}, "livecare-option-2": {"en": "Instant video call", "ar": "اتصال فيديو فوري"},
"livecare-option-3": {"en": "Book Appointment", "ar": "حجز موعد"}, "livecare-option-3": {"en": "Book Appointment", "ar": "حجز موعد"},
"livecare-option-4": {"en": "Schedule video call", "ar": "اتصال فيديو مجدول"}, "livecare-option-4": {"en": "Schedule video call", "ar": "اتصال فيديو مجدول"},

@ -224,16 +224,17 @@ class OffersAndPackagesServices extends BaseService {
// -------------------- // --------------------
// Shopping Cart // Shopping Cart
// -------------------- // --------------------
Future<List<PackagesCartItemsResponseModel>> cartItems({@required BuildContext context, bool showLoading = true}) async{ Future<Map<String,dynamic>> cartItems({@required BuildContext context, bool showLoading = true}) async{
Future errorThrow; Future errorThrow;
cartItemList.clear(); cartItemList.clear();
_showLoading(context, showLoading); _showLoading(context, showLoading);
var url = EXA_CART_API_BASE_URL + PACKAGES_SHOPPING_CART + '/${customer.id}'; var url = EXA_CART_API_BASE_URL + PACKAGES_SHOPPING_CART + '/${customer.id}';
Map<String,dynamic> jsonResponse;
await baseAppClient.simpleGet(url, headers: packagesAuthHeader, onSuccess: (dynamic stringResponse, int statusCode) { await baseAppClient.simpleGet(url, headers: packagesAuthHeader, onSuccess: (dynamic stringResponse, int statusCode) {
_hideLoading(context, showLoading); _hideLoading(context, showLoading);
var jsonResponse = json.decode(stringResponse); jsonResponse = json.decode(stringResponse);
jsonResponse['shopping_carts'].forEach((json) { jsonResponse['shopping_carts'].forEach((json) {
cartItemList.add(PackagesCartItemsResponseModel.fromJson(json)); cartItemList.add(PackagesCartItemsResponseModel.fromJson(json));
}); });
@ -244,7 +245,7 @@ class OffersAndPackagesServices extends BaseService {
errorThrow = Future.error({"error":error, "statusCode":statusCode}); errorThrow = Future.error({"error":error, "statusCode":statusCode});
}, queryParams: null); }, queryParams: null);
return errorThrow ?? cartItemList; return errorThrow ?? jsonResponse;
} }
Future<ResponseModel<PackagesCartItemsResponseModel>> addProductToCart(AddProductToCartRequestModel request, {@required BuildContext context, bool showLoading = true}) async{ Future<ResponseModel<PackagesCartItemsResponseModel>> addProductToCart(AddProductToCartRequestModel request, {@required BuildContext context, bool showLoading = true}) async{

@ -14,7 +14,7 @@ class PrescriptionViewModel extends BaseViewModel {
getPrescription() async { getPrescription() async {
await getSavedLanguage(); await getSavedLanguage();
if(prescriptionsList.isNotEmpty){ if(prescriptionsList.isEmpty){
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionService.getPrescription(); await _prescriptionService.getPrescription();
if (_prescriptionService.hasError) { if (_prescriptionService.hasError) {

@ -70,15 +70,6 @@ class _PaymentMethodState extends State<PaymentMethod> {
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
child: Image.asset("assets/images/new/payment/Mada.png"), child: Image.asset("assets/images/new/payment/Mada.png"),
), ),
// mWidth(12),
// Text(
// "Mada",
// style: TextStyle(
// color: Colors.black,
// fontSize: 14,
// fontWeight: FontWeight.bold,
// ),
// ),
mFlex(1), mFlex(1),
if (selectedPaymentMethod == "MADA") if (selectedPaymentMethod == "MADA")
Container( Container(

@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/models/gradient_color.dart';
import 'package:diplomaticquarterapp/models/hmg_services.dart'; import 'package:diplomaticquarterapp/models/hmg_services.dart';
import 'package:diplomaticquarterapp/models/slider_data.dart'; import 'package:diplomaticquarterapp/models/slider_data.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/logged_slider_view.dart'; import 'package:diplomaticquarterapp/pages/landing/widgets/logged_slider_view.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/services_view.dart'; import 'package:diplomaticquarterapp/pages/landing/widgets/services_view.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/slider_view.dart'; import 'package:diplomaticquarterapp/pages/landing/widgets/slider_view.dart';
@ -236,7 +237,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
), ),
FlatButton( FlatButton(
onPressed: () { onPressed: () {
Navigator.push(context, FadePage(page: AllHabibMedicalService())); Navigator.push(context, FadePage(page: AllHabibMedicalSevicePage2()));
}, },
child: Text( child: Text(
TranslationBase.of(context).viewAllServices, TranslationBase.of(context).viewAllServices,

@ -4,10 +4,9 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart'; import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart';
import 'package:diplomaticquarterapp/pages/pharmacy_categorise.dart'; import 'package:diplomaticquarterapp/pages/pharmacy_categorise.dart';
import 'package:diplomaticquarterapp/pages/search_products_page.dart'; import 'package:diplomaticquarterapp/pages/search_products_page.dart';
@ -146,9 +145,7 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
try { try {
String barcode = result; String barcode = result;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await BaseAppClient() await BaseAppClient().getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode", onSuccess: (dynamic response, int statusCode) {
.getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode",
onSuccess: (dynamic response, int statusCode) {
print(response); print(response);
var product = PharmacyProduct.fromJson(response["products"][0]); var product = PharmacyProduct.fromJson(response["products"][0]);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -158,8 +155,7 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
AppToast.showErrorToast(message: "Product not found"); AppToast.showErrorToast(message: "Product not found");
}); });
} catch (apiEx) { } catch (apiEx) {
AppToast.showErrorToast( AppToast.showErrorToast(message: "Something went wrong, please try again");
message: "Something went wrong, please try again");
} }
} catch (barcodeEx) {} } catch (barcodeEx) {}
} }

@ -1,7 +1,5 @@
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart';
import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCarePendingRequest.dart'; import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCarePendingRequest.dart';
import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_list.dart'; import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_list.dart';
@ -62,7 +60,24 @@ class _LiveCareHomeState extends State<LiveCareHome> with SingleTickerProviderSt
body: Container( body: Container(
child: Column(children: [ child: Column(children: [
TabBar( TabBar(
labelColor: Colors.black, controller: _tabController,
indicatorWeight: 3.0,
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Color(0xff2B353E),
unselectedLabelColor: Color(0xff575757),
labelPadding: EdgeInsets.only(top: 0, bottom: 0, left: 20, right: 20),
labelStyle: TextStyle(
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
unselectedLabelStyle: TextStyle(
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
tabs: [ tabs: [
Tab( Tab(
child: Text( child: Text(
@ -87,7 +102,6 @@ class _LiveCareHomeState extends State<LiveCareHome> with SingleTickerProviderSt
), ),
), ),
], ],
controller: _tabController,
), ),
Expanded( Expanded(
child: TabBarView( child: TabBarView(

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -28,188 +29,71 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
showNewAppBarTitle: true, showNewAppBarTitle: true,
showNewAppBar: true, showNewAppBar: true,
appBarTitle: TranslationBase.of(context).livecare.toUpperCase(), appBarTitle: TranslationBase.of(context).livecare.toUpperCase(),
// appBar: AppBar(
// leading: InkWell(
// onTap: () {
// Navigator.pop(context, null);
// },
// child: Icon(
// Icons.close,
// color: Colors.white,
// ),
// ),
// title: Text(TranslationBase.of(context).bookAppo,
// style: TextStyle(color: Colors.white)),
// ),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.only(left: 20.0, right: 20.0), margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container(child: Text(TranslationBase.of(context).livecareService, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20.0, letterSpacing: -0.64, color: CustomColors.darkGrey))),
Container( Container(
alignment: Alignment.center, margin: EdgeInsets.only(top: 7.0),
margin: EdgeInsets.only(top: 15.0, bottom: 10.0), child: Text(TranslationBase.of(context).livecareServiceDesc, style: TextStyle(fontSize: 14.0, letterSpacing: -0.64, color: CustomColors.textColor, fontWeight: FontWeight.w600))),
child: Image.asset(
languageID == 'ar'
? "assets/images/new-design/liveCare_ar_bg.png"
: "assets/images/new-design/liveCare_en_bg.png",
width: 120),
),
Container(
alignment: Alignment.center,
child: Text(TranslationBase.of(context).livecareService,
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 20.0))),
Container(
margin: EdgeInsets.only(top: 0.0),
alignment: Alignment.center,
child: Text(
TranslationBase.of(context).livecareServiceDesc,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 18.0))),
Container( Container(
margin: EdgeInsets.only(top: 5.0), margin: EdgeInsets.only(top: 20.0),
child: Text(TranslationBase.of(context).whyLivecare, child: Text(TranslationBase.of(context).whyLivecare, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20.0, letterSpacing: -0.64, color: CustomColors.darkGrey))),
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 20.0))),
Container( Container(
margin: EdgeInsets.only(top: 0.0, left: 20.0),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
SvgPicture.asset("assets/images/new-design/check_icon.svg", SvgPicture.asset("assets/images/new-design/allow.svg", width: 20),
width: 25),
Container( Container(
width: MediaQuery.of(context).size.width * 0.72, width: MediaQuery.of(context).size.width * 0.72,
margin: EdgeInsets.all(10.0), margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
child: Text( child: Text(TranslationBase.of(context).livecarePoint1,
TranslationBase.of(context).livecarePoint1, overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0, letterSpacing: -0.64, color: CustomColors.black, fontWeight: FontWeight.w600)),
overflow: TextOverflow.clip,
style: TextStyle(fontSize: 14.0)),
) )
], ],
), ),
), ),
Container( Container(
margin: EdgeInsets.only(top: 5.0, left: 20.0),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
SvgPicture.asset("assets/images/new-design/check_icon.svg", SvgPicture.asset("assets/images/new-design/allow.svg", width: 20),
width: 25),
Container( Container(
width: MediaQuery.of(context).size.width * 0.72, width: MediaQuery.of(context).size.width * 0.72,
margin: EdgeInsets.all(10.0), margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
child: Text(TranslationBase.of(context).docVirtualAppoIns4, child: Text(TranslationBase.of(context).docVirtualAppoIns4,
overflow: TextOverflow.clip, overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0, letterSpacing: -0.64, color: CustomColors.black, fontWeight: FontWeight.w600)),
style: TextStyle(fontSize: 14.0)),
) )
], ],
), ),
), ),
Container( Container(
margin: EdgeInsets.only(top: 5.0, left: 20.0),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
SvgPicture.asset("assets/images/new-design/check_icon.svg", SvgPicture.asset("assets/images/new-design/allow.svg", width: 20),
width: 25),
Container( Container(
width: MediaQuery.of(context).size.width * 0.72, width: MediaQuery.of(context).size.width * 0.72,
margin: EdgeInsets.all(10.0), margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
child: Text(TranslationBase.of(context).docVirtualAppoIns5, child: Text(TranslationBase.of(context).docVirtualAppoIns5,
overflow: TextOverflow.clip, overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0, letterSpacing: -0.64, color: CustomColors.black, fontWeight: FontWeight.w600)),
style: TextStyle(fontSize: 14.0)),
) )
], ],
), ),
), ),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 20.0),
child: Text( child: Text(TranslationBase.of(context).livecareSummary, style: TextStyle(fontSize: 14.0, letterSpacing: -0.64, color: CustomColors.textColor, fontWeight: FontWeight.w600))),
TranslationBase.of(context).livecareSummary,
style: TextStyle(fontSize: 12.0))), GridView(
InkWell( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9),
onTap: (){ physics: NeverScrollableScrollPhysics(),
Navigator.pop(context, "immediate"); padding: EdgeInsets.only(top: 40.0),
}, shrinkWrap: true,
child: Container( children: [
decoration: BoxDecoration( _loginOptionButton(TranslationBase.of(context).livecareOption1, 'assets/images/new/Live_Care.svg', 1),
color: Colors.red[900], _loginOptionButton(TranslationBase.of(context).livecareOption4, 'assets/images/new/book appointment.svg', 2),
borderRadius: BorderRadius.all(Radius.circular(10.0))), ],
height: 100.0,
margin: EdgeInsets.only(top: 20.0),
child: Row(
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 10.0, right: 10.0),
child: SvgPicture.asset(
"assets/images/new-design/liveCare_logo_icon_white.svg",
width: 80),
),
Container(
width: MediaQuery.of(context).size.width * 0.56,
margin: EdgeInsets.fromLTRB(30.0, 10.0, 0.0, 0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(TranslationBase.of(context).livecareOption1,
overflow: TextOverflow.clip,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18.0,
color: Colors.white)),
Container(
margin: EdgeInsets.only(top: 0.0),
child: Text(TranslationBase.of(context).livecareOption2, textAlign: TextAlign.start,
style: TextStyle(
fontSize: 18.0, color: Colors.white)),
)
],
),
),
],
)),
),
InkWell(
onTap: (){
Navigator.pop(context, "schedule");
},
child: Container(
decoration: BoxDecoration(
color: Colors.grey[600],
borderRadius: BorderRadius.all(Radius.circular(10.0))),
height: 100.0,
margin: EdgeInsets.only(top: 20.0),
child: Row(
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 10.0, right: 10.0),
child: Image.asset(
"assets/images/new-design/calendar.png",
width: 60),
),
Container(
width: MediaQuery.of(context).size.width * 0.53,
margin: EdgeInsets.fromLTRB(30.0, 10.0, 0.0, 0.0),
child: Column(
children: <Widget>[
Container(
child: Text(TranslationBase.of(context).livecareOption3,
overflow: TextOverflow.clip,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18.0,
color: Colors.white)),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text(TranslationBase.of(context).livecareOption4,
style: TextStyle(
fontSize: 18.0, color: Colors.white)),
)
],
),
),
],
)),
), ),
SizedBox( SizedBox(
height: 40.0, height: 40.0,
@ -221,6 +105,44 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
); );
} }
Widget _loginOptionButton(String _title, String _icon, int _loginIndex) {
return InkWell(
onTap: () {
if (_loginIndex == 1) {
Navigator.pop(context, "immediate");
} else {
Navigator.pop(context, "schedule");
}
},
child: Container(
padding: EdgeInsets.only(left: 20, right: 20, bottom: 15, top: 28),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
SvgPicture.asset(
_icon,
height: _loginIndex == 1 ? 60 : 50,
width: _loginIndex == 1 ? 60 : 50,
),
Text(
_title,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16),
),
],
),
),
);
}
getLanguageID() async { getLanguageID() async {
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
setState(() { setState(() {

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/models/LiveCare/ClinicsServiceTimingsResponse.dart'; import 'package:diplomaticquarterapp/models/LiveCare/ClinicsServiceTimingsResponse.dart';
import 'package:diplomaticquarterapp/models/LiveCare/LiveCareClinicsListResponse.dart'; import 'package:diplomaticquarterapp/models/LiveCare/LiveCareClinicsListResponse.dart';
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -14,11 +15,7 @@ class ClinicCard extends StatefulWidget {
var languageID; var languageID;
int isOnline; int isOnline;
ClinicCard( ClinicCard({this.isSelected, this.languageID, this.isOnline, @required this.patientERGetClinicsList});
{this.isSelected,
this.languageID,
this.isOnline,
@required this.patientERGetClinicsList});
@override @override
_State createState() => _State(); _State createState() => _State();
@ -35,90 +32,69 @@ class _State extends State<ClinicCard> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Row( return Container(
children: <Widget>[ width: double.infinity,
Card( margin: EdgeInsets.fromLTRB(15.0, 0.0, 15.0, 8.0),
margin: EdgeInsets.fromLTRB(15.0, 10.0, 8.0, 8.0), decoration: BoxDecoration(
color: widget.isSelected ? Color(0xff06b806) : widget.patientERGetClinicsList.isOnline == 1 ? Colors.white : Colors.grey, borderRadius: BorderRadius.all(
shape: RoundedRectangleBorder( Radius.circular(10.0),
borderRadius: BorderRadius.circular(10),
), ),
child: Container( border: Border.all(width: 2, color: widget.isSelected ? CustomColors.green : Color(0xffEFEFEF)),
width: MediaQuery.of(context).size.width * 0.75, boxShadow: [
padding: EdgeInsets.all(12.0), BoxShadow(
child: Column( color: Color(0xff000000).withOpacity(.05),
crossAxisAlignment: CrossAxisAlignment.start, blurRadius: 27,
mainAxisSize: MainAxisSize.max, offset: Offset(0, -3),
children: <Widget>[ ),
],
color: Colors.white),
child: Container(
padding: EdgeInsets.fromLTRB(12.0, 25.0, 12.0, 25.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
child: Text(widget.languageID == 'ar' ? widget.patientERGetClinicsList.serviceNameN : widget.patientERGetClinicsList.serviceName,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16)),
),
Row(
children: [
Container( Container(
child: Text( child: Text(".", style: TextStyle(fontSize: 30.0)),
widget.languageID == 'ar' ),
? widget.patientERGetClinicsList.serviceNameN Container(
: widget.patientERGetClinicsList.serviceName, child: Text("Online"),
style: TextStyle(
fontSize: 16.0,
color:
widget.isSelected ? Colors.white : Colors.black)),
), ),
], ],
), ),
), ],
),
InkWell(
onTap: () {
getClinicTimings(widget.patientERGetClinicsList);
},
child: Card(
margin: EdgeInsets.fromLTRB(8.0, 10.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
child: Container(
padding: EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Icon(Icons.access_time, size: 26.0, color: Colors.red[800]),
],
),
),
),
), ),
], ),
); );
} }
getClinicTimings(PatientERGetClinicsList patientERGetClinicsList) { getClinicTimings(PatientERGetClinicsList patientERGetClinicsList) {
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service service.getLivecareClinicTiming(patientERGetClinicsList.serviceID, context).then((res) {
.getLivecareClinicTiming(patientERGetClinicsList.serviceID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
clinicsServiceTimingsResponse = clinicsServiceTimingsResponse = ClinicsServiceTimingsResponse.fromJson(res);
ClinicsServiceTimingsResponse.fromJson(res); print(clinicsServiceTimingsResponse.patientERGetClinicsServiceTimingsList.length);
print(clinicsServiceTimingsResponse
.patientERGetClinicsServiceTimingsList.length);
showGeneralDialog( showGeneralDialog(
barrierColor: Colors.black.withOpacity(0.5), barrierColor: Colors.black.withOpacity(0.5),
transitionBuilder: (context, a1, a2, widget) { transitionBuilder: (context, a1, a2, widget) {
final curvedValue = final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0;
Curves.easeInOutBack.transform(a1.value) - 1.0;
return Transform( return Transform(
transform: transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity( child: Opacity(
opacity: a1.value, opacity: a1.value,
child: ClinicTimingsDialog( child: ClinicTimingsDialog(
clinicName: patientERGetClinicsList.serviceName, clinicName: patientERGetClinicsList.serviceName,
patientERGetClinicsServiceTimingsList: patientERGetClinicsServiceTimingsList: clinicsServiceTimingsResponse.patientERGetClinicsServiceTimingsList,
clinicsServiceTimingsResponse
.patientERGetClinicsServiceTimingsList,
), ),
), ),
); );

@ -76,11 +76,8 @@ class _clinic_listState extends State<ClinicList> {
if (LiveCareHome.isLiveCareTypeSelected != true) { if (LiveCareHome.isLiveCareTypeSelected != true) {
openLiveCareSelectionDialog(); openLiveCareSelectionDialog();
} else { } else {
print("LiveCare Type Selected");
setState(() { setState(() {
currentSelectedLiveCareType = "immediate"; currentSelectedLiveCareType = "immediate";
// isDataLoaded = true;
// print(liveCareOnlineClinicsListResponse.length);
getLiveCareClinicsList(); getLiveCareClinicsList();
}); });
} }
@ -440,33 +437,35 @@ class _clinic_listState extends State<ClinicList> {
isDataLoaded isDataLoaded
? Container( ? Container(
height: MediaQuery.of(context).size.height * 0.7, height: MediaQuery.of(context).size.height * 0.7,
child: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList.length > 0 ? Column( child: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList.length > 0
crossAxisAlignment: CrossAxisAlignment.start, ? Column(
children: <Widget>[ crossAxisAlignment: CrossAxisAlignment.start,
ListView.builder( children: <Widget>[
scrollDirection: Axis.vertical, ListView.builder(
shrinkWrap: true, scrollDirection: Axis.vertical,
physics: ScrollPhysics(), shrinkWrap: true,
padding: EdgeInsets.all(0.0), physics: ScrollPhysics(),
itemCount: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList.length, padding: EdgeInsets.all(0.0),
itemBuilder: (context, index) { itemCount: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList.length,
return InkWell( itemBuilder: (context, index) {
onTap: () { return InkWell(
updateSelectedScheduleIndex(liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[index]); onTap: () {
}, updateSelectedScheduleIndex(liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[index]);
child: ScheduleClinicCard( },
isSelected: selectedClinicID == liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[index].serviceID ? true : false, child: ScheduleClinicCard(
clinicsHaveScheduleList: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[index], isSelected: selectedClinicID == liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[index].serviceID ? true : false,
languageID: languageID, clinicsHaveScheduleList: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[index],
languageID: languageID,
),
);
},
), ),
); Container(
}, height: 10.0,
), ),
Container( ],
height: 10.0, )
), : getNoDataWidget(context),
],
): getNoDataWidget(context),
) )
: Container(), : Container(),
isDataLoaded isDataLoaded
@ -509,16 +508,11 @@ class _clinic_listState extends State<ClinicList> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container(
margin: EdgeInsets.all(15.0),
child: Text(TranslationBase.of(context).onlineClinics, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
),
ListView.builder( ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0), padding: const EdgeInsets.only(top: 16.0),
// itemCount: liveCareClinicsListResponse.patientERGetClinicsList.length,
itemCount: liveCareOnlineClinicsListResponse.length, itemCount: liveCareOnlineClinicsListResponse.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return InkWell( return InkWell(
@ -533,10 +527,10 @@ class _clinic_listState extends State<ClinicList> {
); );
}, },
), ),
Container( // Container(
margin: EdgeInsets.all(15.0), // margin: EdgeInsets.all(15.0),
child: Text(TranslationBase.of(context).offlineClinics, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), // child: Text(TranslationBase.of(context).offlineClinics, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
), // ),
ListView.builder( ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
@ -12,6 +13,7 @@ import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authent
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/models/Authentication/send_activation_request.dart'; import 'package:diplomaticquarterapp/models/Authentication/send_activation_request.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/login/register_new.dart';
import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
@ -21,6 +23,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -34,13 +37,12 @@ import 'package:intl/intl.dart';
import 'package:local_auth/auth_strings.dart'; import 'package:local_auth/auth_strings.dart';
import 'package:local_auth/local_auth.dart'; import 'package:local_auth/local_auth.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/pages/login/register_new.dart';
class ConfirmLogin extends StatefulWidget { class ConfirmLogin extends StatefulWidget {
final Function changePageViewIndex; final Function changePageViewIndex;
const ConfirmLogin({Key key, this.changePageViewIndex}) : super(key: key); const ConfirmLogin({Key key, this.changePageViewIndex}) : super(key: key);
@override @override
_ConfirmLogin createState() => _ConfirmLogin(); _ConfirmLogin createState() => _ConfirmLogin();
} }
@ -640,15 +642,14 @@ class _ConfirmLogin extends State<ConfirmLogin> {
if (result.isNeedUserAgreement == true) { if (result.isNeedUserAgreement == true) {
//move to agreement page. //move to agreement page.
} else { } else {
insertIMEI(); goToHome();
} }
} }
insertIMEI() { insertIMEI() {
authService.insertDeviceImei(selectedOption).then((value) => {goToHome()}).catchError((err) { authService.insertDeviceImei(selectedOption).then((value) => {}).catchError((err) {
print(err); print(err);
}); });
// authService.registeredAuthenticatedUser(data, token, 0, 0).then((res) => {});
} }
getToDoCount() { getToDoCount() {
@ -670,7 +671,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
projectViewModel.user = authenticatedUserObject.user; projectViewModel.user = authenticatedUserObject.user;
await authenticatedUserObject.getUser(getUser: true); await authenticatedUserObject.getUser(getUser: true);
getToDoCount(); // getToDoCount();
appointmentRateViewModel appointmentRateViewModel
.getIsLastAppointmentRatedList() .getIsLastAppointmentRatedList()
@ -694,13 +695,12 @@ class _ConfirmLogin extends State<ConfirmLogin> {
page: LandingPage(), page: LandingPage(),
), ),
(r) => false) (r) => false)
} },
insertIMEI()
}) })
.catchError((err) { .catchError((err) {
print(err); print(err);
//GifLoaderDialogUtils.hideDialog(context);
}); });
// SMSOTP.showLoadingDialog(context, false),
} }
loading(flag) { loading(flag) {
@ -752,37 +752,6 @@ class _ConfirmLogin extends State<ConfirmLogin> {
), ),
), ),
); );
// return InkWell(
// onTap: () {
// if (_flag == 0) {
// setState(() {
// isMoreOption = true;
// });
// } else {
// authenticateUser(4, isActive: _loginIndex);
// }
// },
// child: RoundedContainer(
// height: 150,
// borderColor: Colors.grey,
// showBorder: true,
// child: Padding(
// padding: EdgeInsets.fromLTRB(30, 15, 30, 15),
// child: Column(
// children: <Widget>[
// Image.asset(
// _icon,
// height: SizeConfig.imageSizeMultiplier * 13,
// width: SizeConfig.imageSizeMultiplier * 16,
// ),
// SizedBox(
// height: 20,
// ),
// Texts(_title, fontSize: SizeConfig.textMultiplier * 2, color: Colors.black)
// ],
// ),
// )));
} }
// todo 'sikander' optimize this after knowing usage // todo 'sikander' optimize this after knowing usage

@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/pages/packages_offers/PackageOrderCompleted
import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy-terms-conditions-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy-terms-conditions-page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart' as utils; import 'package:diplomaticquarterapp/uitl/utils.dart' as utils;
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/offers_packages/PackagesCartItemCard.dart'; import 'package:diplomaticquarterapp/widgets/offers_packages/PackagesCartItemCard.dart';
@ -36,6 +37,8 @@ class _PackagesCartPageState extends State<PackagesCartPage>
languageID = await sharedPref.getString(APP_LANGUAGE); languageID = await sharedPref.getString(APP_LANGUAGE);
} }
double subtotal,tax, total;
@override @override
void initState() { void initState() {
_agreeTerms = false; _agreeTerms = false;
@ -145,6 +148,9 @@ class _PackagesCartPageState extends State<PackagesCartPage>
.catchError((error) { .catchError((error) {
utils.Utils.showErrorToast(error); utils.Utils.showErrorToast(error);
}); });
if(response.status){
fetchData();
}
return response.status ?? false; return response.status ?? false;
}, },
)); ));
@ -170,9 +176,10 @@ class _PackagesCartPageState extends State<PackagesCartPage>
width: 100, width: 100,
color: Colors.grey[300], color: Colors.grey[300],
), ),
_paymentOptions(context, (paymentMethod) { Padding(
setState(() => _selectedPaymentMethod = paymentMethod); padding: const EdgeInsets.only(left: 12.0, right: 12.0),
}), child: getPaymentMethods(),
),
Container( Container(
height: 0.25, height: 0.25,
color: Colors.grey[300], color: Colors.grey[300],
@ -186,7 +193,7 @@ class _PackagesCartPageState extends State<PackagesCartPage>
height: 0.25, height: 0.25,
color: Colors.grey[300], color: Colors.grey[300],
), ),
_payNow(context, onPayNowClick: onPayNowClick) _payNow(context, subtotal: subtotal, tax: tax, total: total, onPayNowClick: onPayNowClick)
], ],
), ),
) )
@ -197,7 +204,12 @@ class _PackagesCartPageState extends State<PackagesCartPage>
} }
fetchData() async { fetchData() async {
await viewModel.service.cartItems(context: context).catchError((error) {}); await viewModel.service.cartItems(context: context).then((value){
subtotal = value['subtotal'] ?? 0.0;
tax = value['tax'] ?? 0.0;
total = value['total'] ?? 0.0;
}).catchError((error) {});
setState(() {}); setState(() {});
} }
@ -335,9 +347,13 @@ Widget _termsAndCondition(BuildContext context,
); );
} }
Widget _payNow(BuildContext context, {@required VoidCallback onPayNowClick}) { Widget _payNow(BuildContext context, {double subtotal, double tax, double total, @required VoidCallback onPayNowClick}) {
bool isPayNowAQctive = (_agreeTerms && (_selectedPaymentMethod != null)); bool isPayNowAQctive = (_agreeTerms && (_selectedPaymentMethod != null));
String _subtotal = (subtotal ?? 0.0).toStringAsFixed(2);
String _tax = (tax ?? 0.0).toStringAsFixed(2);
String _total = (total ?? 0).toStringAsFixed(2);
return Padding( return Padding(
padding: const EdgeInsets.all(5), padding: const EdgeInsets.all(5),
child: Container( child: Container(
@ -350,13 +366,13 @@ Widget _payNow(BuildContext context, {@required VoidCallback onPayNowClick}) {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
'${TranslationBase.of(context).subtotal}: ${'999.9'} ${TranslationBase.of(context).sar}', '${TranslationBase.of(context).subtotal}: $_subtotal ${TranslationBase.of(context).sar}',
heightFactor: 1.5, heightFactor: 1.5,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.grey, color: Colors.grey,
fontSize: 8), fontSize: 8),
Texts( Texts(
'${TranslationBase.of(context).vat}: ${'14.9'} ${TranslationBase.of(context).sar}', '${TranslationBase.of(context).vat}: $_tax ${TranslationBase.of(context).sar}',
heightFactor: 1.5, heightFactor: 1.5,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.grey, color: Colors.grey,
@ -370,7 +386,7 @@ Widget _payNow(BuildContext context, {@required VoidCallback onPayNowClick}) {
), ),
), ),
Texts( Texts(
'${TranslationBase.of(context).total}: 999.99 ${TranslationBase.of(context).sar}', '${TranslationBase.of(context).total}: $_total ${TranslationBase.of(context).sar}',
heightFactor: 1.5, heightFactor: 1.5,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black54, color: Colors.black54,

@ -10,7 +10,6 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/GestureIconButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/GestureIconButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -23,7 +22,10 @@ import 'package:provider/provider.dart';
import 'cart-page/cart-order-preview.dart'; import 'cart-page/cart-order-preview.dart';
class CartOrderPage extends StatefulWidget { class CartOrderPage extends StatefulWidget {
const CartOrderPage({Key key}) : super(key: key);
final Function(int) changeTab;
const CartOrderPage({Key key, this.changeTab}) : super(key: key);
@override @override
_CartOrderPageState createState() => _CartOrderPageState(); _CartOrderPageState createState() => _CartOrderPageState();
@ -36,6 +38,7 @@ class _CartOrderPageState extends State<CartOrderPage> {
void initState() { void initState() {
super.initState(); super.initState();
getData(); getData();
} }
@override @override
@ -46,10 +49,9 @@ class _CartOrderPageState extends State<CartOrderPage> {
final height = mediaQuery.size.height - 60 - mediaQuery.padding.top; final height = mediaQuery.size.height - 60 - mediaQuery.padding.top;
AppScaffold appScaffold; AppScaffold appScaffold;
return NetworkBaseView( return NetworkBaseView(
// baseViewModel: model,
isLoading: isLoading, isLoading: isLoading,
isLocalLoader: true, isLocalLoader: true,
child: AppScaffold( child: appScaffold = AppScaffold(
appBarTitle: TranslationBase.of(context).shoppingCart, appBarTitle: TranslationBase.of(context).shoppingCart,
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true, isPharmacy: true,
@ -202,13 +204,12 @@ class _CartOrderPageState extends State<CartOrderPage> {
indent: 0, indent: 0,
endIndent: 0, endIndent: 0,
), ),
getPaymentMethods(), Image.asset(
// Image.asset( "assets/images/pharmacy_module/payment.png",
// "assets/images/pharmacy_module/payment.png", width: mediaQuery.size.width - 20,
// width: mediaQuery.size.width - 20, height: 30.0,
// height: 30.0, fit: BoxFit.scaleDown,
// fit: BoxFit.scaleDown, ),
// ),
SizedBox( SizedBox(
height: 120, height: 120,
) )
@ -294,7 +295,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
Container( Container(
height: widget.height * 0.070, height: widget.height * 0.070,
color: Color(0xffe6ffe0), color: Color(0xffe6ffe0),
padding: EdgeInsets.symmetric(horizontal: 4), padding: EdgeInsets.only(left: 15.0, right: 15.0),
child: Row( child: Row(
children: [ children: [
InkWell( InkWell(
@ -354,7 +355,8 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
), ),
Container( Container(
height: widget.height * 0.065, height: widget.height * 0.065,
margin: EdgeInsets.symmetric(vertical: 2), margin: EdgeInsets.only(top: 5.0, bottom: 5.0),
padding: EdgeInsets.only(left: 20.0, right: 20.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -399,32 +401,27 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
onPressed: isAgree onPressed: isAgree
// && cart.cartResponse.shoppingCarts[1].product.stockQuantity ==0 // && cart.cartResponse.shoppingCarts[1].product.stockQuantity ==0
? () => { ? () => {
if (cart.isCartItemsOutOfStock()) if(cart.isCartItemsOutOfStock()){
{ // Toast msg
// Toast msg AppToast.showErrorToast(message: TranslationBase.of(context).outOfStockMsg)
AppToast.showErrorToast( }else {
message: TranslationBase.of(context) Navigator.push(
.outOfStockMsg) context,
} FadePage(
else page:
{ OrderPreviewPage(widget.addresses)))
Navigator.push( }
context, }
FadePage(
page: OrderPreviewPage(
widget.addresses)))
}
}
: null, : null,
child: new Text( child: new Text(
"${TranslationBase.of(context).checkOut}", "${TranslationBase.of(context).checkOut}",
style: new TextStyle( style: new TextStyle(
color: color:
isAgree ? Colors.white : Colors.grey.shade300, isAgree ? Colors.white : Colors.grey.shade300,
fontSize: 14), fontSize: 14),
), ),
color: Color(0xFF4CAF50), color: Color(0xFF4CAF50),
disabledColor: Color(0xFF4CAF50), disabledColor:Color(0xFF4CAF50),
// disabledColor: Color(0xff005aff), // disabledColor: Color(0xff005aff),
) )
// RaisedButton( // RaisedButton(

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/footor/quantity_box.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/footor/quantity_box.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
@ -10,8 +11,6 @@ import 'package:hexcolor/hexcolor.dart';
import '../../../../../locator.dart'; import '../../../../../locator.dart';
import '../../../../../routes.dart'; import '../../../../../routes.dart';
import '../../cart-page/cart-order-page.dart';
import '../product-detail.dart';
class FooterWidget extends StatefulWidget { class FooterWidget extends StatefulWidget {
final bool isAvailable; final bool isAvailable;
@ -26,13 +25,8 @@ class FooterWidget extends StatefulWidget {
int quantity; int quantity;
bool isOverQuantity; bool isOverQuantity;
FooterWidget(this.isAvailable, this.maxQuantity, this.minQuantity, FooterWidget(this.isAvailable, this.maxQuantity, this.minQuantity, this.quantityLimit, this.item,
this.quantityLimit, this.item, {this.quantity, this.isOverQuantity = false, this.addToCartFunction, this.addToShoppingCartFunction, this.model});
{this.quantity,
this.isOverQuantity = false,
this.addToCartFunction,
this.addToShoppingCartFunction,
this.model});
@override @override
_FooterWidgetState createState() => _FooterWidgetState(); _FooterWidgetState createState() => _FooterWidgetState();
@ -41,8 +35,7 @@ class FooterWidget extends StatefulWidget {
class _FooterWidgetState extends State<FooterWidget> { class _FooterWidgetState extends State<FooterWidget> {
double quantityUI = 80; double quantityUI = 80;
bool showUI = false; bool showUI = false;
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
locator<AuthenticatedUserObject>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -77,8 +70,7 @@ class _FooterWidgetState extends State<FooterWidget> {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Text( child: Text(
"Quantity", "Quantity",
style: TextStyle( style: TextStyle(fontSize: 15, fontWeight: FontWeight.bold),
fontSize: 15, fontWeight: FontWeight.bold),
), ),
), ),
InkWell( InkWell(
@ -101,11 +93,7 @@ class _FooterWidgetState extends State<FooterWidget> {
SizedBox( SizedBox(
width: 5, width: 5,
), ),
for (int i = 1; i <= 10; i++) for (int i = 1; i <= 10; i++) QuantityBox(label: i, onTapFunc: onChangeValue, isSelected: widget.quantity == i),
QuantityBox(
label: i,
onTapFunc: onChangeValue,
isSelected: widget.quantity == i),
Container( Container(
width: 100, width: 100,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -113,16 +101,14 @@ class _FooterWidgetState extends State<FooterWidget> {
color: Colors.white, color: Colors.white,
), ),
child: TextField( child: TextField(
decoration: InputDecoration( decoration: InputDecoration(labelText: ' Quantity # '),
labelText: ' Quantity # '),
onChanged: (text) { onChanged: (text) {
if (int.tryParse(text) == null) { if (int.tryParse(text) == null) {
text = ''; text = '';
} else { } else {
setState(() { setState(() {
widget.quantity = int.parse(text); widget.quantity = int.parse(text);
if (widget.quantity >= if (widget.quantity >= widget.quantityLimit) {
widget.quantityLimit) {
widget.isOverQuantity = true; widget.isOverQuantity = true;
} else { } else {
widget.isOverQuantity = false; widget.isOverQuantity = false;
@ -187,20 +173,14 @@ class _FooterWidgetState extends State<FooterWidget> {
width: MediaQuery.of(context).size.width * 0.45, width: MediaQuery.of(context).size.width * 0.45,
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase.of(context).addToCart.toUpperCase(), label: TranslationBase.of(context).addToCart.toUpperCase(),
disabled: !widget.isAvailable && widget.quantity == 0 || disabled: (!widget.isAvailable && widget.quantity > 0) || widget.quantity > widget.quantityLimit || widget.item.isRx,
widget.quantity > widget.quantityLimit ||
widget.item.rxMessage != null,
disableColor: Color(0xFF4CAF50),
onTap: () async { onTap: () async {
if (!authenticatedUserObject.isLogin) { if (!authenticatedUserObject.isLogin) {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
WELCOME_LOGIN, WELCOME_LOGIN,
); );
} else } else
await widget.addToCartFunction( await widget.addToCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model);
quantity: widget.quantity,
itemID: widget.item.id,
model: widget.model);
}, },
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
borderColor: Color(0xFF4CAF50), borderColor: Color(0xFF4CAF50),
@ -215,14 +195,9 @@ class _FooterWidgetState extends State<FooterWidget> {
width: MediaQuery.of(context).size.width * 0.35, width: MediaQuery.of(context).size.width * 0.35,
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase.of(context).buyNow.toUpperCase(), label: TranslationBase.of(context).buyNow.toUpperCase(),
disabled: !widget.isAvailable && widget.quantity > 0 || disabled: (!widget.isAvailable && widget.quantity > 0) || (widget.quantity > widget.quantityLimit) || widget.item.isRx,
widget.quantity > widget.quantityLimit ||
widget.item.rxMessage != null,
onTap: () async { onTap: () async {
await widget.addToShoppingCartFunction( await widget.addToShoppingCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model);
quantity: widget.quantity,
itemID: widget.item.id,
model: widget.model);
Navigator.push( Navigator.push(
context, context,
FadePage(page: CartOrderPage()), FadePage(page: CartOrderPage()),
@ -232,11 +207,7 @@ class _FooterWidgetState extends State<FooterWidget> {
borderColor: Colors.grey[800], borderColor: Colors.grey[800],
borderRadius: 3, borderRadius: 3,
disableColor: Colors.grey[700], disableColor: Colors.grey[700],
color: !widget.isAvailable && widget.quantity > 0 || color: !widget.isAvailable && widget.quantity > 0 || widget.quantity > widget.quantityLimit || widget.item.rxMessage != null ? Colors.grey : Colors.grey[800],
widget.quantity > widget.quantityLimit ||
widget.item.rxMessage != null
? Colors.grey
: Colors.grey[800],
), ),
), ),
], ],

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -12,7 +13,6 @@ import 'package:provider/provider.dart';
import '../../../../../locator.dart'; import '../../../../../locator.dart';
import '../../../compare-list.dart'; import '../../../compare-list.dart';
import '../../cart-page/cart-order-page.dart';
import 'icon_with_bg.dart'; import 'icon_with_bg.dart';
class ProductAppBar extends StatelessWidget with PreferredSizeWidget { class ProductAppBar extends StatelessWidget with PreferredSizeWidget {

@ -5,8 +5,6 @@ import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_h
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/home/ViewAllHomeWidget.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/home/ViewAllHomeWidget.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -27,30 +25,21 @@ class PrescriptionsWidget extends StatelessWidget {
isLocalLoader: true, isLocalLoader: true,
baseViewModel: model, baseViewModel: model,
child: Container( child: Container(
height: model.prescriptionsList.length > 0
? MediaQuery.of(context).size.height * 0.28
: 0,
child: Column( child: Column(
children: [ children: [
ViewAllHomeWidget( ViewAllHomeWidget(TranslationBase.of(context).myPrescription, HomePrescriptionsPage()),
TranslationBase.of(context).myPrescription,
HomePrescriptionsPage()),
Container( Container(
padding: EdgeInsets.symmetric( margin: EdgeInsets.only(right: 10.0, left: 10.0),
horizontal: 18.0, vertical: 14.0), height: MediaQuery.of(context).size.height * 0.18,
margin: EdgeInsets.only(left: 10),
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
// physics: NeverScrollableScrollPhysics(),
itemCount: model.prescriptionsList.length, itemCount: model.prescriptionsList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return Container(
height: MediaQuery.of(context).size.height * 0.3, padding: EdgeInsets.only(left: 8.0, right: 8.0),
padding: EdgeInsets.only( margin: EdgeInsets.only(right: 5.0, left: 5.0),
bottom: 5.0, left: 5.0, right: 8.0),
margin: EdgeInsets.only(right: 10.0),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
color: Colors.grey, color: Colors.grey,
@ -59,167 +48,130 @@ class PrescriptionsWidget extends StatelessWidget {
), ),
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(10.0)), borderRadius: BorderRadius.circular(10.0)),
child: Column( child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
crossAxisAlignment: CrossAxisAlignment.start, Row(
children: <Widget>[ children: <Widget>[
Row( Column(children: [
children: <Widget>[ Container(
Column(children: [ padding: EdgeInsets.only(
Container( top: 10.0,
padding: EdgeInsets.only( left: 10.0,
top: 10.0, right: 10.0,
left: 10.0, bottom: 15.0,
right: 10.0, ),
bottom: 15.0, child: CircleAvatar(
), radius: 30,
child: CircleAvatar( backgroundColor: Colors.transparent,
radius: 30, child: Image.network(
backgroundColor: model.prescriptionsList[index].doctorImageURL,
Colors.transparent, width: 60,
child: Image.network( height: 60,
model.prescriptionsList[index]
.doctorImageURL,
width: 60,
height: 60,
),
),
), ),
]),
Column(
children: [
Container(
margin:
EdgeInsets.only(left: 1),
padding: EdgeInsets.only(
left: 15.0, right: 15.0),
decoration: BoxDecoration(
border: Border.all(
color: Colors.green,
style: BorderStyle.solid,
width: 4.0,
),
color: Colors.green,
borderRadius:
BorderRadius.circular(
30.0)),
child: Text(
model.languageID == "ar"
? model
.prescriptionsList[
index]
.isInOutPatientDescriptionN
.toString()
: model
.prescriptionsList[
index]
.isInOutPatientDescription
.toString(),
style: TextStyle(
color: Colors.white,
fontSize: 15.0,
),
)),
Row(children: <Widget>[
Image.asset(
'assets/images/Icon-awesome-calendar.png',
width: 30,
height: 30,
),
Text(
DateUtil.convertStringToDate(
model
.prescriptionsList[
index]
.appointmentDate
.toString())
.toString()
.substring(0, 10),
style: TextStyle(
color: Colors.black,
fontSize: 15.0,
),
)
]),
],
), ),
], ),
), ]),
Row( Column(
crossAxisAlignment: children: [
CrossAxisAlignment.start,
children: <Widget>[
Container( Container(
margin: EdgeInsets.only(left: 5), margin: EdgeInsets.only(left: 1),
child: Row(children: <Widget>[ padding: EdgeInsets.only(left: 15.0, right: 15.0),
Text( decoration: BoxDecoration(
model.prescriptionsList[index] border: Border.all(
.doctorTitle color: Colors.green,
.toString(), style: BorderStyle.solid,
style: TextStyle( width: 4.0,
color: Colors.black, ),
fontSize: 15.0, color: Colors.green,
fontWeight: FontWeight.bold, borderRadius: BorderRadius.circular(30.0)),
), child: Text(
), model.languageID == "ar"
Text( ? model.prescriptionsList[index].isInOutPatientDescriptionN.toString()
model.prescriptionsList[index] : model.prescriptionsList[index].isInOutPatientDescription.toString(),
.doctorName
.toString(),
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.white,
fontSize: 15.0, fontSize: 15.0,
fontWeight: FontWeight.bold,
), ),
), )),
]), Row(children: <Widget>[
), Image.asset(
], 'assets/images/Icon-awesome-calendar.png',
), width: 30,
Row( height: 30,
crossAxisAlignment: ),
CrossAxisAlignment.start, Text(
children: <Widget>[ DateUtil.convertStringToDate(model.prescriptionsList[index].appointmentDate.toString()).toString().substring(0, 10),
Container(
margin: EdgeInsets.only(left: 5),
child: Text(
model.prescriptionsList[index]
.clinicDescription
.toString(),
style: TextStyle( style: TextStyle(
color: Colors.green, color: Colors.black,
fontSize: 15.0, fontSize: 15.0,
// fontWeight: FontWeight.bold,
), ),
)
]),
],
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 5),
child: Row(children: <Widget>[
Text(
model.prescriptionsList[index].doctorTitle.toString(),
style: TextStyle(
color: Colors.black,
fontSize: 15.0,
fontWeight: FontWeight.bold,
), ),
), ),
], Text(
model.prescriptionsList[index].doctorName.toString(),
style: TextStyle(
color: Colors.black,
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
),
]),
), ),
Row( ],
crossAxisAlignment: ),
CrossAxisAlignment.start, Row(
children: <Widget>[ crossAxisAlignment: CrossAxisAlignment.start,
Container( children: <Widget>[
margin: EdgeInsets.only(left: 5), Container(
child: Align( margin: EdgeInsets.only(left: 5),
alignment: Alignment.topLeft, child: Text(
child: RatingBar.readOnly( model.prescriptionsList[index].clinicDescription.toString(),
initialRating: model style: TextStyle(
.prescriptionsList[index] color: Colors.green,
.actualDoctorRate fontSize: 15.0,
.toDouble(), // fontWeight: FontWeight.bold,
),
),
),
],
),
Row(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
Container(
margin: EdgeInsets.only(left: 5),
child: Align(
alignment: Alignment.topLeft,
child: RatingBar.readOnly(
initialRating: model.prescriptionsList[index].actualDoctorRate.toDouble(),
// initialRating: productRate, // initialRating: productRate,
size: 15.0, size: 15.0,
filledColor: Colors.yellow[700], filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500], emptyColor: Colors.grey[500],
isHalfAllowed: true, isHalfAllowed: true,
halfFilledIcon: Icons.star_half, halfFilledIcon: Icons.star_half,
filledIcon: Icons.star, filledIcon: Icons.star,
emptyIcon: Icons.star, emptyIcon: Icons.star,
), ),
), ),
) )
]), ]),
]), ]),
); );
}), }),
), ),

@ -77,16 +77,16 @@ class PackagesCartItemCardState extends State<PackagesCartItemCard> {
), ),
), ),
Positioned( // Positioned(
bottom: 8, // bottom: 8,
left: 10, // left: 10,
child: Row( // child: Row(
children: [ // children: [
_totalLabel(context: context), // _totalLabel(context: context),
_totalPrice((widget.itemModel.product.price * widget.itemModel.quantity), context: context), // _totalPrice((widget.itemModel.product.price * widget.itemModel.quantity), context: context),
], // ],
), // ),
) // )
], ],
) )
) )
@ -136,15 +136,18 @@ Widget _itemName(String name) => Padding(
); );
Widget _itemPrice(double price, {@required BuildContext context}) => Padding( Widget _itemPrice(double price, {@required BuildContext context}) {
final prc = (price ?? 0.0).toStringAsFixed(2);
return Padding(
padding: const EdgeInsets.all(0), padding: const EdgeInsets.all(0),
child: Texts( child: Texts(
'${price} ${TranslationBase.of(context).sar}', '${prc} ${TranslationBase.of(context).sar}',
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.green, color: Colors.green,
fontSize: 15 fontSize: 15
) )
); );
}
// -------------------- // --------------------
@ -159,16 +162,19 @@ Widget _priceSeperator() => Padding(
// -------------------- // --------------------
// Product Price // Product Price
// -------------------- // --------------------
Widget _itemOldPrice(double oldPrice, {@required BuildContext context}) => Padding( Widget _itemOldPrice(double oldPrice, {@required BuildContext context}) {
final prc = (oldPrice ?? 0.0).toStringAsFixed(2);
return Padding(
padding: const EdgeInsets.all(0), padding: const EdgeInsets.all(0),
child: Texts( child: Texts(
'${oldPrice} ${TranslationBase.of(context).sar}', '${prc} ${TranslationBase.of(context).sar}',
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
decoration: TextDecoration.lineThrough, decoration: TextDecoration.lineThrough,
color: Colors.grey, color: Colors.grey,
fontSize: 10 fontSize: 10
) )
); );
}
// -------------------- // --------------------
// Product Price // Product Price

@ -1,6 +1,6 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/order/ProductReview.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/ProductReview.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -26,27 +26,27 @@ class productTile extends StatelessWidget {
final dynamic productID; final dynamic productID;
final Function onDelete; final Function onDelete;
final dynamic approvedTotalReviews; final dynamic approvedTotalReviews;
// final VoidCallback deleteWishlistItems;
productTile( // final VoidCallback deleteWishlistItems;
{this.productName,
this.productPrice,
this.productRate,
this.productReviews,
this.qyt,
this.totalPrice,
this.isOrderDetails = false,
this.productImage,
this.showLine = true,
this.img,
this.imgs,
this.status,
this.product,
this.productID,
this.onDelete,
this.approvedTotalReviews,
}); productTile({
this.productName,
this.productPrice,
this.productRate,
this.productReviews,
this.qyt,
this.totalPrice,
this.isOrderDetails = false,
this.productImage,
this.showLine = true,
this.img,
this.imgs,
this.status,
this.product,
this.productID,
this.onDelete,
this.approvedTotalReviews,
});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -91,10 +91,7 @@ class productTile extends StatelessWidget {
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: productName, text: productName,
style: TextStyle( style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
), ),
), ),
), ),
@ -106,19 +103,16 @@ class productTile extends StatelessWidget {
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: 'SAR $productPrice', text: 'SAR $productPrice',
style: TextStyle( style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
), ),
), ),
), ),
), ),
this.isOrderDetails == false this.isOrderDetails == false
? Row( ? Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Align( child: Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
@ -134,14 +128,12 @@ class productTile extends StatelessWidget {
), ),
), ),
), ),
Text( '$approvedTotalReviews', Text(
style: TextStyle( '$approvedTotalReviews',
fontWeight: FontWeight.bold, style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey, fontSize: 13),
color: Colors.grey, ),
fontSize: 13), ],
), )
],
)
: Container(), : Container(),
], ],
), ),
@ -164,9 +156,11 @@ class productTile extends StatelessWidget {
height: 50, height: 50,
), ),
IconButton( IconButton(
icon: Icon(Icons.shopping_cart, icon: Icon(
Icons.shopping_cart,
size: 18, size: 18,
color: Colors.blue,), color: Colors.blue,
),
onPressed: () async { onPressed: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await addToCartFunction(1, productID); await addToCartFunction(1, productID);
@ -192,13 +186,8 @@ class productTile extends StatelessWidget {
margin: EdgeInsets.only(bottom: 5.0), margin: EdgeInsets.only(bottom: 5.0),
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: TranslationBase.of(context).quantity + text: TranslationBase.of(context).quantity + "" + '$qyt',
"" + style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey, fontSize: 13),
'$qyt',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.grey,
fontSize: 13),
), ),
), ),
), ),
@ -224,10 +213,7 @@ class productTile extends StatelessWidget {
RichText( RichText(
text: TextSpan( text: TextSpan(
text: ' $totalPrice SAR', text: ' $totalPrice SAR',
style: TextStyle( style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 15),
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 15),
), ),
), ),
], ],
@ -268,30 +254,19 @@ class productTile extends StatelessWidget {
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: '($productReviews reviews)', text: '($productReviews reviews)',
style: TextStyle( style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey, fontSize: 13),
fontWeight: FontWeight.bold,
color: Colors.grey,
fontSize: 13),
), ),
), ),
), ),
), ),
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(context, FadePage(page: ProductReviewPage(product)));
context, FadePage(page: ProductReviewPage(product)));
}, },
child: Container( child: Container(
padding: padding: EdgeInsets.only(left: 13.0, right: 13.0, top: 5.0),
EdgeInsets.only(left: 13.0, right: 13.0, top: 5.0),
height: 30.0, height: 30.0,
decoration: BoxDecoration( decoration: BoxDecoration(border: Border.all(color: Colors.orange, style: BorderStyle.solid, width: 1.0), color: Colors.transparent, borderRadius: BorderRadius.circular(5.0)),
border: Border.all(
color: Colors.orange,
style: BorderStyle.solid,
width: 1.0),
color: Colors.transparent,
borderRadius: BorderRadius.circular(5.0)),
child: Text( child: Text(
TranslationBase.of(context).writeReview, TranslationBase.of(context).writeReview,
style: TextStyle( style: TextStyle(

Loading…
Cancel
Save