video call camera view issue fix, barcode plugin change, smart watches improvements.

merge-requests/575/head
Sikander Saleem 3 years ago
parent caec2c4ca4
commit 628439ddf8

@ -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);

@ -34,8 +34,10 @@ class _CamViewWidgetState extends State<CamViewWidget> {
child: Stack(
children: [
FractionallySizedBox(
heightFactor: 1, widthFactor: 1,
heightFactor: 1,
widthFactor: 1,
child: Container(
color: Colors.black87,
child: RTCVideoView(widget.remoteRenderer, mirror: true),
),
),

@ -339,6 +339,12 @@ class _LandingPageState extends State<LandingPage> 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;

@ -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<LandingPagePharmacy> {
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);

@ -348,11 +348,11 @@ class _IncomingCallState extends State<IncomingCall> 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) {

@ -36,40 +36,29 @@ class _HealthDataListState extends State<HealthDataList> {
appBarTitle: TranslationBase.of(context).smartWatches,
isShowAppBar: true,
showNewAppBar: true,
backgroundColor: Color(0xffF7F7F7),
showNewAppBarTitle: true,
body: Container(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
body: Column(
children: [
Container(
width: double.infinity,
height: 20,
),
Padding(
padding: EdgeInsets.only(left: 12, right: 12),
Expanded(
child: GridView.builder(
shrinkWrap: true,
primary: false,
physics: NeverScrollableScrollPhysics(),
physics: BouncingScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12),
padding: EdgeInsets.zero,
padding: EdgeInsets.all(21),
itemCount: myMedicalList.length,
itemBuilder: (BuildContext context, int index) {
return myMedicalList[index];
},
),
),
syncHealthDataButton(),
],
),
),
),
bottomSheet: syncHealthDataButton(),
);
}
List<Widget> myOptionsList(BuildContext context) {
List<Widget> medical = List();
List<Widget> medical = [];
medical.add(InkWell(
onTap: () => Navigator.push(

@ -44,46 +44,48 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
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(
body: Column(
children: [
Expanded(
child: 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(
),
DefaultButton(
TranslationBase.of(context).continues,
() {
_openHealthDataList();
},
color: Color(0xff359846),
),
).insideContainer
],
),
);
}
_getAppleWatchInstructions() {
return SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Container(
width: double.infinity,
margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8),
padding: EdgeInsets.all(21),
physics: BouncingScrollPhysics(),
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)),
Text(
TranslationBase.of(context).supportedWatches,
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.w600,
letterSpacing: -1.2,
color: Color(0xff2E303A),
),
Container(
child: Row(
),
Row(
children: [
Expanded(
child: Container(
@ -121,7 +123,6 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
),
],
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
@ -245,27 +246,34 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
],
),
),
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)),
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.all(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),
),
),
SizedBox(height: 12),
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)),
),
),
],
),
),
],
),
);
@ -273,14 +281,19 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
_getGoogleWatchInstructions() {
return SingleChildScrollView(
child: Container(
width: double.infinity,
margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8),
padding: EdgeInsets.all(21),
physics: BouncingScrollPhysics(),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: Text(TranslationBase.of(context).supportedWatches, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.w600)),
Text(
TranslationBase.of(context).supportedWatches,
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.w600,
letterSpacing: -1.2,
color: Color(0xff2E303A),
),
),
Container(
child: Row(
@ -421,36 +434,48 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
],
),
),
SizedBox(height: 12),
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)),
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),
),
),
SizedBox(height: 12),
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)),
child: Text(
TranslationBase.of(context).watchInstructions,
style: TextStyle(color: CustomColors.accentColor, fontWeight: FontWeight.w600, letterSpacing: -0.64, decoration: TextDecoration.underline),
),
),
],
),
),
);
}
@ -470,21 +495,22 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
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(
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(TranslationBase.of(context).smartWatches, style: TextStyle(fontSize: 22.0, color: Colors.black, fontWeight: FontWeight.w600, letterSpacing: -0.64)),
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: Colors.black,
color: Color(0xff2E303A),
),
onPressed: () {
Navigator.pop(context);
@ -492,47 +518,84 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
),
],
),
Text(
TranslationBase.of(context).syncInstructionsIntro3,
style: TextStyle(
fontSize: 14.0,
letterSpacing: -0.56,
color: Color(0xff575757),
),
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)),
),
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)),
),
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).iosInstructions2,
style: TextStyle(
fontSize: 14.0,
letterSpacing: -0.56,
color: Color(0xff575757),
),
),
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)),
),
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).androidInstructions2,
style: TextStyle(
fontSize: 14.0,
letterSpacing: -0.56,
color: Color(0xff575757),
),
),
SizedBox(height: 12),
Text(
TranslationBase.of(context).androidInstructions3,
style: TextStyle(
fontSize: 14.0,
letterSpacing: -0.56,
color: Color(0xff575757),
),
),
SizedBox(height: 12),
Text(
TranslationBase.of(context).androidInstructions4,
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)),
),
],
),

@ -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<syncHealthDataButton> {
@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 {

@ -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<PharmacyCategorisePage> {
/// 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'];

@ -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();
}

@ -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<AppScaffold> {
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
AppBarWidget appBar;
@override
@ -185,8 +184,7 @@ class _AppScaffoldState extends State<AppScaffold> {
builder: (BuildContext context) {
return InkWell(
onTap: () {
Provider.of<PharmacyPagesViewModel>(context, listen: false)
.changeCurrentTab(0);
Provider.of<PharmacyPagesViewModel>(context, listen: false).changeCurrentTab(0);
},
child: Container(
height: 2.0,
@ -216,12 +214,9 @@ class _AppScaffoldState extends State<AppScaffold> {
AppGlobal.context = context;
PharmacyPagesViewModel pagesViewModel = Provider.of(context);
bool isUserNotLogin =
(!Provider.of<ProjectViewModel>(context, listen: false).isLogin &&
widget.isShowDecPage);
bool isUserNotLogin = (!Provider.of<ProjectViewModel>(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<AppScaffold> {
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<AppScaffold> {
widget.changeCurrentTab(value);
} else {
Navigator.pushAndRemoveUntil(
locator<NavigationService>().navigatorKey.currentContext,
MaterialPageRoute(
builder: (context) => LandingPagePharmacy(currentTab: value)),
(Route<dynamic> r) => false);
locator<NavigationService>().navigatorKey.currentContext, MaterialPageRoute(builder: (context) => LandingPagePharmacy(currentTab: value)), (Route<dynamic> 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<AppScaffold> {
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<AppScaffold> {
}
buildBodyWidget(context) {
return Stack(children: <Widget>[
widget.body,
widget.isHelp == true ? RobotIcon() : Container()
]);
return Stack(children: <Widget>[widget.body, widget.isHelp == true ? RobotIcon() : Container()]);
}
}
@ -347,16 +332,7 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
final List<Widget> 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<int>(
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<AuthenticatedUserObject>();
final AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
final String appBarTitle;
final bool showHomeAppBarIcon;
@ -509,22 +475,12 @@ class AppBarWidgetState extends State<AppBarWidget> {
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<AppBarWidget> {
? 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<AppBarWidget> {
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<AppBarWidget> {
icon: Icon(FontAwesomeIcons.home),
color: Colors.white,
onPressed: () {
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (context) => LandingPage()),
(Route<dynamic> r) => false);
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
// Cart Click Event
if (_onCartClick != null) _onCartClick();

@ -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

Loading…
Cancel
Save