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.
diplomatic-quarter/lib/pages/medical/balance/my_balance_page.dart

116 lines
4.4 KiB
Dart

import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
4 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';
4 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 'package:hexcolor/hexcolor.dart';
import 'advance_payment_page.dart';
class MyBalancePage extends StatelessWidget {
List<ImagesInfo> imagesInfo = List();
4 years ago
@override
Widget build(BuildContext context) {
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'));
4 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,
4 years ago
body: Container(
margin: EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).balanceAmount,
4 years ago
color: Colors.black,
bold: true,
),
SizedBox(
height: 15,
),
Container(
padding: EdgeInsets.all(8),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
4 years ago
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(7),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
4 years ago
Texts(
'${model.totalAdvanceBalanceAmount ?? 0} '+ TranslationBase.of(context).sar,
4 years ago
color: Colors.white,
bold: true,
4 years ago
),
Texts(
TranslationBase.of(context).totalBalance,
4 years ago
color: Colors.white,
),
],
),
),
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,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(7),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
4 years ago
Texts(
'${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} '+TranslationBase.of(context).sar,
4 years ago
bold: true,
),
Texts(model.patientAdvanceBalanceAmountList[index]
.projectDescription),
4 years ago
],
),
),
),
],
),
),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
padding: EdgeInsets.all(12),
child: SecondaryButton(
// color: Colors.grey[900],
textColor: Colors.white,
label: TranslationBase.of(context).createAdvancedPayment,
4 years ago
onTap: () {
4 years ago
Navigator.push(context, FadePage(page: AdvancePaymentPage()));
4 years ago
},
),
),
),
);
}
}