import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_details_page.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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'; import 'package:provider/provider.dart'; class PrescriptionsHistoryPage extends StatelessWidget { final PrescriptionsViewModel prescriptionsViewModel; PrescriptionsHistoryPage({Key key, this.prescriptionsViewModel}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( baseViewModel: prescriptionsViewModel, body: ListView.builder( physics: BouncingScrollPhysics(), itemBuilder: (context, index) => InkWell( onTap: () => Navigator.push( context, FadePage( page: PrescriptionsHistoryDetailsPage( prescriptionsOrder: prescriptionsViewModel.prescriptionsHistory[index], ), ), ), child: Container( padding: EdgeInsets.all(15.0), margin: EdgeInsets.all(8.0), decoration: BoxDecoration(shape: BoxShape.rectangle, color: Colors.white), child: Row( children: [ Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( DateUtil.getDayMonthYearHourMinuteDateFormatted(prescriptionsViewModel.prescriptionsHistory[index].createdOn), fontWeight: FontWeight.w300, ), SizedBox( height: 5, ), Texts( '${TranslationBase.of(context).orderNo} ${prescriptionsViewModel.prescriptionsHistory[index].iD}'), SizedBox( height: 5, ), Texts( '${prescriptionsViewModel.prescriptionsHistory[index].descriptionN}'), SizedBox( height: 5, ), Texts( '${TranslationBase.of(context).orderNo}', fontWeight: FontWeight.w300, ), SizedBox( height: 5, ), ], ), ), Icon( Icons.arrow_forward_ios, size: 25, ) ], ), ), ), itemCount: prescriptionsViewModel.prescriptionsHistory.length, ), ); } }