Merge branch 'development_new_design_2.0' into haroon-new-design

merge-requests/559/head
haroon amjad 4 years ago
commit eb64962d7c

@ -15,8 +15,8 @@ const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
// const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';

@ -57,7 +57,15 @@ class _FooterWidgetState extends State<FooterWidget> {
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(0.0), Radius.circular(0.0),
), ),
border: Border.all(color: Color(0xFF707070), width: 0), boxShadow: [
BoxShadow(
color: Color(0xFFCCCCCC),
spreadRadius: 0,
blurRadius: 4,
offset: Offset(2, 2), // changes position of shadow
),
],
// border: Border.all(color: Color(0xFF707070), width: 0),
), ),
width: double.infinity, width: double.infinity,
height: quantityUI, height: quantityUI,
@ -219,12 +227,12 @@ class _FooterWidgetState extends State<FooterWidget> {
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.35, width: MediaQuery.of(context).size.width * 0.35,
margin: EdgeInsets.symmetric( vertical: 5.0),
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase.of(context).addToCart, label: TranslationBase.of(context).addToCart,
disabled: (!widget.isAvailable && widget.quantity > 0) || disabled: isAddToCartDisable(),
widget.quantity > widget.quantityLimit || fontSize: 15,
widget.item.isRx,
fontSize: 16,
onTap: () async { onTap: () async {
if (!authenticatedUserObject.isLogin) { if (!authenticatedUserObject.isLogin) {
login(); login();
@ -235,8 +243,9 @@ class _FooterWidgetState extends State<FooterWidget> {
model: widget.model); model: widget.model);
}, },
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
borderColor: Color(0xFF4CAF50).withOpacity(0.7),
borderRadius: 6, borderRadius: 6,
disableColor:Color(0xFFD6D6D6),
textColor: isAddToCartDisable()?Color(0xFFACACAC):Colors.white,
color: Color(0xFF535353), color: Color(0xFF535353),
), ),
), ),
@ -245,12 +254,13 @@ class _FooterWidgetState extends State<FooterWidget> {
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.35, width: MediaQuery.of(context).size.width * 0.35,
margin: EdgeInsets.symmetric( vertical: 5.0),
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase.of(context).buyNow, label: TranslationBase.of(context).buyNow,
fontSize: 16, fontSize: 15,
disabled: (!widget.isAvailable && widget.quantity > 0) || disabled: isBuyNowDisable(),
(widget.quantity > widget.quantityLimit) ||
widget.item.isRx,
onTap: () async { onTap: () async {
if (!authenticatedUserObject.isLogin) { if (!authenticatedUserObject.isLogin) {
login(); login();
@ -261,15 +271,11 @@ class _FooterWidgetState extends State<FooterWidget> {
model: widget.model); model: widget.model);
} }
}, },
textColor: isBuyNowDisable()?Color(0xFFACACAC):Colors.white,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
borderColor: Colors.grey[800].withOpacity(0.7),
borderRadius: 6, borderRadius: 6,
disableColor: Colors.grey[700], disableColor: Color(0xFFD6D6D6),
color: !widget.isAvailable && widget.quantity > 0 || color: Color(0xFF5AB145),
widget.quantity > widget.quantityLimit ||
widget.item.isRx
? Color(0xFF535353).withOpacity(0.7)
: Color(0xFF5AB145),
), ),
), ),
], ],
@ -280,6 +286,22 @@ class _FooterWidgetState extends State<FooterWidget> {
); );
} }
bool isBuyNowDisable(){
return (!widget.isAvailable && widget.quantity > 0) ||
(widget.quantity > widget.quantityLimit) ||
widget.item.isRx;
}
bool isAddToCartDisable(){
return (!widget.isAvailable && widget.quantity > 0) ||
widget.quantity > widget.quantityLimit ||
widget.item.isRx;
}
void setUserValues(value) async { void setUserValues(value) async {
if (value != null) sharedPref.setObject(IMEI_USER_DATA, value); if (value != null) sharedPref.setObject(IMEI_USER_DATA, value);
} }

