You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
HMG_Patient_App/lib/pages/medical/balance/my_balance_page.dart

124 lines
4.7 KiB
Dart

import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
6 years ago
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
6 years ago
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.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 'advance_payment_page.dart';
class MyBalancePage extends StatelessWidget {
List<ImagesInfo> imagesInfo = List();
6 years ago
@override
Widget build(BuildContext context) {
5 years ago
imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/ar/0.png'));
6 years ago
return BaseView<MyBalanceViewModel>(
onModelReady: (model) => model.getPatientAdvanceBalanceAmount(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).myBalances,
imagesInfo: imagesInfo,
description: TranslationBase.of(context).infoMyBalance,
5 years ago
body: SingleChildScrollView(
child: Container(
margin: EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).balanceAmount,
color: Colors.black,
bold: true,
6 years ago
),
5 years ago
SizedBox(
height: 15,
6 years ago
),
5 years ago
Container(
6 years ago
padding: EdgeInsets.all(8),
5 years ago
width: double.infinity,
6 years ago
height: 65,
decoration: BoxDecoration(
color: Colors.red[700],
6 years ago
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(7),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
5 years ago
'${model.totalAdvanceBalanceAmount ?? 0} ' +
TranslationBase.of(context).sar,
5 years ago
color: Colors.white,
6 years ago
bold: true,
),
5 years ago
Texts(
TranslationBase.of(context).totalBalance,
color: Colors.white,
),
6 years ago
],
),
),
5 years ago
SizedBox(
height: 9,
),
...List.generate(
model.patientAdvanceBalanceAmountList.length,
(index) => Container(
padding: EdgeInsets.all(8),
height: 65,
margin: EdgeInsets.only(top: 8),
decoration: BoxDecoration(
color: Colors.white,
5 years ago
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(7),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
5 years ago
'${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} ' +
TranslationBase.of(context).sar,
5 years ago
bold: true,
),
Texts(model.patientAdvanceBalanceAmountList[index]
.projectDescription),
],
),
),
),
5 years ago
SizedBox(
height: MediaQuery.of(context).size.height * 0.13,
)
5 years ago
],
),
6 years ago
),
),
bottomSheet: Container(
5 years ago
// height: MediaQuery.of(context).size.height * 0.12,
height: 70.0,
5 years ago
color: Colors.white,
6 years ago
width: double.infinity,
padding: EdgeInsets.all(12),
child: SecondaryButton(
textColor: Colors.white,
label: TranslationBase.of(context).createAdvancedPayment,
6 years ago
onTap: () {
6 years ago
Navigator.push(context, FadePage(page: AdvancePaymentPage()));
6 years ago
},
),
),
),
);
}
}