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.
PatientApp-KKUMC/lib/pages/paymentService/payment_service.dart

111 lines
3.6 KiB
Dart

import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
5 years ago
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
4 years ago
import 'package:diplomaticquarterapp/pages/ContactUs/widgets/card_common_contat.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
5 years ago
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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 PaymentService extends StatelessWidget {
5 years ago
ToDoCountProviderModel model;
ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
5 years ago
projectViewModel = Provider.of(context);
model = Provider.of<ToDoCountProviderModel>(context);
4 years ago
List<Widget> paymentServiceList = getPaymentServiceList(context);
return AppScaffold(
isShowAppBar: true,
5 years ago
isShowDecPage: false,
4 years ago
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).paymentService,
body: SingleChildScrollView(
child: Container(
4 years ago
margin: EdgeInsets.all(20.0),
child: Column(
children: [
4 years ago
Padding(
padding: EdgeInsets.only(left: 12, right: 12),
child: GridView.builder(
shrinkWrap: true,
primary: false,
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9),
padding: EdgeInsets.zero,
itemCount: paymentServiceList.length,
itemBuilder: (BuildContext context, int index) {
return paymentServiceList[index];
},
),
),
],
),
),
),
);
}
5 years ago
4 years ago
List<Widget> getPaymentServiceList(BuildContext context) {
List<Widget> medical = List();
medical.add(
CardCommonContact(
image: 'assets/images/online_payment_icon.png',
text: TranslationBase.of(context).payment,
subText: TranslationBase.of(context).paymentOnline,
type: 6,
width: double.infinity,
height: 55.0,
projectViewModel: projectViewModel,
model: model,
),
);
medical.add(
CardCommonContact(
image: 'assets/images/device_icon.png',
text: TranslationBase.of(context).onlineCheckIn,
subText: TranslationBase.of(context).appointment,
type: 7,
width: 70.0,
height: 60.0,
projectViewModel: projectViewModel,
model: model,
),
);
medical.add(
CardCommonContact(
image: 'assets/images/check-in.png',
text: TranslationBase.of(context).hmg,
subText: TranslationBase.of(context).wallet,
type: 8,
width: 60.0,
height: 55.0,
projectViewModel: projectViewModel,
model: model,
),
);
return medical;
}
5 years ago
navigateToToDoPage(BuildContext context) {
if (projectViewModel.isLogin) {
if (model.count != 0) {
Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true)));
} else {
4 years ago
AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty);
5 years ago
}
} else {
Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true)));
}
}
}