@ -123,65 +123,62 @@ class ProductTileItem extends StatelessWidget {
Container( Container(
width: double.infinity, width: double.infinity,
height: MediaQuery.of(context).size.width * 0.3, height: MediaQuery.of(context).size.width * 0.3,
padding: EdgeInsets.only(left: 10, right: 10, top: 7, bottom: 7), padding:
EdgeInsets.only(left: 10, right: 10, top: 7, bottom: 3.5),
color: Colors.white, color: Colors.white,
child: Container( child: Container(
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
decoration: containerRadiusWithGradientServices(0, decoration: containerRadiusWithGradientServices(0.0,
prescriptionRequired: item.rxMessage != null,
isProduct: true,
isEnglish: !projectProvider.isArabic,
lightColor: Colors.transparent, lightColor: Colors.transparent,
darkColor: Colors.transparent), darkColor: Colors.transparent),
child: Stack( child: Stack(
children: [ children: [
Container( Stack(
width: double.infinity, children: [
height: double.infinity, Container(
//clipBehavior: Clip.antiAlias, decoration: BoxDecoration(
// decoration: projectProvider.isArabic border: Border.all(
// ? containerBottomRightRadiusWithGradientForAr(0, lightColor: Colors.transparent, darkColor: Colors.transparent) color: Color(0xffF0F0F0), width: 1.0),
// : containerBottomRightRadiusWithGradient(0, lightColor: Colors.red, darkColor: CustomColors.green), borderRadius: BorderRadius.only(
child: Stack( topRight: Radius.circular(
children: [ item.rxMessage != null &&
Container( projectProvider.isArabic
decoration: BoxDecoration( ? 20
border: Border.all( : 8),
color: Color(0xffF0F0F0), width: 1.0), bottomLeft: Radius.circular(8),
borderRadius: BorderRadius.only( bottomRight: Radius.circular(8),
topRight: Radius.circular( topLeft: Radius.circular(item.rxMessage != null &&
item.rxMessage != null && !projectProvider.isArabic
projectProvider.isArabic ? 20
? 20 : 8),
: 8),
bottomLeft: Radius.circular(8),
bottomRight: Radius.circular(8),
topLeft: Radius.circular(
item.rxMessage != null &&
!projectProvider.isArabic
? 9
: 8),
),
), ),
margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
alignment: Alignment.center,
child:
(item.images != null && item.images.length > 0)
? Padding(
padding: EdgeInsets.all(12.0),
child: Image.network(
item.images[0].src,
fit: BoxFit.cover,
height: itemHeight / 2,
),
)
: Image.asset(
"assets/images/no_image.png",
fit: BoxFit.cover,
height: itemHeight / 2,
),
), ),
], margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
), alignment: Alignment.center,
child: (item.images != null && item.images.length > 0)
? Padding(
padding: EdgeInsets.all(12.0),
child: Image.network(
item.images[0].src,
fit: BoxFit.cover,
height: itemHeight / 2,
),
)
: Padding(
padding: EdgeInsets.all(8.0),
child: Image.asset(
"assets/images/no_image.png",
fit: BoxFit.cover,
height: itemHeight / 2,
),
),
),
],
), ),
if (item.rxMessage != null) if (item.rxMessage != null)
projectProvider.isArabic projectProvider.isArabic
@ -191,6 +188,7 @@ class ProductTileItem extends StatelessWidget {
child: Transform.rotate( child: Transform.rotate(
angle: math.pi / 4, angle: math.pi / 4,
child: Container( child: Container(
color: CustomColors.accentColor,
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 18, right: 18, top: 6, bottom: 3), left: 18, right: 18, top: 6, bottom: 3),
child: Padding( child: Padding(
@ -201,7 +199,7 @@ class ProductTileItem extends StatelessWidget {
color: Colors.white, color: Colors.white,
fontSize: 7.0, fontSize: 7.0,
height: 0.8, height: 0.8,
fontWeight: FontWeight.bold, fontWeight: FontWeight.w600,
letterSpacing: -0.27, letterSpacing: -0.27,
), ),
), ),

@ -4,6 +4,9 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_mod
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page.dart'; import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
import 'package:diplomaticquarterapp/pages/offers_categorise_page.dart'; import 'package:diplomaticquarterapp/pages/offers_categorise_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/lacum-activitaion-vida-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/lacum-registration-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-main-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/home/GridViewCard.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/home/GridViewCard.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';
@ -50,7 +53,7 @@ class _BannerPagerState extends State<BannerPager> {
(item, index) { (item, index) {
return InkWell( return InkWell(
onTap: () { onTap: () {
Navigator.push(context, FadePage(page: OffersCategorisePage())); bannerNavigator(index);
}, },
child: Container( child: Container(
margin: EdgeInsets.symmetric(horizontal: 1.0), margin: EdgeInsets.symmetric(horizontal: 1.0),
@ -93,4 +96,27 @@ class _BannerPagerState extends State<BannerPager> {
], ],
)); ));
} }
bannerNavigator(index){
switch(index) {
case 1: {
Navigator.push(context, FadePage(page: OffersCategorisePage()));
}
break;
case 2: {
Navigator.push(context, FadePage(page: LakumActivationVidaPage()));
}
break;
case 5: {
Navigator.push(context, FadePage(page: OffersCategorisePage()));
}
break;
default: {
}
break;
}
}
} }

@ -16,44 +16,48 @@ class RecentlyViewedWidget extends StatelessWidget {
onModelReady: (model) => model.getLastVisitedProducts(), onModelReady: (model) => model.getLastVisitedProducts(),
allowAny: true, allowAny: true,
builder: (_, model, wi) => NetworkBaseView( builder: (_, model, wi) => NetworkBaseView(
isLocalLoader: true, isLocalLoader: true,
baseViewModel: model, baseViewModel: model,
child: Container( child: model.lastVisitedProducts.isNotEmpty
child: Column( ? Container(
children: [ child: Column(
ViewAllHomeWidget( children: [
TranslationBase.of(context).recentlyViewed, ViewAllHomeWidget(
FinalProductsPage( TranslationBase.of(context).recentlyViewed,
id: "", FinalProductsPage(
productType: 3, id: "",
)), productType: 3,
if (model.state != ViewState.BusyLocal) )),
Container( if (model.state != ViewState.BusyLocal)
height: model.lastVisitedProducts.length > 0 Container(
? MediaQuery.of(context).size.height / 3 + 1 height: model.lastVisitedProducts.length > 0
: 0, ? MediaQuery.of(context).size.height / 3 + 1
child: ListView.builder( : 0,
itemBuilder: (ctx, i) => ProductTileItem( child: ListView.builder(
model.lastVisitedProducts[i], itemBuilder: (ctx, i) => ProductTileItem(
MediaQuery.of(context).size.height / 4 + 20), model.lastVisitedProducts[i],
scrollDirection: Axis.horizontal, MediaQuery.of(context).size.height / 4 +
itemCount: model.lastVisitedProducts.length, 20),
scrollDirection: Axis.horizontal,
itemCount: model.lastVisitedProducts.length,
),
)
else
Container(
height: 80,
child: Center(
child: CircularProgressIndicator(
backgroundColor: Colors.white,
valueColor: AlwaysStoppedAnimation<Color>(
Colors.grey[500],
),
),
),
),
],
), ),
) )
else : Container(),
Container( ));
height: 80,
child: Center(
child: CircularProgressIndicator(
backgroundColor: Colors.white,
valueColor: AlwaysStoppedAnimation<Color>(
Colors.grey[500],
),
),
),
),
],
),
)));
} }
} }

@ -11,12 +11,16 @@ import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'base/base_view.dart'; import 'base/base_view.dart';
import 'package:intl/intl.dart' as international;
class SearchProductsPage extends StatefulWidget { class SearchProductsPage extends StatefulWidget {
@override @override
@ -27,6 +31,8 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
final textController = TextEditingController(); final textController = TextEditingController();
final _formKey = GlobalKey<FormState>(); final _formKey = GlobalKey<FormState>();
String msg = ''; String msg = '';
String validText="";
bool isTextValid = true;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -55,47 +61,90 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
width: MediaQuery.of(context).size.width * 0.70, width: MediaQuery.of(context).size.width * 0.70,
child: Form( child: Form(
key: _formKey, key: _formKey,
child: TextFields( child: Column(
autoFocus: true, children: [
hintText: TranslationBase.of(context).search, TextFields(
fontSize: 14.5, autoFocus: true,
prefixIcon: Icon(Icons.search), hintText: TranslationBase.of(context).search,
inputAction: TextInputAction.search, fontSize: 14.5,
inputFormatters: <TextInputFormatter>[ prefixIcon: Icon(Icons.search),
FilteringTextInputFormatter.allow( inputAction: TextInputAction.search,
RegExp(r'([A-Za-z0-9 a space])'))
], validator: (value) {
validator: (value) { RegExp regExp = RegExp(r'([A-Za-z0-9 a space])');
RegExp regExp = RegExp(r'([A-Za-z0-9 a space])'); if (value.isEmpty) {
if (value.isEmpty) { TranslationBase.of(context)
TranslationBase.of(context) .pleaseEnterProductName;
.pleaseEnterProductName; } else if (isRTL(value)) {
} else if (!regExp.hasMatch(value)) { AppToast.showErrorToast(
AppToast.showErrorToast( message: TranslationBase.of(context)
message: TranslationBase.of(context) .noArabicLetters);
.noArabicLetters); }
} return null;
return null; },
}, onChanged: (value){
onSaved: (value) { if (value.isEmpty) {
//searchMedicine(model, context); TranslationBase.of(context)
}, .pleaseEnterProductName;
onSubmit: (value) {
searchMedicine(model, context); Future.delayed(const Duration(milliseconds: 10), (){
setState(() {
textController.text = "";
isTextValid = true;
});
})
;
} else if (isRTL(value)) {
Future.delayed(const Duration(milliseconds: 10), (){
setState(() {
textController.text = validText;
isTextValid = false;
});
})
;
}else{
Future.delayed(const Duration(milliseconds: 10), (){
setState(() {
textController.text = value;
validText = value;
isTextValid = true;
});
})
;
}
},
onSaved: (value) {
setState(() {
textController.text = validText;
isTextValid = false;
});
//searchMedicine(model, context);
},
onSubmit: (value) {
searchMedicine(model, context);
// msg = 'No Result Found'; // msg = 'No Result Found';
msg = TranslationBase.of(context).noResultFound; msg = TranslationBase.of(context).noResultFound;
}, },
controller: textController, controller: textController,
// validator: (value) { ),
// if (value.isEmpty) { SizedBox(
//// return 'please Enter Product Name'; width: 10.0,
// return TranslationBase.of(context).pleaseEnterProductName; ),
// } if(!isTextValid)
// return null; AppText( TranslationBase.of(context)
// }, .noArabicLetters, color: Colors.red,),
],
), ),
), ),
), ),
SizedBox( SizedBox(
width: 10.0, width: 10.0,
), ),
@ -337,7 +386,9 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
), ),
); );
} }
bool isRTL(String text) {
return international.Bidi.detectRtlDirectionality(text);
}
searchMedicine(PharmacyCategoriseViewModel model, BuildContext context) { searchMedicine(PharmacyCategoriseViewModel model, BuildContext context) {
Utils.hideKeyboard(context); Utils.hideKeyboard(context);
if (_formKey.currentState.validate()) if (_formKey.currentState.validate())

@ -32,11 +32,16 @@ Widget getPaymentMethods() {
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Image.asset("assets/images/new/payment/Mada.png", width: 50, height: 50), Image.asset("assets/images/new/payment/Mada.png",
Image.asset("assets/images/new/payment/visa.png", width: 50, height: 50), width: 50, height: 50),
Image.asset("assets/images/new/payment/Mastercard.png", width: 50, height: 50), Image.asset("assets/images/new/payment/visa.png",
Image.asset("assets/images/new/payment/Apple_Pay.png", width: 50, height: 50), width: 50, height: 50),
Image.asset("assets/images/new/payment/installments.png", width: 50, height: 50), Image.asset("assets/images/new/payment/Mastercard.png",
width: 50, height: 50),
Image.asset("assets/images/new/payment/Apple_Pay.png",
width: 50, height: 50),
Image.asset("assets/images/new/payment/installments.png",
width: 50, height: 50),
], ],
), ),
); );
@ -48,10 +53,15 @@ Widget getNoDataWidget(BuildContext context) {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
SvgPicture.asset('assets/images/new/not_found.svg', width: 110.0, height: 110.0), SvgPicture.asset('assets/images/new/not_found.svg',
width: 110.0, height: 110.0),
Container( Container(
margin: EdgeInsets.only(top: 15.0), margin: EdgeInsets.only(top: 15.0),
child: Text(TranslationBase.of(context).noResultFound, style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xFFBABABA)))), child: Text(TranslationBase.of(context).noResultFound,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: Color(0xFFBABABA)))),
], ],
), ),
), ),
@ -79,7 +89,8 @@ spacer() {
} }
Future navigateTo(context, page) async { Future navigateTo(context, page) async {
return await Navigator.push(context, MaterialPageRoute(builder: (context) => page)); return await Navigator.push(
context, MaterialPageRoute(builder: (context) => page));
} }
// Future navigateToReplace(context, page) async { // Future navigateToReplace(context, page) async {
@ -137,7 +148,11 @@ Widget circularAviator(
child: Container( child: Container(
width: s, width: s,
height: s, height: s,
decoration: containerColorRadiusBorderWidth(bcColor == null ? Colors.grey[200] : bcColor, 2000, brColor == null ? Colors.blueGrey[800] : brColor, borderWidth == null ? 2 : borderWidth), decoration: containerColorRadiusBorderWidth(
bcColor == null ? Colors.grey[200] : bcColor,
2000,
brColor == null ? Colors.blueGrey[800] : brColor,
borderWidth == null ? 2 : borderWidth),
child: Icon( child: Icon(
icon == null ? Icons.person : icon, icon == null ? Icons.person : icon,
size: s / 1.7, size: s / 1.7,
@ -219,13 +234,14 @@ RoundedRectangleBorder buttonShape() {
); );
} }
Decoration containerRadiusWithGradient(double radius,{Color color1,Color color2}) { Decoration containerRadiusWithGradient(double radius,
{Color color1, Color color2}) {
return BoxDecoration( return BoxDecoration(
borderRadius: BorderRadius.circular(radius), borderRadius: BorderRadius.circular(radius),
gradient: LinearGradient( gradient: LinearGradient(
colors: [ colors: [
color1?? Color(0xFFF71787E), color1 ?? Color(0xFFF71787E),
color2?? Color(0xFFF2B353E), color2 ?? Color(0xFFF2B353E),
], ],
begin: Alignment.centerLeft, begin: Alignment.centerLeft,
end: Alignment.centerRight, end: Alignment.centerRight,
@ -233,7 +249,8 @@ Decoration containerRadiusWithGradient(double radius,{Color color1,Color color2}
); );
} }
Decoration containerBottomRightRadiusWithGradient(double radius, {Color darkColor, Color lightColor}) { Decoration containerBottomRightRadiusWithGradient(double radius,
{Color darkColor, Color lightColor}) {
return BoxDecoration( return BoxDecoration(
borderRadius: BorderRadius.only(bottomRight: Radius.circular(radius)), borderRadius: BorderRadius.only(bottomRight: Radius.circular(radius)),
gradient: LinearGradient( gradient: LinearGradient(
@ -247,7 +264,8 @@ Decoration containerBottomRightRadiusWithGradient(double radius, {Color darkColo
); );
} }
Decoration containerBottomRightRadiusWithGradientForAr(double radius, {Color darkColor, Color lightColor}) { Decoration containerBottomRightRadiusWithGradientForAr(double radius,
{Color darkColor, Color lightColor}) {
return BoxDecoration( return BoxDecoration(
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(radius)), borderRadius: BorderRadius.only(bottomLeft: Radius.circular(radius)),
gradient: LinearGradient( gradient: LinearGradient(
@ -261,9 +279,24 @@ Decoration containerBottomRightRadiusWithGradientForAr(double radius, {Color dar
); );
} }
Decoration containerRadiusWithGradientServices(double radius, {Color darkColor, Color lightColor}) { Decoration containerRadiusWithGradientServices(
double radius, {
Color darkColor,
Color lightColor,
bool isProduct = false,
bool prescriptionRequired = false,
bool isEnglish = true,
}) {
return BoxDecoration( return BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(radius)), borderRadius: !isProduct || !prescriptionRequired
? BorderRadius.all(Radius.circular(radius))
: isEnglish
? BorderRadius.only(
topLeft: Radius.circular(26),
)
: BorderRadius.only(
topRight: Radius.circular(26),
),
gradient: LinearGradient( gradient: LinearGradient(
colors: [ colors: [
darkColor == null ? Color(0xFF2B353E) : darkColor, darkColor == null ? Color(0xFF2B353E) : darkColor,
@ -275,7 +308,11 @@ Decoration containerRadiusWithGradientServices(double radius, {Color darkColor,
); );
} }
Decoration containerBottomRightRadiusWithGradientBorder(double radius, {Color darkColor, Color lightColor, Color borderColor = Colors.transparent, double w = 0}) { Decoration containerBottomRightRadiusWithGradientBorder(double radius,
{Color darkColor,
Color lightColor,
Color borderColor = Colors.transparent,
double w = 0}) {
return BoxDecoration( return BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(radius)), borderRadius: BorderRadius.all(Radius.circular(radius)),
border: Border.all( border: Border.all(
@ -304,7 +341,8 @@ Decoration containerRadius(Color background, double radius) {
); );
} }
Decoration containerColorRadiusBorder(Color background, double radius, Color color) { Decoration containerColorRadiusBorder(
Color background, double radius, Color color) {
return BoxDecoration( return BoxDecoration(
color: background, color: background,
border: Border.all( border: Border.all(
@ -315,7 +353,8 @@ Decoration containerColorRadiusBorder(Color background, double radius, Color col
); );
} }
Decoration containerColorRadiusBorderWidth(Color background, double radius, Color color, double w) { Decoration containerColorRadiusBorderWidth(
Color background, double radius, Color color, double w) {
return BoxDecoration( return BoxDecoration(
color: background, color: background,
border: Border.all( border: Border.all(
@ -326,13 +365,14 @@ Decoration containerColorRadiusBorderWidth(Color background, double radius, Colo
); );
} }
Decoration containerColorRadiusBorderWidthCircular(Color background, double radius, Color color, double w) { Decoration containerColorRadiusBorderWidthCircular(
Color background, double radius, Color color, double w) {
return BoxDecoration( return BoxDecoration(
color: background, color: background,
border: Border.all( border: Border.all(
width: w, // width: w, //
color: color // <--- border width here color: color // <--- border width here
), ),
// borderRadius: BorderRadius.circular(radius), // borderRadius: BorderRadius.circular(radius),
shape: BoxShape.circle, shape: BoxShape.circle,
); );
@ -341,29 +381,36 @@ Decoration containerColorRadiusBorderWidthCircular(Color background, double radi
Decoration containerColorRadiusRight(Color background, double radius) { Decoration containerColorRadiusRight(Color background, double radius) {
return BoxDecoration( return BoxDecoration(
color: background, color: background,
borderRadius: BorderRadius.only(topRight: Radius.circular(radius), bottomRight: Radius.circular(radius)), borderRadius: BorderRadius.only(
topRight: Radius.circular(radius),
bottomRight: Radius.circular(radius)),
); );
} }
Decoration containerColorRadiusLeft(Color background, double radius) { Decoration containerColorRadiusLeft(Color background, double radius) {
return BoxDecoration( return BoxDecoration(
color: background, color: background,
borderRadius: BorderRadius.only(topLeft: Radius.circular(radius), bottomLeft: Radius.circular(radius)), borderRadius: BorderRadius.only(
topLeft: Radius.circular(radius), bottomLeft: Radius.circular(radius)),
); );
} }
Decoration containerColorRadiusRightBorder(Color background, double radius, double w) { Decoration containerColorRadiusRightBorder(
Color background, double radius, double w) {
return BoxDecoration( return BoxDecoration(
color: background, color: background,
border: Border.all( border: Border.all(
width: w, // width: w, //
color: Colors.white // <--- border width here color: Colors.white // <--- border width here
), ),
borderRadius: BorderRadius.only(topRight: Radius.circular(radius), bottomRight: Radius.circular(radius)), borderRadius: BorderRadius.only(
topRight: Radius.circular(radius),
bottomRight: Radius.circular(radius)),
); );
} }
Decoration containerColorRadiusRightBorderc(Color background, double radius, double w, Color borderColor) { Decoration containerColorRadiusRightBorderc(
Color background, double radius, double w, Color borderColor) {
return BoxDecoration( return BoxDecoration(
color: background, color: background,
border: Border.all( border: Border.all(
@ -394,21 +441,23 @@ Decoration containerColorRadiusBottom(Color color, double radius) {
); );
} }
Decoration containerColorRadiusLeftBorder(Color background, double radius, double w) { Decoration containerColorRadiusLeftBorder(
Color background, double radius, double w) {
return BoxDecoration( return BoxDecoration(
color: background, color: background,
border: Border.all( border: Border.all(
width: w, // width: w, //
color: Colors.white // <--- border width here color: Colors.white // <--- border width here
), ),
borderRadius: BorderRadius.only(topLeft: Radius.circular(radius), bottomLeft: Radius.circular(radius)), borderRadius: BorderRadius.only(
topLeft: Radius.circular(radius), bottomLeft: Radius.circular(radius)),
); );
} }
BoxDecoration cardRadius(double radius,{Color color,double elevation}) { BoxDecoration cardRadius(double radius, {Color color, double elevation}) {
return BoxDecoration( return BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
color: color??Colors.white, color: color ?? Colors.white,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(radius), Radius.circular(radius),
), ),
@ -416,7 +465,7 @@ BoxDecoration cardRadius(double radius,{Color color,double elevation}) {
BoxShadow( BoxShadow(
color: Color(0xff000000).withOpacity(.05), color: Color(0xff000000).withOpacity(.05),
//spreadRadius: 5, //spreadRadius: 5,
blurRadius:elevation?? 27, blurRadius: elevation ?? 27,
offset: Offset(-2, 3), offset: Offset(-2, 3),
), ),
], ],
@ -433,19 +482,23 @@ ShapeBorder cardRadiusNew(double radius) {
ShapeBorder cardRadiusTop(double radius) { ShapeBorder cardRadiusTop(double radius) {
return RoundedRectangleBorder( return RoundedRectangleBorder(
side: BorderSide(color: Colors.transparent, width: 0), side: BorderSide(color: Colors.transparent, width: 0),
borderRadius: BorderRadius.only(topLeft: Radius.circular(radius), topRight: Radius.circular(radius)), borderRadius: BorderRadius.only(
topLeft: Radius.circular(radius), topRight: Radius.circular(radius)),
); );
} }
ShapeBorder cardRadiusTop2(double radius) { ShapeBorder cardRadiusTop2(double radius) {
return RoundedRectangleBorder( return RoundedRectangleBorder(
borderRadius: BorderRadius.only(topLeft: Radius.circular(radius), topRight: Radius.circular(radius)), borderRadius: BorderRadius.only(
topLeft: Radius.circular(radius), topRight: Radius.circular(radius)),
); );
} }
ShapeBorder cardRadiusBottom(double radius) { ShapeBorder cardRadiusBottom(double radius) {
return RoundedRectangleBorder( return RoundedRectangleBorder(
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(radius), bottomRight: Radius.circular(radius)), borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(radius),
bottomRight: Radius.circular(radius)),
); );
} }
@ -568,7 +621,8 @@ FontStyle getFontStyle(String fontStyle) {
bool timeCalculator(int startHour, int startMint, int endHour, int endMint) { bool timeCalculator(int startHour, int startMint, int endHour, int endMint) {
DateTime now = DateTime.now(); DateTime now = DateTime.now();
DateTime startDate = DateTime(now.year, now.month, now.day, startHour, startHour); DateTime startDate =
DateTime(now.year, now.month, now.day, startHour, startHour);
DateTime endDate = DateTime(now.year, now.month, now.day, endHour, endMint); DateTime endDate = DateTime(now.year, now.month, now.day, endHour, endMint);
if (startDate.isBefore(now) && endDate.isAfter(now)) if (startDate.isBefore(now) && endDate.isAfter(now))
return true; return true;

@ -200,9 +200,9 @@ class _SecondaryButtonState extends State<SecondaryButton>
width: MediaQuery.of(context).size.width * 2.2, width: MediaQuery.of(context).size.width * 2.2,
height: MediaQuery.of(context).size.width * 2.2, height: MediaQuery.of(context).size.width * 2.2,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, // shape: BoxShape.circle,
color: widget.disabled color: widget.disabled
? Colors.grey ? widget.disableColor ?? Colors.grey
: widget.color ?? Theme.of(context).buttonColor, : widget.color ?? Theme.of(context).buttonColor,
), ),
), ),
@ -212,8 +212,8 @@ class _SecondaryButtonState extends State<SecondaryButton>
padding: widget.iconOnly padding: widget.iconOnly
? EdgeInsets.symmetric(vertical: 4.0, horizontal: 5.0) ? EdgeInsets.symmetric(vertical: 4.0, horizontal: 5.0)
: EdgeInsets.only( : EdgeInsets.only(
top: widget.small ? 8.0 : 14.0, top: widget.small ? 8.0 : 12.0,
bottom: widget.small ? 6.0 : 14.0, bottom: widget.small ? 6.0 : 12.0,
left: 18.0, left: 18.0,
right: 18.0), right: 18.0),
child: Stack( child: Stack(
@ -246,8 +246,10 @@ class _SecondaryButtonState extends State<SecondaryButton>
bottom: widget.small ? 4.0 : 3.0), bottom: widget.small ? 4.0 : 3.0),
child: Text( child: Text(
widget.label, widget.label,
textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: widget.textColor, color: widget.textColor,
fontSize: widget.small ? 12.0 : widget.fontSize??14.0, fontSize: widget.small ? 12.0 : widget.fontSize??14.0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontFamily: projectViewModel.isArabic fontFamily: projectViewModel.isArabic

@ -93,24 +93,22 @@ class _ProcedureListWidgetState extends State<ProcedureListWidget> {
historyInfo), historyInfo),
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (bool newValue) { onChanged: (bool newValue) {
setState(() { selectOption(historyInfo);
if (widget.isEntityListSelected(
historyInfo)) {
widget
.removeHistory(historyInfo);
} else {
widget.addHistory(historyInfo);
}
});
}), }),
Expanded( Expanded(
child: Padding( child: InkWell(
padding: const EdgeInsets.symmetric( onTap:(){
horizontal: 10, vertical: 0), selectOption(historyInfo);
child: Texts(historyInfo.name, },
variant: "bodyText", child: Padding(
bold: true, padding: const EdgeInsets.symmetric(
color: Colors.black), horizontal: 10, vertical: 0),
child: Texts(historyInfo.name,
variant: "bodyText",
bold: true,
color: Colors.black),
),
), ),
), ),
], ],
@ -142,6 +140,19 @@ class _ProcedureListWidgetState extends State<ProcedureListWidget> {
); );
} }
selectOption(historyInfo){
setState(() {
if (widget.isEntityListSelected(
historyInfo)) {
widget
.removeHistory(historyInfo);
} else {
widget.addHistory(historyInfo);
}
});
}
void filterSearchResults(String query) { void filterSearchResults(String query) {
List<CategoriseParentModel> dummySearchList = List(); List<CategoriseParentModel> dummySearchList = List();
dummySearchList.addAll(widget.masterList); dummySearchList.addAll(widget.masterList);

Loading…
Cancel
Save