prescription order log ui changes

merge-update-with-lab-changes
Sikander Saleem 4 years ago
parent 8e27d8210a
commit d9405b2bd0

@ -12,8 +12,8 @@ const PACKAGES_PRODUCTS = '/api/products';
const PACKAGES_CUSTOMER = '/api/customers'; 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 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/';

@ -21,64 +21,112 @@ class PrescriptionsHistoryPage extends StatelessWidget {
return AppScaffold( return AppScaffold(
baseViewModel: prescriptionsViewModel, baseViewModel: prescriptionsViewModel,
body: ListView.builder( body: ListView.separated(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
itemBuilder: (context, index) => InkWell( padding: EdgeInsets.all(21),
separatorBuilder: (context, index) {
return SizedBox(height: 12);
},
itemBuilder: (context, index) {
int status = prescriptionsViewModel.prescriptionsHistory[index].status;
String _statusDisp = projectViewModel.isArabic ? prescriptionsViewModel.prescriptionsHistory[index].descriptionN : prescriptionsViewModel.prescriptionsHistory[index].description;
Color _color;
if (status == 1) {
//pending
_color = Color(0xffCC9B14);
} else if (status == 2) {
//processing
_color = Color(0xff2E303A);
} else if (status == 3) {
//completed
_color = Color(0xff359846);
} else if (status == 4) {
//cancel // Rejected
_color = Color(0xffD02127);
}
return InkWell(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
FadePage( FadePage(
page: PrescriptionsHistoryDetailsPage( page: PrescriptionsHistoryDetailsPage(
prescriptionsOrder: prescriptionsOrder: prescriptionsViewModel.prescriptionsHistory[index],
prescriptionsViewModel.prescriptionsHistory[index],
), ),
), ),
), ),
child: Container( child: Container(
padding: EdgeInsets.all(15.0), height: 65,
margin: EdgeInsets.all(8.0), decoration: BoxDecoration(
decoration: color: Colors.white,
BoxDecoration(shape: BoxShape.rectangle, color: Colors.white), borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
blurRadius: 27,
offset: Offset(0, -3),
),
],
),
child: Row( child: Row(
children: <Widget>[ mainAxisSize: MainAxisSize.min,
children: [
Container(
width: 6,
decoration: BoxDecoration(
color: _color,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0),
bottomLeft: Radius.circular(10.0),
),
),
),
Expanded(
child: Padding(
padding: EdgeInsets.only(left: 12, right: 12),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Expanded( Expanded(
child: Column( child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: [
Texts( Text(
DateUtil.getDayMonthYearHourMinuteDateFormatted(prescriptionsViewModel.prescriptionsHistory[index].createdOn), _statusDisp,
fontWeight: FontWeight.w300, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10),
), ),
SizedBox( Text(
height: 5, '${TranslationBase.of(context).orderNo}. ${prescriptionsViewModel.prescriptionsHistory[index].iD}',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
), ),
Texts( ],
'${TranslationBase.of(context).orderNo} ${prescriptionsViewModel.prescriptionsHistory[index].iD}'),
SizedBox(
height: 5,
), ),
Texts(
'${prescriptionsViewModel.prescriptionsHistory[index].descriptionN}'),
SizedBox(
height: 5,
), ),
Texts( Column(
'${TranslationBase.of(context).orderNo}', mainAxisSize: MainAxisSize.min,
fontWeight: FontWeight.w300, crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
DateUtil.formatDateToDate(prescriptionsViewModel.prescriptionsHistory[index].createdOn, projectViewModel.isArabic),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
), ),
SizedBox( Text(
height: 5, DateUtil.formatDateToTime(prescriptionsViewModel.prescriptionsHistory[index].createdOn),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
), ),
], ],
),
),
Icon(
Icons.arrow_forward_ios,
size: 25,
) )
], ],
), ),
), ),
)
],
), ),
));
},
itemCount: prescriptionsViewModel.prescriptionsHistory.length, itemCount: prescriptionsViewModel.prescriptionsHistory.length,
), ),
); );

@ -76,7 +76,10 @@ class _HomePrescriptionsPageState extends State<HomePrescriptionsPage> with Sing
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.48, letterSpacing: -0.48,
), ),
tabs: [Text(TranslationBase.of(context).prescriptions, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')), Text(TranslationBase.of(context).history, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'))], tabs: [
Text(TranslationBase.of(context).prescriptions, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins')),
Text(TranslationBase.of(context).orderLog, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins')),
],
), ),
Expanded( Expanded(
child: TabBarView( child: TabBarView(

Loading…
Cancel
Save