From 628439ddf8d880cc2268bd10388084cd3ce41808 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Mon, 6 Dec 2021 12:00:38 +0300 Subject: [PATCH] video call camera view issue fix, barcode plugin change, smart watches improvements. --- lib/core/viewModels/qr_view_model.dart | 4 +- .../web_rtc/widgets/cam_view_widget.dart | 4 +- lib/pages/landing/landing_page.dart | 6 + lib/pages/landing/landing_page_pharmcy.dart | 6 +- lib/pages/livecare/incoming_call.dart | 4 +- .../health_data_list.dart | 43 +- .../smart_watch_instructions.dart | 807 ++++++++++-------- .../syncHealthData.dart | 19 +- lib/pages/pharmacy_categorise.dart | 4 +- lib/uitl/app_toast.dart | 80 +- lib/widgets/others/app_scaffold_widget.dart | 97 +-- pubspec.yaml | 8 +- 12 files changed, 506 insertions(+), 576 deletions(-) diff --git a/lib/core/viewModels/qr_view_model.dart b/lib/core/viewModels/qr_view_model.dart index a4a08e3f..da597a0b 100644 --- a/lib/core/viewModels/qr_view_model.dart +++ b/lib/core/viewModels/qr_view_model.dart @@ -1,6 +1,6 @@ import 'dart:convert'; -import 'package:barcode_scan_fix/barcode_scan.dart'; +import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/qr/qr_parking_model.dart'; @@ -16,7 +16,7 @@ class QrViewModel extends BaseViewModel { readQr() async { //TODO fix the barcode scan - String result = await BarcodeScanner.scan(); + String result = (await BarcodeScanner.scan())?.rawContent; var data = json.decode(result); var qRParkingID = data['QRParkingID']; setState(ViewState.BusyLocal); diff --git a/lib/pages/conference/web_rtc/widgets/cam_view_widget.dart b/lib/pages/conference/web_rtc/widgets/cam_view_widget.dart index d27dad55..da502f03 100644 --- a/lib/pages/conference/web_rtc/widgets/cam_view_widget.dart +++ b/lib/pages/conference/web_rtc/widgets/cam_view_widget.dart @@ -34,8 +34,10 @@ class _CamViewWidgetState extends State { child: Stack( children: [ FractionallySizedBox( - heightFactor: 1, widthFactor: 1, + heightFactor: 1, + widthFactor: 1, child: Container( + color: Colors.black87, child: RTCVideoView(widget.remoteRenderer, mirror: true), ), ), diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index efe9f031..cf6b86e4 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -339,6 +339,12 @@ class _LandingPageState extends State with WidgetsBindingObserver { LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); if (!isPageNavigated) { isPageNavigated = true; + + + + + + Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) { Future.delayed(Duration(seconds: 5), () { isPageNavigated = false; diff --git a/lib/pages/landing/landing_page_pharmcy.dart b/lib/pages/landing/landing_page_pharmcy.dart index c90a317a..d84fc445 100644 --- a/lib/pages/landing/landing_page_pharmcy.dart +++ b/lib/pages/landing/landing_page_pharmcy.dart @@ -1,4 +1,4 @@ -import 'package:barcode_scan_fix/barcode_scan.dart'; +import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; @@ -86,9 +86,9 @@ class _LandingPagePharmacyState extends State { void _scanQrAndGetProduct() async { try { - String result = await BarcodeScanner.scan(); + ScanResult result = await BarcodeScanner.scan(); try { - String barcode = result; + String barcode = result?.rawContent; GifLoaderDialogUtils.showMyDialog(context); await BaseAppClient().getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode", onSuccess: (dynamic response, int statusCode) { print(response); diff --git a/lib/pages/livecare/incoming_call.dart b/lib/pages/livecare/incoming_call.dart index 09a13205..8a26e779 100644 --- a/lib/pages/livecare/incoming_call.dart +++ b/lib/pages/livecare/incoming_call.dart @@ -337,7 +337,7 @@ class _IncomingCallState extends State with SingleTickerProviderSt } Future _submit() async { - // backToHome(); + // backToHome(); try { final roomModel = RoomModel(name: widget.incomingCallData.name, token: widget.incomingCallData.sessionId, identity: widget.incomingCallData.identity); @@ -348,11 +348,11 @@ class _IncomingCallState extends State with SingleTickerProviderSt // ConferencePage(roomModel: roomModel), // ), // ); + await _controller.dispose(); await Navigator.of(context).pushReplacement( MaterialPageRoute( fullscreenDialog: true, builder: (BuildContext context) => CallHomePage(receiverId: widget.incomingCallData.receiverID, callerId: widget.incomingCallData.callerID), - ), ); } catch (err) { diff --git a/lib/pages/medical/smart_watch_health_data/health_data_list.dart b/lib/pages/medical/smart_watch_health_data/health_data_list.dart index 80a12cca..48902ff0 100644 --- a/lib/pages/medical/smart_watch_health_data/health_data_list.dart +++ b/lib/pages/medical/smart_watch_health_data/health_data_list.dart @@ -36,40 +36,29 @@ class _HealthDataListState extends State { appBarTitle: TranslationBase.of(context).smartWatches, isShowAppBar: true, showNewAppBar: true, + backgroundColor: Color(0xffF7F7F7), showNewAppBarTitle: true, - body: Container( - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: double.infinity, - height: 20, - ), - Padding( - padding: EdgeInsets.only(left: 12, right: 12), - child: GridView.builder( - shrinkWrap: true, - primary: false, - physics: NeverScrollableScrollPhysics(), - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12), - padding: EdgeInsets.zero, - itemCount: myMedicalList.length, - itemBuilder: (BuildContext context, int index) { - return myMedicalList[index]; - }, - ), - ), - ], + body: Column( + children: [ + Expanded( + child: GridView.builder( + physics: BouncingScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12), + padding: EdgeInsets.all(21), + itemCount: myMedicalList.length, + itemBuilder: (BuildContext context, int index) { + return myMedicalList[index]; + }, + ), ), - ), + syncHealthDataButton(), + ], ), - bottomSheet: syncHealthDataButton(), ); } List myOptionsList(BuildContext context) { - List medical = List(); + List medical = []; medical.add(InkWell( onTap: () => Navigator.push( diff --git a/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart index 17d9d8a8..0c0be8c3 100644 --- a/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart +++ b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart @@ -44,228 +44,236 @@ class _SmartWatchInstructionsState extends State { isShowDecPage: true, showNewAppBar: true, showNewAppBarTitle: true, + backgroundColor: Color(0xffF7F7F7), description: TranslationBase.of(context).infoHealthData, imagesInfo: [ ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/health-data/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/health-data/ar/0.png'), ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/health-data/en/1.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/health-data/ar/1.png') ], - body: Container( - child: Platform.isIOS ? _getAppleWatchInstructions() : _getGoogleWatchInstructions(), - ), - bottomSheet: Container( - color: Theme.of(context).scaffoldBackgroundColor, - padding: EdgeInsets.fromLTRB(15.0, 0.0, 15.0, 30.0), - child: DefaultButton( - TranslationBase.of(context).continues, - () { - _openHealthDataList(); - }, - color: Color(0xff359846), - ), + body: Column( + children: [ + Expanded( + child: Container( + child: Platform.isIOS ? _getAppleWatchInstructions() : _getGoogleWatchInstructions(), + ), + ), + DefaultButton( + TranslationBase.of(context).continues, + () { + _openHealthDataList(); + }, + color: Color(0xff359846), + ).insideContainer + ], ), ); } _getAppleWatchInstructions() { return SingleChildScrollView( + padding: EdgeInsets.all(21), + physics: BouncingScrollPhysics(), child: Column( crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, children: [ - Container( - width: double.infinity, - margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.only(top: 10.0, bottom: 10.0), - child: Text(TranslationBase.of(context).supportedWatches, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.w600)), - ), - Container( + Text( + TranslationBase.of(context).supportedWatches, + style: TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.w600, + letterSpacing: -1.2, + color: Color(0xff2E303A), + ), + ), + Row( + children: [ + Expanded( + child: Container( + margin: EdgeInsets.only(top: 10.0), child: Row( children: [ - Expanded( - child: Container( - margin: EdgeInsets.only(top: 10.0), - child: Row( - children: [ - Image.asset("assets/images/SmartWatches/apple-watch-1.jpeg", width: 70.0, height: 70.0), - Padding( - padding: const EdgeInsets.only(left: 8.0, right: 8.0), - child: Container( - width: MediaQuery.of(context).size.width * 0.22, - child: Text("Apple Watch Series 1", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), - ), - ) - ], - ), - ), - ), - Expanded( + Image.asset("assets/images/SmartWatches/apple-watch-1.jpeg", width: 70.0, height: 70.0), + Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), child: Container( - margin: EdgeInsets.only(top: 10.0), - child: Row( - children: [ - Image.asset("assets/images/SmartWatches/apple-watch-2.jpg", width: 70.0, height: 70.0), - Padding( - padding: const EdgeInsets.only(left: 8.0, right: 8.0), - child: Container( - width: MediaQuery.of(context).size.width * 0.22, - child: Text("Apple Watch Series 2", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), - ), - ) - ], - ), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Apple Watch Series 1", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ), - ), + ) ], ), ), - Container( + ), + Expanded( + child: Container( margin: EdgeInsets.only(top: 10.0), child: Row( children: [ - Expanded( + Image.asset("assets/images/SmartWatches/apple-watch-2.jpg", width: 70.0, height: 70.0), + Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), child: Container( - margin: EdgeInsets.only(top: 15.0), - child: Row( - children: [ - Image.asset("assets/images/SmartWatches/apple-watch-3.jpg", width: 70.0, height: 70.0), - Padding( - padding: const EdgeInsets.only(left: 8.0, right: 8.0), - child: Container( - width: MediaQuery.of(context).size.width * 0.22, - child: Text("Apple Watch Series 3", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), - ), - ) - ], - ), - ), - ), - Expanded( - child: Container( - margin: EdgeInsets.only(top: 15.0), - child: Row( - children: [ - Image.asset("assets/images/SmartWatches/apple-watch-4.jpg", width: 70.0, height: 70.0), - Padding( - padding: const EdgeInsets.only(left: 8.0, right: 8.0), - child: Container( - width: MediaQuery.of(context).size.width * 0.22, - child: Text("Apple Watch Series 4", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), - ), - ) - ], - ), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Apple Watch Series 2", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ), - ), + ) ], ), ), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Row( - children: [ - Expanded( - child: Container( - margin: EdgeInsets.only(top: 15.0), - child: Row( - children: [ - Image.asset("assets/images/SmartWatches/apple-watch-5.jpg", width: 70.0, height: 70.0), - Padding( - padding: const EdgeInsets.only(left: 8.0, right: 8.0), - child: Container( - width: MediaQuery.of(context).size.width * 0.22, - child: Text("Apple Watch Series 5", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), - ), - ) - ], - ), - ), - ), - Expanded( - child: Container( - margin: EdgeInsets.only(top: 15.0), - child: Row( - children: [ - Image.asset("assets/images/SmartWatches/Apple-Watch-6.png", width: 70.0, height: 70.0), - Padding( - padding: const EdgeInsets.only(left: 8.0, right: 8.0), - child: Container( - width: MediaQuery.of(context).size.width * 0.22, - child: Text("Apple Watch Series 6", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), - ), - ) - ], + ), + ], + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Expanded( + child: Container( + margin: EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset("assets/images/SmartWatches/apple-watch-3.jpg", width: 70.0, height: 70.0), + Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Container( + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Apple Watch Series 3", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ), - ), - ), - ], + ) + ], + ), ), ), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Row( - children: [ - Expanded( - child: Container( - margin: EdgeInsets.only(top: 15.0), - child: Row( - children: [ - Image.asset("assets/images/SmartWatches/miBand3.jpg", width: 70.0, height: 70.0), - Padding( - padding: const EdgeInsets.only(left: 8.0, right: 8.0), - child: Container( - width: MediaQuery.of(context).size.width * 0.22, - child: Text("Mi Band 3", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), - ), - ) - ], + Expanded( + child: Container( + margin: EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset("assets/images/SmartWatches/apple-watch-4.jpg", width: 70.0, height: 70.0), + Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Container( + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Apple Watch Series 4", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ), - ), - ), - Expanded( - child: Container( - margin: EdgeInsets.only(top: 15.0), - child: Row( - children: [ - Image.asset("assets/images/SmartWatches/miBand4.jpg", width: 70.0, height: 70.0), - Padding( - padding: const EdgeInsets.only(left: 8.0, right: 8.0), - child: Container( - width: MediaQuery.of(context).size.width * 0.22, - child: Text("Mi Band 4", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), - ), - ) - ], + ) + ], + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Expanded( + child: Container( + margin: EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset("assets/images/SmartWatches/apple-watch-5.jpg", width: 70.0, height: 70.0), + Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Container( + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Apple Watch Series 5", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ), - ), - ), - ], + ) + ], + ), ), ), - Container( - margin: EdgeInsets.fromLTRB(10.0, 30.0, 10.0, 10.0), - child: Text(TranslationBase.of(context).syncInstructionsIntro1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), + Expanded( + child: Container( + margin: EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset("assets/images/SmartWatches/Apple-Watch-6.png", width: 70.0, height: 70.0), + Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Container( + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Apple Watch Series 6", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), + ), + ) + ], + ), + ), ), - Container( - margin: EdgeInsets.all(10.0), - child: Text(TranslationBase.of(context).syncInstructionsIntro2, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Expanded( + child: Container( + margin: EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset("assets/images/SmartWatches/miBand3.jpg", width: 70.0, height: 70.0), + Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Container( + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Mi Band 3", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), + ), + ) + ], + ), + ), ), - InkWell( - onTap: () { - showInstructionsDialog(); - }, - child: Padding( - padding: const EdgeInsets.only(left: 10.0, right: 10.0), - child: Text(TranslationBase.of(context).watchInstructions, - style: TextStyle(color: CustomColors.accentColor, fontWeight: FontWeight.w600, letterSpacing: -0.64, decoration: TextDecoration.underline)), + Expanded( + child: Container( + margin: EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset("assets/images/SmartWatches/miBand4.jpg", width: 70.0, height: 70.0), + Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Container( + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Mi Band 4", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), + ), + ) + ], + ), ), ), ], ), ), + SizedBox(height: 12), + Text( + TranslationBase.of(context).syncInstructionsIntro1, + style: TextStyle( + fontSize: 14.0, + letterSpacing: -0.56, + fontWeight: FontWeight.w600, + color: Color(0xff575757), + ), + ), + SizedBox(height: 12), + Text( + TranslationBase.of(context).syncInstructionsIntro2, + style: TextStyle( + fontSize: 14.0, + letterSpacing: -0.56, + fontWeight: FontWeight.w600, + color: Color(0xff575757), + ), + ), + SizedBox(height: 12), + InkWell( + onTap: () { + showInstructionsDialog(); + }, + child: Text(TranslationBase.of(context).watchInstructions, + style: TextStyle(color: CustomColors.accentColor, fontWeight: FontWeight.w600, letterSpacing: -0.64, decoration: TextDecoration.underline)), + ), ], ), ); @@ -273,183 +281,200 @@ class _SmartWatchInstructionsState extends State { _getGoogleWatchInstructions() { return SingleChildScrollView( - child: Container( - width: double.infinity, - margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: Text(TranslationBase.of(context).supportedWatches, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.w600)), + padding: EdgeInsets.all(21), + physics: BouncingScrollPhysics(), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).supportedWatches, + style: TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.w600, + letterSpacing: -1.2, + color: Color(0xff2E303A), ), - Container( - child: Row( - children: [ - Expanded( - child: Container( - margin: EdgeInsets.only(top: 10.0), - child: Row( - children: [ - Image.asset("assets/images/SmartWatches/huawei-watch-2.png", width: 70.0, height: 70.0), - Container( - width: MediaQuery.of(context).size.width * 0.22, - child: Text("Huawei Watch 2", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), - ) - ], - ), + ), + Container( + child: Row( + children: [ + Expanded( + child: Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Image.asset("assets/images/SmartWatches/huawei-watch-2.png", width: 70.0, height: 70.0), + Container( + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Huawei Watch 2", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), + ) + ], ), ), - Expanded( - child: Container( - margin: EdgeInsets.only(top: 10.0), - child: Row( - children: [ - Image.asset("assets/images/SmartWatches/ticwatche2.png", width: 70.0, height: 70.0), - Container( - width: MediaQuery.of(context).size.width * 0.22, - child: Text("Mobovi TicWatch E2", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), - ) - ], - ), + ), + Expanded( + child: Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Image.asset("assets/images/SmartWatches/ticwatche2.png", width: 70.0, height: 70.0), + Container( + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Mobovi TicWatch E2", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), + ) + ], ), ), - ], - ), + ), + ], ), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Row( - children: [ - Expanded( - child: Container( - margin: EdgeInsets.only(top: 15.0), - child: Row( - children: [ - Image.asset("assets/images/SmartWatches/huawei-watch-2-classic.png", width: 70.0, height: 70.0), - Container( - width: MediaQuery.of(context).size.width * 0.22, - child: Text("Huawei Watch", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), - ) - ], - ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Expanded( + child: Container( + margin: EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset("assets/images/SmartWatches/huawei-watch-2-classic.png", width: 70.0, height: 70.0), + Container( + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Huawei Watch", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), + ) + ], ), ), - Expanded( - child: Container( - margin: EdgeInsets.only(top: 15.0), - child: Row( - children: [ - Image.asset("assets/images/SmartWatches/ticwatche2.png", width: 70.0, height: 70.0), - Container( - width: MediaQuery.of(context).size.width * 0.22, - child: Text("Fossil Sport", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), - ) - ], - ), + ), + Expanded( + child: Container( + margin: EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset("assets/images/SmartWatches/ticwatche2.png", width: 70.0, height: 70.0), + Container( + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Fossil Sport", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), + ) + ], ), ), - ], - ), + ), + ], ), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Row( - children: [ - Expanded( - child: Container( - margin: EdgeInsets.only(top: 15.0), - child: Row( - children: [ - Image.asset("assets/images/SmartWatches/misfit-vapor-2.jpg", width: 70.0, height: 70.0), - Container( - width: MediaQuery.of(context).size.width * 0.22, - child: Text("MisFit Vapor 2", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), - ) - ], - ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Expanded( + child: Container( + margin: EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset("assets/images/SmartWatches/misfit-vapor-2.jpg", width: 70.0, height: 70.0), + Container( + width: MediaQuery.of(context).size.width * 0.22, + child: Text("MisFit Vapor 2", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), + ) + ], ), ), - Expanded( - child: Container( - margin: EdgeInsets.only(top: 15.0), - child: Row( - children: [ - Image.asset("assets/images/SmartWatches/lg-watch-sport.jpg", width: 70.0, height: 70.0), - Container( - width: MediaQuery.of(context).size.width * 0.22, - child: Text("LG Watch Sport", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), - ) - ], - ), + ), + Expanded( + child: Container( + margin: EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset("assets/images/SmartWatches/lg-watch-sport.jpg", width: 70.0, height: 70.0), + Container( + width: MediaQuery.of(context).size.width * 0.22, + child: Text("LG Watch Sport", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), + ) + ], ), ), - ], - ), + ), + ], ), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Row( - children: [ - Expanded( - child: Container( - margin: EdgeInsets.only(top: 15.0), - child: Row( - children: [ - Image.asset("assets/images/SmartWatches/miBand3.jpg", width: 70.0, height: 70.0), - Container( - width: MediaQuery.of(context).size.width * 0.22, - child: Text("Mi Band 3", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), - ) - ], - ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Expanded( + child: Container( + margin: EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset("assets/images/SmartWatches/miBand3.jpg", width: 70.0, height: 70.0), + Container( + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Mi Band 3", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), + ) + ], ), ), - Expanded( - child: Container( - margin: EdgeInsets.only(top: 15.0), - child: Row( - children: [ - Image.asset("assets/images/SmartWatches/miBand4.jpg", width: 70.0, height: 70.0), - Container( - width: MediaQuery.of(context).size.width * 0.22, - child: Text("Mi Band 4", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), - ) - ], - ), + ), + Expanded( + child: Container( + margin: EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset("assets/images/SmartWatches/miBand4.jpg", width: 70.0, height: 70.0), + Container( + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Mi Band 4", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), + ) + ], ), ), - ], - ), + ), + ], ), - InkWell( - onTap: () { - launch("https://wearos.google.com/#find-your-watch"); - }, - child: Container( - margin: EdgeInsets.only(top: 20.0), - child: Text(TranslationBase.of(context).moreSupportedWatches, style: TextStyle(fontSize: 14.0, color: Colors.blue, decoration: TextDecoration.underline, letterSpacing: -0.36)), - ), + ), + SizedBox(height: 12), + InkWell( + onTap: () { + launch("https://wearos.google.com/#find-your-watch"); + }, + child: Text( + TranslationBase.of(context).moreSupportedWatches, + style: TextStyle(fontSize: 14.0, color: Colors.blue, fontWeight: FontWeight.w600, decoration: TextDecoration.underline, letterSpacing: -0.56), ), - Container( - margin: EdgeInsets.only(top: 10.0, bottom: 10.0), - child: Text(TranslationBase.of(context).syncInstructionsIntro1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), + ), + SizedBox(height: 12), + Text( + TranslationBase.of(context).syncInstructionsIntro1, + style: TextStyle( + fontSize: 14.0, + letterSpacing: -0.56, + fontWeight: FontWeight.w600, + color: Color(0xff575757), ), - Container( - margin: EdgeInsets.only(top: 10.0, bottom: 10.0), - child: Text(TranslationBase.of(context).syncInstructionsIntro2, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), + ), + SizedBox(height: 12), + Text( + TranslationBase.of(context).syncInstructionsIntro2, + style: TextStyle( + fontSize: 14.0, + letterSpacing: -0.56, + fontWeight: FontWeight.w600, + color: Color(0xff575757), ), - InkWell( - onTap: () { - showInstructionsDialog(); - }, - child: Padding( - padding: const EdgeInsets.only(top: 10.0, bottom: 10.0), - child: Text(TranslationBase.of(context).watchInstructions, - style: TextStyle(color: CustomColors.accentColor, fontWeight: FontWeight.w600, letterSpacing: -0.64, decoration: TextDecoration.underline)), - ), + ), + SizedBox(height: 12), + InkWell( + onTap: () { + showInstructionsDialog(); + }, + child: Text( + TranslationBase.of(context).watchInstructions, + style: TextStyle(color: CustomColors.accentColor, fontWeight: FontWeight.w600, letterSpacing: -0.64, decoration: TextDecoration.underline), ), - ], - ), + ), + ], ), ); } @@ -470,69 +495,107 @@ class _SmartWatchInstructionsState extends State { children: [ Container( width: 350.0, + padding: EdgeInsets.all(21), color: Colors.white, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - width: MediaQuery.of(context).size.width, - padding: EdgeInsets.all(20.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text(TranslationBase.of(context).smartWatches, style: TextStyle(fontSize: 22.0, color: Colors.black, fontWeight: FontWeight.w600, letterSpacing: -0.64)), - IconButton( - icon: Icon( - Icons.close, - color: Colors.black, - ), - onPressed: () { - Navigator.pop(context); - }, + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + TranslationBase.of(context).smartWatches, + style: TextStyle(fontSize: 18.0, color: Color(0xff2E303A), fontWeight: FontWeight.w600, letterSpacing: -1.2), + ), + IconButton( + icon: Icon( + Icons.close, + color: Color(0xff2E303A), ), - ], - ), + onPressed: () { + Navigator.pop(context); + }, + ), + ], ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 10.0), - child: Text(TranslationBase.of(context).syncInstructionsIntro3, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), + Text( + TranslationBase.of(context).syncInstructionsIntro3, + style: TextStyle( + fontSize: 14.0, + letterSpacing: -0.56, + color: Color(0xff575757), + ), ), + SizedBox(height: 12), Platform.isIOS ? Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 10.0), - child: Text(TranslationBase.of(context).iosInstructions1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), + Text( + TranslationBase.of(context).iosInstructions1, + style: TextStyle( + fontSize: 14.0, + letterSpacing: -0.56, + color: Color(0xff575757), + ), ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 10.0), - child: Text(TranslationBase.of(context).iosInstructions2, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), + SizedBox(height: 12), + Text( + TranslationBase.of(context).iosInstructions2, + style: TextStyle( + fontSize: 14.0, + letterSpacing: -0.56, + color: Color(0xff575757), + ), ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 21.0), - child: Text(TranslationBase.of(context).iosInstructions3, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), + SizedBox(height: 12), + Text( + TranslationBase.of(context).iosInstructions3, + style: TextStyle( + fontSize: 14.0, + letterSpacing: -0.56, + color: Color(0xff575757), + ), ), ], ) : Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 10.0), - child: Text(TranslationBase.of(context).androidInstructions1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), + Text( + TranslationBase.of(context).androidInstructions1, + style: TextStyle( + fontSize: 14.0, + letterSpacing: -0.56, + color: Color(0xff575757), + ), ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 10.0), - child: Text(TranslationBase.of(context).androidInstructions2, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), + SizedBox(height: 12), + Text( + TranslationBase.of(context).androidInstructions2, + style: TextStyle( + fontSize: 14.0, + letterSpacing: -0.56, + color: Color(0xff575757), + ), ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 10.0), - child: Text(TranslationBase.of(context).androidInstructions3, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), + SizedBox(height: 12), + Text( + TranslationBase.of(context).androidInstructions3, + style: TextStyle( + fontSize: 14.0, + letterSpacing: -0.56, + color: Color(0xff575757), + ), ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 10.0), - child: Text(TranslationBase.of(context).androidInstructions4, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), + SizedBox(height: 12), + Text( + TranslationBase.of(context).androidInstructions4, + style: TextStyle( + fontSize: 14.0, + letterSpacing: -0.56, + color: Color(0xff575757), + ), ), ], ), diff --git a/lib/pages/medical/smart_watch_health_data/syncHealthData.dart b/lib/pages/medical/smart_watch_health_data/syncHealthData.dart index 7b089935..19d74f20 100644 --- a/lib/pages/medical/smart_watch_health_data/syncHealthData.dart +++ b/lib/pages/medical/smart_watch_health_data/syncHealthData.dart @@ -11,13 +11,7 @@ import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; class syncHealthDataButton extends StatefulWidget { - double marginTop; - - double hight; - - double minWidth; - - syncHealthDataButton({this.marginTop, this.hight, this.minWidth}); + syncHealthDataButton(); @override _syncHealthDataButtonState createState() => _syncHealthDataButtonState(); @@ -50,16 +44,7 @@ class _syncHealthDataButtonState extends State { @override Widget build(BuildContext context) { - return Container( - color: Colors.white, - child: Padding( - padding: const EdgeInsets.all(20.0), - child: DefaultButton(TranslationBase.of(context).syncHealthData, () { - print("ReadAll"); - readAll(); - }), - ), - ); + return DefaultButton(TranslationBase.of(context).syncHealthData, () => readAll()).insideContainer; } void readAll() async { diff --git a/lib/pages/pharmacy_categorise.dart b/lib/pages/pharmacy_categorise.dart index 9ed1070f..9a364cf4 100644 --- a/lib/pages/pharmacy_categorise.dart +++ b/lib/pages/pharmacy_categorise.dart @@ -1,6 +1,6 @@ import 'dart:convert'; -import 'package:barcode_scan_fix/barcode_scan.dart'; +import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; @@ -277,7 +277,7 @@ class _PharmacyCategorisePageState extends State { /// When give qr we will change this method to get data /// var result = await BarcodeScanner.scan(); /// int patientID = get from qr result - String result = await BarcodeScanner.scan(); + String result = (await BarcodeScanner.scan())?.rawContent; var data = json.decode(result); if (data != null) { var qRParkingID = data['QRParkingID']; diff --git a/lib/uitl/app_toast.dart b/lib/uitl/app_toast.dart index 16aaba3b..30864569 100644 --- a/lib/uitl/app_toast.dart +++ b/lib/uitl/app_toast.dart @@ -1,20 +1,9 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_flexible_toast/flutter_flexible_toast.dart'; +import 'package:fluttertoast/fluttertoast.dart'; class AppToast { - /// show long toast message - /// [message] to show for user - /// [timeInSeconds] how many second the toast will appear to the user - /// [toastLength] the time we show the message but should be Toast.LENGTH_SHORT , Toast.LENGTH_LONG - /// [toastGravity] the position of the toast in the screen - /// [backgroundColor] the background color of the toast - /// [textColor] the text color of the toast - /// [icon] the icon you want include in the toast - /// [radius] the radius of the toast - /// [elevation] an overlay color will be applied to indicate elevation. - /// [imageSize] image size inside the toast static void showToast({ @required String message, Toast toastLength, @@ -23,34 +12,14 @@ class AppToast { ToastGravity toastGravity, Color backgroundColor, Color textColor, - ICON icon, int radius, int elevation, int imageSize, }) { - FlutterFlexibleToast.showToast( - message: message, - toastLength: toastLength, - timeInSeconds: timeInSeconds, - fontSize: fontSize, - toastGravity: toastGravity, - backgroundColor: backgroundColor, - textColor: textColor, - icon: icon, - radius: radius, - elevation: elevation, - imageSize: imageSize); + Fluttertoast.showToast( + msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds, backgroundColor: backgroundColor, textColor: textColor, fontSize: fontSize); } - /// show Success toast message - /// [message] to show for user - /// [timeInSeconds] how many second the toast will appear to the user - /// [toastLength] the time we show the message but should be Toast.LENGTH_SHORT , Toast.LENGTH_LONG - /// [toastGravity] the position of the toast in the screen - /// [textColor] the text color of the toast - /// [radius] the radius of the toast - /// [elevation] an overlay color will be applied to indicate elevation. - /// [imageSize] image size inside the toast static void showSuccessToast({ @required String message, Toast toastLength = Toast.LENGTH_LONG, @@ -62,29 +31,9 @@ class AppToast { int elevation, int imageSize = 32, }) { - FlutterFlexibleToast.showToast( - message: message, - toastLength: toastLength, - timeInSeconds: timeInSeconds = 2, - fontSize: fontSize, - toastGravity: toastGravity, - backgroundColor: Colors.green, - textColor: textColor, - icon: ICON.SUCCESS, - radius: radius, - elevation: elevation, - imageSize: imageSize); + Fluttertoast.showToast(msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds, backgroundColor: Colors.green, textColor: textColor, fontSize: fontSize); } - /// show Error toast message - /// [message] to show for user - /// [timeInSeconds] how many second the toast will appear to the user - /// [toastLength] the time we show the message but should be Toast.LENGTH_SHORT , Toast.LENGTH_LONG - /// [toastGravity] the position of the toast in the screen - /// [textColor] the text color of the toast - /// [radius] the radius of the toast - /// [elevation] an overlay color will be applied to indicate elevation. - /// [imageSize] image size inside the toast static void showErrorToast({ @required String message, Toast toastLength = Toast.LENGTH_LONG, @@ -96,30 +45,15 @@ class AppToast { int elevation, int imageSize = 32, }) { - FlutterFlexibleToast.showToast( - message: message, - toastLength: toastLength, - timeInSeconds: timeInSeconds, - fontSize: fontSize, - toastGravity: toastGravity, - backgroundColor: Colors.red, - textColor: textColor, - icon: ICON.CLOSE, - radius: radius, - elevation: elevation, - imageSize: imageSize - ); - + Fluttertoast.showToast(msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds, backgroundColor: Colors.red, textColor: textColor, fontSize: fontSize); } - /// cancel toast void cancelToast() { - FlutterFlexibleToast.cancel(); + Fluttertoast.cancel(); } void backWithEmpty() { - AppToast.showErrorToast( - message: TranslationBase.of(AppGlobal.context).empty); + AppToast.showErrorToast(message: TranslationBase.of(AppGlobal.context).empty); Navigator.of(AppGlobal.context).pop(); } diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index c5b45b77..26feae87 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -1,6 +1,6 @@ import 'package:auto_size_text/auto_size_text.dart'; import 'package:badges/badges.dart'; -import 'package:barcode_scan_fix/barcode_scan.dart'; +import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; @@ -135,8 +135,7 @@ class AppScaffold extends StatefulWidget { } class _AppScaffoldState extends State { - AuthenticatedUserObject authenticatedUserObject = - locator(); + AuthenticatedUserObject authenticatedUserObject = locator(); AppBarWidget appBar; @override @@ -185,8 +184,7 @@ class _AppScaffoldState extends State { builder: (BuildContext context) { return InkWell( onTap: () { - Provider.of(context, listen: false) - .changeCurrentTab(0); + Provider.of(context, listen: false).changeCurrentTab(0); }, child: Container( height: 2.0, @@ -216,12 +214,9 @@ class _AppScaffoldState extends State { AppGlobal.context = context; PharmacyPagesViewModel pagesViewModel = Provider.of(context); - bool isUserNotLogin = - (!Provider.of(context, listen: false).isLogin && - widget.isShowDecPage); + bool isUserNotLogin = (!Provider.of(context, listen: false).isLogin && widget.isShowDecPage); return Scaffold( - backgroundColor: - widget.backgroundColor ?? CustomColors.appBackgroudGrey2Color, + backgroundColor: widget.backgroundColor ?? CustomColors.appBackgroudGrey2Color, // appBar: widget.isShowPharmacyAppbar // ? pharmacyAppbar() @@ -254,8 +249,7 @@ class _AppScaffoldState extends State { isPharmacy: widget.isPharmacy, showPharmacyCart: widget.showPharmacyCart, isOfferPackages: widget.isOfferPackages, - showOfferPackagesCart: - widget.showOfferPackagesCart, + showOfferPackagesCart: widget.showOfferPackagesCart, isShowDecPage: widget.isShowDecPage, backButtonTab: widget.backButtonTab, ) @@ -294,22 +288,17 @@ class _AppScaffoldState extends State { widget.changeCurrentTab(value); } else { Navigator.pushAndRemoveUntil( - locator().navigatorKey.currentContext, - MaterialPageRoute( - builder: (context) => LandingPagePharmacy(currentTab: value)), - (Route r) => false); + locator().navigatorKey.currentContext, MaterialPageRoute(builder: (context) => LandingPagePharmacy(currentTab: value)), (Route r) => false); } } void _scanQrAndGetProduct() async { try { - String result = await BarcodeScanner.scan(); + String result = (await BarcodeScanner.scan())?.rawContent; try { String barcode = result; GifLoaderDialogUtils.showMyDialog(context); - await BaseAppClient() - .getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode", - onSuccess: (dynamic response, int statusCode) { + await BaseAppClient().getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode", onSuccess: (dynamic response, int statusCode) { print(response); var product = PharmacyProduct.fromJson(response["products"][0]); GifLoaderDialogUtils.hideDialog(context); @@ -319,8 +308,7 @@ class _AppScaffoldState extends State { AppToast.showErrorToast(message: "Product not found"); }); } catch (apiEx) { - AppToast.showErrorToast( - message: "Something went wrong, please try again"); + AppToast.showErrorToast(message: "Something went wrong, please try again"); } } catch (barcodeEx) {} } @@ -330,10 +318,7 @@ class _AppScaffoldState extends State { } buildBodyWidget(context) { - return Stack(children: [ - widget.body, - widget.isHelp == true ? RobotIcon() : Container() - ]); + return Stack(children: [widget.body, widget.isHelp == true ? RobotIcon() : Container()]); } } @@ -347,16 +332,7 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget { final List appBarIcons; Function onTap; - NewAppBarWidget( - {Key key, - this.showTitle = false, - this.showDropDown = false, - this.title = "", - this.dropDownList, - this.appBarIcons, - this.dropdownIndexValue, - this.dropDownIndexChange, - this.onTap}) + NewAppBarWidget({Key key, this.showTitle = false, this.showDropDown = false, this.title = "", this.dropDownList, this.appBarIcons, this.dropdownIndexValue, this.dropDownIndexChange, this.onTap}) : super(key: key); @override @@ -381,13 +357,7 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget { title, maxLines: 1, style: TextStyle( - fontSize: 24, - fontFamily: - (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), - fontWeight: FontWeight.w700, - color: Color(0xff2B353E), - letterSpacing: -1.44, - height: 35 / 24), + fontSize: 24, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24), ), ), if (showDropDown) @@ -399,8 +369,7 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget { alignedDropdown: true, child: DropdownButton( iconEnabledColor: CustomColors.grey2, - style: TextStyle( - color: CustomColors.lightGreyColor, fontSize: 12), + style: TextStyle(color: CustomColors.lightGreyColor, fontSize: 12), dropdownColor: CustomColors.lightGreyColor, value: dropdownIndexValue, items: [ @@ -411,9 +380,7 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget { dropDownList[i], style: TextStyle( fontSize: 12, - fontFamily: (projectViewModel.isArabic - ? 'Cairo' - : 'Poppins'), + fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w600, color: Color(0xff2B2E31), letterSpacing: -.48, @@ -455,8 +422,7 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget { } class AppBarWidget extends StatefulWidget with PreferredSizeWidget { - final AuthenticatedUserObject authenticatedUserObject = - locator(); + final AuthenticatedUserObject authenticatedUserObject = locator(); final String appBarTitle; final bool showHomeAppBarIcon; @@ -509,22 +475,12 @@ class AppBarWidgetState extends State { return AppBar( elevation: 0, - backgroundColor: widget.isPharmacy - ? Colors.green - : Theme.of(context).appBarTheme.color, + backgroundColor: widget.isPharmacy ? Colors.green : Theme.of(context).appBarTheme.color, textTheme: TextTheme( - headline6: TextStyle( - color: Theme.of(context).textTheme.headline1.color, - fontWeight: FontWeight.bold), + headline6: TextStyle(color: Theme.of(context).textTheme.headline1.color, fontWeight: FontWeight.bold), ), - title: Text( - widget.authenticatedUserObject.isLogin || !widget.isShowDecPage - ? widget.appBarTitle.toUpperCase() - : TranslationBase.of(context).serviceInformationTitle, - style: TextStyle( - fontWeight: FontWeight.bold, - color: Theme.of(context).textTheme.headline1.color, - fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')), + title: Text(widget.authenticatedUserObject.isLogin || !widget.isShowDecPage ? widget.appBarTitle.toUpperCase() : TranslationBase.of(context).serviceInformationTitle, + style: TextStyle(fontWeight: FontWeight.bold, color: Theme.of(context).textTheme.headline1.color, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')), leading: Builder( builder: (BuildContext context) { return ArrowBack( @@ -538,8 +494,7 @@ class AppBarWidgetState extends State { ? IconButton( icon: Badge( badgeContent: Text( - orderPreviewViewModel.cartResponse.quantityCount - .toString(), + orderPreviewViewModel.cartResponse.quantityCount.toString(), style: TextStyle(color: Colors.white), ), child: Icon(Icons.shopping_cart)), @@ -554,10 +509,7 @@ class AppBarWidgetState extends State { position: BadgePosition.topStart(top: -15, start: -10), badgeContent: Text( _badgeText, - style: TextStyle( - fontSize: 9, - color: Colors.white, - fontWeight: FontWeight.normal), + style: TextStyle(fontSize: 9, color: Colors.white, fontWeight: FontWeight.normal), ), child: Icon(Icons.shopping_cart)), color: Colors.white, @@ -571,10 +523,7 @@ class AppBarWidgetState extends State { icon: Icon(FontAwesomeIcons.home), color: Colors.white, onPressed: () { - Navigator.pushAndRemoveUntil( - context, - MaterialPageRoute(builder: (context) => LandingPage()), - (Route r) => false); + Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route r) => false); // Cart Click Event if (_onCartClick != null) _onCartClick(); diff --git a/pubspec.yaml b/pubspec.yaml index 8cf5ace0..93465dac 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -53,7 +53,8 @@ dependencies: maps_launcher: ^2.0.1 url_launcher: ^6.0.15 shared_preferences: ^2.0.9 - flutter_flexible_toast: ^0.1.4 +# flutter_flexible_toast: ^0.1.4 + fluttertoast: ^8.0.8 firebase_messaging: ^11.1.0 firebase_analytics: ^8.3.4 # Progress bar @@ -91,7 +92,8 @@ dependencies: flutter_polyline_points: ^1.0.0 location: ^4.3.0 # Qr code Scanner - barcode_scan_fix: ^1.0.2 +# barcode_scan_fix: ^1.0.2 + barcode_scan2: ^4.1.4 # Rating Stars rating_bar: ^0.2.0 @@ -134,7 +136,7 @@ dependencies: jiffy: ^4.1.0 #Flutter WebRTC - flutter_webrtc: ^0.7.1 + flutter_webrtc: ^0.8.0 screen: ^0.0.5