import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/ActiveMedicationsViewModel.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/active_medications/reminder_page.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class ActiveMedicationsPage extends StatelessWidget { @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getActiveMedication(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, showNewAppBar: true, showNewAppBarTitle: true, isShowDecPage: true, baseViewModel: model, appBarTitle: TranslationBase.of(context).activeMedications, body: model.activePrescriptionReport.length > 0 ? Container( child: ListView.builder( itemCount: model.activePrescriptionReport.length, itemBuilder: (context, index) => Container( width: double.infinity, child: Container( margin: EdgeInsets.only(left: 16, right: 16, top: index == 0 ? 16 : 4, bottom: 4), decoration: cardRadius(12), child: Padding( padding: const EdgeInsets.only(top: 12, bottom: 20, left: 20, right: 20), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( model.activePrescriptionReport[index].itemDescription, style: TextStyle( fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600, ), ), mHeight(10), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ // Container( // child: Container( // child: Image.memory( // Utils.dataFromBase64String(model.activePrescriptionReport[index].imageString), // fit: BoxFit.cover, // height: SizeConfig.imageSizeMultiplier * 19, // width: SizeConfig.imageSizeMultiplier * 18, // ), // margin: EdgeInsets.zero, // clipBehavior: Clip.antiAlias, // decoration: cardRadius(2000), // ), // clipBehavior: Clip.antiAlias, // decoration: containerColorRadiusBorderWidth(Colors.white, 200, Colors.grey[200], 1), // ), // mWidth(12), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Text( TranslationBase.of(context).expiryDateTitle + ": ", style: TextStyle( color: Colors.grey, fontSize: 12, letterSpacing: -0.4, fontWeight: FontWeight.w600, ), ), Text( DateUtil.getDayMonthYearDateFormatted(model.activePrescriptionReport[index].orderDate), style: TextStyle( fontSize: 13, letterSpacing: -0.48, fontWeight: FontWeight.w600, ), ), ], ), Row( children: [ Text( TranslationBase.of(context).frequency + ": ", style: TextStyle( color: Colors.grey, fontSize: 12, letterSpacing: -0.4, fontWeight: FontWeight.w600, ), ), Text( model.activePrescriptionReport[index].frequency, style: TextStyle( fontSize: 13, letterSpacing: -0.48, fontWeight: FontWeight.w600, ), ), ], ), Row( children: [ Text( TranslationBase.of(context).route + ": ", style: TextStyle( color: Colors.grey, fontSize: 12, letterSpacing: -0.4, fontWeight: FontWeight.w600, ), ), Text( model.activePrescriptionReport[index].route, style: TextStyle( fontSize: 13, letterSpacing: -0.48, fontWeight: FontWeight.w600, ), ), ], ), Row( children: [ Text( TranslationBase.of(context).dailyDoses + ": ", style: TextStyle( color: Colors.grey, fontSize: 12, letterSpacing: -0.4, fontWeight: FontWeight.w600, ), ), Text( model.activePrescriptionReport[index].doseDailyQuantity.toString(), style: TextStyle( fontSize: 13, letterSpacing: -0.48, fontWeight: FontWeight.w600, ), ), ], ), mHeight(12), ], ), ], ), Container( child: InkWell( onTap: () { Navigator.push( context, FadePage( page: ReminderPage( frequency: model.activePrescriptionReport[index].frequencyNumber, days: model.activePrescriptionReport[index].days, itemDescription: model.activePrescriptionReport[index].itemDescription, ), ), ); }, child: Column( children: [ Icon( Icons.notifications_outlined, color: Colors.red, size: 28, ), Texts( TranslationBase.of(context).addReminder, color: Colors.red, fontSize: 11.0, ) ], ), ), ), ], ), ], ), ), ), ), ), ) : getNoDataWidget(context), ), ); } }